diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/CHANGELOG.md b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/CHANGELOG.md index df6924915b709..0afd4c159fc65 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/CHANGELOG.md +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/CHANGELOG.md @@ -1,14 +1,83 @@ # Release History -## 1.2.0-beta.1 (Unreleased) +## 1.0.0-beta.1 (2025-01-20) + +- 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-2024-11-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 -### Breaking Changes +* `models.SupportedFeatureStatusEnum` was added + +* `models.QuotaUsages` was added + +* `models.TuningOptionsListResult` was added + +* `models.QuotaUsage` was added + +* `models.IndexRecommendationListResult` was added + +* `models.ImpactRecord` was added + +* `models.QuotaUsagesListResult` was added + +* `models.NameProperty` was added + +* `models.IndexRecommendationResourcePropertiesAnalyzedWorkload` was added + +* `models.TuningOptions` was added + +* `models.IndexRecommendationDetails` was added + +* `models.IndexRecommendationResource` was added + +* `models.RecommendationTypeEnum` was added + +* `models.SupportedFeature` was added + +* `models.IndexRecommendationResourcePropertiesImplementationDetails` was added + +* `models.RecommendationType` was added + +* `models.TuningOptionEnum` was added + +* `models.Cluster` was added -### Bugs Fixed +* `models.TuningOptionsResource` was added -### Other Changes +#### `models.ServerForUpdate` was modified + +* `withCluster(models.Cluster)` was added +* `cluster()` was added + +#### `models.FlexibleServerCapability` was modified + +* `supportedFeatures()` was added + +#### `models.ServerVersionCapability` was modified + +* `supportedFeatures()` was added + +#### `models.ServerSkuCapability` was modified + +* `supportedFeatures()` was added +* `securityProfile()` was added + +#### `models.Server$Update` was modified + +* `withCluster(models.Cluster)` was added + +#### `models.Server` was modified + +* `cluster()` was added + +#### `models.Server$Definition` was modified + +* `withCluster(models.Cluster)` was added + +#### `PostgreSqlManager` was modified + +* `tuningOptions()` was added +* `quotaUsages()` was added ## 1.1.0 (2025-01-06) diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/README.md b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/README.md index 21531cd762e68..7115513c60d3d 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-2024-08-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-2024-11-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.1.0 + 1.2.0-beta.1 ``` [//]: # ({x-version-update-end}) diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/SAMPLE.md b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/SAMPLE.md index a36791cecb434..547ca6a30307a 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/SAMPLE.md +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/SAMPLE.md @@ -93,6 +93,10 @@ - [Get](#privatelinkresources_get) - [ListByServer](#privatelinkresources_listbyserver) +## QuotaUsages + +- [List](#quotausages_list) + ## Replicas - [ListByServer](#replicas_listbyserver) @@ -123,6 +127,12 @@ - [Stop](#servers_stop) - [Update](#servers_update) +## TuningOptions + +- [Get](#tuningoptions_get) +- [ListByServer](#tuningoptions_listbyserver) +- [ListRecommendations](#tuningoptions_listrecommendations) + ## VirtualEndpoints - [Create](#virtualendpoints_create) @@ -145,8 +155,8 @@ import com.azure.resourcemanager.postgresqlflexibleserver.models.PrincipalType; public final class AdministratorsCreateSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/AdministratorAdd. - * json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ + * AdministratorAdd.json */ /** * Sample code: Adds an Active DIrectory Administrator for the server. @@ -175,7 +185,7 @@ public final class AdministratorsCreateSamples { public final class AdministratorsDeleteSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ * AdministratorDelete.json */ /** @@ -200,8 +210,8 @@ public final class AdministratorsDeleteSamples { public final class AdministratorsGetSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/AdministratorGet. - * json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ + * AdministratorGet.json */ /** * Sample code: ServerGet. @@ -225,7 +235,7 @@ public final class AdministratorsGetSamples { public final class AdministratorsListByServerSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ * AdministratorsListByServer.json */ /** @@ -249,7 +259,8 @@ public final class AdministratorsListByServerSamples { public final class BackupsCreateSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/BackupCreate.json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ + * BackupCreate.json */ /** * Sample code: Create a new Backup for a flexible server. @@ -273,7 +284,8 @@ public final class BackupsCreateSamples { public final class BackupsDeleteSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/BackupDelete.json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ + * BackupDelete.json */ /** * Sample code: Delete a specific backup. @@ -296,7 +308,8 @@ public final class BackupsDeleteSamples { public final class BackupsGetSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/BackupGet.json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/BackupGet + * .json */ /** * Sample code: Get a backup for a server. @@ -321,8 +334,8 @@ public final class BackupsGetSamples { public final class BackupsListByServerSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/BackupListByServer - * .json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ + * BackupListByServer.json */ /** * Sample code: List backups for a server. @@ -347,7 +360,7 @@ import com.azure.resourcemanager.postgresqlflexibleserver.models.CheckNameAvaila public final class CheckNameAvailabilityExecuteSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ * CheckNameAvailability.json */ /** @@ -374,7 +387,7 @@ import com.azure.resourcemanager.postgresqlflexibleserver.models.CheckNameAvaila public final class CheckNameAvailabilityWithLocationExecuteSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ * CheckNameAvailabilityLocationBased.json */ /** @@ -399,8 +412,8 @@ public final class CheckNameAvailabilityWithLocationExecuteSamples { public final class ConfigurationsGetSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ConfigurationGet. - * json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ + * ConfigurationGet.json */ /** * Sample code: ConfigurationGet. @@ -423,7 +436,7 @@ public final class ConfigurationsGetSamples { public final class ConfigurationsListByServerSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ * ConfigurationListByServer.json */ /** @@ -446,7 +459,7 @@ public final class ConfigurationsListByServerSamples { public final class ConfigurationsPutSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ * ConfigurationUpdate.json */ /** @@ -477,7 +490,7 @@ import com.azure.resourcemanager.postgresqlflexibleserver.models.Configuration; public final class ConfigurationsUpdateSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ * ConfigurationUpdate.json */ /** @@ -504,8 +517,8 @@ public final class ConfigurationsUpdateSamples { public final class DatabasesCreateSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/DatabaseCreate. - * json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ + * DatabaseCreate.json */ /** * Sample code: Create a database. @@ -532,8 +545,8 @@ public final class DatabasesCreateSamples { public final class DatabasesDeleteSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/DatabaseDelete. - * json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ + * DatabaseDelete.json */ /** * Sample code: Delete a database. @@ -555,7 +568,8 @@ public final class DatabasesDeleteSamples { public final class DatabasesGetSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/DatabaseGet.json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ + * DatabaseGet.json */ /** * Sample code: Get a database. @@ -577,7 +591,7 @@ public final class DatabasesGetSamples { public final class DatabasesListByServerSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ * DatabasesListByServer.json */ /** @@ -601,8 +615,8 @@ public final class DatabasesListByServerSamples { public final class FirewallRulesCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/FirewallRuleCreate - * .json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ + * FirewallRuleCreate.json */ /** * Sample code: FirewallRuleCreate. @@ -630,8 +644,8 @@ public final class FirewallRulesCreateOrUpdateSamples { public final class FirewallRulesDeleteSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/FirewallRuleDelete - * .json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ + * FirewallRuleDelete.json */ /** * Sample code: FirewallRuleDelete. @@ -654,8 +668,8 @@ public final class FirewallRulesDeleteSamples { public final class FirewallRulesGetSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/FirewallRuleGet. - * json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ + * FirewallRuleGet.json */ /** * Sample code: FirewallRuleList. @@ -677,7 +691,7 @@ public final class FirewallRulesGetSamples { public final class FirewallRulesListByServerSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ * FirewallRuleListByServer.json */ /** @@ -705,7 +719,7 @@ import java.util.Arrays; public final class FlexibleServerStartLtrBackupSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ * LongTermRetentionBackup.json */ /** @@ -736,7 +750,7 @@ import com.azure.resourcemanager.postgresqlflexibleserver.models.LtrPreBackupReq public final class FlexibleServerTriggerLtrPreBackupSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ * LongTermRetentionPreBackup.json */ /** @@ -762,7 +776,7 @@ public final class FlexibleServerTriggerLtrPreBackupSamples { public final class GetPrivateDnsZoneSuffixExecuteSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ * GetPrivateDnsZoneSuffix.json */ /** @@ -786,7 +800,7 @@ public final class GetPrivateDnsZoneSuffixExecuteSamples { public final class LocationBasedCapabilitiesExecuteSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ * CapabilitiesByLocation.json */ /** @@ -809,7 +823,7 @@ public final class LocationBasedCapabilitiesExecuteSamples { public final class LogFilesListByServerSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ * LogFilesListByServer.json */ /** @@ -833,7 +847,7 @@ public final class LogFilesListByServerSamples { public final class LtrBackupOperationsGetSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ * LongTermRetentionOperationGet.json */ /** @@ -857,7 +871,7 @@ public final class LtrBackupOperationsGetSamples { public final class LtrBackupOperationsListByServerSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ * LongTermRetentionOperationListByServer.json */ /** @@ -892,7 +906,7 @@ import java.util.Arrays; public final class MigrationsCreateSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ * Migrations_Create_With_PrivateEndpoint_Servers.json */ /** @@ -921,7 +935,7 @@ public final class MigrationsCreateSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ * Migrations_Create_With_Roles.json */ /** @@ -949,7 +963,36 @@ public final class MigrationsCreateSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ + * Migrations_Create_With_FullyQualifiedDomainName.json + */ + /** + * Sample code: Migrations Create with fully qualified domain name. + * + * @param manager Entry point to PostgreSqlManager. + */ + public static void migrationsCreateWithFullyQualifiedDomainName( + 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") + .withSourceDbServerFullyQualifiedDomainName("testsourcefqdn.example.com") + .withTargetDbServerFullyQualifiedDomainName("test-target-fqdn.example.com") + .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/2024-11-01-preview/examples/ * Migrations_Create_Validate_Only.json */ /** @@ -977,7 +1020,7 @@ public final class MigrationsCreateSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ * Migrations_Create_With_Other_Users.json */ /** @@ -1005,8 +1048,8 @@ public final class MigrationsCreateSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/Migrations_Create. - * json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ + * Migrations_Create.json */ /** * Sample code: Migrations_Create. @@ -1018,8 +1061,6 @@ public final class MigrationsCreateSamples { .define("testmigration") .withRegion("westus") .withExistingFlexibleServer("ffffffff-ffff-ffff-ffff-ffffffffffff", "testrg", "testtarget") - .withMigrationInstanceResourceId( - "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/flexibleServers/testsourcemigration") .withMigrationMode(MigrationMode.OFFLINE) .withSourceDbServerResourceId( "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/servers/testsource") @@ -1033,7 +1074,7 @@ public final class MigrationsCreateSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ * Migrations_Create_Other_SourceTypes_Validate_Migrate.json */ /** @@ -1071,8 +1112,8 @@ public final class MigrationsCreateSamples { public final class MigrationsDeleteSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/Migrations_Delete. - * json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ + * Migrations_Delete.json */ /** * Sample code: Migrations_Delete. @@ -1096,7 +1137,7 @@ public final class MigrationsDeleteSamples { public final class MigrationsGetSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ * Migrations_GetMigrationWithSuccessfulValidationOnly.json */ /** @@ -1113,8 +1154,8 @@ public final class MigrationsGetSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/Migrations_Get. - * json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ + * Migrations_Get.json */ /** * Sample code: Migrations_Get. @@ -1129,7 +1170,7 @@ public final class MigrationsGetSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ * Migrations_GetMigrationWithSuccessfulValidationButMigrationFailure.json */ /** @@ -1146,7 +1187,7 @@ public final class MigrationsGetSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ * Migrations_GetMigrationWithSuccessfulValidationAndMigration.json */ /** @@ -1163,7 +1204,7 @@ public final class MigrationsGetSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ * Migrations_GetMigrationWithValidationFailures.json */ /** @@ -1191,7 +1232,7 @@ import com.azure.resourcemanager.postgresqlflexibleserver.models.MigrationListFi public final class MigrationsListByTargetServerSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ * Migrations_ListByTargetServer.json */ /** @@ -1221,8 +1262,8 @@ import com.azure.resourcemanager.postgresqlflexibleserver.models.MigrationResour public final class MigrationsUpdateSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/Migrations_Cancel. - * json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ + * Migrations_Cancel.json */ /** * Sample code: Cancel migration. @@ -1239,8 +1280,8 @@ public final class MigrationsUpdateSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/Migrations_Update. - * json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ + * Migrations_Update.json */ /** * Sample code: Migrations_Update. @@ -1266,7 +1307,8 @@ public final class MigrationsUpdateSamples { public final class OperationsListSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/OperationList.json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ + * OperationList.json */ /** * Sample code: OperationList. @@ -1288,7 +1330,7 @@ public final class OperationsListSamples { public final class PrivateEndpointConnectionOperationDeleteSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ * PrivateEndpointConnectionDelete.json */ /** @@ -1318,7 +1360,7 @@ import com.azure.resourcemanager.postgresqlflexibleserver.models.PrivateLinkServ public final class PrivateEndpointConnectionOperationUpdateSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ * PrivateEndpointConnectionUpdate.json */ /** @@ -1347,7 +1389,7 @@ public final class PrivateEndpointConnectionOperationUpdateSamples { public final class PrivateEndpointConnectionsGetSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ * PrivateEndpointConnectionGet.json */ /** @@ -1374,7 +1416,7 @@ public final class PrivateEndpointConnectionsGetSamples { public final class PrivateEndpointConnectionsListByServerSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ * PrivateEndpointConnectionList.json */ /** @@ -1398,7 +1440,7 @@ public final class PrivateEndpointConnectionsListByServerSamples { public final class PrivateLinkResourcesGetSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ * PrivateLinkResourcesGet.json */ /** @@ -1422,7 +1464,7 @@ public final class PrivateLinkResourcesGetSamples { public final class PrivateLinkResourcesListByServerSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ * PrivateLinkResourcesList.json */ /** @@ -1437,6 +1479,30 @@ public final class PrivateLinkResourcesListByServerSamples { } ``` +### QuotaUsages_List + +```java +/** + * Samples for QuotaUsages List. + */ +public final class QuotaUsagesListSamples { + /* + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-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); + } +} +``` + ### Replicas_ListByServer ```java @@ -1446,7 +1512,7 @@ public final class PrivateLinkResourcesListByServerSamples { public final class ReplicasListByServerSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ * ReplicasListByServer.json */ /** @@ -1472,7 +1538,7 @@ import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.Migratio public final class ResourceProviderCheckMigrationNameAvailabilitySamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ * CheckMigrationNameAvailability.json */ /** @@ -1500,8 +1566,8 @@ public final class ResourceProviderCheckMigrationNameAvailabilitySamples { public final class ServerCapabilitiesListSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ServerCapabilities - * .json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ + * ServerCapabilities.json */ /** * Sample code: ServerCapabilitiesList. @@ -1528,7 +1594,7 @@ import com.azure.resourcemanager.postgresqlflexibleserver.models.ThreatProtectio public final class ServerThreatProtectionSettingsCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ * ServerThreatProtectionSettingsCreateOrUpdate.json */ /** @@ -1558,7 +1624,7 @@ import com.azure.resourcemanager.postgresqlflexibleserver.models.ThreatProtectio public final class ServerThreatProtectionSettingsGetSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ * ServerThreatProtectionSettingsGet.json */ /** @@ -1584,7 +1650,7 @@ public final class ServerThreatProtectionSettingsGetSamples { public final class ServerThreatProtectionSettingsListByServerSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ * ServerThreatProtectionSettingsListByServer.json */ /** @@ -1608,6 +1674,7 @@ import com.azure.resourcemanager.postgresqlflexibleserver.models.ArmServerKeyTyp 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.Cluster; import com.azure.resourcemanager.postgresqlflexibleserver.models.CreateMode; import com.azure.resourcemanager.postgresqlflexibleserver.models.DataEncryption; import com.azure.resourcemanager.postgresqlflexibleserver.models.GeoRedundantBackupEnum; @@ -1616,6 +1683,7 @@ import com.azure.resourcemanager.postgresqlflexibleserver.models.HighAvailabilit import com.azure.resourcemanager.postgresqlflexibleserver.models.IdentityType; import com.azure.resourcemanager.postgresqlflexibleserver.models.Network; import com.azure.resourcemanager.postgresqlflexibleserver.models.PasswordAuthEnum; +import com.azure.resourcemanager.postgresqlflexibleserver.models.ServerPublicNetworkAccessState; import com.azure.resourcemanager.postgresqlflexibleserver.models.ServerVersion; import com.azure.resourcemanager.postgresqlflexibleserver.models.Sku; import com.azure.resourcemanager.postgresqlflexibleserver.models.SkuTier; @@ -1633,7 +1701,7 @@ import java.util.Map; public final class ServersCreateSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ * ServerCreateWithDataEncryptionEnabled.json */ /** @@ -1675,7 +1743,7 @@ public final class ServersCreateSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ * ServerCreateReviveDropped.json */ /** @@ -1698,7 +1766,7 @@ public final class ServersCreateSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ * ServerCreateGeoRestoreWithDataEncryptionEnabled.json */ /** @@ -1733,7 +1801,8 @@ public final class ServersCreateSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ServerCreate.json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ + * ServerCreate.json */ /** * Sample code: Create a new server. @@ -1749,7 +1818,7 @@ public final class ServersCreateSamples { .withSku(new Sku().withName("Standard_D4s_v3").withTier(SkuTier.GENERAL_PURPOSE)) .withAdministratorLogin("cloudsa") .withAdministratorLoginPassword("password") - .withVersion(ServerVersion.ONE_TWO) + .withVersion(ServerVersion.ONE_SIX) .withStorage(new Storage().withStorageSizeGB(512) .withAutoGrow(StorageAutoGrow.DISABLED) .withTier(AzureManagedDiskPerformanceTiers.P20)) @@ -1766,7 +1835,7 @@ public final class ServersCreateSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ * ServerCreateWithAadAuthEnabled.json */ /** @@ -1805,7 +1874,7 @@ public final class ServersCreateSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ * ServerCreateReplica.json */ /** @@ -1837,7 +1906,37 @@ public final class ServersCreateSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ + * ClusterCreate.json + */ + /** + * Sample code: ClusterCreate. + * + * @param manager Entry point to PostgreSqlManager. + */ + public static void clusterCreate(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager.servers() + .define("pgtestcluster") + .withRegion("westus") + .withExistingResourceGroup("testrg") + .withSku(new Sku().withName("Standard_D4s_v3").withTier(SkuTier.GENERAL_PURPOSE)) + .withAdministratorLogin("cloudsa") + .withAdministratorLoginPassword("password") + .withVersion(ServerVersion.ONE_SIX) + .withStorage(new Storage().withStorageSizeGB(256) + .withAutoGrow(StorageAutoGrow.DISABLED) + .withTier(AzureManagedDiskPerformanceTiers.P15)) + .withBackup(new Backup().withBackupRetentionDays(7).withGeoRedundantBackup(GeoRedundantBackupEnum.DISABLED)) + .withNetwork(new Network().withPublicNetworkAccess(ServerPublicNetworkAccessState.DISABLED)) + .withHighAvailability(new HighAvailability().withMode(HighAvailabilityMode.DISABLED)) + .withCreateMode(CreateMode.CREATE) + .withCluster(new Cluster().withClusterSize(2)) + .create(); + } + + /* + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ * ServerCreatePointInTimeRestore.json */ /** @@ -1881,7 +1980,8 @@ public final class ServersCreateSamples { public final class ServersDeleteSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ServerDelete.json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ + * ServerDelete.json */ /** * Sample code: ServerDelete. @@ -1903,7 +2003,7 @@ public final class ServersDeleteSamples { public final class ServersGetByResourceGroupSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ * ServerGetWithPrivateEndpoints.json */ /** @@ -1918,7 +2018,8 @@ public final class ServersGetByResourceGroupSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ServerGet.json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ServerGet + * .json */ /** * Sample code: ServerGet. @@ -1931,8 +2032,8 @@ public final class ServersGetByResourceGroupSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ServerGetWithVnet. - * json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ + * ServerGetWithVnet.json */ /** * Sample code: ServerGetWithVnet. @@ -1954,7 +2055,8 @@ public final class ServersGetByResourceGroupSamples { public final class ServersListSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ServerList.json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ + * ServerList.json */ /** * Sample code: ServerList. @@ -1976,7 +2078,7 @@ public final class ServersListSamples { public final class ServersListByResourceGroupSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ * ServerListByResourceGroup.json */ /** @@ -2003,7 +2105,8 @@ import com.azure.resourcemanager.postgresqlflexibleserver.models.RestartParamete public final class ServersRestartSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ServerRestart.json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ + * ServerRestart.json */ /** * Sample code: ServerRestart. @@ -2016,7 +2119,7 @@ public final class ServersRestartSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ * ServerRestartWithFailover.json */ /** @@ -2043,7 +2146,8 @@ public final class ServersRestartSamples { public final class ServersStartSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ServerStart.json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ + * ServerStart.json */ /** * Sample code: ServerStart. @@ -2065,7 +2169,8 @@ public final class ServersStartSamples { public final class ServersStopSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ServerStop.json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ + * ServerStop.json */ /** * Sample code: ServerStop. @@ -2111,7 +2216,7 @@ import java.util.Map; public final class ServersUpdateSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ * ServerUpdateWithAadAuthEnabled.json */ /** @@ -2140,7 +2245,7 @@ public final class ServersUpdateSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ * ServerUpdateWithDataEncryptionEnabled.json */ /** @@ -2175,7 +2280,7 @@ public final class ServersUpdateSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ * PromoteReplicaAsPlannedSwitchover.json */ /** @@ -2198,7 +2303,7 @@ public final class ServersUpdateSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ * PromoteReplicaAsForcedSwitchover.json */ /** @@ -2221,7 +2326,8 @@ public final class ServersUpdateSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ServerUpdate.json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ + * ServerUpdate.json */ /** * Sample code: ServerUpdate. @@ -2245,7 +2351,7 @@ public final class ServersUpdateSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ * ServerUpdateWithMajorVersionUpgrade.json */ /** @@ -2263,7 +2369,7 @@ public final class ServersUpdateSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ * ServerUpdateWithCustomerMaintenanceWindow.json */ /** @@ -2287,7 +2393,7 @@ public final class ServersUpdateSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ * PromoteReplicaAsForcedStandaloneServer.json */ /** @@ -2310,7 +2416,7 @@ public final class ServersUpdateSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ * PromoteReplicaAsPlannedStandaloneServer.json */ /** @@ -2344,6 +2450,102 @@ public final class ServersUpdateSamples { } ``` +### TuningOptions_Get + +```java +import com.azure.resourcemanager.postgresqlflexibleserver.models.TuningOptionEnum; + +/** + * Samples for TuningOptions Get. + */ +public final class TuningOptionsGetSamples { + /* + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ + * Tuning_GetTuningOption.json + */ + /** + * Sample code: TuningOptions_Get. + * + * @param manager Entry point to PostgreSqlManager. + */ + public static void tuningOptionsGet(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager.tuningOptions() + .getWithResponse("testrg", "testserver", TuningOptionEnum.INDEX, com.azure.core.util.Context.NONE); + } +} +``` + +### TuningOptions_ListByServer + +```java +/** + * Samples for TuningOptions ListByServer. + */ +public final class TuningOptionsListByServerSamples { + /* + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ + * Tuning_ListTuningOptions.json + */ + /** + * Sample code: TuningOptions_ListByServer. + * + * @param manager Entry point to PostgreSqlManager. + */ + public static void + tuningOptionsListByServer(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager.tuningOptions().listByServer("testrg", "testserver", com.azure.core.util.Context.NONE); + } +} +``` + +### TuningOptions_ListRecommendations + +```java +import com.azure.resourcemanager.postgresqlflexibleserver.models.RecommendationType; +import com.azure.resourcemanager.postgresqlflexibleserver.models.TuningOptionEnum; + +/** + * Samples for TuningOptions ListRecommendations. + */ +public final class TuningOptionsListRecommendationsSamples { + /* + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ + * Tuning_GetRecommendedIndexes.json + */ + /** + * Sample code: TuningOptions_ListRecommendations. + * + * @param manager Entry point to PostgreSqlManager. + */ + public static void + tuningOptionsListRecommendations(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager.tuningOptions() + .listRecommendations("testrg", "pgtestsvc4", TuningOptionEnum.INDEX, null, + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ + * Tuning_GetFilteredRecommendedIndexes.json + */ + /** + * Sample code: TuningOptions_ListFilteredRecommendations. + * + * @param manager Entry point to PostgreSqlManager. + */ + public static void tuningOptionsListFilteredRecommendations( + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager.tuningOptions() + .listRecommendations("testrg", "pgtestrecs", TuningOptionEnum.INDEX, RecommendationType.CREATE_INDEX, + com.azure.core.util.Context.NONE); + } +} +``` + ### VirtualEndpoints_Create ```java @@ -2356,7 +2558,7 @@ import java.util.Arrays; public final class VirtualEndpointsCreateSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ * VirtualEndpointCreate.json */ /** @@ -2385,7 +2587,7 @@ public final class VirtualEndpointsCreateSamples { public final class VirtualEndpointsDeleteSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ * VirtualEndpointDelete.json */ /** @@ -2410,7 +2612,7 @@ public final class VirtualEndpointsDeleteSamples { public final class VirtualEndpointsGetSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ * VirtualEndpointsGet.json */ /** @@ -2435,7 +2637,7 @@ public final class VirtualEndpointsGetSamples { public final class VirtualEndpointsListByServerSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ * VirtualEndpointsListByServer.json */ /** @@ -2463,7 +2665,7 @@ import java.util.Arrays; public final class VirtualEndpointsUpdateSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ * VirtualEndpointUpdate.json */ /** @@ -2495,7 +2697,7 @@ import com.azure.resourcemanager.postgresqlflexibleserver.models.VirtualNetworkS public final class VirtualNetworkSubnetUsageExecuteSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ * VirtualNetworkSubnetUsage.json */ /** diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/pom.xml b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/pom.xml index 651c40df9ae62..02b53f72d036b 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-2024-08-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-2024-11-01-preview. https://github.com/Azure/azure-sdk-for-java 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 1b81948c4979d..2cd05414e1fc8 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 @@ -42,11 +42,13 @@ 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.TuningOptionsImpl; import com.azure.resourcemanager.postgresqlflexibleserver.implementation.VirtualEndpointsImpl; import com.azure.resourcemanager.postgresqlflexibleserver.implementation.VirtualNetworkSubnetUsagesImpl; import com.azure.resourcemanager.postgresqlflexibleserver.models.Administrators; @@ -66,11 +68,13 @@ 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.TuningOptions; import com.azure.resourcemanager.postgresqlflexibleserver.models.VirtualEndpoints; import com.azure.resourcemanager.postgresqlflexibleserver.models.VirtualNetworkSubnetUsages; import java.time.Duration; @@ -125,12 +129,16 @@ public final class PostgreSqlManager { private PrivateLinkResources privateLinkResources; + private QuotaUsages quotaUsages; + private Replicas replicas; private LogFiles logFiles; private ServerThreatProtectionSettings serverThreatProtectionSettings; + private TuningOptions tuningOptions; + private VirtualEndpoints virtualEndpoints; private VirtualNetworkSubnetUsages virtualNetworkSubnetUsages; @@ -299,7 +307,7 @@ public PostgreSqlManager authenticate(TokenCredential credential, AzureProfile p .append("-") .append("com.azure.resourcemanager.postgresqlflexibleserver") .append("/") - .append("1.1.0"); + .append("1.0.0-beta.1"); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { userAgentBuilder.append(" (") .append(Configuration.getGlobalConfiguration().get("java.version")) @@ -579,6 +587,18 @@ public PrivateLinkResources privateLinkResources() { 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. * @@ -617,6 +637,18 @@ public ServerThreatProtectionSettings serverThreatProtectionSettings() { return serverThreatProtectionSettings; } + /** + * Gets the resource collection API of TuningOptions. + * + * @return Resource collection API of TuningOptions. + */ + public TuningOptions tuningOptions() { + if (this.tuningOptions == null) { + this.tuningOptions = new TuningOptionsImpl(clientObject.getTuningOptions(), this); + } + return tuningOptions; + } + /** * Gets the resource collection API of VirtualEndpoints. It manages VirtualEndpointResource. * 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 3cc78d0a298f9..2ef805b509d30 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 @@ -179,6 +179,13 @@ public interface PostgreSqlManagementClient { */ PrivateLinkResourcesClient getPrivateLinkResources(); + /** + * Gets the QuotaUsagesClient object to access its operations. + * + * @return the QuotaUsagesClient object. + */ + QuotaUsagesClient getQuotaUsages(); + /** * Gets the ReplicasClient object to access its operations. * @@ -200,6 +207,13 @@ public interface PostgreSqlManagementClient { */ ServerThreatProtectionSettingsClient getServerThreatProtectionSettings(); + /** + * Gets the TuningOptionsClient object to access its operations. + * + * @return the TuningOptionsClient object. + */ + TuningOptionsClient getTuningOptions(); + /** * Gets the VirtualEndpointsClient object to access its operations. * 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 0000000000000..59ed9de674a3d --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/QuotaUsagesClient.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.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/TuningOptionsClient.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/TuningOptionsClient.java new file mode 100644 index 0000000000000..6557eb5ee3e79 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/TuningOptionsClient.java @@ -0,0 +1,189 @@ +// Copyright (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.IndexRecommendationResourceInner; +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.TuningOptionsResourceInner; +import com.azure.resourcemanager.postgresqlflexibleserver.models.RecommendationType; +import com.azure.resourcemanager.postgresqlflexibleserver.models.TuningOptionEnum; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in TuningOptionsClient. + */ +public interface TuningOptionsClient { + /** + * Retrieve the tuning option on a server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return stores property that features impact on some metric if this recommended action is applied along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> getWithResponseAsync(String resourceGroupName, String serverName, + TuningOptionEnum tuningOption); + + /** + * Retrieve the tuning option on a server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return stores property that features impact on some metric if this recommended action is applied on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono getAsync(String resourceGroupName, String serverName, + TuningOptionEnum tuningOption); + + /** + * Retrieve the tuning option on a server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @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 stores property that features impact on some metric if this recommended action is applied along with + * {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String serverName, + TuningOptionEnum tuningOption, Context context); + + /** + * Retrieve the tuning option on a server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return stores property that features impact on some metric if this recommended action is applied. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + TuningOptionsResourceInner get(String resourceGroupName, String serverName, TuningOptionEnum tuningOption); + + /** + * Retrieve the list of available tuning index recommendations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @param recommendationType Recommendations list filter. Retrieves recommendations based on type. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 available index recommendations as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listRecommendationsAsync(String resourceGroupName, String serverName, + TuningOptionEnum tuningOption, RecommendationType recommendationType); + + /** + * Retrieve the list of available tuning index recommendations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 available index recommendations as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listRecommendationsAsync(String resourceGroupName, String serverName, + TuningOptionEnum tuningOption); + + /** + * Retrieve the list of available tuning index recommendations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 available index recommendations as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listRecommendations(String resourceGroupName, String serverName, + TuningOptionEnum tuningOption); + + /** + * Retrieve the list of available tuning index recommendations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @param recommendationType Recommendations list filter. Retrieves recommendations based on type. + * @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 available index recommendations as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listRecommendations(String resourceGroupName, String serverName, + TuningOptionEnum tuningOption, RecommendationType recommendationType, Context context); + + /** + * Retrieve the list of available tuning options. + * + * @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 tuning options as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listByServerAsync(String resourceGroupName, String serverName); + + /** + * Retrieve the list of available tuning options. + * + * @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 tuning options as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByServer(String resourceGroupName, String serverName); + + /** + * Retrieve the list of available tuning options. + * + * @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 tuning options 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/FlexibleServerCapabilityInner.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/FlexibleServerCapabilityInner.java index ddf05ffe6f1cf..6b52db9e0bcb0 100644 --- 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 @@ -18,6 +18,7 @@ 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.SupportedFeature; import com.azure.resourcemanager.postgresqlflexibleserver.models.ZoneRedundantHaAndGeoBackupSupportedEnum; import com.azure.resourcemanager.postgresqlflexibleserver.models.ZoneRedundantHaSupportedEnum; import java.io.IOException; @@ -43,9 +44,15 @@ public final class FlexibleServerCapabilityInner extends CapabilityBase { */ private List supportedServerVersions; + /* + * The supported features. + */ + private List supportedFeatures; + /* * Gets a value indicating whether fast provisioning is supported. "Enabled" means fast provisioning is supported. - * "Disabled" stands for fast provisioning is not supported. + * "Disabled" stands for fast provisioning is not supported. Will be deprecated in future, please look to Supported + * Features for "FastProvisioning". */ private FastProvisioningSupportedEnum fastProvisioningSupported; @@ -56,38 +63,41 @@ public final class FlexibleServerCapabilityInner extends CapabilityBase { /* * Determines if geo-backup is supported in this region. "Enabled" means geo-backup is supported. "Disabled" stands - * for geo-back is not supported. + * for geo-back is not supported. Will be deprecated in future, please look to Supported Features for "GeoBackup". */ 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. + * supported. "Disabled" stands for zone redundant HA is not supported. Will be deprecated in future, please look to + * Supported Features for "ZoneRedundantHa". */ 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. + * supported. Will be deprecated in future, please look to Supported Features for "ZoneRedundantHaAndGeoBackup". */ 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. + * supported. "Disabled" stands for storage auto-grow is not supported. Will be deprecated in future, please look to + * Supported Features for "StorageAutoGrowth". */ 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. + * storage online resize is supported. "Disabled" means storage online resize is not supported. Will be deprecated + * in future, please look to Supported Features for "OnlineResize". */ private OnlineResizeSupportedEnum onlineResizeSupported; /* * A value indicating whether this region is restricted. "Enabled" means region is restricted. "Disabled" stands for - * region is not restricted. + * region is not restricted. Will be deprecated in future, please look to Supported Features for "Restricted". */ private RestrictedEnum restricted; @@ -145,9 +155,19 @@ public List supportedServerVersions() { return this.supportedServerVersions; } + /** + * Get the supportedFeatures property: The supported features. + * + * @return the supportedFeatures value. + */ + public List supportedFeatures() { + return this.supportedFeatures; + } + /** * 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. + * "Enabled" means fast provisioning is supported. "Disabled" stands for fast provisioning is not supported. Will be + * deprecated in future, please look to Supported Features for "FastProvisioning". * * @return the fastProvisioningSupported value. */ @@ -166,7 +186,8 @@ public List 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. + * geo-backup is supported. "Disabled" stands for geo-back is not supported. Will be deprecated in future, please + * look to Supported Features for "GeoBackup". * * @return the geoBackupSupported value. */ @@ -177,6 +198,7 @@ public GeoBackupSupportedEnum 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. + * Will be deprecated in future, please look to Supported Features for "ZoneRedundantHa". * * @return the zoneRedundantHaSupported value. */ @@ -187,7 +209,8 @@ public ZoneRedundantHaSupportedEnum 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. + * stands for zone redundant HA and geo-backup is not supported. Will be deprecated in future, please look to + * Supported Features for "ZoneRedundantHaAndGeoBackup". * * @return the zoneRedundantHaAndGeoBackupSupported value. */ @@ -198,6 +221,7 @@ public ZoneRedundantHaAndGeoBackupSupportedEnum zoneRedundantHaAndGeoBackupSuppo /** * 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. + * Will be deprecated in future, please look to Supported Features for "StorageAutoGrowth". * * @return the storageAutoGrowthSupported value. */ @@ -208,7 +232,7 @@ public StorageAutoGrowthSupportedEnum 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. + * resize is not supported. Will be deprecated in future, please look to Supported Features for "OnlineResize". * * @return the onlineResizeSupported value. */ @@ -218,7 +242,8 @@ public OnlineResizeSupportedEnum 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. + * restricted. "Disabled" stands for region is not restricted. Will be deprecated in future, please look to + * Supported Features for "Restricted". * * @return the restricted value. */ @@ -259,6 +284,9 @@ public void validate() { if (supportedServerVersions() != null) { supportedServerVersions().forEach(e -> e.validate()); } + if (supportedFeatures() != null) { + supportedFeatures().forEach(e -> e.validate()); + } if (supportedFastProvisioningEditions() != null) { supportedFastProvisioningEditions().forEach(e -> e.validate()); } @@ -304,6 +332,10 @@ public static FlexibleServerCapabilityInner fromJson(JsonReader jsonReader) thro List supportedServerVersions = reader.readArray(reader1 -> ServerVersionCapability.fromJson(reader1)); deserializedFlexibleServerCapabilityInner.supportedServerVersions = supportedServerVersions; + } else if ("supportedFeatures".equals(fieldName)) { + List supportedFeatures + = reader.readArray(reader1 -> SupportedFeature.fromJson(reader1)); + deserializedFlexibleServerCapabilityInner.supportedFeatures = supportedFeatures; } else if ("fastProvisioningSupported".equals(fieldName)) { deserializedFlexibleServerCapabilityInner.fastProvisioningSupported = FastProvisioningSupportedEnum.fromString(reader.getString()); diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/IndexRecommendationResourceInner.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/IndexRecommendationResourceInner.java new file mode 100644 index 0000000000000..6364a63155a3b --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/IndexRecommendationResourceInner.java @@ -0,0 +1,383 @@ +// Copyright (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.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.postgresqlflexibleserver.models.ImpactRecord; +import com.azure.resourcemanager.postgresqlflexibleserver.models.IndexRecommendationDetails; +import com.azure.resourcemanager.postgresqlflexibleserver.models.IndexRecommendationResourcePropertiesAnalyzedWorkload; +import com.azure.resourcemanager.postgresqlflexibleserver.models.IndexRecommendationResourcePropertiesImplementationDetails; +import com.azure.resourcemanager.postgresqlflexibleserver.models.RecommendationTypeEnum; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.List; + +/** + * Index recommendation properties. + */ +@Fluent +public final class IndexRecommendationResourceInner extends ProxyResource { + /* + * Properties of IndexRecommendationResource. + */ + private IndexRecommendationResourceProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of IndexRecommendationResourceInner class. + */ + public IndexRecommendationResourceInner() { + } + + /** + * Get the innerProperties property: Properties of IndexRecommendationResource. + * + * @return the innerProperties value. + */ + private IndexRecommendationResourceProperties 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 type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the initialRecommendedTime property: Creation time of this recommendation in UTC date-time string format. + * + * @return the initialRecommendedTime value. + */ + public OffsetDateTime initialRecommendedTime() { + return this.innerProperties() == null ? null : this.innerProperties().initialRecommendedTime(); + } + + /** + * Set the initialRecommendedTime property: Creation time of this recommendation in UTC date-time string format. + * + * @param initialRecommendedTime the initialRecommendedTime value to set. + * @return the IndexRecommendationResourceInner object itself. + */ + public IndexRecommendationResourceInner withInitialRecommendedTime(OffsetDateTime initialRecommendedTime) { + if (this.innerProperties() == null) { + this.innerProperties = new IndexRecommendationResourceProperties(); + } + this.innerProperties().withInitialRecommendedTime(initialRecommendedTime); + return this; + } + + /** + * Get the lastRecommendedTime property: The last refresh of this recommendation in UTC date-time string format. + * + * @return the lastRecommendedTime value. + */ + public OffsetDateTime lastRecommendedTime() { + return this.innerProperties() == null ? null : this.innerProperties().lastRecommendedTime(); + } + + /** + * Set the lastRecommendedTime property: The last refresh of this recommendation in UTC date-time string format. + * + * @param lastRecommendedTime the lastRecommendedTime value to set. + * @return the IndexRecommendationResourceInner object itself. + */ + public IndexRecommendationResourceInner withLastRecommendedTime(OffsetDateTime lastRecommendedTime) { + if (this.innerProperties() == null) { + this.innerProperties = new IndexRecommendationResourceProperties(); + } + this.innerProperties().withLastRecommendedTime(lastRecommendedTime); + return this; + } + + /** + * Get the timesRecommended property: The number of times this recommendation has encountered. + * + * @return the timesRecommended value. + */ + public Integer timesRecommended() { + return this.innerProperties() == null ? null : this.innerProperties().timesRecommended(); + } + + /** + * Set the timesRecommended property: The number of times this recommendation has encountered. + * + * @param timesRecommended the timesRecommended value to set. + * @return the IndexRecommendationResourceInner object itself. + */ + public IndexRecommendationResourceInner withTimesRecommended(Integer timesRecommended) { + if (this.innerProperties() == null) { + this.innerProperties = new IndexRecommendationResourceProperties(); + } + this.innerProperties().withTimesRecommended(timesRecommended); + return this; + } + + /** + * Get the improvedQueryIds property: The ImprovedQueryIds. The list will only be populated for CREATE INDEX + * recommendations. + * + * @return the improvedQueryIds value. + */ + public List improvedQueryIds() { + return this.innerProperties() == null ? null : this.innerProperties().improvedQueryIds(); + } + + /** + * Set the improvedQueryIds property: The ImprovedQueryIds. The list will only be populated for CREATE INDEX + * recommendations. + * + * @param improvedQueryIds the improvedQueryIds value to set. + * @return the IndexRecommendationResourceInner object itself. + */ + public IndexRecommendationResourceInner withImprovedQueryIds(List improvedQueryIds) { + if (this.innerProperties() == null) { + this.innerProperties = new IndexRecommendationResourceProperties(); + } + this.innerProperties().withImprovedQueryIds(improvedQueryIds); + return this; + } + + /** + * Get the recommendationReason property: Reason for this recommendation. + * + * @return the recommendationReason value. + */ + public String recommendationReason() { + return this.innerProperties() == null ? null : this.innerProperties().recommendationReason(); + } + + /** + * Set the recommendationReason property: Reason for this recommendation. + * + * @param recommendationReason the recommendationReason value to set. + * @return the IndexRecommendationResourceInner object itself. + */ + public IndexRecommendationResourceInner withRecommendationReason(String recommendationReason) { + if (this.innerProperties() == null) { + this.innerProperties = new IndexRecommendationResourceProperties(); + } + this.innerProperties().withRecommendationReason(recommendationReason); + return this; + } + + /** + * Get the recommendationType property: Type for this recommendation. + * + * @return the recommendationType value. + */ + public RecommendationTypeEnum recommendationType() { + return this.innerProperties() == null ? null : this.innerProperties().recommendationType(); + } + + /** + * Set the recommendationType property: Type for this recommendation. + * + * @param recommendationType the recommendationType value to set. + * @return the IndexRecommendationResourceInner object itself. + */ + public IndexRecommendationResourceInner withRecommendationType(RecommendationTypeEnum recommendationType) { + if (this.innerProperties() == null) { + this.innerProperties = new IndexRecommendationResourceProperties(); + } + this.innerProperties().withRecommendationType(recommendationType); + return this; + } + + /** + * Get the implementationDetails property: Stores implementation details for the recommended action. + * + * @return the implementationDetails value. + */ + public IndexRecommendationResourcePropertiesImplementationDetails implementationDetails() { + return this.innerProperties() == null ? null : this.innerProperties().implementationDetails(); + } + + /** + * Set the implementationDetails property: Stores implementation details for the recommended action. + * + * @param implementationDetails the implementationDetails value to set. + * @return the IndexRecommendationResourceInner object itself. + */ + public IndexRecommendationResourceInner + withImplementationDetails(IndexRecommendationResourcePropertiesImplementationDetails implementationDetails) { + if (this.innerProperties() == null) { + this.innerProperties = new IndexRecommendationResourceProperties(); + } + this.innerProperties().withImplementationDetails(implementationDetails); + return this; + } + + /** + * Get the analyzedWorkload property: Stores workload information for the recommended action. + * + * @return the analyzedWorkload value. + */ + public IndexRecommendationResourcePropertiesAnalyzedWorkload analyzedWorkload() { + return this.innerProperties() == null ? null : this.innerProperties().analyzedWorkload(); + } + + /** + * Set the analyzedWorkload property: Stores workload information for the recommended action. + * + * @param analyzedWorkload the analyzedWorkload value to set. + * @return the IndexRecommendationResourceInner object itself. + */ + public IndexRecommendationResourceInner + withAnalyzedWorkload(IndexRecommendationResourcePropertiesAnalyzedWorkload analyzedWorkload) { + if (this.innerProperties() == null) { + this.innerProperties = new IndexRecommendationResourceProperties(); + } + this.innerProperties().withAnalyzedWorkload(analyzedWorkload); + return this; + } + + /** + * Get the estimatedImpact property: The estimated impact of this recommended action. + * + * @return the estimatedImpact value. + */ + public List estimatedImpact() { + return this.innerProperties() == null ? null : this.innerProperties().estimatedImpact(); + } + + /** + * Get the details property: Stores recommendation details for the recommended action. + * + * @return the details value. + */ + public IndexRecommendationDetails details() { + return this.innerProperties() == null ? null : this.innerProperties().details(); + } + + /** + * Set the details property: Stores recommendation details for the recommended action. + * + * @param details the details value to set. + * @return the IndexRecommendationResourceInner object itself. + */ + public IndexRecommendationResourceInner withDetails(IndexRecommendationDetails details) { + if (this.innerProperties() == null) { + this.innerProperties = new IndexRecommendationResourceProperties(); + } + this.innerProperties().withDetails(details); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IndexRecommendationResourceInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IndexRecommendationResourceInner if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the IndexRecommendationResourceInner. + */ + public static IndexRecommendationResourceInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IndexRecommendationResourceInner deserializedIndexRecommendationResourceInner + = new IndexRecommendationResourceInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedIndexRecommendationResourceInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedIndexRecommendationResourceInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedIndexRecommendationResourceInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedIndexRecommendationResourceInner.innerProperties + = IndexRecommendationResourceProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedIndexRecommendationResourceInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedIndexRecommendationResourceInner; + }); + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/IndexRecommendationResourceProperties.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/IndexRecommendationResourceProperties.java new file mode 100644 index 0000000000000..4763df1769cfd --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/IndexRecommendationResourceProperties.java @@ -0,0 +1,377 @@ +// Copyright (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.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.postgresqlflexibleserver.models.ImpactRecord; +import com.azure.resourcemanager.postgresqlflexibleserver.models.IndexRecommendationDetails; +import com.azure.resourcemanager.postgresqlflexibleserver.models.IndexRecommendationResourcePropertiesAnalyzedWorkload; +import com.azure.resourcemanager.postgresqlflexibleserver.models.IndexRecommendationResourcePropertiesImplementationDetails; +import com.azure.resourcemanager.postgresqlflexibleserver.models.RecommendationTypeEnum; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.List; + +/** + * Index recommendation properties. + */ +@Fluent +public final class IndexRecommendationResourceProperties + implements JsonSerializable { + /* + * Creation time of this recommendation in UTC date-time string format. + */ + private OffsetDateTime initialRecommendedTime; + + /* + * The last refresh of this recommendation in UTC date-time string format. + */ + private OffsetDateTime lastRecommendedTime; + + /* + * The number of times this recommendation has encountered. + */ + private Integer timesRecommended; + + /* + * The ImprovedQueryIds. The list will only be populated for CREATE INDEX recommendations. + */ + private List improvedQueryIds; + + /* + * Reason for this recommendation. + */ + private String recommendationReason; + + /* + * Type for this recommendation. + */ + private RecommendationTypeEnum recommendationType; + + /* + * Stores implementation details for the recommended action. + */ + private IndexRecommendationResourcePropertiesImplementationDetails implementationDetails; + + /* + * Stores workload information for the recommended action. + */ + private IndexRecommendationResourcePropertiesAnalyzedWorkload analyzedWorkload; + + /* + * The estimated impact of this recommended action + */ + private List estimatedImpact; + + /* + * Stores recommendation details for the recommended action. + */ + private IndexRecommendationDetails details; + + /** + * Creates an instance of IndexRecommendationResourceProperties class. + */ + public IndexRecommendationResourceProperties() { + } + + /** + * Get the initialRecommendedTime property: Creation time of this recommendation in UTC date-time string format. + * + * @return the initialRecommendedTime value. + */ + public OffsetDateTime initialRecommendedTime() { + return this.initialRecommendedTime; + } + + /** + * Set the initialRecommendedTime property: Creation time of this recommendation in UTC date-time string format. + * + * @param initialRecommendedTime the initialRecommendedTime value to set. + * @return the IndexRecommendationResourceProperties object itself. + */ + public IndexRecommendationResourceProperties withInitialRecommendedTime(OffsetDateTime initialRecommendedTime) { + this.initialRecommendedTime = initialRecommendedTime; + return this; + } + + /** + * Get the lastRecommendedTime property: The last refresh of this recommendation in UTC date-time string format. + * + * @return the lastRecommendedTime value. + */ + public OffsetDateTime lastRecommendedTime() { + return this.lastRecommendedTime; + } + + /** + * Set the lastRecommendedTime property: The last refresh of this recommendation in UTC date-time string format. + * + * @param lastRecommendedTime the lastRecommendedTime value to set. + * @return the IndexRecommendationResourceProperties object itself. + */ + public IndexRecommendationResourceProperties withLastRecommendedTime(OffsetDateTime lastRecommendedTime) { + this.lastRecommendedTime = lastRecommendedTime; + return this; + } + + /** + * Get the timesRecommended property: The number of times this recommendation has encountered. + * + * @return the timesRecommended value. + */ + public Integer timesRecommended() { + return this.timesRecommended; + } + + /** + * Set the timesRecommended property: The number of times this recommendation has encountered. + * + * @param timesRecommended the timesRecommended value to set. + * @return the IndexRecommendationResourceProperties object itself. + */ + public IndexRecommendationResourceProperties withTimesRecommended(Integer timesRecommended) { + this.timesRecommended = timesRecommended; + return this; + } + + /** + * Get the improvedQueryIds property: The ImprovedQueryIds. The list will only be populated for CREATE INDEX + * recommendations. + * + * @return the improvedQueryIds value. + */ + public List improvedQueryIds() { + return this.improvedQueryIds; + } + + /** + * Set the improvedQueryIds property: The ImprovedQueryIds. The list will only be populated for CREATE INDEX + * recommendations. + * + * @param improvedQueryIds the improvedQueryIds value to set. + * @return the IndexRecommendationResourceProperties object itself. + */ + public IndexRecommendationResourceProperties withImprovedQueryIds(List improvedQueryIds) { + this.improvedQueryIds = improvedQueryIds; + return this; + } + + /** + * Get the recommendationReason property: Reason for this recommendation. + * + * @return the recommendationReason value. + */ + public String recommendationReason() { + return this.recommendationReason; + } + + /** + * Set the recommendationReason property: Reason for this recommendation. + * + * @param recommendationReason the recommendationReason value to set. + * @return the IndexRecommendationResourceProperties object itself. + */ + public IndexRecommendationResourceProperties withRecommendationReason(String recommendationReason) { + this.recommendationReason = recommendationReason; + return this; + } + + /** + * Get the recommendationType property: Type for this recommendation. + * + * @return the recommendationType value. + */ + public RecommendationTypeEnum recommendationType() { + return this.recommendationType; + } + + /** + * Set the recommendationType property: Type for this recommendation. + * + * @param recommendationType the recommendationType value to set. + * @return the IndexRecommendationResourceProperties object itself. + */ + public IndexRecommendationResourceProperties withRecommendationType(RecommendationTypeEnum recommendationType) { + this.recommendationType = recommendationType; + return this; + } + + /** + * Get the implementationDetails property: Stores implementation details for the recommended action. + * + * @return the implementationDetails value. + */ + public IndexRecommendationResourcePropertiesImplementationDetails implementationDetails() { + return this.implementationDetails; + } + + /** + * Set the implementationDetails property: Stores implementation details for the recommended action. + * + * @param implementationDetails the implementationDetails value to set. + * @return the IndexRecommendationResourceProperties object itself. + */ + public IndexRecommendationResourceProperties + withImplementationDetails(IndexRecommendationResourcePropertiesImplementationDetails implementationDetails) { + this.implementationDetails = implementationDetails; + return this; + } + + /** + * Get the analyzedWorkload property: Stores workload information for the recommended action. + * + * @return the analyzedWorkload value. + */ + public IndexRecommendationResourcePropertiesAnalyzedWorkload analyzedWorkload() { + return this.analyzedWorkload; + } + + /** + * Set the analyzedWorkload property: Stores workload information for the recommended action. + * + * @param analyzedWorkload the analyzedWorkload value to set. + * @return the IndexRecommendationResourceProperties object itself. + */ + public IndexRecommendationResourceProperties + withAnalyzedWorkload(IndexRecommendationResourcePropertiesAnalyzedWorkload analyzedWorkload) { + this.analyzedWorkload = analyzedWorkload; + return this; + } + + /** + * Get the estimatedImpact property: The estimated impact of this recommended action. + * + * @return the estimatedImpact value. + */ + public List estimatedImpact() { + return this.estimatedImpact; + } + + /** + * Get the details property: Stores recommendation details for the recommended action. + * + * @return the details value. + */ + public IndexRecommendationDetails details() { + return this.details; + } + + /** + * Set the details property: Stores recommendation details for the recommended action. + * + * @param details the details value to set. + * @return the IndexRecommendationResourceProperties object itself. + */ + public IndexRecommendationResourceProperties withDetails(IndexRecommendationDetails details) { + this.details = details; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (implementationDetails() != null) { + implementationDetails().validate(); + } + if (analyzedWorkload() != null) { + analyzedWorkload().validate(); + } + if (estimatedImpact() != null) { + estimatedImpact().forEach(e -> e.validate()); + } + if (details() != null) { + details().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("initialRecommendedTime", + this.initialRecommendedTime == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.initialRecommendedTime)); + jsonWriter.writeStringField("lastRecommendedTime", + this.lastRecommendedTime == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastRecommendedTime)); + jsonWriter.writeNumberField("timesRecommended", this.timesRecommended); + jsonWriter.writeArrayField("improvedQueryIds", this.improvedQueryIds, + (writer, element) -> writer.writeLong(element)); + jsonWriter.writeStringField("recommendationReason", this.recommendationReason); + jsonWriter.writeStringField("recommendationType", + this.recommendationType == null ? null : this.recommendationType.toString()); + jsonWriter.writeJsonField("implementationDetails", this.implementationDetails); + jsonWriter.writeJsonField("analyzedWorkload", this.analyzedWorkload); + jsonWriter.writeJsonField("details", this.details); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IndexRecommendationResourceProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IndexRecommendationResourceProperties if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the IndexRecommendationResourceProperties. + */ + public static IndexRecommendationResourceProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IndexRecommendationResourceProperties deserializedIndexRecommendationResourceProperties + = new IndexRecommendationResourceProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("initialRecommendedTime".equals(fieldName)) { + deserializedIndexRecommendationResourceProperties.initialRecommendedTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("lastRecommendedTime".equals(fieldName)) { + deserializedIndexRecommendationResourceProperties.lastRecommendedTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("timesRecommended".equals(fieldName)) { + deserializedIndexRecommendationResourceProperties.timesRecommended + = reader.getNullable(JsonReader::getInt); + } else if ("improvedQueryIds".equals(fieldName)) { + List improvedQueryIds = reader.readArray(reader1 -> reader1.getLong()); + deserializedIndexRecommendationResourceProperties.improvedQueryIds = improvedQueryIds; + } else if ("recommendationReason".equals(fieldName)) { + deserializedIndexRecommendationResourceProperties.recommendationReason = reader.getString(); + } else if ("recommendationType".equals(fieldName)) { + deserializedIndexRecommendationResourceProperties.recommendationType + = RecommendationTypeEnum.fromString(reader.getString()); + } else if ("implementationDetails".equals(fieldName)) { + deserializedIndexRecommendationResourceProperties.implementationDetails + = IndexRecommendationResourcePropertiesImplementationDetails.fromJson(reader); + } else if ("analyzedWorkload".equals(fieldName)) { + deserializedIndexRecommendationResourceProperties.analyzedWorkload + = IndexRecommendationResourcePropertiesAnalyzedWorkload.fromJson(reader); + } else if ("estimatedImpact".equals(fieldName)) { + List estimatedImpact = reader.readArray(reader1 -> ImpactRecord.fromJson(reader1)); + deserializedIndexRecommendationResourceProperties.estimatedImpact = estimatedImpact; + } else if ("details".equals(fieldName)) { + deserializedIndexRecommendationResourceProperties.details + = IndexRecommendationDetails.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedIndexRecommendationResourceProperties; + }); + } +} 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 index cb2b052bd6e89..b797362428075 100644 --- 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 @@ -219,7 +219,10 @@ public MigrationResourceInner withMigrationOption(MigrationOption migrationOptio /** * Get the sourceType property: migration source server type : OnPremises, AWS, GCP, AzureVM, - * PostgreSQLSingleServer, AWS_RDS, AWS_AURORA, AWS_EC2, GCP_CloudSQL, GCP_AlloyDB, GCP_Compute, or EDB. + * PostgreSQLSingleServer, AWS_RDS, AWS_AURORA, AWS_EC2, GCP_CloudSQL, GCP_AlloyDB, GCP_Compute, EDB, + * EDB_Oracle_Server, EDB_PostgreSQL, PostgreSQLFlexibleServer, PostgreSQLCosmosDB, Huawei_RDS, Huawei_Compute, + * Heroku_PostgreSQL, Crunchy_PostgreSQL, ApsaraDB_RDS, Digital_Ocean_Droplets, Digital_Ocean_PostgreSQL, or + * Supabase_PostgreSQL. * * @return the sourceType value. */ @@ -229,7 +232,10 @@ public SourceType sourceType() { /** * Set the sourceType property: migration source server type : OnPremises, AWS, GCP, AzureVM, - * PostgreSQLSingleServer, AWS_RDS, AWS_AURORA, AWS_EC2, GCP_CloudSQL, GCP_AlloyDB, GCP_Compute, or EDB. + * PostgreSQLSingleServer, AWS_RDS, AWS_AURORA, AWS_EC2, GCP_CloudSQL, GCP_AlloyDB, GCP_Compute, EDB, + * EDB_Oracle_Server, EDB_PostgreSQL, PostgreSQLFlexibleServer, PostgreSQLCosmosDB, Huawei_RDS, Huawei_Compute, + * Heroku_PostgreSQL, Crunchy_PostgreSQL, ApsaraDB_RDS, Digital_Ocean_Droplets, Digital_Ocean_PostgreSQL, or + * Supabase_PostgreSQL. * * @param sourceType the sourceType value to set. * @return the MigrationResourceInner object itself. 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 index c70cd83bd17af..52eb3cd8491e3 100644 --- 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 @@ -60,7 +60,9 @@ public final class MigrationResourceProperties implements JsonSerializable { + /* + * Name of quota usage for flexible servers + */ + private NameProperty name; + + /* + * Quota limit + */ + private Long limit; + + /* + * Quota unit + */ + private String unit; + + /* + * Current Quota usage value + */ + private Long currentValue; + + /* + * Fully qualified ARM resource 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(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("name", this.name); + jsonWriter.writeNumberField("limit", this.limit); + jsonWriter.writeStringField("unit", this.unit); + jsonWriter.writeNumberField("currentValue", this.currentValue); + jsonWriter.writeStringField("id", this.id); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of QuotaUsageInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of QuotaUsageInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the QuotaUsageInner. + */ + public static QuotaUsageInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + QuotaUsageInner deserializedQuotaUsageInner = new QuotaUsageInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedQuotaUsageInner.name = NameProperty.fromJson(reader); + } else if ("limit".equals(fieldName)) { + deserializedQuotaUsageInner.limit = reader.getNullable(JsonReader::getLong); + } else if ("unit".equals(fieldName)) { + deserializedQuotaUsageInner.unit = reader.getString(); + } else if ("currentValue".equals(fieldName)) { + deserializedQuotaUsageInner.currentValue = reader.getNullable(JsonReader::getLong); + } else if ("id".equals(fieldName)) { + deserializedQuotaUsageInner.id = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedQuotaUsageInner; + }); + } +} 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 dc708a9932a1b..fa7f206b7f5e3 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 @@ -12,6 +12,7 @@ import com.azure.json.JsonWriter; import com.azure.resourcemanager.postgresqlflexibleserver.models.AuthConfig; import com.azure.resourcemanager.postgresqlflexibleserver.models.Backup; +import com.azure.resourcemanager.postgresqlflexibleserver.models.Cluster; import com.azure.resourcemanager.postgresqlflexibleserver.models.CreateMode; import com.azure.resourcemanager.postgresqlflexibleserver.models.DataEncryption; import com.azure.resourcemanager.postgresqlflexibleserver.models.HighAvailability; @@ -607,6 +608,29 @@ public List privateEndpointConnections() { return this.innerProperties() == null ? null : this.innerProperties().privateEndpointConnections(); } + /** + * Get the cluster property: Cluster properties of a server. + * + * @return the cluster value. + */ + public Cluster cluster() { + return this.innerProperties() == null ? null : this.innerProperties().cluster(); + } + + /** + * Set the cluster property: Cluster properties of a server. + * + * @param cluster the cluster value to set. + * @return the ServerInner object itself. + */ + public ServerInner withCluster(Cluster cluster) { + if (this.innerProperties() == null) { + this.innerProperties = new ServerProperties(); + } + this.innerProperties().withCluster(cluster); + return this; + } + /** * 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 b1ebfc56b6879..d927380c4d66c 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,6 +12,7 @@ import com.azure.json.JsonWriter; import com.azure.resourcemanager.postgresqlflexibleserver.models.AuthConfig; import com.azure.resourcemanager.postgresqlflexibleserver.models.Backup; +import com.azure.resourcemanager.postgresqlflexibleserver.models.Cluster; import com.azure.resourcemanager.postgresqlflexibleserver.models.CreateMode; import com.azure.resourcemanager.postgresqlflexibleserver.models.DataEncryption; import com.azure.resourcemanager.postgresqlflexibleserver.models.HighAvailability; @@ -142,6 +143,11 @@ public final class ServerProperties implements JsonSerializable privateEndpointConnections; + /* + * Cluster properties of a server. + */ + private Cluster cluster; + /** * Creates an instance of ServerProperties class. */ @@ -526,6 +532,26 @@ public List privateEndpointConnections() { return this.privateEndpointConnections; } + /** + * Get the cluster property: Cluster properties of a server. + * + * @return the cluster value. + */ + public Cluster cluster() { + return this.cluster; + } + + /** + * Set the cluster property: Cluster properties of a server. + * + * @param cluster the cluster value to set. + * @return the ServerProperties object itself. + */ + public ServerProperties withCluster(Cluster cluster) { + this.cluster = cluster; + return this; + } + /** * Validates the instance. * @@ -559,6 +585,9 @@ public void validate() { if (privateEndpointConnections() != null) { privateEndpointConnections().forEach(e -> e.validate()); } + if (cluster() != null) { + cluster().validate(); + } } /** @@ -585,6 +614,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { this.replicationRole == null ? null : this.replicationRole.toString()); jsonWriter.writeJsonField("replica", this.replica); jsonWriter.writeStringField("createMode", this.createMode == null ? null : this.createMode.toString()); + jsonWriter.writeJsonField("cluster", this.cluster); return jsonWriter.writeEndObject(); } @@ -648,6 +678,8 @@ public static ServerProperties fromJson(JsonReader jsonReader) throws IOExceptio List privateEndpointConnections = reader.readArray(reader1 -> PrivateEndpointConnectionInner.fromJson(reader1)); deserializedServerProperties.privateEndpointConnections = privateEndpointConnections; + } else if ("cluster".equals(fieldName)) { + deserializedServerProperties.cluster = Cluster.fromJson(reader); } else { reader.skipChildren(); } 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 fc7b07dfd9cff..ccb9ceb80c240 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 @@ -11,6 +11,7 @@ import com.azure.json.JsonWriter; import com.azure.resourcemanager.postgresqlflexibleserver.models.AuthConfig; import com.azure.resourcemanager.postgresqlflexibleserver.models.Backup; +import com.azure.resourcemanager.postgresqlflexibleserver.models.Cluster; import com.azure.resourcemanager.postgresqlflexibleserver.models.CreateModeForUpdate; import com.azure.resourcemanager.postgresqlflexibleserver.models.DataEncryption; import com.azure.resourcemanager.postgresqlflexibleserver.models.HighAvailability; @@ -95,6 +96,11 @@ public final class ServerPropertiesForUpdate implements JsonSerializable { + TuningOptionsResourceInner deserializedTuningOptionsResourceInner = new TuningOptionsResourceInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedTuningOptionsResourceInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedTuningOptionsResourceInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedTuningOptionsResourceInner.type = reader.getString(); + } else if ("systemData".equals(fieldName)) { + deserializedTuningOptionsResourceInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedTuningOptionsResourceInner; + }); + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/FlexibleServerCapabilityImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/FlexibleServerCapabilityImpl.java index ae6f7cefa57b1..16dbb57ae0e86 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/FlexibleServerCapabilityImpl.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/FlexibleServerCapabilityImpl.java @@ -15,6 +15,7 @@ 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.SupportedFeature; import com.azure.resourcemanager.postgresqlflexibleserver.models.ZoneRedundantHaAndGeoBackupSupportedEnum; import com.azure.resourcemanager.postgresqlflexibleserver.models.ZoneRedundantHaSupportedEnum; import java.util.Collections; @@ -61,6 +62,15 @@ public List supportedServerVersions() { } } + public List supportedFeatures() { + List inner = this.innerModel().supportedFeatures(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + public FastProvisioningSupportedEnum fastProvisioningSupported() { return this.innerModel().fastProvisioningSupported(); } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/IndexRecommendationResourceImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/IndexRecommendationResourceImpl.java new file mode 100644 index 0000000000000..2bd529464728d --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/IndexRecommendationResourceImpl.java @@ -0,0 +1,103 @@ +// Copyright (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.IndexRecommendationResourceInner; +import com.azure.resourcemanager.postgresqlflexibleserver.models.ImpactRecord; +import com.azure.resourcemanager.postgresqlflexibleserver.models.IndexRecommendationDetails; +import com.azure.resourcemanager.postgresqlflexibleserver.models.IndexRecommendationResource; +import com.azure.resourcemanager.postgresqlflexibleserver.models.IndexRecommendationResourcePropertiesAnalyzedWorkload; +import com.azure.resourcemanager.postgresqlflexibleserver.models.IndexRecommendationResourcePropertiesImplementationDetails; +import com.azure.resourcemanager.postgresqlflexibleserver.models.RecommendationTypeEnum; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; + +public final class IndexRecommendationResourceImpl implements IndexRecommendationResource { + private IndexRecommendationResourceInner innerObject; + + private final com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager; + + IndexRecommendationResourceImpl(IndexRecommendationResourceInner 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 initialRecommendedTime() { + return this.innerModel().initialRecommendedTime(); + } + + public OffsetDateTime lastRecommendedTime() { + return this.innerModel().lastRecommendedTime(); + } + + public Integer timesRecommended() { + return this.innerModel().timesRecommended(); + } + + public List improvedQueryIds() { + List inner = this.innerModel().improvedQueryIds(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String recommendationReason() { + return this.innerModel().recommendationReason(); + } + + public RecommendationTypeEnum recommendationType() { + return this.innerModel().recommendationType(); + } + + public IndexRecommendationResourcePropertiesImplementationDetails implementationDetails() { + return this.innerModel().implementationDetails(); + } + + public IndexRecommendationResourcePropertiesAnalyzedWorkload analyzedWorkload() { + return this.innerModel().analyzedWorkload(); + } + + public List estimatedImpact() { + List inner = this.innerModel().estimatedImpact(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public IndexRecommendationDetails details() { + return this.innerModel().details(); + } + + public IndexRecommendationResourceInner 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/PostgreSqlManagementClientImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/PostgreSqlManagementClientImpl.java index e7154902c1caa..19bb2f14c79cf 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 @@ -41,11 +41,13 @@ 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.TuningOptionsClient; import com.azure.resourcemanager.postgresqlflexibleserver.fluent.VirtualEndpointsClient; import com.azure.resourcemanager.postgresqlflexibleserver.fluent.VirtualNetworkSubnetUsagesClient; import java.io.IOException; @@ -412,6 +414,20 @@ 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. */ @@ -454,6 +470,20 @@ public ServerThreatProtectionSettingsClient getServerThreatProtectionSettings() return this.serverThreatProtectionSettings; } + /** + * The TuningOptionsClient object to access its operations. + */ + private final TuningOptionsClient tuningOptions; + + /** + * Gets the TuningOptionsClient object to access its operations. + * + * @return the TuningOptionsClient object. + */ + public TuningOptionsClient getTuningOptions() { + return this.tuningOptions; + } + /** * The VirtualEndpointsClient object to access its operations. */ @@ -499,7 +529,7 @@ public VirtualNetworkSubnetUsagesClient getVirtualNetworkSubnetUsages() { this.defaultPollInterval = defaultPollInterval; this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.apiVersion = "2024-08-01"; + this.apiVersion = "2024-11-01-preview"; this.administrators = new AdministratorsClientImpl(this); this.backups = new BackupsClientImpl(this); this.locationBasedCapabilities = new LocationBasedCapabilitiesClientImpl(this); @@ -519,9 +549,11 @@ public VirtualNetworkSubnetUsagesClient getVirtualNetworkSubnetUsages() { 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.tuningOptions = new TuningOptionsClientImpl(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/QuotaUsageImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/QuotaUsageImpl.java new file mode 100644 index 0000000000000..7e4b096d65810 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/QuotaUsageImpl.java @@ -0,0 +1,49 @@ +// Copyright (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 0000000000000..86be3cf855b66 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/QuotaUsagesClientImpl.java @@ -0,0 +1,259 @@ +// Copyright (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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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. + * @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 0000000000000..47d5bef6e5f69 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/QuotaUsagesImpl.java @@ -0,0 +1,45 @@ +// Copyright (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 ResourceManagerUtils.mapPage(inner, inner1 -> new QuotaUsageImpl(inner1, this.manager())); + } + + public PagedIterable list(String locationName, Context context) { + PagedIterable inner = this.serviceClient().list(locationName, context); + return ResourceManagerUtils.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/ServerImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/ServerImpl.java index 684673b9cb706..1abda05900b2d 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 @@ -11,6 +11,7 @@ import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.ServerInner; import com.azure.resourcemanager.postgresqlflexibleserver.models.AuthConfig; import com.azure.resourcemanager.postgresqlflexibleserver.models.Backup; +import com.azure.resourcemanager.postgresqlflexibleserver.models.Cluster; import com.azure.resourcemanager.postgresqlflexibleserver.models.CreateMode; import com.azure.resourcemanager.postgresqlflexibleserver.models.CreateModeForUpdate; import com.azure.resourcemanager.postgresqlflexibleserver.models.DataEncryption; @@ -167,6 +168,10 @@ public List privateEndpointConnections() { } } + public Cluster cluster() { + return this.innerModel().cluster(); + } + public Region region() { return Region.fromName(this.regionName()); } @@ -445,6 +450,16 @@ public ServerImpl withCreateMode(CreateMode createMode) { return this; } + public ServerImpl withCluster(Cluster cluster) { + if (isInCreateMode()) { + this.innerModel().withCluster(cluster); + return this; + } else { + this.updateParameters.withCluster(cluster); + return this; + } + } + public ServerImpl withMaintenanceWindow(MaintenanceWindow maintenanceWindow) { this.updateParameters.withMaintenanceWindow(maintenanceWindow); return this; diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/TuningOptionsClientImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/TuningOptionsClientImpl.java new file mode 100644 index 0000000000000..82a3158436555 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/TuningOptionsClientImpl.java @@ -0,0 +1,694 @@ +// Copyright (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.TuningOptionsClient; +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.IndexRecommendationResourceInner; +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.TuningOptionsResourceInner; +import com.azure.resourcemanager.postgresqlflexibleserver.models.IndexRecommendationListResult; +import com.azure.resourcemanager.postgresqlflexibleserver.models.RecommendationType; +import com.azure.resourcemanager.postgresqlflexibleserver.models.TuningOptionEnum; +import com.azure.resourcemanager.postgresqlflexibleserver.models.TuningOptionsListResult; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in TuningOptionsClient. + */ +public final class TuningOptionsClientImpl implements TuningOptionsClient { + /** + * The proxy service used to perform REST calls. + */ + private final TuningOptionsService service; + + /** + * The service client containing this operation class. + */ + private final PostgreSqlManagementClientImpl client; + + /** + * Initializes an instance of TuningOptionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + TuningOptionsClientImpl(PostgreSqlManagementClientImpl client) { + this.service + = RestProxy.create(TuningOptionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for PostgreSqlManagementClientTuningOptions to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "PostgreSqlManagement") + public interface TuningOptionsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/tuningOptions/{tuningOption}") + @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("tuningOption") TuningOptionEnum tuningOption, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/tuningOptions/{tuningOption}/recommendations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listRecommendations(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("serverName") String serverName, + @PathParam("tuningOption") TuningOptionEnum tuningOption, + @QueryParam("$recommendationType") RecommendationType recommendationType, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/tuningOptions") + @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> listRecommendationsNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByServerNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Retrieve the tuning option on a server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return stores property that features impact on some metric if this recommended action is applied along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponseAsync(String resourceGroupName, String serverName, + TuningOptionEnum tuningOption) { + 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 (tuningOption == null) { + return Mono.error(new IllegalArgumentException("Parameter tuningOption 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, tuningOption, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieve the tuning option on a server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @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 stores property that features impact on some metric if this recommended action is applied along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String serverName, + TuningOptionEnum tuningOption, 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 (tuningOption == null) { + return Mono.error(new IllegalArgumentException("Parameter tuningOption 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, tuningOption, accept, context); + } + + /** + * Retrieve the tuning option on a server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return stores property that features impact on some metric if this recommended action is applied on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getAsync(String resourceGroupName, String serverName, + TuningOptionEnum tuningOption) { + return getWithResponseAsync(resourceGroupName, serverName, tuningOption) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Retrieve the tuning option on a server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @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 stores property that features impact on some metric if this recommended action is applied along with + * {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String serverName, + TuningOptionEnum tuningOption, Context context) { + return getWithResponseAsync(resourceGroupName, serverName, tuningOption, context).block(); + } + + /** + * Retrieve the tuning option on a server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return stores property that features impact on some metric if this recommended action is applied. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public TuningOptionsResourceInner get(String resourceGroupName, String serverName, TuningOptionEnum tuningOption) { + return getWithResponse(resourceGroupName, serverName, tuningOption, Context.NONE).getValue(); + } + + /** + * Retrieve the list of available tuning index recommendations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @param recommendationType Recommendations list filter. Retrieves recommendations based on type. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 available index recommendations along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listRecommendationsSinglePageAsync( + String resourceGroupName, String serverName, TuningOptionEnum tuningOption, + RecommendationType recommendationType) { + 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 (tuningOption == null) { + return Mono.error(new IllegalArgumentException("Parameter tuningOption is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listRecommendations(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serverName, tuningOption, recommendationType, + 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())); + } + + /** + * Retrieve the list of available tuning index recommendations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @param recommendationType Recommendations list filter. Retrieves recommendations based on type. + * @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 available index recommendations along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listRecommendationsSinglePageAsync( + String resourceGroupName, String serverName, TuningOptionEnum tuningOption, + RecommendationType recommendationType, 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 (tuningOption == null) { + return Mono.error(new IllegalArgumentException("Parameter tuningOption is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listRecommendations(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serverName, tuningOption, recommendationType, + accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Retrieve the list of available tuning index recommendations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @param recommendationType Recommendations list filter. Retrieves recommendations based on type. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 available index recommendations as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listRecommendationsAsync(String resourceGroupName, + String serverName, TuningOptionEnum tuningOption, RecommendationType recommendationType) { + return new PagedFlux<>( + () -> listRecommendationsSinglePageAsync(resourceGroupName, serverName, tuningOption, recommendationType), + nextLink -> listRecommendationsNextSinglePageAsync(nextLink)); + } + + /** + * Retrieve the list of available tuning index recommendations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 available index recommendations as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listRecommendationsAsync(String resourceGroupName, + String serverName, TuningOptionEnum tuningOption) { + final RecommendationType recommendationType = null; + return new PagedFlux<>( + () -> listRecommendationsSinglePageAsync(resourceGroupName, serverName, tuningOption, recommendationType), + nextLink -> listRecommendationsNextSinglePageAsync(nextLink)); + } + + /** + * Retrieve the list of available tuning index recommendations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @param recommendationType Recommendations list filter. Retrieves recommendations based on type. + * @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 available index recommendations as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listRecommendationsAsync(String resourceGroupName, + String serverName, TuningOptionEnum tuningOption, RecommendationType recommendationType, Context context) { + return new PagedFlux<>(() -> listRecommendationsSinglePageAsync(resourceGroupName, serverName, tuningOption, + recommendationType, context), nextLink -> listRecommendationsNextSinglePageAsync(nextLink, context)); + } + + /** + * Retrieve the list of available tuning index recommendations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 available index recommendations as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listRecommendations(String resourceGroupName, + String serverName, TuningOptionEnum tuningOption) { + final RecommendationType recommendationType = null; + return new PagedIterable<>( + listRecommendationsAsync(resourceGroupName, serverName, tuningOption, recommendationType)); + } + + /** + * Retrieve the list of available tuning index recommendations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @param recommendationType Recommendations list filter. Retrieves recommendations based on type. + * @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 available index recommendations as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listRecommendations(String resourceGroupName, + String serverName, TuningOptionEnum tuningOption, RecommendationType recommendationType, Context context) { + return new PagedIterable<>( + listRecommendationsAsync(resourceGroupName, serverName, tuningOption, recommendationType, context)); + } + + /** + * Retrieve the list of available tuning options. + * + * @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 tuning options 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())); + } + + /** + * Retrieve the list of available tuning options. + * + * @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 tuning options 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)); + } + + /** + * Retrieve the list of available tuning options. + * + * @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 tuning options 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)); + } + + /** + * Retrieve the list of available tuning options. + * + * @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 tuning options 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)); + } + + /** + * Retrieve the list of available tuning options. + * + * @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 tuning options as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByServer(String resourceGroupName, String serverName) { + return new PagedIterable<>(listByServerAsync(resourceGroupName, serverName)); + } + + /** + * Retrieve the list of available tuning options. + * + * @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 tuning options 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 available index recommendations along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listRecommendationsNextSinglePageAsync(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.listRecommendationsNext(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. + * @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 available index recommendations along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listRecommendationsNextSinglePageAsync(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.listRecommendationsNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 tuning options 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. + * @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 tuning options 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/TuningOptionsImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/TuningOptionsImpl.java new file mode 100644 index 0000000000000..650f7d4d9b2c6 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/TuningOptionsImpl.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.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.TuningOptionsClient; +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.IndexRecommendationResourceInner; +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.TuningOptionsResourceInner; +import com.azure.resourcemanager.postgresqlflexibleserver.models.IndexRecommendationResource; +import com.azure.resourcemanager.postgresqlflexibleserver.models.RecommendationType; +import com.azure.resourcemanager.postgresqlflexibleserver.models.TuningOptionEnum; +import com.azure.resourcemanager.postgresqlflexibleserver.models.TuningOptions; +import com.azure.resourcemanager.postgresqlflexibleserver.models.TuningOptionsResource; + +public final class TuningOptionsImpl implements TuningOptions { + private static final ClientLogger LOGGER = new ClientLogger(TuningOptionsImpl.class); + + private final TuningOptionsClient innerClient; + + private final com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager; + + public TuningOptionsImpl(TuningOptionsClient innerClient, + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String resourceGroupName, String serverName, + TuningOptionEnum tuningOption, Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, serverName, tuningOption, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new TuningOptionsResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public TuningOptionsResource get(String resourceGroupName, String serverName, TuningOptionEnum tuningOption) { + TuningOptionsResourceInner inner = this.serviceClient().get(resourceGroupName, serverName, tuningOption); + if (inner != null) { + return new TuningOptionsResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable listRecommendations(String resourceGroupName, String serverName, + TuningOptionEnum tuningOption) { + PagedIterable inner + = this.serviceClient().listRecommendations(resourceGroupName, serverName, tuningOption); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new IndexRecommendationResourceImpl(inner1, this.manager())); + } + + public PagedIterable listRecommendations(String resourceGroupName, String serverName, + TuningOptionEnum tuningOption, RecommendationType recommendationType, Context context) { + PagedIterable inner = this.serviceClient() + .listRecommendations(resourceGroupName, serverName, tuningOption, recommendationType, context); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new IndexRecommendationResourceImpl(inner1, this.manager())); + } + + public PagedIterable listByServer(String resourceGroupName, String serverName) { + PagedIterable inner + = this.serviceClient().listByServer(resourceGroupName, serverName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new TuningOptionsResourceImpl(inner1, this.manager())); + } + + public PagedIterable listByServer(String resourceGroupName, String serverName, + Context context) { + PagedIterable inner + = this.serviceClient().listByServer(resourceGroupName, serverName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new TuningOptionsResourceImpl(inner1, this.manager())); + } + + private TuningOptionsClient 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/TuningOptionsResourceImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/TuningOptionsResourceImpl.java new file mode 100644 index 0000000000000..becdc8f9556ab --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/TuningOptionsResourceImpl.java @@ -0,0 +1,45 @@ +// Copyright (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.TuningOptionsResourceInner; +import com.azure.resourcemanager.postgresqlflexibleserver.models.TuningOptionsResource; + +public final class TuningOptionsResourceImpl implements TuningOptionsResource { + private TuningOptionsResourceInner innerObject; + + private final com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager; + + TuningOptionsResourceImpl(TuningOptionsResourceInner 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 TuningOptionsResourceInner 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/models/Cluster.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/Cluster.java new file mode 100644 index 0000000000000..0880429954b4a --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/Cluster.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Cluster properties of a server. + */ +@Fluent +public final class Cluster implements JsonSerializable { + /* + * The node count for the cluster. + */ + private Integer clusterSize; + + /** + * Creates an instance of Cluster class. + */ + public Cluster() { + } + + /** + * Get the clusterSize property: The node count for the cluster. + * + * @return the clusterSize value. + */ + public Integer clusterSize() { + return this.clusterSize; + } + + /** + * Set the clusterSize property: The node count for the cluster. + * + * @param clusterSize the clusterSize value to set. + * @return the Cluster object itself. + */ + public Cluster withClusterSize(Integer clusterSize) { + this.clusterSize = clusterSize; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("clusterSize", this.clusterSize); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Cluster from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Cluster if the JsonReader was pointing to an instance of it, or null if it was pointing to + * JSON null. + * @throws IOException If an error occurs while reading the Cluster. + */ + public static Cluster fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Cluster deserializedCluster = new Cluster(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("clusterSize".equals(fieldName)) { + deserializedCluster.clusterSize = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedCluster; + }); + } +} 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 index 616b5ac852685..2c0d60b0dd373 100644 --- 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 @@ -9,7 +9,8 @@ /** * Gets a value indicating whether fast provisioning is supported. "Enabled" means fast provisioning is supported. - * "Disabled" stands for fast provisioning is not supported. + * "Disabled" stands for fast provisioning is not supported. Will be deprecated in future, please look to Supported + * Features for "FastProvisioning". */ public final class FastProvisioningSupportedEnum extends ExpandableStringEnum { /** 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 index 5a2620a2d3c0c..8c97306ca6422 100644 --- 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 @@ -46,9 +46,17 @@ public interface FlexibleServerCapability { */ List supportedServerVersions(); + /** + * Gets the supportedFeatures property: The supported features. + * + * @return the supportedFeatures value. + */ + List supportedFeatures(); + /** * 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. + * "Enabled" means fast provisioning is supported. "Disabled" stands for fast provisioning is not supported. Will be + * deprecated in future, please look to Supported Features for "FastProvisioning". * * @return the fastProvisioningSupported value. */ @@ -63,7 +71,8 @@ public interface FlexibleServerCapability { /** * 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. + * geo-backup is supported. "Disabled" stands for geo-back is not supported. Will be deprecated in future, please + * look to Supported Features for "GeoBackup". * * @return the geoBackupSupported value. */ @@ -72,6 +81,7 @@ public interface FlexibleServerCapability { /** * 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. + * Will be deprecated in future, please look to Supported Features for "ZoneRedundantHa". * * @return the zoneRedundantHaSupported value. */ @@ -80,7 +90,8 @@ public interface FlexibleServerCapability { /** * 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. + * stands for zone redundant HA and geo-backup is not supported. Will be deprecated in future, please look to + * Supported Features for "ZoneRedundantHaAndGeoBackup". * * @return the zoneRedundantHaAndGeoBackupSupported value. */ @@ -89,6 +100,7 @@ public interface FlexibleServerCapability { /** * 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. + * Will be deprecated in future, please look to Supported Features for "StorageAutoGrowth". * * @return the storageAutoGrowthSupported value. */ @@ -97,7 +109,7 @@ public interface FlexibleServerCapability { /** * 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. + * resize is not supported. Will be deprecated in future, please look to Supported Features for "OnlineResize". * * @return the onlineResizeSupported value. */ @@ -105,7 +117,8 @@ public interface FlexibleServerCapability { /** * Gets the restricted property: A value indicating whether this region is restricted. "Enabled" means region is - * restricted. "Disabled" stands for region is not restricted. + * restricted. "Disabled" stands for region is not restricted. Will be deprecated in future, please look to + * Supported Features for "Restricted". * * @return the restricted value. */ 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 index 90eb394f96a12..8c098fa8361ff 100644 --- 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 @@ -9,7 +9,7 @@ /** * Determines if geo-backup is supported in this region. "Enabled" means geo-backup is supported. "Disabled" stands for - * geo-back is not supported. + * geo-back is not supported. Will be deprecated in future, please look to Supported Features for "GeoBackup". */ public final class GeoBackupSupportedEnum extends ExpandableStringEnum { /** diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/IdentityType.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/IdentityType.java index 1993c85677652..33d5e2f2e69a3 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/IdentityType.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/IdentityType.java @@ -8,7 +8,7 @@ import java.util.Collection; /** - * the types of identities associated with this resource; currently restricted to 'None and UserAssigned'. + * the types of identities associated with this resource. */ public final class IdentityType extends ExpandableStringEnum { /** diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ImpactRecord.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ImpactRecord.java new file mode 100644 index 0000000000000..265cb23da1e5f --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ImpactRecord.java @@ -0,0 +1,179 @@ +// Copyright (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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Stores property that features impact on some metric if this recommended action is applied. + */ +@Fluent +public final class ImpactRecord implements JsonSerializable { + /* + * Dimension name + */ + private String dimensionName; + + /* + * Dimension unit + */ + private String unit; + + /* + * Optional property that can be used to store the QueryId if the metric is for a specific query. + */ + private Long queryId; + + /* + * Absolute value + */ + private Double absoluteValue; + + /** + * Creates an instance of ImpactRecord class. + */ + public ImpactRecord() { + } + + /** + * Get the dimensionName property: Dimension name. + * + * @return the dimensionName value. + */ + public String dimensionName() { + return this.dimensionName; + } + + /** + * Set the dimensionName property: Dimension name. + * + * @param dimensionName the dimensionName value to set. + * @return the ImpactRecord object itself. + */ + public ImpactRecord withDimensionName(String dimensionName) { + this.dimensionName = dimensionName; + return this; + } + + /** + * Get the unit property: Dimension unit. + * + * @return the unit value. + */ + public String unit() { + return this.unit; + } + + /** + * Set the unit property: Dimension unit. + * + * @param unit the unit value to set. + * @return the ImpactRecord object itself. + */ + public ImpactRecord withUnit(String unit) { + this.unit = unit; + return this; + } + + /** + * Get the queryId property: Optional property that can be used to store the QueryId if the metric is for a specific + * query. + * + * @return the queryId value. + */ + public Long queryId() { + return this.queryId; + } + + /** + * Set the queryId property: Optional property that can be used to store the QueryId if the metric is for a specific + * query. + * + * @param queryId the queryId value to set. + * @return the ImpactRecord object itself. + */ + public ImpactRecord withQueryId(Long queryId) { + this.queryId = queryId; + return this; + } + + /** + * Get the absoluteValue property: Absolute value. + * + * @return the absoluteValue value. + */ + public Double absoluteValue() { + return this.absoluteValue; + } + + /** + * Set the absoluteValue property: Absolute value. + * + * @param absoluteValue the absoluteValue value to set. + * @return the ImpactRecord object itself. + */ + public ImpactRecord withAbsoluteValue(Double absoluteValue) { + this.absoluteValue = absoluteValue; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("dimensionName", this.dimensionName); + jsonWriter.writeStringField("unit", this.unit); + jsonWriter.writeNumberField("queryId", this.queryId); + jsonWriter.writeNumberField("absoluteValue", this.absoluteValue); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ImpactRecord from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ImpactRecord if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ImpactRecord. + */ + public static ImpactRecord fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ImpactRecord deserializedImpactRecord = new ImpactRecord(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("dimensionName".equals(fieldName)) { + deserializedImpactRecord.dimensionName = reader.getString(); + } else if ("unit".equals(fieldName)) { + deserializedImpactRecord.unit = reader.getString(); + } else if ("queryId".equals(fieldName)) { + deserializedImpactRecord.queryId = reader.getNullable(JsonReader::getLong); + } else if ("absoluteValue".equals(fieldName)) { + deserializedImpactRecord.absoluteValue = reader.getNullable(JsonReader::getDouble); + } else { + reader.skipChildren(); + } + } + + return deserializedImpactRecord; + }); + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/IndexRecommendationDetails.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/IndexRecommendationDetails.java new file mode 100644 index 0000000000000..c3c80532df586 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/IndexRecommendationDetails.java @@ -0,0 +1,233 @@ +// Copyright (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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Recommendation details for the recommended action. + */ +@Fluent +public final class IndexRecommendationDetails implements JsonSerializable { + /* + * Database name. + */ + private String databaseName; + + /* + * Schema name. + */ + private String schema; + + /* + * Table name. + */ + private String table; + + /* + * Index type. + */ + private String indexType; + + /* + * Index name. + */ + private String indexName; + + /* + * Index columns. These will be semi-column separated. + */ + private String indexColumns; + + /** + * Creates an instance of IndexRecommendationDetails class. + */ + public IndexRecommendationDetails() { + } + + /** + * Get the databaseName property: Database name. + * + * @return the databaseName value. + */ + public String databaseName() { + return this.databaseName; + } + + /** + * Set the databaseName property: Database name. + * + * @param databaseName the databaseName value to set. + * @return the IndexRecommendationDetails object itself. + */ + public IndexRecommendationDetails withDatabaseName(String databaseName) { + this.databaseName = databaseName; + return this; + } + + /** + * Get the schema property: Schema name. + * + * @return the schema value. + */ + public String schema() { + return this.schema; + } + + /** + * Set the schema property: Schema name. + * + * @param schema the schema value to set. + * @return the IndexRecommendationDetails object itself. + */ + public IndexRecommendationDetails withSchema(String schema) { + this.schema = schema; + return this; + } + + /** + * Get the table property: Table name. + * + * @return the table value. + */ + public String table() { + return this.table; + } + + /** + * Set the table property: Table name. + * + * @param table the table value to set. + * @return the IndexRecommendationDetails object itself. + */ + public IndexRecommendationDetails withTable(String table) { + this.table = table; + return this; + } + + /** + * Get the indexType property: Index type. + * + * @return the indexType value. + */ + public String indexType() { + return this.indexType; + } + + /** + * Set the indexType property: Index type. + * + * @param indexType the indexType value to set. + * @return the IndexRecommendationDetails object itself. + */ + public IndexRecommendationDetails withIndexType(String indexType) { + this.indexType = indexType; + return this; + } + + /** + * Get the indexName property: Index name. + * + * @return the indexName value. + */ + public String indexName() { + return this.indexName; + } + + /** + * Set the indexName property: Index name. + * + * @param indexName the indexName value to set. + * @return the IndexRecommendationDetails object itself. + */ + public IndexRecommendationDetails withIndexName(String indexName) { + this.indexName = indexName; + return this; + } + + /** + * Get the indexColumns property: Index columns. These will be semi-column separated. + * + * @return the indexColumns value. + */ + public String indexColumns() { + return this.indexColumns; + } + + /** + * Set the indexColumns property: Index columns. These will be semi-column separated. + * + * @param indexColumns the indexColumns value to set. + * @return the IndexRecommendationDetails object itself. + */ + public IndexRecommendationDetails withIndexColumns(String indexColumns) { + this.indexColumns = indexColumns; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("databaseName", this.databaseName); + jsonWriter.writeStringField("schema", this.schema); + jsonWriter.writeStringField("table", this.table); + jsonWriter.writeStringField("indexType", this.indexType); + jsonWriter.writeStringField("indexName", this.indexName); + jsonWriter.writeStringField("indexColumns", this.indexColumns); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IndexRecommendationDetails from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IndexRecommendationDetails if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the IndexRecommendationDetails. + */ + public static IndexRecommendationDetails fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IndexRecommendationDetails deserializedIndexRecommendationDetails = new IndexRecommendationDetails(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("databaseName".equals(fieldName)) { + deserializedIndexRecommendationDetails.databaseName = reader.getString(); + } else if ("schema".equals(fieldName)) { + deserializedIndexRecommendationDetails.schema = reader.getString(); + } else if ("table".equals(fieldName)) { + deserializedIndexRecommendationDetails.table = reader.getString(); + } else if ("indexType".equals(fieldName)) { + deserializedIndexRecommendationDetails.indexType = reader.getString(); + } else if ("indexName".equals(fieldName)) { + deserializedIndexRecommendationDetails.indexName = reader.getString(); + } else if ("indexColumns".equals(fieldName)) { + deserializedIndexRecommendationDetails.indexColumns = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedIndexRecommendationDetails; + }); + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/IndexRecommendationListResult.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/IndexRecommendationListResult.java new file mode 100644 index 0000000000000..1d7aaa6536680 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/IndexRecommendationListResult.java @@ -0,0 +1,132 @@ +// Copyright (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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.IndexRecommendationResourceInner; +import java.io.IOException; +import java.util.List; + +/** + * A list of available index recommendations. + */ +@Fluent +public final class IndexRecommendationListResult implements JsonSerializable { + /* + * A list of available index recommendations. + */ + private List value; + + /* + * URL client should use to fetch the next page (per server side paging). + * It's null for now, added for future use. + */ + private String nextLink; + + /** + * Creates an instance of IndexRecommendationListResult class. + */ + public IndexRecommendationListResult() { + } + + /** + * Get the value property: A list of available index recommendations. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of available index recommendations. + * + * @param value the value value to set. + * @return the IndexRecommendationListResult object itself. + */ + public IndexRecommendationListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL client should use to fetch the next page (per server side paging). + * It's null for now, added for future use. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL client should use to fetch the next page (per server side paging). + * It's null for now, added for future use. + * + * @param nextLink the nextLink value to set. + * @return the IndexRecommendationListResult object itself. + */ + public IndexRecommendationListResult 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IndexRecommendationListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IndexRecommendationListResult if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the IndexRecommendationListResult. + */ + public static IndexRecommendationListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IndexRecommendationListResult deserializedIndexRecommendationListResult + = new IndexRecommendationListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> IndexRecommendationResourceInner.fromJson(reader1)); + deserializedIndexRecommendationListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedIndexRecommendationListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedIndexRecommendationListResult; + }); + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/IndexRecommendationResource.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/IndexRecommendationResource.java new file mode 100644 index 0000000000000..3203a448662e5 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/IndexRecommendationResource.java @@ -0,0 +1,122 @@ +// Copyright (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.IndexRecommendationResourceInner; +import java.time.OffsetDateTime; +import java.util.List; + +/** + * An immutable client-side representation of IndexRecommendationResource. + */ +public interface IndexRecommendationResource { + /** + * 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 initialRecommendedTime property: Creation time of this recommendation in UTC date-time string format. + * + * @return the initialRecommendedTime value. + */ + OffsetDateTime initialRecommendedTime(); + + /** + * Gets the lastRecommendedTime property: The last refresh of this recommendation in UTC date-time string format. + * + * @return the lastRecommendedTime value. + */ + OffsetDateTime lastRecommendedTime(); + + /** + * Gets the timesRecommended property: The number of times this recommendation has encountered. + * + * @return the timesRecommended value. + */ + Integer timesRecommended(); + + /** + * Gets the improvedQueryIds property: The ImprovedQueryIds. The list will only be populated for CREATE INDEX + * recommendations. + * + * @return the improvedQueryIds value. + */ + List improvedQueryIds(); + + /** + * Gets the recommendationReason property: Reason for this recommendation. + * + * @return the recommendationReason value. + */ + String recommendationReason(); + + /** + * Gets the recommendationType property: Type for this recommendation. + * + * @return the recommendationType value. + */ + RecommendationTypeEnum recommendationType(); + + /** + * Gets the implementationDetails property: Stores implementation details for the recommended action. + * + * @return the implementationDetails value. + */ + IndexRecommendationResourcePropertiesImplementationDetails implementationDetails(); + + /** + * Gets the analyzedWorkload property: Stores workload information for the recommended action. + * + * @return the analyzedWorkload value. + */ + IndexRecommendationResourcePropertiesAnalyzedWorkload analyzedWorkload(); + + /** + * Gets the estimatedImpact property: The estimated impact of this recommended action. + * + * @return the estimatedImpact value. + */ + List estimatedImpact(); + + /** + * Gets the details property: Stores recommendation details for the recommended action. + * + * @return the details value. + */ + IndexRecommendationDetails details(); + + /** + * Gets the inner com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.IndexRecommendationResourceInner + * object. + * + * @return the inner object. + */ + IndexRecommendationResourceInner innerModel(); +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/IndexRecommendationResourcePropertiesAnalyzedWorkload.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/IndexRecommendationResourcePropertiesAnalyzedWorkload.java new file mode 100644 index 0000000000000..a4f20b53c7387 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/IndexRecommendationResourcePropertiesAnalyzedWorkload.java @@ -0,0 +1,160 @@ +// Copyright (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.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; + +/** + * Stores workload information for the recommended action. + */ +@Fluent +public final class IndexRecommendationResourcePropertiesAnalyzedWorkload + implements JsonSerializable { + /* + * Workload start time in UTC date-time string format. + */ + private OffsetDateTime startTime; + + /* + * Workload end time in UTC date-time string format. + */ + private OffsetDateTime endTime; + + /* + * Workload query examined count. For DROP INDEX will be 0. + */ + private Integer queryCount; + + /** + * Creates an instance of IndexRecommendationResourcePropertiesAnalyzedWorkload class. + */ + public IndexRecommendationResourcePropertiesAnalyzedWorkload() { + } + + /** + * Get the startTime property: Workload start time in UTC date-time string format. + * + * @return the startTime value. + */ + public OffsetDateTime startTime() { + return this.startTime; + } + + /** + * Set the startTime property: Workload start time in UTC date-time string format. + * + * @param startTime the startTime value to set. + * @return the IndexRecommendationResourcePropertiesAnalyzedWorkload object itself. + */ + public IndexRecommendationResourcePropertiesAnalyzedWorkload withStartTime(OffsetDateTime startTime) { + this.startTime = startTime; + return this; + } + + /** + * Get the endTime property: Workload end time in UTC date-time string format. + * + * @return the endTime value. + */ + public OffsetDateTime endTime() { + return this.endTime; + } + + /** + * Set the endTime property: Workload end time in UTC date-time string format. + * + * @param endTime the endTime value to set. + * @return the IndexRecommendationResourcePropertiesAnalyzedWorkload object itself. + */ + public IndexRecommendationResourcePropertiesAnalyzedWorkload withEndTime(OffsetDateTime endTime) { + this.endTime = endTime; + return this; + } + + /** + * Get the queryCount property: Workload query examined count. For DROP INDEX will be 0. + * + * @return the queryCount value. + */ + public Integer queryCount() { + return this.queryCount; + } + + /** + * Set the queryCount property: Workload query examined count. For DROP INDEX will be 0. + * + * @param queryCount the queryCount value to set. + * @return the IndexRecommendationResourcePropertiesAnalyzedWorkload object itself. + */ + public IndexRecommendationResourcePropertiesAnalyzedWorkload withQueryCount(Integer queryCount) { + this.queryCount = queryCount; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("startTime", + this.startTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.startTime)); + jsonWriter.writeStringField("endTime", + this.endTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.endTime)); + jsonWriter.writeNumberField("queryCount", this.queryCount); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IndexRecommendationResourcePropertiesAnalyzedWorkload from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IndexRecommendationResourcePropertiesAnalyzedWorkload if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the IndexRecommendationResourcePropertiesAnalyzedWorkload. + */ + public static IndexRecommendationResourcePropertiesAnalyzedWorkload fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + IndexRecommendationResourcePropertiesAnalyzedWorkload deserializedIndexRecommendationResourcePropertiesAnalyzedWorkload + = new IndexRecommendationResourcePropertiesAnalyzedWorkload(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("startTime".equals(fieldName)) { + deserializedIndexRecommendationResourcePropertiesAnalyzedWorkload.startTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("endTime".equals(fieldName)) { + deserializedIndexRecommendationResourcePropertiesAnalyzedWorkload.endTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("queryCount".equals(fieldName)) { + deserializedIndexRecommendationResourcePropertiesAnalyzedWorkload.queryCount + = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedIndexRecommendationResourcePropertiesAnalyzedWorkload; + }); + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/IndexRecommendationResourcePropertiesImplementationDetails.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/IndexRecommendationResourcePropertiesImplementationDetails.java new file mode 100644 index 0000000000000..62f9bd9fac37c --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/IndexRecommendationResourcePropertiesImplementationDetails.java @@ -0,0 +1,125 @@ +// Copyright (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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Stores implementation details for the recommended action. + */ +@Fluent +public final class IndexRecommendationResourcePropertiesImplementationDetails + implements JsonSerializable { + /* + * Method of implementation for recommended action + */ + private String method; + + /* + * Implementation script for the recommended action + */ + private String script; + + /** + * Creates an instance of IndexRecommendationResourcePropertiesImplementationDetails class. + */ + public IndexRecommendationResourcePropertiesImplementationDetails() { + } + + /** + * Get the method property: Method of implementation for recommended action. + * + * @return the method value. + */ + public String method() { + return this.method; + } + + /** + * Set the method property: Method of implementation for recommended action. + * + * @param method the method value to set. + * @return the IndexRecommendationResourcePropertiesImplementationDetails object itself. + */ + public IndexRecommendationResourcePropertiesImplementationDetails withMethod(String method) { + this.method = method; + return this; + } + + /** + * Get the script property: Implementation script for the recommended action. + * + * @return the script value. + */ + public String script() { + return this.script; + } + + /** + * Set the script property: Implementation script for the recommended action. + * + * @param script the script value to set. + * @return the IndexRecommendationResourcePropertiesImplementationDetails object itself. + */ + public IndexRecommendationResourcePropertiesImplementationDetails withScript(String script) { + this.script = script; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("method", this.method); + jsonWriter.writeStringField("script", this.script); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IndexRecommendationResourcePropertiesImplementationDetails from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IndexRecommendationResourcePropertiesImplementationDetails if the JsonReader was pointing + * to an instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the + * IndexRecommendationResourcePropertiesImplementationDetails. + */ + public static IndexRecommendationResourcePropertiesImplementationDetails fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + IndexRecommendationResourcePropertiesImplementationDetails deserializedIndexRecommendationResourcePropertiesImplementationDetails + = new IndexRecommendationResourcePropertiesImplementationDetails(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("method".equals(fieldName)) { + deserializedIndexRecommendationResourcePropertiesImplementationDetails.method = reader.getString(); + } else if ("script".equals(fieldName)) { + deserializedIndexRecommendationResourcePropertiesImplementationDetails.script = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedIndexRecommendationResourcePropertiesImplementationDetails; + }); + } +} 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 index 3f6c745d66748..c181239fecb13 100644 --- 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 @@ -95,7 +95,10 @@ public interface MigrationResource { /** * Gets the sourceType property: migration source server type : OnPremises, AWS, GCP, AzureVM, - * PostgreSQLSingleServer, AWS_RDS, AWS_AURORA, AWS_EC2, GCP_CloudSQL, GCP_AlloyDB, GCP_Compute, or EDB. + * PostgreSQLSingleServer, AWS_RDS, AWS_AURORA, AWS_EC2, GCP_CloudSQL, GCP_AlloyDB, GCP_Compute, EDB, + * EDB_Oracle_Server, EDB_PostgreSQL, PostgreSQLFlexibleServer, PostgreSQLCosmosDB, Huawei_RDS, Huawei_Compute, + * Heroku_PostgreSQL, Crunchy_PostgreSQL, ApsaraDB_RDS, Digital_Ocean_Droplets, Digital_Ocean_PostgreSQL, or + * Supabase_PostgreSQL. * * @return the sourceType value. */ @@ -416,10 +419,16 @@ interface WithMigrationOption { interface WithSourceType { /** * Specifies the sourceType property: migration source server type : OnPremises, AWS, GCP, AzureVM, - * PostgreSQLSingleServer, AWS_RDS, AWS_AURORA, AWS_EC2, GCP_CloudSQL, GCP_AlloyDB, GCP_Compute, or EDB. + * PostgreSQLSingleServer, AWS_RDS, AWS_AURORA, AWS_EC2, GCP_CloudSQL, GCP_AlloyDB, GCP_Compute, EDB, + * EDB_Oracle_Server, EDB_PostgreSQL, PostgreSQLFlexibleServer, PostgreSQLCosmosDB, Huawei_RDS, + * Huawei_Compute, Heroku_PostgreSQL, Crunchy_PostgreSQL, ApsaraDB_RDS, Digital_Ocean_Droplets, + * Digital_Ocean_PostgreSQL, or Supabase_PostgreSQL. * * @param sourceType migration source server type : OnPremises, AWS, GCP, AzureVM, PostgreSQLSingleServer, - * AWS_RDS, AWS_AURORA, AWS_EC2, GCP_CloudSQL, GCP_AlloyDB, GCP_Compute, or EDB. + * AWS_RDS, AWS_AURORA, AWS_EC2, GCP_CloudSQL, GCP_AlloyDB, GCP_Compute, EDB, EDB_Oracle_Server, + * EDB_PostgreSQL, PostgreSQLFlexibleServer, PostgreSQLCosmosDB, Huawei_RDS, Huawei_Compute, + * Heroku_PostgreSQL, Crunchy_PostgreSQL, ApsaraDB_RDS, Digital_Ocean_Droplets, Digital_Ocean_PostgreSQL, or + * Supabase_PostgreSQL. * @return the next definition stage. */ WithCreate withSourceType(SourceType sourceType); 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 0000000000000..48cf6475bcaee --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/NameProperty.java @@ -0,0 +1,121 @@ +// Copyright (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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Name property for quota usage. + */ +@Fluent +public final class NameProperty implements JsonSerializable { + /* + * Name value + */ + private String value; + + /* + * Localized name + */ + 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", this.value); + jsonWriter.writeStringField("localizedValue", this.localizedValue); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NameProperty from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NameProperty if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the NameProperty. + */ + public static NameProperty fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NameProperty deserializedNameProperty = new NameProperty(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedNameProperty.value = reader.getString(); + } else if ("localizedValue".equals(fieldName)) { + deserializedNameProperty.localizedValue = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedNameProperty; + }); + } +} 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 index 2a754a896d969..87b9162a17093 100644 --- 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 @@ -9,7 +9,8 @@ /** * 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. + * storage online resize is supported. "Disabled" means storage online resize is not supported. Will be deprecated in + * future, please look to Supported Features for "OnlineResize". */ public final class OnlineResizeSupportedEnum extends ExpandableStringEnum { /** 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 0000000000000..42fc8e3aba599 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/QuotaUsage.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.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 0000000000000..b2243c0d47237 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/QuotaUsages.java @@ -0,0 +1,38 @@ +// Copyright (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 0000000000000..30745c74c1f3e --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/QuotaUsagesListResult.java @@ -0,0 +1,103 @@ +// Copyright (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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.QuotaUsageInner; +import java.io.IOException; +import java.util.List; + +/** + * Capability for the PostgreSQL server. + */ +@Immutable +public final class QuotaUsagesListResult implements JsonSerializable { + /* + * A list of quota usages. + */ + private List value; + + /* + * Link to retrieve next page of results. + */ + 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of QuotaUsagesListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of QuotaUsagesListResult if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the QuotaUsagesListResult. + */ + public static QuotaUsagesListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + QuotaUsagesListResult deserializedQuotaUsagesListResult = new QuotaUsagesListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> QuotaUsageInner.fromJson(reader1)); + deserializedQuotaUsagesListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedQuotaUsagesListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedQuotaUsagesListResult; + }); + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/RecommendationType.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/RecommendationType.java new file mode 100644 index 0000000000000..884e90b6f9a0a --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/RecommendationType.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 java.util.Collection; + +/** + * Defines values for RecommendationType. + */ +public final class RecommendationType extends ExpandableStringEnum { + /** + * Static value CreateIndex for RecommendationType. + */ + public static final RecommendationType CREATE_INDEX = fromString("CreateIndex"); + + /** + * Static value DropIndex for RecommendationType. + */ + public static final RecommendationType DROP_INDEX = fromString("DropIndex"); + + /** + * Creates a new instance of RecommendationType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public RecommendationType() { + } + + /** + * Creates or finds a RecommendationType from its string representation. + * + * @param name a name to look for. + * @return the corresponding RecommendationType. + */ + public static RecommendationType fromString(String name) { + return fromString(name, RecommendationType.class); + } + + /** + * Gets known RecommendationType values. + * + * @return known RecommendationType values. + */ + public static Collection values() { + return values(RecommendationType.class); + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/RecommendationTypeEnum.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/RecommendationTypeEnum.java new file mode 100644 index 0000000000000..ab215532490f5 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/RecommendationTypeEnum.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 java.util.Collection; + +/** + * Type for this recommendation. + */ +public final class RecommendationTypeEnum extends ExpandableStringEnum { + /** + * Static value CreateIndex for RecommendationTypeEnum. + */ + public static final RecommendationTypeEnum CREATE_INDEX = fromString("CreateIndex"); + + /** + * Static value DropIndex for RecommendationTypeEnum. + */ + public static final RecommendationTypeEnum DROP_INDEX = fromString("DropIndex"); + + /** + * Creates a new instance of RecommendationTypeEnum value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public RecommendationTypeEnum() { + } + + /** + * Creates or finds a RecommendationTypeEnum from its string representation. + * + * @param name a name to look for. + * @return the corresponding RecommendationTypeEnum. + */ + public static RecommendationTypeEnum fromString(String name) { + return fromString(name, RecommendationTypeEnum.class); + } + + /** + * Gets known RecommendationTypeEnum values. + * + * @return known RecommendationTypeEnum values. + */ + public static Collection values() { + return values(RecommendationTypeEnum.class); + } +} 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 index 7e9d344449f3e..a4432f0b07642 100644 --- 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 @@ -9,7 +9,7 @@ /** * A value indicating whether this region is restricted. "Enabled" means region is restricted. "Disabled" stands for - * region is not restricted. + * region is not restricted. Will be deprecated in future, please look to Supported Features for "Restricted". */ public final class RestrictedEnum extends ExpandableStringEnum { /** 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 651c795fa2b88..637d756ca7ea2 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 @@ -226,6 +226,13 @@ public interface Server { */ List privateEndpointConnections(); + /** + * Gets the cluster property: Cluster properties of a server. + * + * @return the cluster value. + */ + Cluster cluster(); + /** * Gets the region of the resource. * @@ -315,7 +322,7 @@ interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithSku DefinitionStages.WithDataEncryption, DefinitionStages.WithBackup, DefinitionStages.WithNetwork, DefinitionStages.WithHighAvailability, DefinitionStages.WithSourceServerResourceId, DefinitionStages.WithPointInTimeUtc, DefinitionStages.WithAvailabilityZone, - DefinitionStages.WithReplicationRole, DefinitionStages.WithCreateMode { + DefinitionStages.WithReplicationRole, DefinitionStages.WithCreateMode, DefinitionStages.WithCluster { /** * Executes the create request. * @@ -564,6 +571,19 @@ interface WithCreateMode { */ WithCreate withCreateMode(CreateMode createMode); } + + /** + * The stage of the Server definition allowing to specify cluster. + */ + interface WithCluster { + /** + * Specifies the cluster property: Cluster properties of a server.. + * + * @param cluster Cluster properties of a server. + * @return the next definition stage. + */ + WithCreate withCluster(Cluster cluster); + } } /** @@ -581,7 +601,7 @@ interface Update extends UpdateStages.WithTags, UpdateStages.WithSku, UpdateStag UpdateStages.WithStorage, UpdateStages.WithBackup, UpdateStages.WithHighAvailability, UpdateStages.WithMaintenanceWindow, UpdateStages.WithAuthConfig, UpdateStages.WithDataEncryption, UpdateStages.WithCreateMode, UpdateStages.WithReplicationRole, UpdateStages.WithReplica, - UpdateStages.WithNetwork { + UpdateStages.WithNetwork, UpdateStages.WithCluster { /** * Executes the update request. * @@ -817,6 +837,19 @@ interface WithNetwork { */ Update withNetwork(Network network); } + + /** + * The stage of the Server update allowing to specify cluster. + */ + interface WithCluster { + /** + * Specifies the cluster property: Cluster properties of a server.. + * + * @param cluster Cluster properties of a server. + * @return the next definition stage. + */ + Update withCluster(Cluster cluster); + } } /** 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 a754d623d7b60..52e77e36a1e4d 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 @@ -418,6 +418,29 @@ public ServerForUpdate withNetwork(Network network) { return this; } + /** + * Get the cluster property: Cluster properties of a server. + * + * @return the cluster value. + */ + public Cluster cluster() { + return this.innerProperties() == null ? null : this.innerProperties().cluster(); + } + + /** + * Set the cluster property: Cluster properties of a server. + * + * @param cluster the cluster value to set. + * @return the ServerForUpdate object itself. + */ + public ServerForUpdate withCluster(Cluster cluster) { + if (this.innerProperties() == null) { + this.innerProperties = new ServerPropertiesForUpdate(); + } + this.innerProperties().withCluster(cluster); + return this; + } + /** * Validates the instance. * 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 index c9523b6952d2a..3d2b935bf3ee2 100644 --- 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 @@ -46,6 +46,16 @@ public final class ServerSkuCapability extends CapabilityBase { */ private List supportedHaMode; + /* + * The supported features. + */ + private List supportedFeatures; + + /* + * The value of security profile indicating if its confidential vm + */ + private String securityProfile; + /* * The reason for the capability not being available. */ @@ -116,6 +126,24 @@ public List supportedHaMode() { return this.supportedHaMode; } + /** + * Get the supportedFeatures property: The supported features. + * + * @return the supportedFeatures value. + */ + public List supportedFeatures() { + return this.supportedFeatures; + } + + /** + * Get the securityProfile property: The value of security profile indicating if its confidential vm. + * + * @return the securityProfile value. + */ + public String securityProfile() { + return this.securityProfile; + } + /** * Get the reason property: The reason for the capability not being available. * @@ -143,6 +171,9 @@ public CapabilityStatus status() { */ @Override public void validate() { + if (supportedFeatures() != null) { + supportedFeatures().forEach(e -> e.validate()); + } } /** @@ -187,6 +218,12 @@ public static ServerSkuCapability fromJson(JsonReader jsonReader) throws IOExcep } else if ("supportedHaMode".equals(fieldName)) { List supportedHaMode = reader.readArray(reader1 -> HaMode.fromString(reader1.getString())); deserializedServerSkuCapability.supportedHaMode = supportedHaMode; + } else if ("supportedFeatures".equals(fieldName)) { + List supportedFeatures + = reader.readArray(reader1 -> SupportedFeature.fromJson(reader1)); + deserializedServerSkuCapability.supportedFeatures = supportedFeatures; + } else if ("securityProfile".equals(fieldName)) { + deserializedServerSkuCapability.securityProfile = reader.getString(); } else { reader.skipChildren(); } 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 6b152fa9b30aa..d32b5c9d571fe 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 @@ -11,6 +11,11 @@ * The version of a server. */ public final class ServerVersion extends ExpandableStringEnum { + /** + * Static value 17 for ServerVersion. + */ + public static final ServerVersion ONE_SEVEN = fromString("17"); + /** * Static value 16 for ServerVersion. */ 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 89a71e12cb413..c380981455ef0 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 @@ -26,6 +26,11 @@ public final class ServerVersionCapability extends CapabilityBase { */ private List supportedVersionsToUpgrade; + /* + * The supported features. + */ + private List supportedFeatures; + /* * The reason for the capability not being available. */ @@ -60,6 +65,15 @@ public List supportedVersionsToUpgrade() { return this.supportedVersionsToUpgrade; } + /** + * Get the supportedFeatures property: The supported features. + * + * @return the supportedFeatures value. + */ + public List supportedFeatures() { + return this.supportedFeatures; + } + /** * Get the reason property: The reason for the capability not being available. * @@ -87,6 +101,9 @@ public CapabilityStatus status() { */ @Override public void validate() { + if (supportedFeatures() != null) { + supportedFeatures().forEach(e -> e.validate()); + } } /** @@ -122,6 +139,10 @@ public static ServerVersionCapability fromJson(JsonReader jsonReader) throws IOE } else if ("supportedVersionsToUpgrade".equals(fieldName)) { List supportedVersionsToUpgrade = reader.readArray(reader1 -> reader1.getString()); deserializedServerVersionCapability.supportedVersionsToUpgrade = supportedVersionsToUpgrade; + } else if ("supportedFeatures".equals(fieldName)) { + List supportedFeatures + = reader.readArray(reader1 -> SupportedFeature.fromJson(reader1)); + deserializedServerVersionCapability.supportedFeatures = supportedFeatures; } else { reader.skipChildren(); } 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 index b983a13f55c13..a4a35c753c4c2 100644 --- 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 @@ -9,7 +9,9 @@ /** * Migration source server type : OnPremises, AWS, GCP, AzureVM, PostgreSQLSingleServer, AWS_RDS, AWS_AURORA, AWS_EC2, - * GCP_CloudSQL, GCP_AlloyDB, GCP_Compute, or EDB. + * GCP_CloudSQL, GCP_AlloyDB, GCP_Compute, EDB, EDB_Oracle_Server, EDB_PostgreSQL, PostgreSQLFlexibleServer, + * PostgreSQLCosmosDB, Huawei_RDS, Huawei_Compute, Heroku_PostgreSQL, Crunchy_PostgreSQL, ApsaraDB_RDS, + * Digital_Ocean_Droplets, Digital_Ocean_PostgreSQL, or Supabase_PostgreSQL. */ public final class SourceType extends ExpandableStringEnum { /** @@ -72,6 +74,66 @@ public final class SourceType extends ExpandableStringEnum { */ public static final SourceType EDB = fromString("EDB"); + /** + * Static value EDB_Oracle_Server for SourceType. + */ + public static final SourceType EDB_ORACLE_SERVER = fromString("EDB_Oracle_Server"); + + /** + * Static value EDB_PostgreSQL for SourceType. + */ + public static final SourceType EDB_POSTGRE_SQL = fromString("EDB_PostgreSQL"); + + /** + * Static value PostgreSQLFlexibleServer for SourceType. + */ + public static final SourceType POSTGRE_SQLFLEXIBLE_SERVER = fromString("PostgreSQLFlexibleServer"); + + /** + * Static value PostgreSQLCosmosDB for SourceType. + */ + public static final SourceType POSTGRE_SQLCOSMOS_DB = fromString("PostgreSQLCosmosDB"); + + /** + * Static value Huawei_RDS for SourceType. + */ + public static final SourceType HUAWEI_RDS = fromString("Huawei_RDS"); + + /** + * Static value Huawei_Compute for SourceType. + */ + public static final SourceType HUAWEI_COMPUTE = fromString("Huawei_Compute"); + + /** + * Static value Heroku_PostgreSQL for SourceType. + */ + public static final SourceType HEROKU_POSTGRE_SQL = fromString("Heroku_PostgreSQL"); + + /** + * Static value Crunchy_PostgreSQL for SourceType. + */ + public static final SourceType CRUNCHY_POSTGRE_SQL = fromString("Crunchy_PostgreSQL"); + + /** + * Static value ApsaraDB_RDS for SourceType. + */ + public static final SourceType APSARA_DB_RDS = fromString("ApsaraDB_RDS"); + + /** + * Static value Digital_Ocean_Droplets for SourceType. + */ + public static final SourceType DIGITAL_OCEAN_DROPLETS = fromString("Digital_Ocean_Droplets"); + + /** + * Static value Digital_Ocean_PostgreSQL for SourceType. + */ + public static final SourceType DIGITAL_OCEAN_POSTGRE_SQL = fromString("Digital_Ocean_PostgreSQL"); + + /** + * Static value Supabase_PostgreSQL for SourceType. + */ + public static final SourceType SUPABASE_POSTGRE_SQL = fromString("Supabase_PostgreSQL"); + /** * Creates a new instance of SourceType value. * 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 f0028e4fa6288..b7e41138acdde 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 @@ -32,18 +32,18 @@ public final class Storage implements JsonSerializable { private AzureManagedDiskPerformanceTiers tier; /* - * Storage tier IOPS quantity. This property is required to be set for storage Type PremiumV2_LRS + * Storage tier IOPS quantity. This property is required to be set for storage Type PremiumV2_LRS and UltraSSD_LRS. */ private Integer iops; /* - * Storage throughput for the server. This is required to be set for storage Type PremiumV2_LRS + * Storage throughput for the server. This is required to be set for storage Type PremiumV2_LRS and UltraSSD_LRS. */ private Integer throughput; /* - * Storage type for the server. Allowed values are Premium_LRS and PremiumV2_LRS, and default is Premium_LRS if not - * specified + * Storage type for the server. Allowed values are Premium_LRS, PremiumV2_LRS, and UltraSSD_LRS. Default is + * Premium_LRS if not specified */ private StorageType type; @@ -115,7 +115,7 @@ public Storage withTier(AzureManagedDiskPerformanceTiers tier) { /** * Get the iops property: Storage tier IOPS quantity. This property is required to be set for storage Type - * PremiumV2_LRS. + * PremiumV2_LRS and UltraSSD_LRS. * * @return the iops value. */ @@ -125,7 +125,7 @@ public Integer iops() { /** * Set the iops property: Storage tier IOPS quantity. This property is required to be set for storage Type - * PremiumV2_LRS. + * PremiumV2_LRS and UltraSSD_LRS. * * @param iops the iops value to set. * @return the Storage object itself. @@ -137,7 +137,7 @@ public Storage withIops(Integer iops) { /** * Get the throughput property: Storage throughput for the server. This is required to be set for storage Type - * PremiumV2_LRS. + * PremiumV2_LRS and UltraSSD_LRS. * * @return the throughput value. */ @@ -147,7 +147,7 @@ public Integer throughput() { /** * Set the throughput property: Storage throughput for the server. This is required to be set for storage Type - * PremiumV2_LRS. + * PremiumV2_LRS and UltraSSD_LRS. * * @param throughput the throughput value to set. * @return the Storage object itself. @@ -158,8 +158,8 @@ public Storage withThroughput(Integer throughput) { } /** - * 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. + * Get the type property: Storage type for the server. Allowed values are Premium_LRS, PremiumV2_LRS, and + * UltraSSD_LRS. Default is Premium_LRS if not specified. * * @return the type value. */ @@ -168,8 +168,8 @@ public StorageType 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. + * Set the type property: Storage type for the server. Allowed values are Premium_LRS, PremiumV2_LRS, and + * UltraSSD_LRS. Default is Premium_LRS if not specified. * * @param type the type value to set. * @return the Storage object itself. 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 index b92cde1e775af..5ce1e1e5ac261 100644 --- 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 @@ -9,7 +9,8 @@ /** * 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. + * supported. "Disabled" stands for storage auto-grow is not supported. Will be deprecated in future, please look to + * Supported Features for "StorageAutoGrowth". */ public final class StorageAutoGrowthSupportedEnum extends ExpandableStringEnum { /** 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 index aee52348ee0fa..95d307215ab07 100644 --- 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 @@ -8,8 +8,8 @@ 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. + * Storage type for the server. Allowed values are Premium_LRS, PremiumV2_LRS, and UltraSSD_LRS. Default is Premium_LRS + * if not specified. */ public final class StorageType extends ExpandableStringEnum { /** @@ -22,6 +22,11 @@ public final class StorageType extends ExpandableStringEnum { */ public static final StorageType PREMIUM_V2_LRS = fromString("PremiumV2_LRS"); + /** + * Static value UltraSSD_LRS for StorageType. + */ + public static final StorageType ULTRA_SSD_LRS = fromString("UltraSSD_LRS"); + /** * Creates a new instance of StorageType value. * diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/SupportedFeature.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/SupportedFeature.java new file mode 100644 index 0000000000000..10ea9a216afd4 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/SupportedFeature.java @@ -0,0 +1,97 @@ +// Copyright (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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The supported features. + */ +@Immutable +public final class SupportedFeature implements JsonSerializable { + /* + * Name of feature + */ + private String name; + + /* + * Status of feature + */ + private SupportedFeatureStatusEnum status; + + /** + * Creates an instance of SupportedFeature class. + */ + public SupportedFeature() { + } + + /** + * Get the name property: Name of feature. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the status property: Status of feature. + * + * @return the status value. + */ + public SupportedFeatureStatusEnum status() { + return this.status; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SupportedFeature from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SupportedFeature if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the SupportedFeature. + */ + public static SupportedFeature fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SupportedFeature deserializedSupportedFeature = new SupportedFeature(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedSupportedFeature.name = reader.getString(); + } else if ("status".equals(fieldName)) { + deserializedSupportedFeature.status = SupportedFeatureStatusEnum.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedSupportedFeature; + }); + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/SupportedFeatureStatusEnum.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/SupportedFeatureStatusEnum.java new file mode 100644 index 0000000000000..2d1e2755bc6da --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/SupportedFeatureStatusEnum.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 java.util.Collection; + +/** + * Status of feature. + */ +public final class SupportedFeatureStatusEnum extends ExpandableStringEnum { + /** + * Static value Enabled for SupportedFeatureStatusEnum. + */ + public static final SupportedFeatureStatusEnum ENABLED = fromString("Enabled"); + + /** + * Static value Disabled for SupportedFeatureStatusEnum. + */ + public static final SupportedFeatureStatusEnum DISABLED = fromString("Disabled"); + + /** + * Creates a new instance of SupportedFeatureStatusEnum value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SupportedFeatureStatusEnum() { + } + + /** + * Creates or finds a SupportedFeatureStatusEnum from its string representation. + * + * @param name a name to look for. + * @return the corresponding SupportedFeatureStatusEnum. + */ + public static SupportedFeatureStatusEnum fromString(String name) { + return fromString(name, SupportedFeatureStatusEnum.class); + } + + /** + * Gets known SupportedFeatureStatusEnum values. + * + * @return known SupportedFeatureStatusEnum values. + */ + public static Collection values() { + return values(SupportedFeatureStatusEnum.class); + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/TuningOptionEnum.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/TuningOptionEnum.java new file mode 100644 index 0000000000000..dec6a134e0f32 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/TuningOptionEnum.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.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Defines values for TuningOptionEnum. + */ +public final class TuningOptionEnum extends ExpandableStringEnum { + /** + * Static value index for TuningOptionEnum. + */ + public static final TuningOptionEnum INDEX = fromString("index"); + + /** + * Creates a new instance of TuningOptionEnum value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public TuningOptionEnum() { + } + + /** + * Creates or finds a TuningOptionEnum from its string representation. + * + * @param name a name to look for. + * @return the corresponding TuningOptionEnum. + */ + public static TuningOptionEnum fromString(String name) { + return fromString(name, TuningOptionEnum.class); + } + + /** + * Gets known TuningOptionEnum values. + * + * @return known TuningOptionEnum values. + */ + public static Collection values() { + return values(TuningOptionEnum.class); + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/TuningOptions.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/TuningOptions.java new file mode 100644 index 0000000000000..bae5860b15f83 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/TuningOptions.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 TuningOptions. + */ +public interface TuningOptions { + /** + * Retrieve the tuning option on a server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @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 stores property that features impact on some metric if this recommended action is applied along with + * {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String serverName, + TuningOptionEnum tuningOption, Context context); + + /** + * Retrieve the tuning option on a server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return stores property that features impact on some metric if this recommended action is applied. + */ + TuningOptionsResource get(String resourceGroupName, String serverName, TuningOptionEnum tuningOption); + + /** + * Retrieve the list of available tuning index recommendations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 available index recommendations as paginated response with {@link PagedIterable}. + */ + PagedIterable listRecommendations(String resourceGroupName, String serverName, + TuningOptionEnum tuningOption); + + /** + * Retrieve the list of available tuning index recommendations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @param recommendationType Recommendations list filter. Retrieves recommendations based on type. + * @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 available index recommendations as paginated response with {@link PagedIterable}. + */ + PagedIterable listRecommendations(String resourceGroupName, String serverName, + TuningOptionEnum tuningOption, RecommendationType recommendationType, Context context); + + /** + * Retrieve the list of available tuning options. + * + * @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 tuning options as paginated response with {@link PagedIterable}. + */ + PagedIterable listByServer(String resourceGroupName, String serverName); + + /** + * Retrieve the list of available tuning options. + * + * @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 tuning options 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/TuningOptionsListResult.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/TuningOptionsListResult.java new file mode 100644 index 0000000000000..db3fbdfdcca72 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/TuningOptionsListResult.java @@ -0,0 +1,131 @@ +// Copyright (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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.TuningOptionsResourceInner; +import java.io.IOException; +import java.util.List; + +/** + * A list of server tuning options. + */ +@Fluent +public final class TuningOptionsListResult implements JsonSerializable { + /* + * A list of available tuning options. + */ + private List value; + + /* + * URL client should use to fetch the next page (per server side paging). + * It's null for now, added for future use. + */ + private String nextLink; + + /** + * Creates an instance of TuningOptionsListResult class. + */ + public TuningOptionsListResult() { + } + + /** + * Get the value property: A list of available tuning options. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of available tuning options. + * + * @param value the value value to set. + * @return the TuningOptionsListResult object itself. + */ + public TuningOptionsListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL client should use to fetch the next page (per server side paging). + * It's null for now, added for future use. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL client should use to fetch the next page (per server side paging). + * It's null for now, added for future use. + * + * @param nextLink the nextLink value to set. + * @return the TuningOptionsListResult object itself. + */ + public TuningOptionsListResult 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TuningOptionsListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TuningOptionsListResult if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the TuningOptionsListResult. + */ + public static TuningOptionsListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TuningOptionsListResult deserializedTuningOptionsListResult = new TuningOptionsListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> TuningOptionsResourceInner.fromJson(reader1)); + deserializedTuningOptionsListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedTuningOptionsListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedTuningOptionsListResult; + }); + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/TuningOptionsResource.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/TuningOptionsResource.java new file mode 100644 index 0000000000000..a998e785913a1 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/TuningOptionsResource.java @@ -0,0 +1,49 @@ +// Copyright (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.TuningOptionsResourceInner; + +/** + * An immutable client-side representation of TuningOptionsResource. + */ +public interface TuningOptionsResource { + /** + * 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 inner com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.TuningOptionsResourceInner + * object. + * + * @return the inner object. + */ + TuningOptionsResourceInner innerModel(); +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/UserAssignedIdentity.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/UserAssignedIdentity.java index 06a9d485b2d86..e7c63d1e58f5e 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/UserAssignedIdentity.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/UserAssignedIdentity.java @@ -24,7 +24,7 @@ public final class UserAssignedIdentity implements JsonSerializable userAssignedIdentities; /* - * the types of identities associated with this resource; currently restricted to 'None and UserAssigned' + * the types of identities associated with this resource */ private IdentityType type; @@ -60,8 +60,7 @@ public UserAssignedIdentity withUserAssignedIdentities(Map } /** - * Get the type property: the types of identities associated with this resource; currently restricted to 'None and - * UserAssigned'. + * Get the type property: the types of identities associated with this resource. * * @return the type value. */ @@ -70,8 +69,7 @@ public IdentityType type() { } /** - * Set the type property: the types of identities associated with this resource; currently restricted to 'None and - * UserAssigned'. + * Set the type property: the types of identities associated with this resource. * * @param type the type value to set. * @return the UserAssignedIdentity object itself. 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 index 0e1d9e706f8a3..3d603c02c172c 100644 --- 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 @@ -10,6 +10,7 @@ /** * 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. + * Will be deprecated in future, please look to Supported Features for "ZoneRedundantHaAndGeoBackup". */ public final class ZoneRedundantHaAndGeoBackupSupportedEnum extends ExpandableStringEnum { 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 index b321c4fc8b4c0..afa367f7b0852 100644 --- 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 @@ -9,7 +9,8 @@ /** * 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. + * supported. "Disabled" stands for zone redundant HA is not supported. Will be deprecated in future, please look to + * Supported Features for "ZoneRedundantHa". */ public final class ZoneRedundantHaSupportedEnum extends ExpandableStringEnum { /** 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 index 15d392fdd4a28..822f368de735f 100644 --- 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 @@ -1 +1 @@ -[["com.azure.resourcemanager.postgresqlflexibleserver.implementation.AdministratorsClientImpl$AdministratorsService"],["com.azure.resourcemanager.postgresqlflexibleserver.implementation.BackupsClientImpl$BackupsService"],["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.FlexibleServersClientImpl$FlexibleServersService"],["com.azure.resourcemanager.postgresqlflexibleserver.implementation.GetPrivateDnsZoneSuffixesClientImpl$GetPrivateDnsZoneSuffixesService"],["com.azure.resourcemanager.postgresqlflexibleserver.implementation.LocationBasedCapabilitiesClientImpl$LocationBasedCapabilitiesService"],["com.azure.resourcemanager.postgresqlflexibleserver.implementation.LogFilesClientImpl$LogFilesService"],["com.azure.resourcemanager.postgresqlflexibleserver.implementation.LtrBackupOperationsClientImpl$LtrBackupOperationsService"],["com.azure.resourcemanager.postgresqlflexibleserver.implementation.MigrationsClientImpl$MigrationsService"],["com.azure.resourcemanager.postgresqlflexibleserver.implementation.OperationsClientImpl$OperationsService"],["com.azure.resourcemanager.postgresqlflexibleserver.implementation.PrivateEndpointConnectionOperationsClientImpl$PrivateEndpointConnectionOperationsService"],["com.azure.resourcemanager.postgresqlflexibleserver.implementation.PrivateEndpointConnectionsClientImpl$PrivateEndpointConnectionsService"],["com.azure.resourcemanager.postgresqlflexibleserver.implementation.PrivateLinkResourcesClientImpl$PrivateLinkResourcesService"],["com.azure.resourcemanager.postgresqlflexibleserver.implementation.ReplicasClientImpl$ReplicasService"],["com.azure.resourcemanager.postgresqlflexibleserver.implementation.ResourceProvidersClientImpl$ResourceProvidersService"],["com.azure.resourcemanager.postgresqlflexibleserver.implementation.ServerCapabilitiesClientImpl$ServerCapabilitiesService"],["com.azure.resourcemanager.postgresqlflexibleserver.implementation.ServerThreatProtectionSettingsClientImpl$ServerThreatProtectionSettingsService"],["com.azure.resourcemanager.postgresqlflexibleserver.implementation.ServersClientImpl$ServersService"],["com.azure.resourcemanager.postgresqlflexibleserver.implementation.VirtualEndpointsClientImpl$VirtualEndpointsService"],["com.azure.resourcemanager.postgresqlflexibleserver.implementation.VirtualNetworkSubnetUsagesClientImpl$VirtualNetworkSubnetUsagesService"]] \ No newline at end of file +[["com.azure.resourcemanager.postgresqlflexibleserver.implementation.AdministratorsClientImpl$AdministratorsService"],["com.azure.resourcemanager.postgresqlflexibleserver.implementation.BackupsClientImpl$BackupsService"],["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.FlexibleServersClientImpl$FlexibleServersService"],["com.azure.resourcemanager.postgresqlflexibleserver.implementation.GetPrivateDnsZoneSuffixesClientImpl$GetPrivateDnsZoneSuffixesService"],["com.azure.resourcemanager.postgresqlflexibleserver.implementation.LocationBasedCapabilitiesClientImpl$LocationBasedCapabilitiesService"],["com.azure.resourcemanager.postgresqlflexibleserver.implementation.LogFilesClientImpl$LogFilesService"],["com.azure.resourcemanager.postgresqlflexibleserver.implementation.LtrBackupOperationsClientImpl$LtrBackupOperationsService"],["com.azure.resourcemanager.postgresqlflexibleserver.implementation.MigrationsClientImpl$MigrationsService"],["com.azure.resourcemanager.postgresqlflexibleserver.implementation.OperationsClientImpl$OperationsService"],["com.azure.resourcemanager.postgresqlflexibleserver.implementation.PrivateEndpointConnectionOperationsClientImpl$PrivateEndpointConnectionOperationsService"],["com.azure.resourcemanager.postgresqlflexibleserver.implementation.PrivateEndpointConnectionsClientImpl$PrivateEndpointConnectionsService"],["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.ResourceProvidersClientImpl$ResourceProvidersService"],["com.azure.resourcemanager.postgresqlflexibleserver.implementation.ServerCapabilitiesClientImpl$ServerCapabilitiesService"],["com.azure.resourcemanager.postgresqlflexibleserver.implementation.ServerThreatProtectionSettingsClientImpl$ServerThreatProtectionSettingsService"],["com.azure.resourcemanager.postgresqlflexibleserver.implementation.ServersClientImpl$ServersService"],["com.azure.resourcemanager.postgresqlflexibleserver.implementation.TuningOptionsClientImpl$TuningOptionsService"],["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/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 c8da7bb0fd048..57886ee4474d7 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 @@ -12,8 +12,8 @@ public final class AdministratorsCreateSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/AdministratorAdd. - * json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-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 a5ce53c36868f..073b4e9da63f7 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 @@ -10,7 +10,7 @@ public final class AdministratorsDeleteSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ * AdministratorDelete.json */ /** 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 fd0f575d0f4c2..cfacaa3c10f36 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 @@ -10,8 +10,8 @@ public final class AdministratorsGetSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/AdministratorGet. - * json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-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 dc885e8329966..f822db6e658a9 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 @@ -10,7 +10,7 @@ public final class AdministratorsListByServerSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ * AdministratorsListByServer.json */ /** diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/BackupsCreateSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/BackupsCreateSamples.java index 6f0546c397d25..e5843a0de8f66 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/BackupsCreateSamples.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/BackupsCreateSamples.java @@ -10,7 +10,8 @@ public final class BackupsCreateSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/BackupCreate.json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ + * BackupCreate.json */ /** * Sample code: Create a new Backup for a flexible server. diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/BackupsDeleteSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/BackupsDeleteSamples.java index 066f4f44dbea7..0d6e09ef48ba8 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/BackupsDeleteSamples.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/BackupsDeleteSamples.java @@ -10,7 +10,8 @@ public final class BackupsDeleteSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/BackupDelete.json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ + * BackupDelete.json */ /** * Sample code: Delete a specific backup. 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 5405f4a7916ae..f85ac7e732db8 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 @@ -10,7 +10,8 @@ public final class BackupsGetSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/BackupGet.json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-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 0a0c6b713e8fc..9afdbda1402b3 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 @@ -10,8 +10,8 @@ public final class BackupsListByServerSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/BackupListByServer - * .json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-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 c986ef8de0adf..d013b0642b419 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 @@ -12,7 +12,7 @@ public final class CheckNameAvailabilityExecuteSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ * CheckNameAvailability.json */ /** 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 1f0c044766e7e..25ecc717fa6af 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 @@ -12,7 +12,7 @@ public final class CheckNameAvailabilityWithLocationExecuteSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ * CheckNameAvailabilityLocationBased.json */ /** 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 e9f497a40bd86..40ede6f577f2d 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 @@ -10,8 +10,8 @@ public final class ConfigurationsGetSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ConfigurationGet. - * json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-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 cf66792c1c551..2f7cf2e70aaee 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 @@ -10,7 +10,7 @@ public final class ConfigurationsListByServerSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ * ConfigurationListByServer.json */ /** 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 9e36145f98ab5..7a9356c62cb67 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 @@ -10,7 +10,7 @@ public final class ConfigurationsPutSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ * ConfigurationUpdate.json */ /** 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 c5c413e03959d..2928cd058de12 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 @@ -12,7 +12,7 @@ public final class ConfigurationsUpdateSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ * ConfigurationUpdate.json */ /** 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 6d44230028c7a..e565bb5acd6d9 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 @@ -10,8 +10,8 @@ public final class DatabasesCreateSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/DatabaseCreate. - * json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-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 77b4e31a75543..3064e4aaefe88 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 @@ -10,8 +10,8 @@ public final class DatabasesDeleteSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/DatabaseDelete. - * json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-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 e47d311d7898b..3d90413fec329 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 @@ -10,7 +10,8 @@ public final class DatabasesGetSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/DatabaseGet.json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-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 c85e307ed8ed2..49202428ed911 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 @@ -10,7 +10,7 @@ public final class DatabasesListByServerSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ * DatabasesListByServer.json */ /** 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 a3603597959e6..28cde56c3aeef 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 @@ -10,8 +10,8 @@ public final class FirewallRulesCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/FirewallRuleCreate - * .json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-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 08412f8b92deb..aa13241ba2fb3 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 @@ -10,8 +10,8 @@ public final class FirewallRulesDeleteSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/FirewallRuleDelete - * .json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-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 ce57988ef0601..45824348b7d8c 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 @@ -10,8 +10,8 @@ public final class FirewallRulesGetSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/FirewallRuleGet. - * json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-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 ac5e219773c4d..ddd7bd3e53d2a 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 @@ -10,7 +10,7 @@ public final class FirewallRulesListByServerSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ * FirewallRuleListByServer.json */ /** 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 index 7b7a09e32a03e..a5c791328419a 100644 --- 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 @@ -15,7 +15,7 @@ public final class FlexibleServerStartLtrBackupSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ * LongTermRetentionBackup.json */ /** 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 index 3b4fe01e4530e..6415f4b5ce140 100644 --- 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 @@ -13,7 +13,7 @@ public final class FlexibleServerTriggerLtrPreBackupSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ * LongTermRetentionPreBackup.json */ /** 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 f368ac1cd2778..0398ab87cd50d 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 @@ -10,7 +10,7 @@ public final class GetPrivateDnsZoneSuffixExecuteSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ * GetPrivateDnsZoneSuffix.json */ /** 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 42e796cd6b57a..de52a3c2cd8c8 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 @@ -10,7 +10,7 @@ public final class LocationBasedCapabilitiesExecuteSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ * CapabilitiesByLocation.json */ /** 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 index 8a784c8dd2472..b3c0bb1bc42a2 100644 --- 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 @@ -10,7 +10,7 @@ public final class LogFilesListByServerSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ * LogFilesListByServer.json */ /** 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 index 2027eab2e3976..b20173e2e67bf 100644 --- 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 @@ -10,7 +10,7 @@ public final class LtrBackupOperationsGetSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ * LongTermRetentionOperationGet.json */ /** 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 index 85b38c5ebf499..59755f44f8ac2 100644 --- 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 @@ -10,7 +10,7 @@ public final class LtrBackupOperationsListByServerSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ * LongTermRetentionOperationListByServer.json */ /** 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 index 016860d07dc04..d8b39f04e81de 100644 --- 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 @@ -20,7 +20,7 @@ public final class MigrationsCreateSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ * Migrations_Create_With_PrivateEndpoint_Servers.json */ /** @@ -49,7 +49,7 @@ public static void migrationsCreateWithPrivateEndpoint( /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ * Migrations_Create_With_Roles.json */ /** @@ -77,7 +77,36 @@ public static void migrationsCreateWithPrivateEndpoint( /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ + * Migrations_Create_With_FullyQualifiedDomainName.json + */ + /** + * Sample code: Migrations Create with fully qualified domain name. + * + * @param manager Entry point to PostgreSqlManager. + */ + public static void migrationsCreateWithFullyQualifiedDomainName( + 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") + .withSourceDbServerFullyQualifiedDomainName("testsourcefqdn.example.com") + .withTargetDbServerFullyQualifiedDomainName("test-target-fqdn.example.com") + .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/2024-11-01-preview/examples/ * Migrations_Create_Validate_Only.json */ /** @@ -105,7 +134,7 @@ public static void migrationsCreateWithPrivateEndpoint( /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ * Migrations_Create_With_Other_Users.json */ /** @@ -133,8 +162,8 @@ public static void migrationsCreateByPassingUserNames( /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/Migrations_Create. - * json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ + * Migrations_Create.json */ /** * Sample code: Migrations_Create. @@ -146,8 +175,6 @@ public static void migrationsCreate(com.azure.resourcemanager.postgresqlflexible .define("testmigration") .withRegion("westus") .withExistingFlexibleServer("ffffffff-ffff-ffff-ffff-ffffffffffff", "testrg", "testtarget") - .withMigrationInstanceResourceId( - "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/flexibleServers/testsourcemigration") .withMigrationMode(MigrationMode.OFFLINE) .withSourceDbServerResourceId( "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/servers/testsource") @@ -161,7 +188,7 @@ public static void migrationsCreate(com.azure.resourcemanager.postgresqlflexible /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ * Migrations_Create_Other_SourceTypes_Validate_Migrate.json */ /** 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 index 48a7f76441b90..905f5fd03c1d7 100644 --- 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 @@ -10,8 +10,8 @@ public final class MigrationsDeleteSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/Migrations_Delete. - * json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ + * Migrations_Delete.json */ /** * Sample code: Migrations_Delete. 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 index 9d51abb8b08ec..b393202c5bf40 100644 --- 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 @@ -10,7 +10,7 @@ public final class MigrationsGetSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ * Migrations_GetMigrationWithSuccessfulValidationOnly.json */ /** @@ -27,8 +27,8 @@ public static void migrationsGetMigrationWithSuccessfulValidationOnly( /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/Migrations_Get. - * json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ + * Migrations_Get.json */ /** * Sample code: Migrations_Get. @@ -43,7 +43,7 @@ public static void migrationsGet(com.azure.resourcemanager.postgresqlflexibleser /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ * Migrations_GetMigrationWithSuccessfulValidationButMigrationFailure.json */ /** @@ -60,7 +60,7 @@ public static void migrationsGetMigrationWithSuccessfulValidationButMigrationFai /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ * Migrations_GetMigrationWithSuccessfulValidationAndMigration.json */ /** @@ -77,7 +77,7 @@ public static void migrationsGetMigrationWithSuccessfulValidationAndMigration( /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ * Migrations_GetMigrationWithValidationFailures.json */ /** 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 index d78612f8125d2..84c836d2457bc 100644 --- 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 @@ -12,7 +12,7 @@ public final class MigrationsListByTargetServerSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ * Migrations_ListByTargetServer.json */ /** 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 index 2c0bbb312a19f..5ff76c38a15a0 100644 --- 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 @@ -14,8 +14,8 @@ public final class MigrationsUpdateSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/Migrations_Cancel. - * json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ + * Migrations_Cancel.json */ /** * Sample code: Cancel migration. @@ -32,8 +32,8 @@ public static void cancelMigration(com.azure.resourcemanager.postgresqlflexibles /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/Migrations_Update. - * json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ + * Migrations_Update.json */ /** * Sample code: Migrations_Update. 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 6ae70ae058afb..e531baa29cf73 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 @@ -10,7 +10,8 @@ public final class OperationsListSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/OperationList.json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-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 index 8beb0397758fc..265f1a4e87cbf 100644 --- 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 @@ -10,7 +10,7 @@ public final class PrivateEndpointConnectionOperationDeleteSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ * PrivateEndpointConnectionDelete.json */ /** 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 index ab47986e82121..4a678e30ba51f 100644 --- 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 @@ -14,7 +14,7 @@ public final class PrivateEndpointConnectionOperationUpdateSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ * PrivateEndpointConnectionUpdate.json */ /** 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 index 87e75c5f74384..4b9965fcc88f2 100644 --- 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 @@ -10,7 +10,7 @@ public final class PrivateEndpointConnectionsGetSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ * PrivateEndpointConnectionGet.json */ /** 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 index a21888da56600..1a35f171de40b 100644 --- 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 @@ -10,7 +10,7 @@ public final class PrivateEndpointConnectionsListByServerSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ * PrivateEndpointConnectionList.json */ /** 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 index 781d4af866b74..0a2738b95055b 100644 --- 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 @@ -10,7 +10,7 @@ public final class PrivateLinkResourcesGetSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ * PrivateLinkResourcesGet.json */ /** 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 index 2ba6b79e73b2f..e57f3ad826941 100644 --- 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 @@ -10,7 +10,7 @@ public final class PrivateLinkResourcesListByServerSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ * PrivateLinkResourcesList.json */ /** 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 0000000000000..c957d7fb12242 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/QuotaUsagesListSamples.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.generated; + +/** + * Samples for QuotaUsages List. + */ +public final class QuotaUsagesListSamples { + /* + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-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 35b198b3b0404..0f32db3731fc5 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 @@ -10,7 +10,7 @@ public final class ReplicasListByServerSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ * ReplicasListByServer.json */ /** 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 index 6ce4872776efb..f5ac93de6591a 100644 --- 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 @@ -12,7 +12,7 @@ public final class ResourceProviderCheckMigrationNameAvailabilitySamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ * CheckMigrationNameAvailability.json */ /** 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 index e4fc1b3d7f409..03deaca6d54fa 100644 --- 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 @@ -10,8 +10,8 @@ public final class ServerCapabilitiesListSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ServerCapabilities - * .json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ + * ServerCapabilities.json */ /** * Sample code: ServerCapabilitiesList. 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 index 3a0c1c3c10e39..349ba083da61c 100644 --- 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 @@ -14,7 +14,7 @@ public final class ServerThreatProtectionSettingsCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ * ServerThreatProtectionSettingsCreateOrUpdate.json */ /** 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 index 83a139be15a49..0820653f79ce4 100644 --- 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 @@ -12,7 +12,7 @@ public final class ServerThreatProtectionSettingsGetSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ * ServerThreatProtectionSettingsGet.json */ /** 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 index b792f1cd761a6..90597185c4280 100644 --- 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 @@ -10,7 +10,7 @@ public final class ServerThreatProtectionSettingsListByServerSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ * ServerThreatProtectionSettingsListByServer.json */ /** 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 043ea557ed950..ad8fcd4ec162e 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 @@ -9,6 +9,7 @@ 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.Cluster; import com.azure.resourcemanager.postgresqlflexibleserver.models.CreateMode; import com.azure.resourcemanager.postgresqlflexibleserver.models.DataEncryption; import com.azure.resourcemanager.postgresqlflexibleserver.models.GeoRedundantBackupEnum; @@ -17,6 +18,7 @@ import com.azure.resourcemanager.postgresqlflexibleserver.models.IdentityType; import com.azure.resourcemanager.postgresqlflexibleserver.models.Network; import com.azure.resourcemanager.postgresqlflexibleserver.models.PasswordAuthEnum; +import com.azure.resourcemanager.postgresqlflexibleserver.models.ServerPublicNetworkAccessState; import com.azure.resourcemanager.postgresqlflexibleserver.models.ServerVersion; import com.azure.resourcemanager.postgresqlflexibleserver.models.Sku; import com.azure.resourcemanager.postgresqlflexibleserver.models.SkuTier; @@ -34,7 +36,7 @@ public final class ServersCreateSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ * ServerCreateWithDataEncryptionEnabled.json */ /** @@ -76,7 +78,7 @@ public static void serverCreateWithDataEncryptionEnabled( /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ * ServerCreateReviveDropped.json */ /** @@ -99,7 +101,7 @@ public static void serverCreateWithDataEncryptionEnabled( /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ * ServerCreateGeoRestoreWithDataEncryptionEnabled.json */ /** @@ -134,7 +136,8 @@ public static void createADatabaseAsAGeoRestoreInGeoPairedLocation( /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ServerCreate.json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ + * ServerCreate.json */ /** * Sample code: Create a new server. @@ -150,7 +153,7 @@ public static void createANewServer(com.azure.resourcemanager.postgresqlflexible .withSku(new Sku().withName("Standard_D4s_v3").withTier(SkuTier.GENERAL_PURPOSE)) .withAdministratorLogin("cloudsa") .withAdministratorLoginPassword("password") - .withVersion(ServerVersion.ONE_TWO) + .withVersion(ServerVersion.ONE_SIX) .withStorage(new Storage().withStorageSizeGB(512) .withAutoGrow(StorageAutoGrow.DISABLED) .withTier(AzureManagedDiskPerformanceTiers.P20)) @@ -167,7 +170,7 @@ public static void createANewServer(com.azure.resourcemanager.postgresqlflexible /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ * ServerCreateWithAadAuthEnabled.json */ /** @@ -206,7 +209,7 @@ public static void createANewServerWithActiveDirectoryAuthenticationEnabled( /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ * ServerCreateReplica.json */ /** @@ -238,7 +241,37 @@ public static void createANewServerWithActiveDirectoryAuthenticationEnabled( /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ + * ClusterCreate.json + */ + /** + * Sample code: ClusterCreate. + * + * @param manager Entry point to PostgreSqlManager. + */ + public static void clusterCreate(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager.servers() + .define("pgtestcluster") + .withRegion("westus") + .withExistingResourceGroup("testrg") + .withSku(new Sku().withName("Standard_D4s_v3").withTier(SkuTier.GENERAL_PURPOSE)) + .withAdministratorLogin("cloudsa") + .withAdministratorLoginPassword("password") + .withVersion(ServerVersion.ONE_SIX) + .withStorage(new Storage().withStorageSizeGB(256) + .withAutoGrow(StorageAutoGrow.DISABLED) + .withTier(AzureManagedDiskPerformanceTiers.P15)) + .withBackup(new Backup().withBackupRetentionDays(7).withGeoRedundantBackup(GeoRedundantBackupEnum.DISABLED)) + .withNetwork(new Network().withPublicNetworkAccess(ServerPublicNetworkAccessState.DISABLED)) + .withHighAvailability(new HighAvailability().withMode(HighAvailabilityMode.DISABLED)) + .withCreateMode(CreateMode.CREATE) + .withCluster(new Cluster().withClusterSize(2)) + .create(); + } + + /* + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ * ServerCreatePointInTimeRestore.json */ /** 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 d2ee043ae3d6a..34fd9e4295b62 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 @@ -10,7 +10,8 @@ public final class ServersDeleteSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ServerDelete.json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-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 05bda087cbc31..7dec6135047ff 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 @@ -10,7 +10,7 @@ public final class ServersGetByResourceGroupSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ * ServerGetWithPrivateEndpoints.json */ /** @@ -25,7 +25,8 @@ public final class ServersGetByResourceGroupSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ServerGet.json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ServerGet + * .json */ /** * Sample code: ServerGet. @@ -38,8 +39,8 @@ public static void serverGet(com.azure.resourcemanager.postgresqlflexibleserver. /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ServerGetWithVnet. - * json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-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 0be7c0ac29f79..db07ca80d7348 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 @@ -10,7 +10,7 @@ public final class ServersListByResourceGroupSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ * ServerListByResourceGroup.json */ /** 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 9985a9a298db2..b158de3ae25aa 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 @@ -10,7 +10,8 @@ public final class ServersListSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ServerList.json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-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 87b281bf4f1fc..ffe282f3e3f3b 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 @@ -13,7 +13,8 @@ public final class ServersRestartSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ServerRestart.json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ + * ServerRestart.json */ /** * Sample code: ServerRestart. @@ -26,7 +27,7 @@ public static void serverRestart(com.azure.resourcemanager.postgresqlflexibleser /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ * ServerRestartWithFailover.json */ /** 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 931a547d3f505..88a0d4bf8096d 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 @@ -10,7 +10,8 @@ public final class ServersStartSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ServerStart.json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-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 9ca7f7ce4940c..b99adc0dc8a49 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 @@ -10,7 +10,8 @@ public final class ServersStopSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ServerStop.json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-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 7d302eb2ac73a..cb4983bffddfc 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 @@ -34,7 +34,7 @@ public final class ServersUpdateSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ * ServerUpdateWithAadAuthEnabled.json */ /** @@ -63,7 +63,7 @@ public final class ServersUpdateSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ * ServerUpdateWithDataEncryptionEnabled.json */ /** @@ -98,7 +98,7 @@ public static void serverUpdateWithDataEncryptionEnabled( /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ * PromoteReplicaAsPlannedSwitchover.json */ /** @@ -121,7 +121,7 @@ public static void serverUpdateWithDataEncryptionEnabled( /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ * PromoteReplicaAsForcedSwitchover.json */ /** @@ -144,7 +144,8 @@ public static void serverUpdateWithDataEncryptionEnabled( /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ServerUpdate.json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ + * ServerUpdate.json */ /** * Sample code: ServerUpdate. @@ -168,7 +169,7 @@ public static void serverUpdate(com.azure.resourcemanager.postgresqlflexibleserv /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ * ServerUpdateWithMajorVersionUpgrade.json */ /** @@ -186,7 +187,7 @@ public static void serverUpdateWithMajorVersionUpgrade( /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ * ServerUpdateWithCustomerMaintenanceWindow.json */ /** @@ -210,7 +211,7 @@ public static void serverUpdateWithCustomerMaintenanceWindow( /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ * PromoteReplicaAsForcedStandaloneServer.json */ /** @@ -233,7 +234,7 @@ public static void serverUpdateWithCustomerMaintenanceWindow( /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ * PromoteReplicaAsPlannedStandaloneServer.json */ /** diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/TuningOptionsGetSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/TuningOptionsGetSamples.java new file mode 100644 index 0000000000000..24cfa10bd4865 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/TuningOptionsGetSamples.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; + +import com.azure.resourcemanager.postgresqlflexibleserver.models.TuningOptionEnum; + +/** + * Samples for TuningOptions Get. + */ +public final class TuningOptionsGetSamples { + /* + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ + * Tuning_GetTuningOption.json + */ + /** + * Sample code: TuningOptions_Get. + * + * @param manager Entry point to PostgreSqlManager. + */ + public static void tuningOptionsGet(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager.tuningOptions() + .getWithResponse("testrg", "testserver", TuningOptionEnum.INDEX, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/TuningOptionsListByServerSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/TuningOptionsListByServerSamples.java new file mode 100644 index 0000000000000..0b077ebd6447b --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/TuningOptionsListByServerSamples.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.generated; + +/** + * Samples for TuningOptions ListByServer. + */ +public final class TuningOptionsListByServerSamples { + /* + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ + * Tuning_ListTuningOptions.json + */ + /** + * Sample code: TuningOptions_ListByServer. + * + * @param manager Entry point to PostgreSqlManager. + */ + public static void + tuningOptionsListByServer(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager.tuningOptions().listByServer("testrg", "testserver", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/TuningOptionsListRecommendationsSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/TuningOptionsListRecommendationsSamples.java new file mode 100644 index 0000000000000..1eaa6f546ae41 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/TuningOptionsListRecommendationsSamples.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.generated; + +import com.azure.resourcemanager.postgresqlflexibleserver.models.RecommendationType; +import com.azure.resourcemanager.postgresqlflexibleserver.models.TuningOptionEnum; + +/** + * Samples for TuningOptions ListRecommendations. + */ +public final class TuningOptionsListRecommendationsSamples { + /* + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ + * Tuning_GetRecommendedIndexes.json + */ + /** + * Sample code: TuningOptions_ListRecommendations. + * + * @param manager Entry point to PostgreSqlManager. + */ + public static void + tuningOptionsListRecommendations(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager.tuningOptions() + .listRecommendations("testrg", "pgtestsvc4", TuningOptionEnum.INDEX, null, + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ + * Tuning_GetFilteredRecommendedIndexes.json + */ + /** + * Sample code: TuningOptions_ListFilteredRecommendations. + * + * @param manager Entry point to PostgreSqlManager. + */ + public static void tuningOptionsListFilteredRecommendations( + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager.tuningOptions() + .listRecommendations("testrg", "pgtestrecs", TuningOptionEnum.INDEX, RecommendationType.CREATE_INDEX, + com.azure.core.util.Context.NONE); + } +} 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 index 00bdc0f50c001..2fa554549c8d4 100644 --- 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 @@ -13,7 +13,7 @@ public final class VirtualEndpointsCreateSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ * VirtualEndpointCreate.json */ /** 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 index 1cfeb98160806..99e68d9933696 100644 --- 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 @@ -10,7 +10,7 @@ public final class VirtualEndpointsDeleteSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ * VirtualEndpointDelete.json */ /** 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 index da06bfbb49def..f3a80c1fad71f 100644 --- 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 @@ -10,7 +10,7 @@ public final class VirtualEndpointsGetSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ * VirtualEndpointsGet.json */ /** 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 index 2385749f6f350..01fb6a3bc6827 100644 --- 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 @@ -10,7 +10,7 @@ public final class VirtualEndpointsListByServerSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ * VirtualEndpointsListByServer.json */ /** 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 index 158bd8c1aa75a..675bd3dca7626 100644 --- 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 @@ -14,7 +14,7 @@ public final class VirtualEndpointsUpdateSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ * VirtualEndpointUpdate.json */ /** 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 3248d459e3976..e8c510f3f4de4 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 @@ -12,7 +12,7 @@ public final class VirtualNetworkSubnetUsageExecuteSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ * VirtualNetworkSubnetUsage.json */ /** 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 a29cc16246fa0..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ActiveDirectoryAdministratorAddTests.java +++ /dev/null @@ -1,35 +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 ebc3b53e61033..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ActiveDirectoryAdministratorInnerTests.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.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 6e664d88b9141..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/AdministratorListResultTests.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.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 1312e8a16e561..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/AdministratorPropertiesForAddTests.java +++ /dev/null @@ -1,35 +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 d22f7e073bc14..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/AdministratorPropertiesTests.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.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 3423cadebdecb..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/AdministratorsCreateMockTests.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.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager; -import com.azure.resourcemanager.postgresqlflexibleserver.models.ActiveDirectoryAdministrator; -import com.azure.resourcemanager.postgresqlflexibleserver.models.PrincipalType; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class AdministratorsCreateMockTests { - @Test - public void testCreate() throws Exception { - String responseStr - = "{\"properties\":{\"principalType\":\"Group\",\"principalName\":\"brhu\",\"objectId\":\"kh\",\"tenantId\":\"ygo\"},\"id\":\"kkqfqjbvle\",\"name\":\"rfmluiqtq\",\"type\":\"fa\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - 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("odqkdlwwqfb") - .withExistingFlexibleServer("gzibthostgktstv", "xeclzedqbcvhzlhp") - .withPrincipalType(PrincipalType.USER) - .withPrincipalName("trqjfsmlmbtx") - .withTenantId("gfwsrtaw") - .create(); - - Assertions.assertEquals(PrincipalType.GROUP, response.principalType()); - Assertions.assertEquals("brhu", response.principalName()); - Assertions.assertEquals("kh", response.objectId()); - Assertions.assertEquals("ygo", 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 95bc1147d0793..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/AdministratorsDeleteMockTests.java +++ /dev/null @@ -1,33 +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.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class AdministratorsDeleteMockTests { - @Test - public void testDelete() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - 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("rykqgaifmvikl", "ydv", "hbejdznxcvdsrhnj", 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 f48d172dcaf45..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/AdministratorsGetWithResponseMockTests.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager; -import com.azure.resourcemanager.postgresqlflexibleserver.models.ActiveDirectoryAdministrator; -import com.azure.resourcemanager.postgresqlflexibleserver.models.PrincipalType; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class AdministratorsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"principalType\":\"Group\",\"principalName\":\"ftul\",\"objectId\":\"tduceamt\",\"tenantId\":\"zuo\"},\"id\":\"jw\",\"name\":\"w\",\"type\":\"qioknssxmojm\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - 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("volvtn", "v", "fzg", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(PrincipalType.GROUP, response.principalType()); - Assertions.assertEquals("ftul", response.principalName()); - Assertions.assertEquals("tduceamt", response.objectId()); - Assertions.assertEquals("zuo", 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 ecd931dea43aa..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/AdministratorsListByServerMockTests.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager; -import com.azure.resourcemanager.postgresqlflexibleserver.models.ActiveDirectoryAdministrator; -import com.azure.resourcemanager.postgresqlflexibleserver.models.PrincipalType; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class AdministratorsListByServerMockTests { - @Test - public void testListByServer() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"principalType\":\"Group\",\"principalName\":\"yxgtczh\",\"objectId\":\"dbsdshm\",\"tenantId\":\"maehvbbxurip\"},\"id\":\"fnhtbaxkgxyw\",\"name\":\"ckpyklyhplu\",\"type\":\"dpvruud\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - 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("vpkjpr", "kwcf", com.azure.core.util.Context.NONE); - - Assertions.assertEquals(PrincipalType.GROUP, response.iterator().next().principalType()); - Assertions.assertEquals("yxgtczh", response.iterator().next().principalName()); - Assertions.assertEquals("dbsdshm", response.iterator().next().objectId()); - Assertions.assertEquals("maehvbbxurip", response.iterator().next().tenantId()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/BackupRequestBaseTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/BackupRequestBaseTests.java deleted file mode 100644 index d32be37d0cb8d..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/BackupRequestBaseTests.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.BackupRequestBase; -import com.azure.resourcemanager.postgresqlflexibleserver.models.BackupSettings; -import org.junit.jupiter.api.Assertions; - -public final class BackupRequestBaseTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - BackupRequestBase model = BinaryData.fromString("{\"backupSettings\":{\"backupName\":\"zhxgktrmgucn\"}}") - .toObject(BackupRequestBase.class); - Assertions.assertEquals("zhxgktrmgucn", model.backupSettings().backupName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - BackupRequestBase model - = new BackupRequestBase().withBackupSettings(new BackupSettings().withBackupName("zhxgktrmgucn")); - model = BinaryData.fromObject(model).toObject(BackupRequestBase.class); - Assertions.assertEquals("zhxgktrmgucn", model.backupSettings().backupName()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/BackupSettingsTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/BackupSettingsTests.java deleted file mode 100644 index ed6e4ba6c4902..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/BackupSettingsTests.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.BackupSettings; -import org.junit.jupiter.api.Assertions; - -public final class BackupSettingsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - BackupSettings model = BinaryData.fromString("{\"backupName\":\"pkteo\"}").toObject(BackupSettings.class); - Assertions.assertEquals("pkteo", model.backupName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - BackupSettings model = new BackupSettings().withBackupName("pkteo"); - model = BinaryData.fromObject(model).toObject(BackupSettings.class); - Assertions.assertEquals("pkteo", model.backupName()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/BackupStoreDetailsTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/BackupStoreDetailsTests.java deleted file mode 100644 index c2579dca3c6bd..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/BackupStoreDetailsTests.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.BackupStoreDetails; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class BackupStoreDetailsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - BackupStoreDetails model - = BinaryData.fromString("{\"sasUriList\":[\"zfq\",\"hhuao\",\"ppcqeqxolz\",\"ahzxctobgbk\"]}") - .toObject(BackupStoreDetails.class); - Assertions.assertEquals("zfq", model.sasUriList().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - BackupStoreDetails model - = new BackupStoreDetails().withSasUriList(Arrays.asList("zfq", "hhuao", "ppcqeqxolz", "ahzxctobgbk")); - model = BinaryData.fromObject(model).toObject(BackupStoreDetails.class); - Assertions.assertEquals("zfq", model.sasUriList().get(0)); - } -} 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 cfe4e3ac2f3ee..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/BackupTests.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.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\":585337534,\"geoRedundantBackup\":\"Enabled\",\"earliestRestoreDate\":\"2021-10-15T08:45:58Z\"}") - .toObject(Backup.class); - Assertions.assertEquals(585337534, model.backupRetentionDays()); - Assertions.assertEquals(GeoRedundantBackupEnum.ENABLED, model.geoRedundantBackup()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Backup model - = new Backup().withBackupRetentionDays(585337534).withGeoRedundantBackup(GeoRedundantBackupEnum.ENABLED); - model = BinaryData.fromObject(model).toObject(Backup.class); - Assertions.assertEquals(585337534, model.backupRetentionDays()); - Assertions.assertEquals(GeoRedundantBackupEnum.ENABLED, model.geoRedundantBackup()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/BackupsCreateMockTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/BackupsCreateMockTests.java deleted file mode 100644 index ab80c31512687..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/BackupsCreateMockTests.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.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager; -import com.azure.resourcemanager.postgresqlflexibleserver.models.Origin; -import com.azure.resourcemanager.postgresqlflexibleserver.models.ServerBackup; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class BackupsCreateMockTests { - @Test - public void testCreate() throws Exception { - String responseStr - = "{\"properties\":{\"backupType\":\"Customer On-Demand\",\"completedTime\":\"2021-09-10T03:49:52Z\",\"source\":\"cv\"},\"id\":\"uwrbehwagoh\",\"name\":\"uffkmrqemvvh\",\"type\":\"xtdr\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - 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().create("yvnqqybaryeuay", "kq", "bqgzslesjcbhern", com.azure.core.util.Context.NONE); - - Assertions.assertEquals(Origin.CUSTOMER_ON_DEMAND, response.backupType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-10T03:49:52Z"), response.completedTime()); - Assertions.assertEquals("cv", response.source()); - } -} 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 0c42201d8c2a3..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/BackupsGetWithResponseMockTests.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.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager; -import com.azure.resourcemanager.postgresqlflexibleserver.models.Origin; -import com.azure.resourcemanager.postgresqlflexibleserver.models.ServerBackup; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class BackupsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"backupType\":\"Customer On-Demand\",\"completedTime\":\"2021-02-14T17:29:05Z\",\"source\":\"uxxpshne\"},\"id\":\"ulfgslqu\",\"name\":\"kwdlenrdsutujba\",\"type\":\"pjuohminyfl\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - 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("futacoebjvewzc", "znmwcp", "guaadraufactkahz", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(Origin.CUSTOMER_ON_DEMAND, response.backupType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-14T17:29:05Z"), response.completedTime()); - Assertions.assertEquals("uxxpshne", 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 56038b3c4d14a..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/BackupsListByServerMockTests.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager; -import com.azure.resourcemanager.postgresqlflexibleserver.models.Origin; -import com.azure.resourcemanager.postgresqlflexibleserver.models.ServerBackup; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class BackupsListByServerMockTests { - @Test - public void testListByServer() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"backupType\":\"Customer On-Demand\",\"completedTime\":\"2021-08-06T16:36:03Z\",\"source\":\"pqchiszep\"},\"id\":\"bjcrxgibbdaxco\",\"name\":\"fozauorsuk\",\"type\":\"kwbqplhlvnuu\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - 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("orwmduvwpklv", "w", com.azure.core.util.Context.NONE); - - Assertions.assertEquals(Origin.CUSTOMER_ON_DEMAND, response.iterator().next().backupType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-06T16:36:03Z"), - response.iterator().next().completedTime()); - Assertions.assertEquals("pqchiszep", 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 9ebdc9c5ad915..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/CapabilitiesListResultTests.java +++ /dev/null @@ -1,23 +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\":[{\"name\":\"wyahuxinpmqnja\",\"supportedServerEditions\":[{\"name\":\"jsprozvcpute\",\"defaultSkuName\":\"vwmf\",\"supportedStorageEditions\":[{}],\"supportedServerSkus\":[{}],\"status\":\"Disabled\",\"reason\":\"pjhulsuuvmkj\"},{\"name\":\"k\",\"defaultSkuName\":\"f\",\"supportedStorageEditions\":[{},{}],\"supportedServerSkus\":[{},{}],\"status\":\"Default\",\"reason\":\"lwejdpv\"},{\"name\":\"yoqpsoaccta\",\"defaultSkuName\":\"kljla\",\"supportedStorageEditions\":[{}],\"supportedServerSkus\":[{},{}],\"status\":\"Default\",\"reason\":\"fdosyg\"},{\"name\":\"paojakhmsbzjh\",\"defaultSkuName\":\"zevdphlx\",\"supportedStorageEditions\":[{},{},{}],\"supportedServerSkus\":[{},{},{}],\"status\":\"Visible\",\"reason\":\"gqjbpfzfsin\"}],\"supportedServerVersions\":[{\"name\":\"cjrwzoxxjtfellu\",\"supportedVersionsToUpgrade\":[\"it\",\"np\",\"qfpjk\",\"lxofpdvhpfxxypin\"],\"status\":\"Disabled\",\"reason\":\"yhuybbkpod\"}],\"fastProvisioningSupported\":\"Disabled\",\"supportedFastProvisioningEditions\":[{\"supportedTier\":\"nuvamiheogna\",\"supportedSku\":\"zxtheotusivyevcc\",\"supportedStorageGb\":1522291140,\"supportedServerVersions\":\"nhungbw\",\"serverCount\":870807939,\"status\":\"Disabled\",\"reason\":\"gxg\"},{\"supportedTier\":\"pemvtzfkufubljof\",\"supportedSku\":\"eofjaeqjh\",\"supportedStorageGb\":158340850,\"supportedServerVersions\":\"s\",\"serverCount\":1818222173,\"status\":\"Visible\",\"reason\":\"ulngsntn\"},{\"supportedTier\":\"bkzgcwrwclx\",\"supportedSku\":\"rljdouskcqv\",\"supportedStorageGb\":422670277,\"supportedServerVersions\":\"cjdkwtnhxbnjbi\",\"serverCount\":1514521592,\"status\":\"Visible\",\"reason\":\"ssainqpjwnzll\"}],\"geoBackupSupported\":\"Disabled\",\"zoneRedundantHaSupported\":\"Enabled\",\"zoneRedundantHaAndGeoBackupSupported\":\"Disabled\",\"storageAutoGrowthSupported\":\"Enabled\",\"onlineResizeSupported\":\"Enabled\",\"restricted\":\"Disabled\",\"status\":\"Available\",\"reason\":\"yqduujit\"}],\"nextLink\":\"czdzev\"}") - .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/CapabilityBaseTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/CapabilityBaseTests.java deleted file mode 100644 index ca199787d04ca..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/CapabilityBaseTests.java +++ /dev/null @@ -1,22 +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.CapabilityBase; - -public final class CapabilityBaseTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CapabilityBase model = BinaryData.fromString("{\"status\":\"Available\",\"reason\":\"tadehxnltyfsopp\"}") - .toObject(CapabilityBase.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CapabilityBase model = new CapabilityBase(); - model = BinaryData.fromObject(model).toObject(CapabilityBase.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 6ad9e338edf86..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/CheckNameAvailabilitiesExecuteWithResponseMockTests.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -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.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class CheckNameAvailabilitiesExecuteWithResponseMockTests { - @Test - public void testExecuteWithResponse() throws Exception { - String responseStr - = "{\"name\":\"oqbeitpkxzt\",\"type\":\"ob\",\"nameAvailable\":false,\"reason\":\"Invalid\",\"message\":\"gfcwqmpimaqxzhem\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - 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("vvib").withType("jj"), - com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(false, response.nameAvailable()); - Assertions.assertEquals(CheckNameAvailabilityReason.INVALID, response.reason()); - Assertions.assertEquals("gfcwqmpimaqxzhem", 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 6f2879240e990..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/CheckNameAvailabilityRequestTests.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.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\":\"nysounqe\",\"type\":\"noae\"}") - .toObject(CheckNameAvailabilityRequest.class); - Assertions.assertEquals("nysounqe", model.name()); - Assertions.assertEquals("noae", model.type()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CheckNameAvailabilityRequest model = new CheckNameAvailabilityRequest().withName("nysounqe").withType("noae"); - model = BinaryData.fromObject(model).toObject(CheckNameAvailabilityRequest.class); - Assertions.assertEquals("nysounqe", model.name()); - Assertions.assertEquals("noae", 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 e989b159c70a3..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/CheckNameAvailabilityResponseTests.java +++ /dev/null @@ -1,33 +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\":\"AlreadyExists\",\"message\":\"gf\"}") - .toObject(CheckNameAvailabilityResponse.class); - Assertions.assertEquals(true, model.nameAvailable()); - Assertions.assertEquals(CheckNameAvailabilityReason.ALREADY_EXISTS, model.reason()); - Assertions.assertEquals("gf", model.message()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CheckNameAvailabilityResponse model = new CheckNameAvailabilityResponse().withNameAvailable(true) - .withReason(CheckNameAvailabilityReason.ALREADY_EXISTS) - .withMessage("gf"); - model = BinaryData.fromObject(model).toObject(CheckNameAvailabilityResponse.class); - Assertions.assertEquals(true, model.nameAvailable()); - Assertions.assertEquals(CheckNameAvailabilityReason.ALREADY_EXISTS, model.reason()); - Assertions.assertEquals("gf", 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 79351669a23d2..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/CheckNameAvailabilityWithLocationsExecuteWithResponseMockTests.java +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -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.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class CheckNameAvailabilityWithLocationsExecuteWithResponseMockTests { - @Test - public void testExecuteWithResponse() throws Exception { - String responseStr - = "{\"name\":\"ktalhsnvkcdmxz\",\"type\":\"oaimlnw\",\"nameAvailable\":false,\"reason\":\"AlreadyExists\",\"message\":\"l\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - 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("yhohujswtwkozzwc", - new CheckNameAvailabilityRequest().withName("kb").withType("pfajnjwltlwtjj"), - com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(false, response.nameAvailable()); - Assertions.assertEquals(CheckNameAvailabilityReason.ALREADY_EXISTS, response.reason()); - Assertions.assertEquals("l", 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 34580683b0acc..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ConfigurationForUpdateTests.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.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\":\"yoxgvcltbgsnc\",\"description\":\"kjeszz\",\"defaultValue\":\"ijhtxf\",\"dataType\":\"Boolean\",\"allowedValues\":\"fsm\",\"source\":\"eh\",\"isDynamicConfig\":true,\"isReadOnly\":false,\"isConfigPendingRestart\":true,\"unit\":\"debfqkkrbmpukgri\",\"documentationLink\":\"lzlfbxzpuz\"}}") - .toObject(ConfigurationForUpdate.class); - Assertions.assertEquals("yoxgvcltbgsnc", model.value()); - Assertions.assertEquals("eh", model.source()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ConfigurationForUpdate model = new ConfigurationForUpdate().withValue("yoxgvcltbgsnc").withSource("eh"); - model = BinaryData.fromObject(model).toObject(ConfigurationForUpdate.class); - Assertions.assertEquals("yoxgvcltbgsnc", model.value()); - Assertions.assertEquals("eh", 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 d96bc61c9deb4..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ConfigurationInnerTests.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.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\":\"rywn\",\"description\":\"oqftiyqzrnkcq\",\"defaultValue\":\"xlwhzlsicoh\",\"dataType\":\"Numeric\",\"allowedValues\":\"wvl\",\"source\":\"avwhheunm\",\"isDynamicConfig\":true,\"isReadOnly\":false,\"isConfigPendingRestart\":false,\"unit\":\"onocukok\",\"documentationLink\":\"axuconuq\"},\"id\":\"fkbey\",\"name\":\"ewrmjmwvvjektc\",\"type\":\"senhwlrs\"}") - .toObject(ConfigurationInner.class); - Assertions.assertEquals("rywn", model.value()); - Assertions.assertEquals("avwhheunm", model.source()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ConfigurationInner model = new ConfigurationInner().withValue("rywn").withSource("avwhheunm"); - model = BinaryData.fromObject(model).toObject(ConfigurationInner.class); - Assertions.assertEquals("rywn", model.value()); - Assertions.assertEquals("avwhheunm", 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 758fd3f6e202f..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ConfigurationListResultTests.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.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\":\"zyiuokk\",\"description\":\"hrdxwzywqsmbs\",\"defaultValue\":\"exim\",\"dataType\":\"Boolean\",\"allowedValues\":\"cfsf\",\"source\":\"ymddys\",\"isDynamicConfig\":false,\"isReadOnly\":false,\"isConfigPendingRestart\":true,\"unit\":\"yudxorrqnbp\",\"documentationLink\":\"zvyifqrvkdvj\"},\"id\":\"lrmv\",\"name\":\"d\",\"type\":\"watkpnpulexxb\"},{\"properties\":{\"value\":\"truwiqzb\",\"description\":\"vsovmyokac\",\"defaultValue\":\"kwlhzdo\",\"dataType\":\"Numeric\",\"allowedValues\":\"mflbv\",\"source\":\"chrkcciwwzjuqk\",\"isDynamicConfig\":false,\"isReadOnly\":true,\"isConfigPendingRestart\":true,\"unit\":\"uo\",\"documentationLink\":\"skghsauuimj\"},\"id\":\"xieduugidyjrr\",\"name\":\"byao\",\"type\":\"v\"},{\"properties\":{\"value\":\"sonpclhocohs\",\"description\":\"ev\",\"defaultValue\":\"ggzfbu\",\"dataType\":\"Enumeration\",\"allowedValues\":\"faxkffeii\",\"source\":\"lvmezyvshxmzsbbz\",\"isDynamicConfig\":false,\"isReadOnly\":false,\"isConfigPendingRestart\":true,\"unit\":\"burvjxxjnspy\",\"documentationLink\":\"tko\"},\"id\":\"kouknvudwtiu\",\"name\":\"bldngkpoc\",\"type\":\"pazyxoegukg\"},{\"properties\":{\"value\":\"iucgygevqzn\",\"description\":\"pmr\",\"defaultValue\":\"izcdrqjsd\",\"dataType\":\"Enumeration\",\"allowedValues\":\"fyhxde\",\"source\":\"jzicwifsjt\",\"isDynamicConfig\":true,\"isReadOnly\":true,\"isConfigPendingRestart\":true,\"unit\":\"cbkhajdeyeamdph\",\"documentationLink\":\"alpbuxwgipwhon\"},\"id\":\"kgshwa\",\"name\":\"kix\",\"type\":\"bin\"}],\"nextLink\":\"pu\"}") - .toObject(ConfigurationListResult.class); - Assertions.assertEquals("zyiuokk", model.value().get(0).value()); - Assertions.assertEquals("ymddys", model.value().get(0).source()); - Assertions.assertEquals("pu", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ConfigurationListResult model = new ConfigurationListResult() - .withValue(Arrays.asList(new ConfigurationInner().withValue("zyiuokk").withSource("ymddys"), - new ConfigurationInner().withValue("truwiqzb").withSource("chrkcciwwzjuqk"), - new ConfigurationInner().withValue("sonpclhocohs").withSource("lvmezyvshxmzsbbz"), - new ConfigurationInner().withValue("iucgygevqzn").withSource("jzicwifsjt"))) - .withNextLink("pu"); - model = BinaryData.fromObject(model).toObject(ConfigurationListResult.class); - Assertions.assertEquals("zyiuokk", model.value().get(0).value()); - Assertions.assertEquals("ymddys", model.value().get(0).source()); - Assertions.assertEquals("pu", 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 36ea214a9dcf2..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ConfigurationPropertiesTests.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.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\":\"rzpwvlqdqgbiq\",\"description\":\"ihkaetcktvfc\",\"defaultValue\":\"fsnkymuctq\",\"dataType\":\"Integer\",\"allowedValues\":\"ebrjcxe\",\"source\":\"uwutttxfvjrbi\",\"isDynamicConfig\":true,\"isReadOnly\":true,\"isConfigPendingRestart\":false,\"unit\":\"vahfn\",\"documentationLink\":\"kyqxjvuujqgidokg\"}") - .toObject(ConfigurationProperties.class); - Assertions.assertEquals("rzpwvlqdqgbiq", model.value()); - Assertions.assertEquals("uwutttxfvjrbi", model.source()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ConfigurationProperties model - = new ConfigurationProperties().withValue("rzpwvlqdqgbiq").withSource("uwutttxfvjrbi"); - model = BinaryData.fromObject(model).toObject(ConfigurationProperties.class); - Assertions.assertEquals("rzpwvlqdqgbiq", model.value()); - Assertions.assertEquals("uwutttxfvjrbi", 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 5921f9f702d00..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ConfigurationsGetWithResponseMockTests.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.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager; -import com.azure.resourcemanager.postgresqlflexibleserver.models.Configuration; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ConfigurationsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"value\":\"vl\",\"description\":\"fcq\",\"defaultValue\":\"rdve\",\"dataType\":\"Integer\",\"allowedValues\":\"dtutnwldu\",\"source\":\"vuzhyr\",\"isDynamicConfig\":true,\"isReadOnly\":true,\"isConfigPendingRestart\":true,\"unit\":\"k\",\"documentationLink\":\"ukuqgsj\"},\"id\":\"undxgketw\",\"name\":\"hhzjhfj\",\"type\":\"hvvmuvgpmun\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - 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("nzqodfvpg", "hoxgsgbpf", "zdjtxvzflbqv", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("vl", response.value()); - Assertions.assertEquals("vuzhyr", 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 abde24ecdfe38..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ConfigurationsListByServerMockTests.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.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager; -import com.azure.resourcemanager.postgresqlflexibleserver.models.Configuration; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ConfigurationsListByServerMockTests { - @Test - public void testListByServer() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"value\":\"l\",\"description\":\"swpchwahfbousn\",\"defaultValue\":\"pgfewetwlyx\",\"dataType\":\"Boolean\",\"allowedValues\":\"ykxhdjh\",\"source\":\"mmbcxfhbcp\",\"isDynamicConfig\":false,\"isReadOnly\":true,\"isConfigPendingRestart\":false,\"unit\":\"hqizxfpxtgqscj\",\"documentationLink\":\"ftjuh\"},\"id\":\"azkmtgguwp\",\"name\":\"jrajcivm\",\"type\":\"ghfcfiwrxgkneuvy\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - 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("eazulcs", "thwwn", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("l", response.iterator().next().value()); - Assertions.assertEquals("mmbcxfhbcp", 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 cf14c7e9f58e5..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ConfigurationsPutMockTests.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager; -import com.azure.resourcemanager.postgresqlflexibleserver.models.Configuration; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ConfigurationsPutMockTests { - @Test - public void testPut() throws Exception { - String responseStr - = "{\"properties\":{\"value\":\"frpmpdnqqskaw\",\"description\":\"qvmmbn\",\"defaultValue\":\"fr\",\"dataType\":\"Enumeration\",\"allowedValues\":\"zmegnitgvk\",\"source\":\"zyqdrfegcealzx\",\"isDynamicConfig\":true,\"isReadOnly\":true,\"isConfigPendingRestart\":false,\"unit\":\"oyqhlwig\",\"documentationLink\":\"vbkbxgomf\"},\"id\":\"uwasqvd\",\"name\":\"e\",\"type\":\"y\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - 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("yue") - .withExistingFlexibleServer("qsxvmhf", "uzjyihsasbhudypo") - .withValue("ynsqyrpfoobr") - .withSource("yvi") - .create(); - - Assertions.assertEquals("frpmpdnqqskaw", response.value()); - Assertions.assertEquals("zyqdrfegcealzx", 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 2f2d9f79d6346..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/DatabaseInnerTests.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.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\":\"spnqzahmgkb\",\"collation\":\"yydhibnuqqk\"},\"id\":\"kadrgvt\",\"name\":\"agnb\",\"type\":\"ynhijggme\"}") - .toObject(DatabaseInner.class); - Assertions.assertEquals("spnqzahmgkb", model.charset()); - Assertions.assertEquals("yydhibnuqqk", model.collation()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DatabaseInner model = new DatabaseInner().withCharset("spnqzahmgkb").withCollation("yydhibnuqqk"); - model = BinaryData.fromObject(model).toObject(DatabaseInner.class); - Assertions.assertEquals("spnqzahmgkb", model.charset()); - Assertions.assertEquals("yydhibnuqqk", 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 101b96e9ac8cd..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/DatabaseListResultTests.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.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\":\"hrbnlankxmyskpbh\",\"collation\":\"btkcxywnytnrsyn\"},\"id\":\"idybyxczf\",\"name\":\"lhaaxdbabp\",\"type\":\"lwrq\"},{\"properties\":{\"charset\":\"tsthsucocm\",\"collation\":\"yazttbtwwrqpue\"},\"id\":\"kzywbiex\",\"name\":\"fey\",\"type\":\"eaxib\"},{\"properties\":{\"charset\":\"wbhqwal\",\"collation\":\"zyoxaepdkzjan\"},\"id\":\"xrhdwbavxbniwdjs\",\"name\":\"zt\",\"type\":\"dbpgnxytxhp\"}],\"nextLink\":\"bzpfzab\"}") - .toObject(DatabaseListResult.class); - Assertions.assertEquals("hrbnlankxmyskpbh", model.value().get(0).charset()); - Assertions.assertEquals("btkcxywnytnrsyn", model.value().get(0).collation()); - Assertions.assertEquals("bzpfzab", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DatabaseListResult model - = new DatabaseListResult() - .withValue( - Arrays.asList(new DatabaseInner().withCharset("hrbnlankxmyskpbh").withCollation("btkcxywnytnrsyn"), - new DatabaseInner().withCharset("tsthsucocm").withCollation("yazttbtwwrqpue"), - new DatabaseInner().withCharset("wbhqwal").withCollation("zyoxaepdkzjan"))) - .withNextLink("bzpfzab"); - model = BinaryData.fromObject(model).toObject(DatabaseListResult.class); - Assertions.assertEquals("hrbnlankxmyskpbh", model.value().get(0).charset()); - Assertions.assertEquals("btkcxywnytnrsyn", model.value().get(0).collation()); - Assertions.assertEquals("bzpfzab", 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 3e51fe6ad66fe..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/DatabasePropertiesTests.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.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\":\"siarbutrcvpn\",\"collation\":\"zmhjrunmp\"}") - .toObject(DatabaseProperties.class); - Assertions.assertEquals("siarbutrcvpn", model.charset()); - Assertions.assertEquals("zmhjrunmp", model.collation()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DatabaseProperties model = new DatabaseProperties().withCharset("siarbutrcvpn").withCollation("zmhjrunmp"); - model = BinaryData.fromObject(model).toObject(DatabaseProperties.class); - Assertions.assertEquals("siarbutrcvpn", model.charset()); - Assertions.assertEquals("zmhjrunmp", 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 8b0b2dea4b372..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/DatabasesCreateMockTests.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager; -import com.azure.resourcemanager.postgresqlflexibleserver.models.Database; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class DatabasesCreateMockTests { - @Test - public void testCreate() throws Exception { - String responseStr - = "{\"properties\":{\"charset\":\"d\",\"collation\":\"nsiru\"},\"id\":\"z\",\"name\":\"mes\",\"type\":\"kdlpa\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - 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("tvtzeexavoxtfg") - .withExistingFlexibleServer("awddjibab", "vit") - .withCharset("dmdqb") - .withCollation("ypq") - .create(); - - Assertions.assertEquals("d", response.charset()); - Assertions.assertEquals("nsiru", 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 85f2f5384032e..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/DatabasesDeleteMockTests.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.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class DatabasesDeleteMockTests { - @Test - public void testDelete() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - 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("uxakjsqzhzbezk", "imsidxasicddyvvj", "kgfmocwahpq", 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 fe7e46ae74f2b..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/DatabasesGetWithResponseMockTests.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.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager; -import com.azure.resourcemanager.postgresqlflexibleserver.models.Database; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class DatabasesGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"charset\":\"idjks\",\"collation\":\"kyxvxevblbjedn\"},\"id\":\"lageuaulxun\",\"name\":\"mjbnk\",\"type\":\"pxynenlsvxeizzg\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - 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("atjeaahh", "jhhn", "kzyb", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("idjks", response.charset()); - Assertions.assertEquals("kyxvxevblbjedn", 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 48f8bfef70143..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/DatabasesListByServerMockTests.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.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager; -import com.azure.resourcemanager.postgresqlflexibleserver.models.Database; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class DatabasesListByServerMockTests { - @Test - public void testListByServer() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"charset\":\"ekkkzd\",\"collation\":\"tkgdojbmxva\"},\"id\":\"efdeesve\",\"name\":\"uij\",\"type\":\"xtxsuwprtujw\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - 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("klnsrmffey", "xcktpiymerteeamm", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("ekkkzd", response.iterator().next().charset()); - Assertions.assertEquals("tkgdojbmxva", response.iterator().next().collation()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/DbLevelValidationStatusTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/DbLevelValidationStatusTests.java deleted file mode 100644 index 17c9b51b8f991..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/DbLevelValidationStatusTests.java +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.postgresqlflexibleserver.models.DbLevelValidationStatus; -import com.azure.resourcemanager.postgresqlflexibleserver.models.ValidationMessage; -import com.azure.resourcemanager.postgresqlflexibleserver.models.ValidationState; -import com.azure.resourcemanager.postgresqlflexibleserver.models.ValidationSummaryItem; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class DbLevelValidationStatusTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DbLevelValidationStatus model = BinaryData.fromString( - "{\"databaseName\":\"i\",\"startedOn\":\"2021-11-01T17:10:34Z\",\"endedOn\":\"2021-09-29T21:57:11Z\",\"summary\":[{\"type\":\"r\",\"state\":\"Failed\",\"messages\":[{\"state\":\"Failed\",\"message\":\"r\"},{\"state\":\"Succeeded\",\"message\":\"squyfxrxxlep\"},{\"state\":\"Succeeded\",\"message\":\"xje\"}]},{\"type\":\"lwnwxuqlcvydyp\",\"state\":\"Succeeded\",\"messages\":[{\"state\":\"Failed\",\"message\":\"kniod\"}]}]}") - .toObject(DbLevelValidationStatus.class); - Assertions.assertEquals("i", model.databaseName()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-01T17:10:34Z"), model.startedOn()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-29T21:57:11Z"), model.endedOn()); - Assertions.assertEquals("r", model.summary().get(0).type()); - Assertions.assertEquals(ValidationState.FAILED, model.summary().get(0).state()); - Assertions.assertEquals(ValidationState.FAILED, model.summary().get(0).messages().get(0).state()); - Assertions.assertEquals("r", model.summary().get(0).messages().get(0).message()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DbLevelValidationStatus model - = new DbLevelValidationStatus().withDatabaseName("i") - .withStartedOn(OffsetDateTime.parse("2021-11-01T17:10:34Z")) - .withEndedOn(OffsetDateTime.parse("2021-09-29T21:57:11Z")) - .withSummary( - Arrays.asList( - new ValidationSummaryItem().withType("r") - .withState(ValidationState.FAILED) - .withMessages(Arrays.asList( - new ValidationMessage().withState(ValidationState.FAILED).withMessage("r"), - new ValidationMessage().withState(ValidationState.SUCCEEDED) - .withMessage("squyfxrxxlep"), - new ValidationMessage().withState(ValidationState.SUCCEEDED).withMessage("xje"))), - new ValidationSummaryItem().withType("lwnwxuqlcvydyp") - .withState(ValidationState.SUCCEEDED) - .withMessages(Arrays.asList( - new ValidationMessage().withState(ValidationState.FAILED).withMessage("kniod"))))); - model = BinaryData.fromObject(model).toObject(DbLevelValidationStatus.class); - Assertions.assertEquals("i", model.databaseName()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-01T17:10:34Z"), model.startedOn()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-29T21:57:11Z"), model.endedOn()); - Assertions.assertEquals("r", model.summary().get(0).type()); - Assertions.assertEquals(ValidationState.FAILED, model.summary().get(0).state()); - Assertions.assertEquals(ValidationState.FAILED, model.summary().get(0).messages().get(0).state()); - Assertions.assertEquals("r", model.summary().get(0).messages().get(0).message()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/DbMigrationStatusTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/DbMigrationStatusTests.java deleted file mode 100644 index b2e4395665c85..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/DbMigrationStatusTests.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.util.BinaryData; -import com.azure.resourcemanager.postgresqlflexibleserver.models.DbMigrationStatus; -import com.azure.resourcemanager.postgresqlflexibleserver.models.MigrationDbState; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; - -public final class DbMigrationStatusTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DbMigrationStatus model = BinaryData.fromString( - "{\"databaseName\":\"r\",\"migrationState\":\"WaitingForCutoverTrigger\",\"migrationOperation\":\"eae\",\"startedOn\":\"2021-06-29T04:07:56Z\",\"endedOn\":\"2021-07-07T15:43:19Z\",\"fullLoadQueuedTables\":737595664,\"fullLoadErroredTables\":463401012,\"fullLoadLoadingTables\":1305337055,\"fullLoadCompletedTables\":2043314878,\"cdcUpdateCounter\":1025445351,\"cdcDeleteCounter\":868651284,\"cdcInsertCounter\":435205940,\"appliedChanges\":429988234,\"incomingChanges\":632482030,\"latency\":1294061553,\"message\":\"hyoulpjr\"}") - .toObject(DbMigrationStatus.class); - Assertions.assertEquals("r", model.databaseName()); - Assertions.assertEquals(MigrationDbState.WAITING_FOR_CUTOVER_TRIGGER, model.migrationState()); - Assertions.assertEquals("eae", model.migrationOperation()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-29T04:07:56Z"), model.startedOn()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-07T15:43:19Z"), model.endedOn()); - Assertions.assertEquals(737595664, model.fullLoadQueuedTables()); - Assertions.assertEquals(463401012, model.fullLoadErroredTables()); - Assertions.assertEquals(1305337055, model.fullLoadLoadingTables()); - Assertions.assertEquals(2043314878, model.fullLoadCompletedTables()); - Assertions.assertEquals(1025445351, model.cdcUpdateCounter()); - Assertions.assertEquals(868651284, model.cdcDeleteCounter()); - Assertions.assertEquals(435205940, model.cdcInsertCounter()); - Assertions.assertEquals(429988234, model.appliedChanges()); - Assertions.assertEquals(632482030, model.incomingChanges()); - Assertions.assertEquals(1294061553, model.latency()); - Assertions.assertEquals("hyoulpjr", model.message()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DbMigrationStatus model = new DbMigrationStatus().withDatabaseName("r") - .withMigrationState(MigrationDbState.WAITING_FOR_CUTOVER_TRIGGER) - .withMigrationOperation("eae") - .withStartedOn(OffsetDateTime.parse("2021-06-29T04:07:56Z")) - .withEndedOn(OffsetDateTime.parse("2021-07-07T15:43:19Z")) - .withFullLoadQueuedTables(737595664) - .withFullLoadErroredTables(463401012) - .withFullLoadLoadingTables(1305337055) - .withFullLoadCompletedTables(2043314878) - .withCdcUpdateCounter(1025445351) - .withCdcDeleteCounter(868651284) - .withCdcInsertCounter(435205940) - .withAppliedChanges(429988234) - .withIncomingChanges(632482030) - .withLatency(1294061553) - .withMessage("hyoulpjr"); - model = BinaryData.fromObject(model).toObject(DbMigrationStatus.class); - Assertions.assertEquals("r", model.databaseName()); - Assertions.assertEquals(MigrationDbState.WAITING_FOR_CUTOVER_TRIGGER, model.migrationState()); - Assertions.assertEquals("eae", model.migrationOperation()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-29T04:07:56Z"), model.startedOn()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-07T15:43:19Z"), model.endedOn()); - Assertions.assertEquals(737595664, model.fullLoadQueuedTables()); - Assertions.assertEquals(463401012, model.fullLoadErroredTables()); - Assertions.assertEquals(1305337055, model.fullLoadLoadingTables()); - Assertions.assertEquals(2043314878, model.fullLoadCompletedTables()); - Assertions.assertEquals(1025445351, model.cdcUpdateCounter()); - Assertions.assertEquals(868651284, model.cdcDeleteCounter()); - Assertions.assertEquals(435205940, model.cdcInsertCounter()); - Assertions.assertEquals(429988234, model.appliedChanges()); - Assertions.assertEquals(632482030, model.incomingChanges()); - Assertions.assertEquals(1294061553, model.latency()); - Assertions.assertEquals("hyoulpjr", model.message()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/DbServerMetadataTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/DbServerMetadataTests.java deleted file mode 100644 index 2c6c438a845b3..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/DbServerMetadataTests.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.DbServerMetadata; -import com.azure.resourcemanager.postgresqlflexibleserver.models.ServerSku; -import com.azure.resourcemanager.postgresqlflexibleserver.models.SkuTier; -import org.junit.jupiter.api.Assertions; - -public final class DbServerMetadataTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DbServerMetadata model = BinaryData.fromString( - "{\"location\":\"oebwnujhemms\",\"version\":\"dkcrodt\",\"storageMb\":1997229408,\"sku\":{\"name\":\"jlfltkacjvefkdlf\",\"tier\":\"MemoryOptimized\"}}") - .toObject(DbServerMetadata.class); - Assertions.assertEquals("dkcrodt", model.version()); - Assertions.assertEquals(1997229408, model.storageMb()); - Assertions.assertEquals("jlfltkacjvefkdlf", model.sku().name()); - Assertions.assertEquals(SkuTier.MEMORY_OPTIMIZED, model.sku().tier()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DbServerMetadata model = new DbServerMetadata().withVersion("dkcrodt") - .withStorageMb(1997229408) - .withSku(new ServerSku().withName("jlfltkacjvefkdlf").withTier(SkuTier.MEMORY_OPTIMIZED)); - model = BinaryData.fromObject(model).toObject(DbServerMetadata.class); - Assertions.assertEquals("dkcrodt", model.version()); - Assertions.assertEquals(1997229408, model.storageMb()); - Assertions.assertEquals("jlfltkacjvefkdlf", model.sku().name()); - Assertions.assertEquals(SkuTier.MEMORY_OPTIMIZED, model.sku().tier()); - } -} 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 e37410e9de583..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/DelegatedSubnetUsageTests.java +++ /dev/null @@ -1,22 +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\":\"x\",\"usage\":7062133650624687777}") - .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 d17b8cdec4e1f..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/FastProvisioningEditionCapabilityTests.java +++ /dev/null @@ -1,23 +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( - "{\"supportedTier\":\"ezrkgqhcjrefo\",\"supportedSku\":\"mkqsleyyv\",\"supportedStorageGb\":1769493620,\"supportedServerVersions\":\"pkc\",\"serverCount\":1721979703,\"status\":\"Visible\",\"reason\":\"jcrcczsqpjhvmda\"}") - .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 05950b2abf1d6..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/FirewallRuleInnerTests.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.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\":\"lcuhxwtctyqiklb\",\"endIpAddress\":\"ovplw\"},\"id\":\"hvgyuguosvmk\",\"name\":\"ss\",\"type\":\"qukkfp\"}") - .toObject(FirewallRuleInner.class); - Assertions.assertEquals("lcuhxwtctyqiklb", model.startIpAddress()); - Assertions.assertEquals("ovplw", model.endIpAddress()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - FirewallRuleInner model - = new FirewallRuleInner().withStartIpAddress("lcuhxwtctyqiklb").withEndIpAddress("ovplw"); - model = BinaryData.fromObject(model).toObject(FirewallRuleInner.class); - Assertions.assertEquals("lcuhxwtctyqiklb", model.startIpAddress()); - Assertions.assertEquals("ovplw", 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 9a15a912a55db..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/FirewallRuleListResultTests.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.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\":\"ghxpkdw\",\"endIpAddress\":\"baiuebbaumny\"},\"id\":\"ped\",\"name\":\"ojnabckhsmtxpsie\",\"type\":\"tfhvpesapskrdqmh\"},{\"properties\":{\"startIpAddress\":\"jdhtldwkyzxu\",\"endIpAddress\":\"tkncwsc\"},\"id\":\"vlxotogtwrupqsx\",\"name\":\"nmic\",\"type\":\"kvceoveilovnotyf\"}],\"nextLink\":\"cnjbkcnxdhbt\"}") - .toObject(FirewallRuleListResult.class); - Assertions.assertEquals("ghxpkdw", model.value().get(0).startIpAddress()); - Assertions.assertEquals("baiuebbaumny", model.value().get(0).endIpAddress()); - Assertions.assertEquals("cnjbkcnxdhbt", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - FirewallRuleListResult model = new FirewallRuleListResult() - .withValue( - Arrays.asList(new FirewallRuleInner().withStartIpAddress("ghxpkdw").withEndIpAddress("baiuebbaumny"), - new FirewallRuleInner().withStartIpAddress("jdhtldwkyzxu").withEndIpAddress("tkncwsc"))) - .withNextLink("cnjbkcnxdhbt"); - model = BinaryData.fromObject(model).toObject(FirewallRuleListResult.class); - Assertions.assertEquals("ghxpkdw", model.value().get(0).startIpAddress()); - Assertions.assertEquals("baiuebbaumny", model.value().get(0).endIpAddress()); - Assertions.assertEquals("cnjbkcnxdhbt", 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 aad68f53961a9..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/FirewallRulePropertiesTests.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.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\":\"gmgsxnkjzkde\",\"endIpAddress\":\"lpvlopw\"}") - .toObject(FirewallRuleProperties.class); - Assertions.assertEquals("gmgsxnkjzkde", model.startIpAddress()); - Assertions.assertEquals("lpvlopw", model.endIpAddress()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - FirewallRuleProperties model - = new FirewallRuleProperties().withStartIpAddress("gmgsxnkjzkde").withEndIpAddress("lpvlopw"); - model = BinaryData.fromObject(model).toObject(FirewallRuleProperties.class); - Assertions.assertEquals("gmgsxnkjzkde", model.startIpAddress()); - Assertions.assertEquals("lpvlopw", 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 1d36cb0ce7fa3..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/FirewallRulesCreateOrUpdateMockTests.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager; -import com.azure.resourcemanager.postgresqlflexibleserver.models.FirewallRule; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class FirewallRulesCreateOrUpdateMockTests { - @Test - public void testCreateOrUpdate() throws Exception { - String responseStr - = "{\"properties\":{\"startIpAddress\":\"iqtgdqoh\",\"endIpAddress\":\"cwsldri\"},\"id\":\"tpwb\",\"name\":\"a\",\"type\":\"llibphbqzmizak\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - 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("ehgpp") - .withExistingFlexibleServer("wxezwzhok", "bwnhhtql") - .withStartIpAddress("pifhpfeoajvgcxtx") - .withEndIpAddress("csheafidltugsr") - .create(); - - Assertions.assertEquals("iqtgdqoh", response.startIpAddress()); - Assertions.assertEquals("cwsldri", 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 ac40851d9f296..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/FirewallRulesDeleteMockTests.java +++ /dev/null @@ -1,33 +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.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class FirewallRulesDeleteMockTests { - @Test - public void testDelete() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - 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("zrcxfailcfxwmdbo", "dfgsftufqobrj", "nac", 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 e872dc4b673c3..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/FirewallRulesGetWithResponseMockTests.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.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager; -import com.azure.resourcemanager.postgresqlflexibleserver.models.FirewallRule; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class FirewallRulesGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"startIpAddress\":\"zvulj\",\"endIpAddress\":\"aaeranokqgukk\"},\"id\":\"nvbroylaxx\",\"name\":\"lcdisd\",\"type\":\"sfjbjsvg\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - 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("cc", "knh", "kizvytn", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("zvulj", response.startIpAddress()); - Assertions.assertEquals("aaeranokqgukk", 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 03c6843e93583..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/FirewallRulesListByServerMockTests.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.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager; -import com.azure.resourcemanager.postgresqlflexibleserver.models.FirewallRule; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class FirewallRulesListByServerMockTests { - @Test - public void testListByServer() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"startIpAddress\":\"pdvjdhttzaefedx\",\"endIpAddress\":\"hchrphkmcrjdqn\"},\"id\":\"fzpbgtgkyl\",\"name\":\"dgh\",\"type\":\"jeuut\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - 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("rwhryvycytd", "lxgccknfnwmbtm", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("pdvjdhttzaefedx", response.iterator().next().startIpAddress()); - Assertions.assertEquals("hchrphkmcrjdqn", response.iterator().next().endIpAddress()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/FlexibleServerCapabilityInnerTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/FlexibleServerCapabilityInnerTests.java deleted file mode 100644 index 9e83142dd5896..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/FlexibleServerCapabilityInnerTests.java +++ /dev/null @@ -1,26 +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.FlexibleServerCapabilityInner; -import org.junit.jupiter.api.Assertions; - -public final class FlexibleServerCapabilityInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - FlexibleServerCapabilityInner model = BinaryData.fromString( - "{\"name\":\"hkr\",\"supportedServerEditions\":[{\"name\":\"ppdsbdkvwrwj\",\"defaultSkuName\":\"usnhutje\",\"supportedStorageEditions\":[{\"name\":\"ldhugjzzdatqxh\",\"defaultStorageSizeMb\":1803716875035783430,\"supportedStorageMb\":[{},{},{},{}],\"status\":\"Available\",\"reason\":\"phut\"},{\"name\":\"ndv\",\"defaultStorageSizeMb\":6252386858806975297,\"supportedStorageMb\":[{},{},{}],\"status\":\"Default\",\"reason\":\"yhxhu\"}],\"supportedServerSkus\":[{\"name\":\"tyxolniwpwc\",\"vCores\":12030769,\"supportedIops\":1720882214,\"supportedMemoryPerVcoreMb\":8355721007467412768,\"supportedZones\":[\"klryplwck\",\"asy\"],\"supportedHaMode\":[\"ZoneRedundant\",\"SameZone\",\"ZoneRedundant\"],\"status\":\"Default\",\"reason\":\"bacphejko\"}],\"status\":\"Default\",\"reason\":\"gou\"}],\"supportedServerVersions\":[{\"name\":\"likwyqkgfgib\",\"supportedVersionsToUpgrade\":[\"gakeqsr\"],\"status\":\"Disabled\",\"reason\":\"qqedqytbciqfou\"},{\"name\":\"mmnkzsmodmgl\",\"supportedVersionsToUpgrade\":[\"pbkwtmu\",\"duqkt\",\"pspwgcuertu\"],\"status\":\"Disabled\",\"reason\":\"svqwhbmdgbbjfd\"}],\"fastProvisioningSupported\":\"Disabled\",\"supportedFastProvisioningEditions\":[{\"supportedTier\":\"ex\",\"supportedSku\":\"bhtqqrolfpfpsa\",\"supportedStorageGb\":2143599393,\"supportedServerVersions\":\"uxig\",\"serverCount\":917498996,\"status\":\"Default\",\"reason\":\"aoyfhrtxilnerkuj\"}],\"geoBackupSupported\":\"Disabled\",\"zoneRedundantHaSupported\":\"Enabled\",\"zoneRedundantHaAndGeoBackupSupported\":\"Disabled\",\"storageAutoGrowthSupported\":\"Disabled\",\"onlineResizeSupported\":\"Enabled\",\"restricted\":\"Disabled\",\"status\":\"Available\",\"reason\":\"wjkcp\"}") - .toObject(FlexibleServerCapabilityInner.class); - Assertions.assertEquals("hkr", model.name()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - FlexibleServerCapabilityInner model = new FlexibleServerCapabilityInner().withName("hkr"); - model = BinaryData.fromObject(model).toObject(FlexibleServerCapabilityInner.class); - Assertions.assertEquals("hkr", model.name()); - } -} 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 cc2a220fb74a8..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/FlexibleServerEditionCapabilityTests.java +++ /dev/null @@ -1,23 +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\":\"nwbxgjvtbvpyssz\",\"defaultSkuName\":\"rujqg\",\"supportedStorageEditions\":[{\"name\":\"ouqfprwz\",\"defaultStorageSizeMb\":7801015302360323222,\"supportedStorageMb\":[{\"supportedIops\":1015054859,\"supportedMaximumIops\":1093234369,\"storageSizeMb\":3421519817258122094,\"maximumStorageSizeMb\":6910082069847359363,\"supportedThroughput\":2085813380,\"supportedMaximumThroughput\":1785230840,\"defaultIopsTier\":\"ckyfih\",\"supportedIopsTiers\":[{}],\"status\":\"Default\",\"reason\":\"zwdzuh\"},{\"supportedIops\":1424073065,\"supportedMaximumIops\":1847084741,\"storageSizeMb\":1702945430371192394,\"maximumStorageSizeMb\":9204546244351616694,\"supportedThroughput\":404172620,\"supportedMaximumThroughput\":183094185,\"defaultIopsTier\":\"eiwaopvkmi\",\"supportedIopsTiers\":[{},{}],\"status\":\"Visible\",\"reason\":\"cufufsrpymz\"},{\"supportedIops\":860979555,\"supportedMaximumIops\":1949364989,\"storageSizeMb\":7089145328472125116,\"maximumStorageSizeMb\":2426544779140155490,\"supportedThroughput\":1074081564,\"supportedMaximumThroughput\":309313223,\"defaultIopsTier\":\"cs\",\"supportedIopsTiers\":[{},{},{},{}],\"status\":\"Default\",\"reason\":\"z\"},{\"supportedIops\":1351080961,\"supportedMaximumIops\":1121754168,\"storageSizeMb\":2982546818195845622,\"maximumStorageSizeMb\":1362560180657370264,\"supportedThroughput\":219333087,\"supportedMaximumThroughput\":1039180854,\"defaultIopsTier\":\"fqpte\",\"supportedIopsTiers\":[{},{},{},{}],\"status\":\"Disabled\",\"reason\":\"pyqr\"}],\"status\":\"Visible\",\"reason\":\"npvswjdkirso\"},{\"name\":\"qxhcrmn\",\"defaultStorageSizeMb\":661111027301241875,\"supportedStorageMb\":[{\"supportedIops\":88014725,\"supportedMaximumIops\":1289285070,\"storageSizeMb\":7706383625926000656,\"maximumStorageSizeMb\":2637424156793324533,\"supportedThroughput\":748845194,\"supportedMaximumThroughput\":1921161938,\"defaultIopsTier\":\"wpgrjbzno\",\"supportedIopsTiers\":[{},{},{}],\"status\":\"Visible\",\"reason\":\"nb\"}],\"status\":\"Available\",\"reason\":\"bnmo\"}],\"supportedServerSkus\":[{\"name\":\"shurzafbljjgpbto\",\"vCores\":1923577636,\"supportedIops\":719319664,\"supportedMemoryPerVcoreMb\":3852594143010370498,\"supportedZones\":[\"qidtqajzyu\",\"pku\"],\"supportedHaMode\":[\"ZoneRedundant\",\"SameZone\",\"ZoneRedundant\"],\"status\":\"Disabled\",\"reason\":\"hfepgzgqex\"},{\"name\":\"ocxscpaierhhbcs\",\"vCores\":526297458,\"supportedIops\":1936652093,\"supportedMemoryPerVcoreMb\":7673414974614237227,\"supportedZones\":[\"odxobnbdxkqpxok\",\"jionpimexgstxgc\"],\"supportedHaMode\":[\"SameZone\"],\"status\":\"Available\",\"reason\":\"jrmvdjwzrlo\"},{\"name\":\"clwhijcoejctbz\",\"vCores\":21849341,\"supportedIops\":2038129581,\"supportedMemoryPerVcoreMb\":7357191703099930404,\"supportedZones\":[\"fkgukdkexxppof\",\"xaxcfjpgddtocjjx\",\"vpmouexhdzxib\"],\"supportedHaMode\":[\"ZoneRedundant\",\"ZoneRedundant\",\"ZoneRedundant\"],\"status\":\"Visible\",\"reason\":\"vddntwn\"},{\"name\":\"icbtwnpzao\",\"vCores\":1330155911,\"supportedIops\":114023042,\"supportedMemoryPerVcoreMb\":2446371757978717753,\"supportedZones\":[\"yd\",\"glmjth\",\"qkwpyeicxmqc\",\"wqvhkhixuigdt\"],\"supportedHaMode\":[\"ZoneRedundant\"],\"status\":\"Default\",\"reason\":\"ghmewuam\"}],\"status\":\"Disabled\",\"reason\":\"z\"}") - .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/FlexibleServersTriggerLtrPreBackupWithResponseMockTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/FlexibleServersTriggerLtrPreBackupWithResponseMockTests.java deleted file mode 100644 index 92dd850775d77..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/FlexibleServersTriggerLtrPreBackupWithResponseMockTests.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.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager; -import com.azure.resourcemanager.postgresqlflexibleserver.models.BackupSettings; -import com.azure.resourcemanager.postgresqlflexibleserver.models.LtrPreBackupRequest; -import com.azure.resourcemanager.postgresqlflexibleserver.models.LtrPreBackupResponse; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class FlexibleServersTriggerLtrPreBackupWithResponseMockTests { - @Test - public void testTriggerLtrPreBackupWithResponse() throws Exception { - String responseStr = "{\"properties\":{\"numberOfContainers\":1318617256}}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - PostgreSqlManager manager = PostgreSqlManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - LtrPreBackupResponse response = manager.flexibleServers() - .triggerLtrPreBackupWithResponse("mqspkcdqzhlctdd", "nqndyfpchrqbn", - new LtrPreBackupRequest().withBackupSettings(new BackupSettings().withBackupName("jrcg")), - com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(1318617256, response.numberOfContainers()); - } -} 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 1b487697ee2d5..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/GetPrivateDnsZoneSuffixesExecuteWithResponseMockTests.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.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class GetPrivateDnsZoneSuffixesExecuteWithResponseMockTests { - @Test - public void testExecuteWithResponse() throws Exception { - String responseStr = "\"ghgshejjtbxqmu\""; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - 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("ghgshejjtbxqmu", 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 f6425506c59a2..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/HighAvailabilityTests.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.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\":\"Disabled\",\"state\":\"Healthy\",\"standbyAvailabilityZone\":\"oxdjebwpuc\"}") - .toObject(HighAvailability.class); - Assertions.assertEquals(HighAvailabilityMode.DISABLED, model.mode()); - Assertions.assertEquals("oxdjebwpuc", model.standbyAvailabilityZone()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - HighAvailability model - = new HighAvailability().withMode(HighAvailabilityMode.DISABLED).withStandbyAvailabilityZone("oxdjebwpuc"); - model = BinaryData.fromObject(model).toObject(HighAvailability.class); - Assertions.assertEquals(HighAvailabilityMode.DISABLED, model.mode()); - Assertions.assertEquals("oxdjebwpuc", model.standbyAvailabilityZone()); - } -} 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 449307a678e7e..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/LocationBasedCapabilitiesExecuteMockTests.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.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager; -import com.azure.resourcemanager.postgresqlflexibleserver.models.FlexibleServerCapability; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class LocationBasedCapabilitiesExecuteMockTests { - @Test - public void testExecute() throws Exception { - String responseStr - = "{\"value\":[{\"name\":\"oldweyuqdu\",\"supportedServerEditions\":[{\"name\":\"nrwrbiork\",\"defaultSkuName\":\"lywjhh\",\"supportedStorageEditions\":[{\"name\":\"xmsivfomiloxggdu\",\"defaultStorageSizeMb\":322470867216638009,\"supportedStorageMb\":[{},{},{},{}],\"status\":\"Disabled\",\"reason\":\"ao\"},{\"name\":\"chvcyyysfgdo\",\"defaultStorageSizeMb\":7467577489537815272,\"supportedStorageMb\":[{}],\"status\":\"Disabled\",\"reason\":\"pwoqo\"}],\"supportedServerSkus\":[{\"name\":\"jeknizshq\",\"vCores\":1591499316,\"supportedIops\":932128156,\"supportedMemoryPerVcoreMb\":4510672218626509110,\"supportedZones\":[\"b\",\"rrilbywdxsmic\",\"wrwfscjfnyns\"],\"supportedHaMode\":[\"ZoneRedundant\"],\"status\":\"Disabled\",\"reason\":\"voqyt\"},{\"name\":\"yo\",\"vCores\":853520386,\"supportedIops\":1293894339,\"supportedMemoryPerVcoreMb\":2703223552159511284,\"supportedZones\":[\"pthjoxo\"],\"supportedHaMode\":[\"SameZone\",\"ZoneRedundant\"],\"status\":\"Disabled\",\"reason\":\"iml\"}],\"status\":\"Default\",\"reason\":\"xkcgxxlxsffgcvi\"},{\"name\":\"zdwlvwlyoupfgfb\",\"defaultSkuName\":\"ubdyhgk\",\"supportedStorageEditions\":[{\"name\":\"sgow\",\"defaultStorageSizeMb\":7972724077673531011,\"supportedStorageMb\":[{},{},{}],\"status\":\"Available\",\"reason\":\"lahb\"}],\"supportedServerSkus\":[{\"name\":\"xtgzukxitmmqtgqq\",\"vCores\":1748959674,\"supportedIops\":107951618,\"supportedMemoryPerVcoreMb\":3154721021246185511,\"supportedZones\":[\"juisavokqdzf\"],\"supportedHaMode\":[\"ZoneRedundant\"],\"status\":\"Available\",\"reason\":\"frqttbajlkatnw\"},{\"name\":\"iopid\",\"vCores\":1150651693,\"supportedIops\":128266879,\"supportedMemoryPerVcoreMb\":3873613137312097491,\"supportedZones\":[\"kdmligovi\",\"rxkpmloazuruoc\"],\"supportedHaMode\":[\"SameZone\"],\"status\":\"Available\",\"reason\":\"eoybfhjxakvvjgs\"},{\"name\":\"r\",\"vCores\":1486233885,\"supportedIops\":482425656,\"supportedMemoryPerVcoreMb\":1679876509876130353,\"supportedZones\":[\"kxn\",\"edabgyvudtjue\",\"bcihxuuwhc\"],\"supportedHaMode\":[\"SameZone\",\"ZoneRedundant\"],\"status\":\"Visible\",\"reason\":\"payakkud\"}],\"status\":\"Disabled\",\"reason\":\"wjplma\"}],\"supportedServerVersions\":[{\"name\":\"yohpfkyrkdbdgiog\",\"supportedVersionsToUpgrade\":[\"mnwqj\",\"obaiyhddviaceg\",\"n\",\"ntfpmvmemfnc\"],\"status\":\"Visible\",\"reason\":\"vbalxlllc\"},{\"name\":\"odbzevwrdnhf\",\"supportedVersionsToUpgrade\":[\"vsjcswsmystuluqy\"],\"status\":\"Disabled\",\"reason\":\"lerchpq\"},{\"name\":\"f\",\"supportedVersionsToUpgrade\":[\"abwidfcxsspuun\",\"oxyhkxgqddrihpf\",\"oqcaaewdaomdj\"],\"status\":\"Available\",\"reason\":\"x\"}],\"fastProvisioningSupported\":\"Enabled\",\"supportedFastProvisioningEditions\":[{\"supportedTier\":\"sgeivsiy\",\"supportedSku\":\"kdncj\",\"supportedStorageGb\":1690186599,\"supportedServerVersions\":\"bzo\",\"serverCount\":1760548701,\"status\":\"Available\",\"reason\":\"p\"},{\"supportedTier\":\"y\",\"supportedSku\":\"gogtqxepnylbf\",\"supportedStorageGb\":347721012,\"supportedServerVersions\":\"yjt\",\"serverCount\":279762954,\"status\":\"Visible\",\"reason\":\"hvfcibyfmow\"},{\"supportedTier\":\"rkjpvdwxfzwii\",\"supportedSku\":\"zjb\",\"supportedStorageGb\":1608749608,\"supportedServerVersions\":\"xjrk\",\"serverCount\":2109306549,\"status\":\"Available\",\"reason\":\"egv\"},{\"supportedTier\":\"vuqeqvldspast\",\"supportedSku\":\"kkdmfl\",\"supportedStorageGb\":922777,\"supportedServerVersions\":\"mjlxrrilozapeewc\",\"serverCount\":159855339,\"status\":\"Default\",\"reason\":\"wk\"}],\"geoBackupSupported\":\"Disabled\",\"zoneRedundantHaSupported\":\"Disabled\",\"zoneRedundantHaAndGeoBackupSupported\":\"Disabled\",\"storageAutoGrowthSupported\":\"Enabled\",\"onlineResizeSupported\":\"Enabled\",\"restricted\":\"Enabled\",\"status\":\"Available\",\"reason\":\"tyh\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - 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("pzlrphw", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("oldweyuqdu", response.iterator().next().name()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/LogFileInnerTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/LogFileInnerTests.java deleted file mode 100644 index fdca96006c746..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/LogFileInnerTests.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.fluent.models.LogFileInner; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; - -public final class LogFileInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - LogFileInner model = BinaryData.fromString( - "{\"properties\":{\"createdTime\":\"2021-04-03T12:46:32Z\",\"lastModifiedTime\":\"2021-12-09T11:25:56Z\",\"sizeInKb\":3934291710122169990,\"type\":\"ubxcbihw\",\"url\":\"nfdn\"},\"id\":\"jchrdgoihxumw\",\"name\":\"ton\",\"type\":\"zj\"}") - .toObject(LogFileInner.class); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-03T12:46:32Z"), model.createdTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-12-09T11:25:56Z"), model.lastModifiedTime()); - Assertions.assertEquals(3934291710122169990L, model.sizeInKb()); - Assertions.assertEquals("ubxcbihw", model.typePropertiesType()); - Assertions.assertEquals("nfdn", model.url()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - LogFileInner model = new LogFileInner().withCreatedTime(OffsetDateTime.parse("2021-04-03T12:46:32Z")) - .withLastModifiedTime(OffsetDateTime.parse("2021-12-09T11:25:56Z")) - .withSizeInKb(3934291710122169990L) - .withTypePropertiesType("ubxcbihw") - .withUrl("nfdn"); - model = BinaryData.fromObject(model).toObject(LogFileInner.class); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-03T12:46:32Z"), model.createdTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-12-09T11:25:56Z"), model.lastModifiedTime()); - Assertions.assertEquals(3934291710122169990L, model.sizeInKb()); - Assertions.assertEquals("ubxcbihw", model.typePropertiesType()); - Assertions.assertEquals("nfdn", model.url()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/LogFileListResultTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/LogFileListResultTests.java deleted file mode 100644 index 1fbfa93073a9b..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/LogFileListResultTests.java +++ /dev/null @@ -1,50 +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.LogFileInner; -import com.azure.resourcemanager.postgresqlflexibleserver.models.LogFileListResult; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class LogFileListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - LogFileListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"createdTime\":\"2021-10-31T02:18:42Z\",\"lastModifiedTime\":\"2021-04-04T17:22:28Z\",\"sizeInKb\":7989893119356760730,\"type\":\"m\",\"url\":\"d\"},\"id\":\"mmji\",\"name\":\"yeozphvwauyqncy\",\"type\":\"upkvipmdsc\"},{\"properties\":{\"createdTime\":\"2021-09-24T17:39:42Z\",\"lastModifiedTime\":\"2021-06-13T19:10:51Z\",\"sizeInKb\":7138744715268482510,\"type\":\"stotxh\",\"url\":\"ujbypelmcuvhixb\"},\"id\":\"yfwnylr\",\"name\":\"ool\",\"type\":\"ttpkiwkkbnujrywv\"}],\"nextLink\":\"lbfpncurd\"}") - .toObject(LogFileListResult.class); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-31T02:18:42Z"), model.value().get(0).createdTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-04T17:22:28Z"), model.value().get(0).lastModifiedTime()); - Assertions.assertEquals(7989893119356760730L, model.value().get(0).sizeInKb()); - Assertions.assertEquals("m", model.value().get(0).typePropertiesType()); - Assertions.assertEquals("d", model.value().get(0).url()); - Assertions.assertEquals("lbfpncurd", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - LogFileListResult model = new LogFileListResult().withValue(Arrays.asList( - new LogFileInner().withCreatedTime(OffsetDateTime.parse("2021-10-31T02:18:42Z")) - .withLastModifiedTime(OffsetDateTime.parse("2021-04-04T17:22:28Z")) - .withSizeInKb(7989893119356760730L) - .withTypePropertiesType("m") - .withUrl("d"), - new LogFileInner().withCreatedTime(OffsetDateTime.parse("2021-09-24T17:39:42Z")) - .withLastModifiedTime(OffsetDateTime.parse("2021-06-13T19:10:51Z")) - .withSizeInKb(7138744715268482510L) - .withTypePropertiesType("stotxh") - .withUrl("ujbypelmcuvhixb"))) - .withNextLink("lbfpncurd"); - model = BinaryData.fromObject(model).toObject(LogFileListResult.class); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-31T02:18:42Z"), model.value().get(0).createdTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-04T17:22:28Z"), model.value().get(0).lastModifiedTime()); - Assertions.assertEquals(7989893119356760730L, model.value().get(0).sizeInKb()); - Assertions.assertEquals("m", model.value().get(0).typePropertiesType()); - Assertions.assertEquals("d", model.value().get(0).url()); - Assertions.assertEquals("lbfpncurd", model.nextLink()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/LogFilePropertiesTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/LogFilePropertiesTests.java deleted file mode 100644 index e77535f94fc26..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/LogFilePropertiesTests.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.fluent.models.LogFileProperties; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; - -public final class LogFilePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - LogFileProperties model = BinaryData.fromString( - "{\"createdTime\":\"2021-04-03T13:31:04Z\",\"lastModifiedTime\":\"2021-10-05T06:38:19Z\",\"sizeInKb\":2404210463735215567,\"type\":\"gytsbwtovv\",\"url\":\"seinqfiuf\"}") - .toObject(LogFileProperties.class); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-03T13:31:04Z"), model.createdTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-05T06:38:19Z"), model.lastModifiedTime()); - Assertions.assertEquals(2404210463735215567L, model.sizeInKb()); - Assertions.assertEquals("gytsbwtovv", model.type()); - Assertions.assertEquals("seinqfiuf", model.url()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - LogFileProperties model = new LogFileProperties().withCreatedTime(OffsetDateTime.parse("2021-04-03T13:31:04Z")) - .withLastModifiedTime(OffsetDateTime.parse("2021-10-05T06:38:19Z")) - .withSizeInKb(2404210463735215567L) - .withType("gytsbwtovv") - .withUrl("seinqfiuf"); - model = BinaryData.fromObject(model).toObject(LogFileProperties.class); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-03T13:31:04Z"), model.createdTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-05T06:38:19Z"), model.lastModifiedTime()); - Assertions.assertEquals(2404210463735215567L, model.sizeInKb()); - Assertions.assertEquals("gytsbwtovv", model.type()); - Assertions.assertEquals("seinqfiuf", model.url()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/LogFilesListByServerMockTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/LogFilesListByServerMockTests.java deleted file mode 100644 index 3b865c9dd4b27..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/LogFilesListByServerMockTests.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager; -import com.azure.resourcemanager.postgresqlflexibleserver.models.LogFile; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class LogFilesListByServerMockTests { - @Test - public void testListByServer() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"createdTime\":\"2021-10-10T10:22:02Z\",\"lastModifiedTime\":\"2021-11-03T03:19:16Z\",\"sizeInKb\":3437193079645331762,\"type\":\"zizvuxmmk\",\"url\":\"vthn\"},\"id\":\"zt\",\"name\":\"kovmribiatt\",\"type\":\"plucfotangcfhnyk\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - 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.logFiles().listByServer("fr", "xousxauzl", com.azure.core.util.Context.NONE); - - Assertions.assertEquals(OffsetDateTime.parse("2021-10-10T10:22:02Z"), response.iterator().next().createdTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-03T03:19:16Z"), - response.iterator().next().lastModifiedTime()); - Assertions.assertEquals(3437193079645331762L, response.iterator().next().sizeInKb()); - Assertions.assertEquals("zizvuxmmk", response.iterator().next().typePropertiesType()); - Assertions.assertEquals("vthn", response.iterator().next().url()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/LtrBackupRequestTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/LtrBackupRequestTests.java deleted file mode 100644 index 9a31b7680679c..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/LtrBackupRequestTests.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.BackupSettings; -import com.azure.resourcemanager.postgresqlflexibleserver.models.BackupStoreDetails; -import com.azure.resourcemanager.postgresqlflexibleserver.models.LtrBackupRequest; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class LtrBackupRequestTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - LtrBackupRequest model = BinaryData - .fromString( - "{\"targetDetails\":{\"sasUriList\":[\"pt\",\"d\"]},\"backupSettings\":{\"backupName\":\"gpfqbuace\"}}") - .toObject(LtrBackupRequest.class); - Assertions.assertEquals("gpfqbuace", model.backupSettings().backupName()); - Assertions.assertEquals("pt", model.targetDetails().sasUriList().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - LtrBackupRequest model - = new LtrBackupRequest().withBackupSettings(new BackupSettings().withBackupName("gpfqbuace")) - .withTargetDetails(new BackupStoreDetails().withSasUriList(Arrays.asList("pt", "d"))); - model = BinaryData.fromObject(model).toObject(LtrBackupRequest.class); - Assertions.assertEquals("gpfqbuace", model.backupSettings().backupName()); - Assertions.assertEquals("pt", model.targetDetails().sasUriList().get(0)); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/LtrPreBackupRequestTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/LtrPreBackupRequestTests.java deleted file mode 100644 index b20248569b241..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/LtrPreBackupRequestTests.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.BackupSettings; -import com.azure.resourcemanager.postgresqlflexibleserver.models.LtrPreBackupRequest; -import org.junit.jupiter.api.Assertions; - -public final class LtrPreBackupRequestTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - LtrPreBackupRequest model = BinaryData.fromString("{\"backupSettings\":{\"backupName\":\"ncw\"}}") - .toObject(LtrPreBackupRequest.class); - Assertions.assertEquals("ncw", model.backupSettings().backupName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - LtrPreBackupRequest model - = new LtrPreBackupRequest().withBackupSettings(new BackupSettings().withBackupName("ncw")); - model = BinaryData.fromObject(model).toObject(LtrPreBackupRequest.class); - Assertions.assertEquals("ncw", model.backupSettings().backupName()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/LtrPreBackupResponseInnerTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/LtrPreBackupResponseInnerTests.java deleted file mode 100644 index 87869d984f9e4..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/LtrPreBackupResponseInnerTests.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.LtrPreBackupResponseInner; -import org.junit.jupiter.api.Assertions; - -public final class LtrPreBackupResponseInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - LtrPreBackupResponseInner model = BinaryData.fromString("{\"properties\":{\"numberOfContainers\":1950925712}}") - .toObject(LtrPreBackupResponseInner.class); - Assertions.assertEquals(1950925712, model.numberOfContainers()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - LtrPreBackupResponseInner model = new LtrPreBackupResponseInner().withNumberOfContainers(1950925712); - model = BinaryData.fromObject(model).toObject(LtrPreBackupResponseInner.class); - Assertions.assertEquals(1950925712, model.numberOfContainers()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/LtrPreBackupResponsePropertiesTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/LtrPreBackupResponsePropertiesTests.java deleted file mode 100644 index a9b028c867b47..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/LtrPreBackupResponsePropertiesTests.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.LtrPreBackupResponseProperties; -import org.junit.jupiter.api.Assertions; - -public final class LtrPreBackupResponsePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - LtrPreBackupResponseProperties model = BinaryData.fromString("{\"numberOfContainers\":1761160515}") - .toObject(LtrPreBackupResponseProperties.class); - Assertions.assertEquals(1761160515, model.numberOfContainers()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - LtrPreBackupResponseProperties model = new LtrPreBackupResponseProperties().withNumberOfContainers(1761160515); - model = BinaryData.fromObject(model).toObject(LtrPreBackupResponseProperties.class); - Assertions.assertEquals(1761160515, model.numberOfContainers()); - } -} 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 acc204f694be3..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/MaintenanceWindowTests.java +++ /dev/null @@ -1,35 +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\":\"fvovbvmeuecivy\",\"startHour\":343837467,\"startMinute\":1240635196,\"dayOfWeek\":1339093969}") - .toObject(MaintenanceWindow.class); - Assertions.assertEquals("fvovbvmeuecivy", model.customWindow()); - Assertions.assertEquals(343837467, model.startHour()); - Assertions.assertEquals(1240635196, model.startMinute()); - Assertions.assertEquals(1339093969, model.dayOfWeek()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MaintenanceWindow model = new MaintenanceWindow().withCustomWindow("fvovbvmeuecivy") - .withStartHour(343837467) - .withStartMinute(1240635196) - .withDayOfWeek(1339093969); - model = BinaryData.fromObject(model).toObject(MaintenanceWindow.class); - Assertions.assertEquals("fvovbvmeuecivy", model.customWindow()); - Assertions.assertEquals(343837467, model.startHour()); - Assertions.assertEquals(1240635196, model.startMinute()); - Assertions.assertEquals(1339093969, model.dayOfWeek()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/MigrationNameAvailabilityResourceInnerTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/MigrationNameAvailabilityResourceInnerTests.java deleted file mode 100644 index 582bf663e7172..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/MigrationNameAvailabilityResourceInnerTests.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.MigrationNameAvailabilityResourceInner; -import org.junit.jupiter.api.Assertions; - -public final class MigrationNameAvailabilityResourceInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MigrationNameAvailabilityResourceInner model = BinaryData.fromString( - "{\"name\":\"i\",\"type\":\"ybxarzgszu\",\"nameAvailable\":false,\"reason\":\"AlreadyExists\",\"message\":\"opidoamciodh\"}") - .toObject(MigrationNameAvailabilityResourceInner.class); - Assertions.assertEquals("i", model.name()); - Assertions.assertEquals("ybxarzgszu", model.type()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MigrationNameAvailabilityResourceInner model - = new MigrationNameAvailabilityResourceInner().withName("i").withType("ybxarzgszu"); - model = BinaryData.fromObject(model).toObject(MigrationNameAvailabilityResourceInner.class); - Assertions.assertEquals("i", model.name()); - Assertions.assertEquals("ybxarzgszu", model.type()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/MigrationStatusTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/MigrationStatusTests.java deleted file mode 100644 index 6fe3aaa10057f..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/MigrationStatusTests.java +++ /dev/null @@ -1,23 +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.MigrationStatus; - -public final class MigrationStatusTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MigrationStatus model = BinaryData.fromString( - "{\"state\":\"ValidationFailed\",\"error\":\"cnqxwbpokulpi\",\"currentSubStateDetails\":{\"currentSubState\":\"PerformingPreRequisiteSteps\",\"dbDetails\":{\"kpw\":{\"databaseName\":\"pqiiobyuqe\",\"migrationState\":\"Canceled\",\"migrationOperation\":\"pqwcciuqgbdbutau\",\"startedOn\":\"2021-03-08T12:51:31Z\",\"endedOn\":\"2021-09-10T07:31:19Z\",\"fullLoadQueuedTables\":468710648,\"fullLoadErroredTables\":101712535,\"fullLoadLoadingTables\":1986574356,\"fullLoadCompletedTables\":85815752,\"cdcUpdateCounter\":697722485,\"cdcDeleteCounter\":1295718584,\"cdcInsertCounter\":1219836437,\"appliedChanges\":351936442,\"incomingChanges\":1456966010,\"latency\":1324529031,\"message\":\"hkoymkcdyhbp\"},\"e\":{\"databaseName\":\"eqnovvqfovl\",\"migrationState\":\"Canceled\",\"migrationOperation\":\"suwsyrsnds\",\"startedOn\":\"2021-07-30T00:54:27Z\",\"endedOn\":\"2021-01-20T22:42:12Z\",\"fullLoadQueuedTables\":181693605,\"fullLoadErroredTables\":1114834303,\"fullLoadLoadingTables\":890415173,\"fullLoadCompletedTables\":884783389,\"cdcUpdateCounter\":2046621104,\"cdcDeleteCounter\":596140767,\"cdcInsertCounter\":1726613749,\"appliedChanges\":1182920658,\"incomingChanges\":262159322,\"latency\":1397845425,\"message\":\"jfqka\"}},\"validationDetails\":{\"status\":\"Succeeded\",\"validationStartTimeInUtc\":\"2021-08-24T20:21:29Z\",\"validationEndTimeInUtc\":\"2021-01-21T02:19:24Z\",\"serverLevelValidationDetails\":[{\"type\":\"wwiftohqkvpuv\",\"state\":\"Succeeded\",\"messages\":[{}]},{\"type\":\"aknynfsynljphuop\",\"state\":\"Warning\",\"messages\":[{}]},{\"type\":\"ynt\",\"state\":\"Succeeded\",\"messages\":[{},{}]}],\"dbLevelValidationDetails\":[{\"databaseName\":\"sjswsrms\",\"startedOn\":\"2021-07-10T12:22Z\",\"endedOn\":\"2021-03-30T08:07:03Z\",\"summary\":[{},{},{}]},{\"databaseName\":\"hckqqzqioxiy\",\"startedOn\":\"2021-10-31T06:14:16Z\",\"endedOn\":\"2021-10-09T00:37:48Z\",\"summary\":[{},{},{},{}]}]}}}") - .toObject(MigrationStatus.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MigrationStatus model = new MigrationStatus(); - model = BinaryData.fromObject(model).toObject(MigrationStatus.class); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/MigrationSubStateDetailsTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/MigrationSubStateDetailsTests.java deleted file mode 100644 index abdeb05c18992..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/MigrationSubStateDetailsTests.java +++ /dev/null @@ -1,189 +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.DbLevelValidationStatus; -import com.azure.resourcemanager.postgresqlflexibleserver.models.DbMigrationStatus; -import com.azure.resourcemanager.postgresqlflexibleserver.models.MigrationDbState; -import com.azure.resourcemanager.postgresqlflexibleserver.models.MigrationSubStateDetails; -import com.azure.resourcemanager.postgresqlflexibleserver.models.ValidationDetails; -import com.azure.resourcemanager.postgresqlflexibleserver.models.ValidationMessage; -import com.azure.resourcemanager.postgresqlflexibleserver.models.ValidationState; -import com.azure.resourcemanager.postgresqlflexibleserver.models.ValidationSummaryItem; -import java.time.OffsetDateTime; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class MigrationSubStateDetailsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MigrationSubStateDetails model = BinaryData.fromString( - "{\"currentSubState\":\"PerformingPreRequisiteSteps\",\"dbDetails\":{\"lkdmtncvokotllxd\":{\"databaseName\":\"trwyhqmib\",\"migrationState\":\"InProgress\",\"migrationOperation\":\"itsmypyyn\",\"startedOn\":\"2020-12-28T22:53:56Z\",\"endedOn\":\"2021-11-03T04:02:51Z\",\"fullLoadQueuedTables\":874382237,\"fullLoadErroredTables\":66905695,\"fullLoadLoadingTables\":944462660,\"fullLoadCompletedTables\":1547081847,\"cdcUpdateCounter\":1417683929,\"cdcDeleteCounter\":130212191,\"cdcInsertCounter\":1046581273,\"appliedChanges\":438726197,\"incomingChanges\":284256630,\"latency\":1287311603,\"message\":\"bldtlww\"},\"ipicc\":{\"databaseName\":\"gsyocogj\",\"migrationState\":\"Canceled\",\"migrationOperation\":\"bnnhadoocrkvcik\",\"startedOn\":\"2021-09-16T23:17:11Z\",\"endedOn\":\"2021-10-11T09:13:27Z\",\"fullLoadQueuedTables\":924007604,\"fullLoadErroredTables\":210666313,\"fullLoadLoadingTables\":1810691305,\"fullLoadCompletedTables\":1026255480,\"cdcUpdateCounter\":443622503,\"cdcDeleteCounter\":1292561525,\"cdcInsertCounter\":2021225461,\"appliedChanges\":1344310513,\"incomingChanges\":1558005484,\"latency\":395512854,\"message\":\"tmelw\"}},\"validationDetails\":{\"status\":\"Warning\",\"validationStartTimeInUtc\":\"2021-06-18T18:11Z\",\"validationEndTimeInUtc\":\"2021-12-08T15:57:22Z\",\"serverLevelValidationDetails\":[{\"type\":\"ayrhyrnx\",\"state\":\"Succeeded\",\"messages\":[{\"state\":\"Warning\",\"message\":\"rdvstkwqqtch\"},{\"state\":\"Warning\",\"message\":\"fmtdaaygdvwvgp\"}]}],\"dbLevelValidationDetails\":[{\"databaseName\":\"wxrt\",\"startedOn\":\"2021-04-12T14:57:26Z\",\"endedOn\":\"2021-10-02T23:21:47Z\",\"summary\":[{\"type\":\"yqagvrvm\",\"state\":\"Succeeded\",\"messages\":[{},{},{},{}]}]},{\"databaseName\":\"himdbl\",\"startedOn\":\"2021-03-06T12:44:58Z\",\"endedOn\":\"2021-12-09T15:02:58Z\",\"summary\":[{\"type\":\"hfjx\",\"state\":\"Succeeded\",\"messages\":[{},{}]}]},{\"databaseName\":\"foqreyfkzik\",\"startedOn\":\"2021-01-25T00:08:01Z\",\"endedOn\":\"2021-02-22T10:12:12Z\",\"summary\":[{\"type\":\"vxwc\",\"state\":\"Warning\",\"messages\":[{}]}]}]}}") - .toObject(MigrationSubStateDetails.class); - Assertions.assertEquals("trwyhqmib", model.dbDetails().get("lkdmtncvokotllxd").databaseName()); - Assertions.assertEquals(MigrationDbState.IN_PROGRESS, - model.dbDetails().get("lkdmtncvokotllxd").migrationState()); - Assertions.assertEquals("itsmypyyn", model.dbDetails().get("lkdmtncvokotllxd").migrationOperation()); - Assertions.assertEquals(OffsetDateTime.parse("2020-12-28T22:53:56Z"), - model.dbDetails().get("lkdmtncvokotllxd").startedOn()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-03T04:02:51Z"), - model.dbDetails().get("lkdmtncvokotllxd").endedOn()); - Assertions.assertEquals(874382237, model.dbDetails().get("lkdmtncvokotllxd").fullLoadQueuedTables()); - Assertions.assertEquals(66905695, model.dbDetails().get("lkdmtncvokotllxd").fullLoadErroredTables()); - Assertions.assertEquals(944462660, model.dbDetails().get("lkdmtncvokotllxd").fullLoadLoadingTables()); - Assertions.assertEquals(1547081847, model.dbDetails().get("lkdmtncvokotllxd").fullLoadCompletedTables()); - Assertions.assertEquals(1417683929, model.dbDetails().get("lkdmtncvokotllxd").cdcUpdateCounter()); - Assertions.assertEquals(130212191, model.dbDetails().get("lkdmtncvokotllxd").cdcDeleteCounter()); - Assertions.assertEquals(1046581273, model.dbDetails().get("lkdmtncvokotllxd").cdcInsertCounter()); - Assertions.assertEquals(438726197, model.dbDetails().get("lkdmtncvokotllxd").appliedChanges()); - Assertions.assertEquals(284256630, model.dbDetails().get("lkdmtncvokotllxd").incomingChanges()); - Assertions.assertEquals(1287311603, model.dbDetails().get("lkdmtncvokotllxd").latency()); - Assertions.assertEquals("bldtlww", model.dbDetails().get("lkdmtncvokotllxd").message()); - Assertions.assertEquals(ValidationState.WARNING, model.validationDetails().status()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-18T18:11Z"), - model.validationDetails().validationStartTimeInUtc()); - Assertions.assertEquals(OffsetDateTime.parse("2021-12-08T15:57:22Z"), - model.validationDetails().validationEndTimeInUtc()); - Assertions.assertEquals("ayrhyrnx", model.validationDetails().serverLevelValidationDetails().get(0).type()); - Assertions.assertEquals(ValidationState.SUCCEEDED, - model.validationDetails().serverLevelValidationDetails().get(0).state()); - Assertions.assertEquals(ValidationState.WARNING, - model.validationDetails().serverLevelValidationDetails().get(0).messages().get(0).state()); - Assertions.assertEquals("rdvstkwqqtch", - model.validationDetails().serverLevelValidationDetails().get(0).messages().get(0).message()); - Assertions.assertEquals("wxrt", model.validationDetails().dbLevelValidationDetails().get(0).databaseName()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-12T14:57:26Z"), - model.validationDetails().dbLevelValidationDetails().get(0).startedOn()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-02T23:21:47Z"), - model.validationDetails().dbLevelValidationDetails().get(0).endedOn()); - Assertions.assertEquals("yqagvrvm", - model.validationDetails().dbLevelValidationDetails().get(0).summary().get(0).type()); - Assertions.assertEquals(ValidationState.SUCCEEDED, - model.validationDetails().dbLevelValidationDetails().get(0).summary().get(0).state()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MigrationSubStateDetails model = new MigrationSubStateDetails() - .withDbDetails(mapOf("lkdmtncvokotllxd", - new DbMigrationStatus().withDatabaseName("trwyhqmib") - .withMigrationState(MigrationDbState.IN_PROGRESS) - .withMigrationOperation("itsmypyyn") - .withStartedOn(OffsetDateTime.parse("2020-12-28T22:53:56Z")) - .withEndedOn(OffsetDateTime.parse("2021-11-03T04:02:51Z")) - .withFullLoadQueuedTables(874382237) - .withFullLoadErroredTables(66905695) - .withFullLoadLoadingTables(944462660) - .withFullLoadCompletedTables(1547081847) - .withCdcUpdateCounter(1417683929) - .withCdcDeleteCounter(130212191) - .withCdcInsertCounter(1046581273) - .withAppliedChanges(438726197) - .withIncomingChanges(284256630) - .withLatency(1287311603) - .withMessage("bldtlww"), - "ipicc", - new DbMigrationStatus().withDatabaseName("gsyocogj") - .withMigrationState(MigrationDbState.CANCELED) - .withMigrationOperation("bnnhadoocrkvcik") - .withStartedOn(OffsetDateTime.parse("2021-09-16T23:17:11Z")) - .withEndedOn(OffsetDateTime.parse("2021-10-11T09:13:27Z")) - .withFullLoadQueuedTables(924007604) - .withFullLoadErroredTables(210666313) - .withFullLoadLoadingTables(1810691305) - .withFullLoadCompletedTables(1026255480) - .withCdcUpdateCounter(443622503) - .withCdcDeleteCounter(1292561525) - .withCdcInsertCounter(2021225461) - .withAppliedChanges(1344310513) - .withIncomingChanges(1558005484) - .withLatency(395512854) - .withMessage("tmelw"))) - .withValidationDetails(new ValidationDetails().withStatus(ValidationState.WARNING) - .withValidationStartTimeInUtc(OffsetDateTime.parse("2021-06-18T18:11Z")) - .withValidationEndTimeInUtc(OffsetDateTime.parse("2021-12-08T15:57:22Z")) - .withServerLevelValidationDetails(Arrays.asList(new ValidationSummaryItem().withType("ayrhyrnx") - .withState(ValidationState.SUCCEEDED) - .withMessages(Arrays.asList( - new ValidationMessage().withState(ValidationState.WARNING).withMessage("rdvstkwqqtch"), - new ValidationMessage().withState(ValidationState.WARNING).withMessage("fmtdaaygdvwvgp"))))) - .withDbLevelValidationDetails(Arrays.asList( - new DbLevelValidationStatus().withDatabaseName("wxrt") - .withStartedOn(OffsetDateTime.parse("2021-04-12T14:57:26Z")) - .withEndedOn(OffsetDateTime.parse("2021-10-02T23:21:47Z")) - .withSummary(Arrays.asList(new ValidationSummaryItem().withType("yqagvrvm") - .withState(ValidationState.SUCCEEDED) - .withMessages(Arrays.asList(new ValidationMessage(), new ValidationMessage(), - new ValidationMessage(), new ValidationMessage())))), - new DbLevelValidationStatus().withDatabaseName("himdbl") - .withStartedOn(OffsetDateTime.parse("2021-03-06T12:44:58Z")) - .withEndedOn(OffsetDateTime.parse("2021-12-09T15:02:58Z")) - .withSummary(Arrays.asList(new ValidationSummaryItem().withType("hfjx") - .withState(ValidationState.SUCCEEDED) - .withMessages(Arrays.asList(new ValidationMessage(), new ValidationMessage())))), - new DbLevelValidationStatus().withDatabaseName("foqreyfkzik") - .withStartedOn(OffsetDateTime.parse("2021-01-25T00:08:01Z")) - .withEndedOn(OffsetDateTime.parse("2021-02-22T10:12:12Z")) - .withSummary(Arrays.asList(new ValidationSummaryItem().withType("vxwc") - .withState(ValidationState.WARNING) - .withMessages(Arrays.asList(new ValidationMessage()))))))); - model = BinaryData.fromObject(model).toObject(MigrationSubStateDetails.class); - Assertions.assertEquals("trwyhqmib", model.dbDetails().get("lkdmtncvokotllxd").databaseName()); - Assertions.assertEquals(MigrationDbState.IN_PROGRESS, - model.dbDetails().get("lkdmtncvokotllxd").migrationState()); - Assertions.assertEquals("itsmypyyn", model.dbDetails().get("lkdmtncvokotllxd").migrationOperation()); - Assertions.assertEquals(OffsetDateTime.parse("2020-12-28T22:53:56Z"), - model.dbDetails().get("lkdmtncvokotllxd").startedOn()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-03T04:02:51Z"), - model.dbDetails().get("lkdmtncvokotllxd").endedOn()); - Assertions.assertEquals(874382237, model.dbDetails().get("lkdmtncvokotllxd").fullLoadQueuedTables()); - Assertions.assertEquals(66905695, model.dbDetails().get("lkdmtncvokotllxd").fullLoadErroredTables()); - Assertions.assertEquals(944462660, model.dbDetails().get("lkdmtncvokotllxd").fullLoadLoadingTables()); - Assertions.assertEquals(1547081847, model.dbDetails().get("lkdmtncvokotllxd").fullLoadCompletedTables()); - Assertions.assertEquals(1417683929, model.dbDetails().get("lkdmtncvokotllxd").cdcUpdateCounter()); - Assertions.assertEquals(130212191, model.dbDetails().get("lkdmtncvokotllxd").cdcDeleteCounter()); - Assertions.assertEquals(1046581273, model.dbDetails().get("lkdmtncvokotllxd").cdcInsertCounter()); - Assertions.assertEquals(438726197, model.dbDetails().get("lkdmtncvokotllxd").appliedChanges()); - Assertions.assertEquals(284256630, model.dbDetails().get("lkdmtncvokotllxd").incomingChanges()); - Assertions.assertEquals(1287311603, model.dbDetails().get("lkdmtncvokotllxd").latency()); - Assertions.assertEquals("bldtlww", model.dbDetails().get("lkdmtncvokotllxd").message()); - Assertions.assertEquals(ValidationState.WARNING, model.validationDetails().status()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-18T18:11Z"), - model.validationDetails().validationStartTimeInUtc()); - Assertions.assertEquals(OffsetDateTime.parse("2021-12-08T15:57:22Z"), - model.validationDetails().validationEndTimeInUtc()); - Assertions.assertEquals("ayrhyrnx", model.validationDetails().serverLevelValidationDetails().get(0).type()); - Assertions.assertEquals(ValidationState.SUCCEEDED, - model.validationDetails().serverLevelValidationDetails().get(0).state()); - Assertions.assertEquals(ValidationState.WARNING, - model.validationDetails().serverLevelValidationDetails().get(0).messages().get(0).state()); - Assertions.assertEquals("rdvstkwqqtch", - model.validationDetails().serverLevelValidationDetails().get(0).messages().get(0).message()); - Assertions.assertEquals("wxrt", model.validationDetails().dbLevelValidationDetails().get(0).databaseName()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-12T14:57:26Z"), - model.validationDetails().dbLevelValidationDetails().get(0).startedOn()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-02T23:21:47Z"), - model.validationDetails().dbLevelValidationDetails().get(0).endedOn()); - Assertions.assertEquals("yqagvrvm", - model.validationDetails().dbLevelValidationDetails().get(0).summary().get(0).type()); - Assertions.assertEquals(ValidationState.SUCCEEDED, - model.validationDetails().dbLevelValidationDetails().get(0).summary().get(0).state()); - } - - // 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/MigrationsDeleteWithResponseMockTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/MigrationsDeleteWithResponseMockTests.java deleted file mode 100644 index bbe04f2ef1871..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/MigrationsDeleteWithResponseMockTests.java +++ /dev/null @@ -1,33 +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.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class MigrationsDeleteWithResponseMockTests { - @Test - public void testDeleteWithResponse() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - PostgreSqlManager manager = PostgreSqlManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.migrations().deleteWithResponse("czurtlei", "q", "bkwvzg", "zvd", com.azure.core.util.Context.NONE); - - } -} 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 c0bf3657768a3..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/NameAvailabilityInnerTests.java +++ /dev/null @@ -1,33 +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\":\"fhyhltrpmopjmcma\",\"type\":\"okth\",\"nameAvailable\":false,\"reason\":\"AlreadyExists\",\"message\":\"dsfcpkvxodpuoz\"}") - .toObject(NameAvailabilityInner.class); - Assertions.assertEquals(false, model.nameAvailable()); - Assertions.assertEquals(CheckNameAvailabilityReason.ALREADY_EXISTS, model.reason()); - Assertions.assertEquals("dsfcpkvxodpuoz", model.message()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NameAvailabilityInner model = new NameAvailabilityInner().withNameAvailable(false) - .withReason(CheckNameAvailabilityReason.ALREADY_EXISTS) - .withMessage("dsfcpkvxodpuoz"); - model = BinaryData.fromObject(model).toObject(NameAvailabilityInner.class); - Assertions.assertEquals(false, model.nameAvailable()); - Assertions.assertEquals(CheckNameAvailabilityReason.ALREADY_EXISTS, model.reason()); - Assertions.assertEquals("dsfcpkvxodpuoz", 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 de85923fa9a14..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/NetworkTests.java +++ /dev/null @@ -1,33 +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 com.azure.resourcemanager.postgresqlflexibleserver.models.ServerPublicNetworkAccessState; -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\":\"Disabled\",\"delegatedSubnetResourceId\":\"akauha\",\"privateDnsZoneArmResourceId\":\"sfwxosowzxc\"}") - .toObject(Network.class); - Assertions.assertEquals(ServerPublicNetworkAccessState.DISABLED, model.publicNetworkAccess()); - Assertions.assertEquals("akauha", model.delegatedSubnetResourceId()); - Assertions.assertEquals("sfwxosowzxc", model.privateDnsZoneArmResourceId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Network model = new Network().withPublicNetworkAccess(ServerPublicNetworkAccessState.DISABLED) - .withDelegatedSubnetResourceId("akauha") - .withPrivateDnsZoneArmResourceId("sfwxosowzxc"); - model = BinaryData.fromObject(model).toObject(Network.class); - Assertions.assertEquals(ServerPublicNetworkAccessState.DISABLED, model.publicNetworkAccess()); - Assertions.assertEquals("akauha", model.delegatedSubnetResourceId()); - Assertions.assertEquals("sfwxosowzxc", model.privateDnsZoneArmResourceId()); - } -} 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 5500bd85ae563..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/OperationDisplayTests.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.OperationDisplay; - -public final class OperationDisplayTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationDisplay model = BinaryData - .fromString( - "{\"provider\":\"r\",\"resource\":\"ldgmfpgvmpip\",\"operation\":\"ltha\",\"description\":\"x\"}") - .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 13826a277c84f..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/OperationListResultInnerTests.java +++ /dev/null @@ -1,33 +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\":\"xkhnzbonlwnto\",\"display\":{\"provider\":\"kdwbwhkszz\",\"resource\":\"rvexztvb\",\"operation\":\"gsfraoyzkoow\",\"description\":\"mnguxawqaldsyu\"},\"isDataAction\":true,\"origin\":\"user\",\"properties\":{\"nkbykutwpfhp\":\"datafobwy\",\"tdlmkkzevd\":\"datagmhrskdsnfdsdoak\"}},{\"name\":\"ewpusdsttwvogvb\",\"display\":{\"provider\":\"dcngqqmoakufgmj\",\"resource\":\"wr\",\"operation\":\"rtwaenuuzko\",\"description\":\"minrfdw\"},\"isDataAction\":true,\"origin\":\"user\",\"properties\":{\"efozbhdms\":\"datau\",\"zqhof\":\"datal\",\"ah\":\"datarmaequ\",\"piyylhalnswhccsp\":\"dataicslfaoq\"}},{\"name\":\"aivwitqscywu\",\"display\":{\"provider\":\"oluhczbwemh\",\"resource\":\"rsbrgzdwm\",\"operation\":\"eypqwdxggicccn\",\"description\":\"huexmk\"},\"isDataAction\":true,\"origin\":\"NotSpecified\",\"properties\":{\"iypbsfgytgusl\":\"datazywemhzrncsdtclu\",\"sx\":\"dataeadcygqukyhejhz\",\"lppvksrpq\":\"datafpel\",\"htwdwrftswibyrcd\":\"dataujzra\"}},{\"name\":\"h\",\"display\":{\"provider\":\"wpracstwitykhev\",\"resource\":\"cedcpnmdy\",\"operation\":\"nwzxltjcv\",\"description\":\"ltiugcxnavv\"},\"isDataAction\":false,\"origin\":\"NotSpecified\",\"properties\":{\"djrkvfgbvfvpd\":\"dataunyowxwl\",\"q\":\"dataodacizs\",\"ibdeibq\":\"datahkr\",\"kghv\":\"datap\"}}],\"nextLink\":\"dzwmkrefajpj\"}") - .toObject(OperationListResultInner.class); - Assertions.assertEquals(true, model.value().get(0).isDataAction()); - Assertions.assertEquals("dzwmkrefajpj", 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), new Operation().withIsDataAction(false))) - .withNextLink("dzwmkrefajpj"); - model = BinaryData.fromObject(model).toObject(OperationListResultInner.class); - Assertions.assertEquals(true, model.value().get(0).isDataAction()); - Assertions.assertEquals("dzwmkrefajpj", 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 b74a63638716a..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/OperationTests.java +++ /dev/null @@ -1,26 +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\":\"wkqnyhg\",\"display\":{\"provider\":\"tjivfxzsjabib\",\"resource\":\"stawfsdjpvkv\",\"operation\":\"jxbkzbzkdvn\",\"description\":\"abudurgk\"},\"isDataAction\":true,\"origin\":\"system\",\"properties\":{\"mouwqlgzrfzeey\":\"datajjklff\",\"bjbsybb\":\"databizikayuhq\"}}") - .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 0461c49556340..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/OperationsListWithResponseMockTests.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.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager; -import com.azure.resourcemanager.postgresqlflexibleserver.models.OperationListResult; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class OperationsListWithResponseMockTests { - @Test - public void testListWithResponse() throws Exception { - String responseStr - = "{\"value\":[{\"name\":\"e\",\"display\":{\"provider\":\"zqn\",\"resource\":\"vsqltnzoibgsxg\",\"operation\":\"fyq\",\"description\":\"mpqoxw\"},\"isDataAction\":true,\"origin\":\"user\",\"properties\":{\"h\":\"dataqxeiiqbimhtmwwi\",\"bcblemb\":\"datahfqpofv\",\"ihebwtsw\":\"datakbwvqvxkdiv\"}},{\"name\":\"uwfmduragegizvc\",\"display\":{\"provider\":\"lisdjubggbq\",\"resource\":\"kxkbsazgakgacyr\",\"operation\":\"jdmspofapvuhryln\",\"description\":\"frzgbzjed\"},\"isDataAction\":true,\"origin\":\"system\",\"properties\":{\"bcuiiz\":\"datav\"}},{\"name\":\"twfans\",\"display\":{\"provider\":\"dibmikostbzbkiwb\",\"resource\":\"n\",\"operation\":\"phzfylsgcrp\",\"description\":\"cunezzcezelfw\"},\"isDataAction\":false,\"origin\":\"NotSpecified\",\"properties\":{\"afzvaylptrs\":\"datawetnpsihc\",\"cxwaxfewz\":\"dataqwztcmwqkc\",\"ylkkshkbffmbm\":\"datakjexfdeqvhp\"}},{\"name\":\"jrgywwpgjxsn\",\"display\":{\"provider\":\"ujgicgaaoe\",\"resource\":\"taqutdewem\",\"operation\":\"wvruunzzj\",\"description\":\"hkfkimrtixokf\"},\"isDataAction\":false,\"origin\":\"user\",\"properties\":{\"tshi\":\"dataqepqwhixmon\",\"vuwcobiegstmnin\":\"dataxgvelfclduccbird\"}}],\"nextLink\":\"izcil\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - 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("izcil", response.nextLink()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/PrivateEndpointConnectionInnerTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/PrivateEndpointConnectionInnerTests.java deleted file mode 100644 index 3b64a806f5e71..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/PrivateEndpointConnectionInnerTests.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.PrivateEndpointConnectionInner; -import com.azure.resourcemanager.postgresqlflexibleserver.models.PrivateEndpoint; -import com.azure.resourcemanager.postgresqlflexibleserver.models.PrivateEndpointServiceConnectionStatus; -import com.azure.resourcemanager.postgresqlflexibleserver.models.PrivateLinkServiceConnectionState; -import org.junit.jupiter.api.Assertions; - -public final class PrivateEndpointConnectionInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrivateEndpointConnectionInner model = BinaryData.fromString( - "{\"properties\":{\"groupIds\":[\"dytdxwitx\",\"rjaw\"],\"privateEndpoint\":{\"id\":\"gxhnisk\"},\"privateLinkServiceConnectionState\":{\"status\":\"Approved\",\"description\":\"py\",\"actionsRequired\":\"klwndnhjdauwhv\"},\"provisioningState\":\"Creating\"},\"id\":\"btdhxujznbm\",\"name\":\"ow\",\"type\":\"wpr\"}") - .toObject(PrivateEndpointConnectionInner.class); - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.APPROVED, - model.privateLinkServiceConnectionState().status()); - Assertions.assertEquals("py", model.privateLinkServiceConnectionState().description()); - Assertions.assertEquals("klwndnhjdauwhv", model.privateLinkServiceConnectionState().actionsRequired()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateEndpointConnectionInner model - = new PrivateEndpointConnectionInner().withPrivateEndpoint(new PrivateEndpoint()) - .withPrivateLinkServiceConnectionState( - new PrivateLinkServiceConnectionState().withStatus(PrivateEndpointServiceConnectionStatus.APPROVED) - .withDescription("py") - .withActionsRequired("klwndnhjdauwhv")); - model = BinaryData.fromObject(model).toObject(PrivateEndpointConnectionInner.class); - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.APPROVED, - model.privateLinkServiceConnectionState().status()); - Assertions.assertEquals("py", model.privateLinkServiceConnectionState().description()); - Assertions.assertEquals("klwndnhjdauwhv", model.privateLinkServiceConnectionState().actionsRequired()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/PrivateEndpointConnectionListResultTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/PrivateEndpointConnectionListResultTests.java deleted file mode 100644 index 29cdc81cbf552..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/PrivateEndpointConnectionListResultTests.java +++ /dev/null @@ -1,23 +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.PrivateEndpointConnectionListResult; - -public final class PrivateEndpointConnectionListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrivateEndpointConnectionListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"groupIds\":[\"wbdsr\",\"zpdrhneu\",\"owqkdwytisi\",\"ircgpikpz\"],\"privateEndpoint\":{\"id\":\"j\"},\"privateLinkServiceConnectionState\":{\"status\":\"Pending\",\"description\":\"fzxiavrmb\",\"actionsRequired\":\"nokixrjqcirgz\"},\"provisioningState\":\"Deleting\"},\"id\":\"azszrnwoiindfpw\",\"name\":\"jylwbtlhflsj\",\"type\":\"dhszfjv\"},{\"properties\":{\"groupIds\":[\"feljagrqm\"],\"privateEndpoint\":{\"id\":\"dvriiiojnal\"},\"privateLinkServiceConnectionState\":{\"status\":\"Approved\",\"description\":\"vtvsexsowueluq\",\"actionsRequired\":\"ahhxvrh\"},\"provisioningState\":\"Failed\"},\"id\":\"pjgwwspug\",\"name\":\"ftqsxhqxujxuk\",\"type\":\"dxdigr\"},{\"properties\":{\"groupIds\":[\"fzdm\",\"yqtfihwh\"],\"privateEndpoint\":{\"id\":\"z\"},\"privateLinkServiceConnectionState\":{\"status\":\"Pending\",\"description\":\"mvpp\",\"actionsRequired\":\"szqzudphqamv\"},\"provisioningState\":\"Failed\"},\"id\":\"ynwcvtbv\",\"name\":\"ayhmtnvyqiatkz\",\"type\":\"pcnp\"}],\"nextLink\":\"cjaesgvvs\"}") - .toObject(PrivateEndpointConnectionListResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateEndpointConnectionListResult model = new PrivateEndpointConnectionListResult(); - model = BinaryData.fromObject(model).toObject(PrivateEndpointConnectionListResult.class); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/PrivateEndpointConnectionOperationsUpdateMockTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/PrivateEndpointConnectionOperationsUpdateMockTests.java deleted file mode 100644 index 5063482d4e365..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/PrivateEndpointConnectionOperationsUpdateMockTests.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager; -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.PrivateEndpointServiceConnectionStatus; -import com.azure.resourcemanager.postgresqlflexibleserver.models.PrivateLinkServiceConnectionState; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class PrivateEndpointConnectionOperationsUpdateMockTests { - @Test - public void testUpdate() throws Exception { - String responseStr - = "{\"properties\":{\"groupIds\":[\"sn\",\"wfl\",\"qmp\",\"zruwn\"],\"privateEndpoint\":{\"id\":\"pxiwf\"},\"privateLinkServiceConnectionState\":{\"status\":\"Rejected\",\"description\":\"saasiixtmkzj\",\"actionsRequired\":\"viirhgfgrws\"},\"provisioningState\":\"Succeeded\"},\"id\":\"atzv\",\"name\":\"bglbyvict\",\"type\":\"tbrxkjz\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - PostgreSqlManager manager = PostgreSqlManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PrivateEndpointConnection response = manager.privateEndpointConnectionOperations() - .update("nbsoqeqalarv", "agunbtgfebw", "nbmhyree", - new PrivateEndpointConnectionInner().withPrivateEndpoint(new PrivateEndpoint()) - .withPrivateLinkServiceConnectionState(new PrivateLinkServiceConnectionState() - .withStatus(PrivateEndpointServiceConnectionStatus.REJECTED) - .withDescription("jkwrusnkq") - .withActionsRequired("syrq")), - com.azure.core.util.Context.NONE); - - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.REJECTED, - response.privateLinkServiceConnectionState().status()); - Assertions.assertEquals("saasiixtmkzj", response.privateLinkServiceConnectionState().description()); - Assertions.assertEquals("viirhgfgrws", response.privateLinkServiceConnectionState().actionsRequired()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/PrivateEndpointConnectionPropertiesTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/PrivateEndpointConnectionPropertiesTests.java deleted file mode 100644 index b0236c4e523b4..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/PrivateEndpointConnectionPropertiesTests.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.PrivateEndpointConnectionProperties; -import com.azure.resourcemanager.postgresqlflexibleserver.models.PrivateEndpoint; -import com.azure.resourcemanager.postgresqlflexibleserver.models.PrivateEndpointServiceConnectionStatus; -import com.azure.resourcemanager.postgresqlflexibleserver.models.PrivateLinkServiceConnectionState; -import org.junit.jupiter.api.Assertions; - -public final class PrivateEndpointConnectionPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrivateEndpointConnectionProperties model = BinaryData.fromString( - "{\"groupIds\":[\"veual\"],\"privateEndpoint\":{\"id\":\"mkh\"},\"privateLinkServiceConnectionState\":{\"status\":\"Approved\",\"description\":\"bcswsrt\",\"actionsRequired\":\"iplrbpbewtghfgb\"},\"provisioningState\":\"Succeeded\"}") - .toObject(PrivateEndpointConnectionProperties.class); - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.APPROVED, - model.privateLinkServiceConnectionState().status()); - Assertions.assertEquals("bcswsrt", model.privateLinkServiceConnectionState().description()); - Assertions.assertEquals("iplrbpbewtghfgb", model.privateLinkServiceConnectionState().actionsRequired()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateEndpointConnectionProperties model - = new PrivateEndpointConnectionProperties().withPrivateEndpoint(new PrivateEndpoint()) - .withPrivateLinkServiceConnectionState( - new PrivateLinkServiceConnectionState().withStatus(PrivateEndpointServiceConnectionStatus.APPROVED) - .withDescription("bcswsrt") - .withActionsRequired("iplrbpbewtghfgb")); - model = BinaryData.fromObject(model).toObject(PrivateEndpointConnectionProperties.class); - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.APPROVED, - model.privateLinkServiceConnectionState().status()); - Assertions.assertEquals("bcswsrt", model.privateLinkServiceConnectionState().description()); - Assertions.assertEquals("iplrbpbewtghfgb", model.privateLinkServiceConnectionState().actionsRequired()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/PrivateEndpointConnectionsGetWithResponseMockTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/PrivateEndpointConnectionsGetWithResponseMockTests.java deleted file mode 100644 index 11e3f80ffcf9c..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/PrivateEndpointConnectionsGetWithResponseMockTests.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager; -import com.azure.resourcemanager.postgresqlflexibleserver.models.PrivateEndpointConnection; -import com.azure.resourcemanager.postgresqlflexibleserver.models.PrivateEndpointServiceConnectionStatus; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class PrivateEndpointConnectionsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"groupIds\":[\"gfuhokzrusw\",\"vhczznvfby\",\"jsxjwwix\"],\"privateEndpoint\":{\"id\":\"mwmxqhndvnoamld\"},\"privateLinkServiceConnectionState\":{\"status\":\"Rejected\",\"description\":\"ohdjhhflzok\",\"actionsRequired\":\"ox\"},\"provisioningState\":\"Deleting\"},\"id\":\"jetagltsxoatft\",\"name\":\"zpnpbswv\",\"type\":\"floccsrmozih\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - PostgreSqlManager manager = PostgreSqlManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PrivateEndpointConnection response = manager.privateEndpointConnections() - .getWithResponse("uxlxqzvners", "ycucrwnamikzeb", "qbsms", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.REJECTED, - response.privateLinkServiceConnectionState().status()); - Assertions.assertEquals("ohdjhhflzok", response.privateLinkServiceConnectionState().description()); - Assertions.assertEquals("ox", response.privateLinkServiceConnectionState().actionsRequired()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/PrivateEndpointConnectionsListByServerMockTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/PrivateEndpointConnectionsListByServerMockTests.java deleted file mode 100644 index 7ce1bca14d5c0..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/PrivateEndpointConnectionsListByServerMockTests.java +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager; -import com.azure.resourcemanager.postgresqlflexibleserver.models.PrivateEndpointConnection; -import com.azure.resourcemanager.postgresqlflexibleserver.models.PrivateEndpointServiceConnectionStatus; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class PrivateEndpointConnectionsListByServerMockTests { - @Test - public void testListByServer() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"groupIds\":[\"jxgrytfmp\",\"ycilrmcaykggnox\"],\"privateEndpoint\":{\"id\":\"rksxwpndfc\"},\"privateLinkServiceConnectionState\":{\"status\":\"Approved\",\"description\":\"nthjtwkjaosrxuzv\",\"actionsRequired\":\"mktcqiosmgbza\"},\"provisioningState\":\"Failed\"},\"id\":\"dl\",\"name\":\"rtltla\",\"type\":\"rltzkatbhjmz\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - 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.privateEndpointConnections().listByServer("ipgawtxx", "ky", com.azure.core.util.Context.NONE); - - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.APPROVED, - response.iterator().next().privateLinkServiceConnectionState().status()); - Assertions.assertEquals("nthjtwkjaosrxuzv", - response.iterator().next().privateLinkServiceConnectionState().description()); - Assertions.assertEquals("mktcqiosmgbza", - response.iterator().next().privateLinkServiceConnectionState().actionsRequired()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/PrivateEndpointTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/PrivateEndpointTests.java deleted file mode 100644 index 7dce36b229066..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/PrivateEndpointTests.java +++ /dev/null @@ -1,21 +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.PrivateEndpoint; - -public final class PrivateEndpointTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrivateEndpoint model = BinaryData.fromString("{\"id\":\"xzvlvqhjkbegib\"}").toObject(PrivateEndpoint.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateEndpoint model = new PrivateEndpoint(); - model = BinaryData.fromObject(model).toObject(PrivateEndpoint.class); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/PrivateLinkResourceInnerTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/PrivateLinkResourceInnerTests.java deleted file mode 100644 index 82a8a45119076..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/PrivateLinkResourceInnerTests.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.fluent.models.PrivateLinkResourceInner; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class PrivateLinkResourceInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrivateLinkResourceInner model = BinaryData.fromString( - "{\"properties\":{\"groupId\":\"gfipnsxk\",\"requiredMembers\":[\"a\",\"krrjrea\",\"xt\",\"gumhjglikkxws\"],\"requiredZoneNames\":[\"bq\",\"vuzlm\",\"felfktg\",\"lcrpw\"]},\"id\":\"eznoig\",\"name\":\"rnjwmw\",\"type\":\"pn\"}") - .toObject(PrivateLinkResourceInner.class); - Assertions.assertEquals("bq", model.requiredZoneNames().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateLinkResourceInner model - = new PrivateLinkResourceInner().withRequiredZoneNames(Arrays.asList("bq", "vuzlm", "felfktg", "lcrpw")); - model = BinaryData.fromObject(model).toObject(PrivateLinkResourceInner.class); - Assertions.assertEquals("bq", model.requiredZoneNames().get(0)); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/PrivateLinkResourceListResultTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/PrivateLinkResourceListResultTests.java deleted file mode 100644 index d1af6a9b6370d..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/PrivateLinkResourceListResultTests.java +++ /dev/null @@ -1,23 +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.PrivateLinkResourceListResult; - -public final class PrivateLinkResourceListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrivateLinkResourceListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"groupId\":\"g\",\"requiredMembers\":[\"hwyg\",\"lvdnkfx\",\"semdwzrmu\",\"apfcqdpsq\"],\"requiredZoneNames\":[\"psvuoymgc\",\"elvezrypq\",\"mfe\"]},\"id\":\"erqwkyhkobopg\",\"name\":\"edkowepbqpcrfk\",\"type\":\"wccsnjvcdwxlpqek\"},{\"properties\":{\"groupId\":\"khtj\",\"requiredMembers\":[\"ngwfqatm\"],\"requiredZoneNames\":[\"tmdvypgikdgs\",\"ywkbirryuzhlhkjo\"]},\"id\":\"vqqaatjinrvgo\",\"name\":\"pmfi\",\"type\":\"bfggjioolvr\"},{\"properties\":{\"groupId\":\"v\",\"requiredMembers\":[\"gllqwjy\"],\"requiredZoneNames\":[\"ayvblmhvkzuhbx\",\"vyhgs\",\"pbyrqufegxu\"]},\"id\":\"zfbn\",\"name\":\"lmctlpd\",\"type\":\"gitvg\"},{\"properties\":{\"groupId\":\"rixkwmyijejve\",\"requiredMembers\":[\"bpnaixexccbdre\",\"xhcexdrrvqahq\",\"ghtpw\",\"jnhyjsvf\"],\"requiredZoneNames\":[\"z\"]},\"id\":\"voowvr\",\"name\":\"mtg\",\"type\":\"qp\"}],\"nextLink\":\"ostronz\"}") - .toObject(PrivateLinkResourceListResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateLinkResourceListResult model = new PrivateLinkResourceListResult(); - model = BinaryData.fromObject(model).toObject(PrivateLinkResourceListResult.class); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/PrivateLinkResourcePropertiesTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/PrivateLinkResourcePropertiesTests.java deleted file mode 100644 index 83e3cf154e80b..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/PrivateLinkResourcePropertiesTests.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.fluent.models.PrivateLinkResourceProperties; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class PrivateLinkResourcePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrivateLinkResourceProperties model = BinaryData.fromString( - "{\"groupId\":\"azej\",\"requiredMembers\":[\"kagfhsxtt\",\"ugzxnf\",\"azpxdtnkdmkqjjl\"],\"requiredZoneNames\":[\"nvrk\",\"yo\",\"aibrebqaaysjkixq\",\"nqttezl\"]}") - .toObject(PrivateLinkResourceProperties.class); - Assertions.assertEquals("nvrk", model.requiredZoneNames().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateLinkResourceProperties model = new PrivateLinkResourceProperties() - .withRequiredZoneNames(Arrays.asList("nvrk", "yo", "aibrebqaaysjkixq", "nqttezl")); - model = BinaryData.fromObject(model).toObject(PrivateLinkResourceProperties.class); - Assertions.assertEquals("nvrk", model.requiredZoneNames().get(0)); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/PrivateLinkResourcesGetWithResponseMockTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/PrivateLinkResourcesGetWithResponseMockTests.java deleted file mode 100644 index 56a9e3bc03549..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/PrivateLinkResourcesGetWithResponseMockTests.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.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager; -import com.azure.resourcemanager.postgresqlflexibleserver.models.PrivateLinkResource; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class PrivateLinkResourcesGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"groupId\":\"jbmzyospspsh\",\"requiredMembers\":[\"kyjpmspbps\",\"df\",\"pyogtieyuj\",\"vczkcnyxrxmunjd\"],\"requiredZoneNames\":[\"lnkvxlx\",\"aglqivbgkcvkh\",\"zvuqdflvon\"]},\"id\":\"pfpubcpzgpx\",\"name\":\"ivhjknidi\",\"type\":\"gqjxgpnrhgovfgp\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - PostgreSqlManager manager = PostgreSqlManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PrivateLinkResource response = manager.privateLinkResources() - .getWithResponse("dtmaa", "quhuxylrj", "m", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("lnkvxlx", response.requiredZoneNames().get(0)); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/PrivateLinkResourcesListByServerMockTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/PrivateLinkResourcesListByServerMockTests.java deleted file mode 100644 index d321f962d65ce..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/PrivateLinkResourcesListByServerMockTests.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.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager; -import com.azure.resourcemanager.postgresqlflexibleserver.models.PrivateLinkResource; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class PrivateLinkResourcesListByServerMockTests { - @Test - public void testListByServer() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"groupId\":\"clnapxbiygnugjkn\",\"requiredMembers\":[\"fcttuxuuyilfl\",\"oiquvrehmrnjhvs\"],\"requiredZoneNames\":[\"tczytqjtwh\",\"uunfprnjletlxsm\"]},\"id\":\"ddoui\",\"name\":\"amowaziynknlqwzd\",\"type\":\"piwhxqs\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - 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.privateLinkResources() - .listByServer("rgxffmshkw", "bkgozxwopdbydpi", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("tczytqjtwh", response.iterator().next().requiredZoneNames().get(0)); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/PrivateLinkServiceConnectionStateTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/PrivateLinkServiceConnectionStateTests.java deleted file mode 100644 index b07081de996ce..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/PrivateLinkServiceConnectionStateTests.java +++ /dev/null @@ -1,35 +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.PrivateEndpointServiceConnectionStatus; -import com.azure.resourcemanager.postgresqlflexibleserver.models.PrivateLinkServiceConnectionState; -import org.junit.jupiter.api.Assertions; - -public final class PrivateLinkServiceConnectionStateTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrivateLinkServiceConnectionState model = BinaryData - .fromString( - "{\"status\":\"Approved\",\"description\":\"iebwwaloayqcgwrt\",\"actionsRequired\":\"uzgwyzmhtx\"}") - .toObject(PrivateLinkServiceConnectionState.class); - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.APPROVED, model.status()); - Assertions.assertEquals("iebwwaloayqcgwrt", model.description()); - Assertions.assertEquals("uzgwyzmhtx", model.actionsRequired()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateLinkServiceConnectionState model - = new PrivateLinkServiceConnectionState().withStatus(PrivateEndpointServiceConnectionStatus.APPROVED) - .withDescription("iebwwaloayqcgwrt") - .withActionsRequired("uzgwyzmhtx"); - model = BinaryData.fromObject(model).toObject(PrivateLinkServiceConnectionState.class); - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.APPROVED, model.status()); - Assertions.assertEquals("iebwwaloayqcgwrt", model.description()); - Assertions.assertEquals("uzgwyzmhtx", model.actionsRequired()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ReplicaTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ReplicaTests.java deleted file mode 100644 index 9b157ab1d9fd1..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ReplicaTests.java +++ /dev/null @@ -1,35 +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.ReadReplicaPromoteMode; -import com.azure.resourcemanager.postgresqlflexibleserver.models.Replica; -import com.azure.resourcemanager.postgresqlflexibleserver.models.ReplicationPromoteOption; -import com.azure.resourcemanager.postgresqlflexibleserver.models.ReplicationRole; -import org.junit.jupiter.api.Assertions; - -public final class ReplicaTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Replica model = BinaryData.fromString( - "{\"role\":\"AsyncReplica\",\"capacity\":1026391011,\"replicationState\":\"Updating\",\"promoteMode\":\"switchover\",\"promoteOption\":\"planned\"}") - .toObject(Replica.class); - Assertions.assertEquals(ReplicationRole.ASYNC_REPLICA, model.role()); - Assertions.assertEquals(ReadReplicaPromoteMode.SWITCHOVER, model.promoteMode()); - Assertions.assertEquals(ReplicationPromoteOption.PLANNED, model.promoteOption()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Replica model = new Replica().withRole(ReplicationRole.ASYNC_REPLICA) - .withPromoteMode(ReadReplicaPromoteMode.SWITCHOVER) - .withPromoteOption(ReplicationPromoteOption.PLANNED); - model = BinaryData.fromObject(model).toObject(Replica.class); - Assertions.assertEquals(ReplicationRole.ASYNC_REPLICA, model.role()); - Assertions.assertEquals(ReadReplicaPromoteMode.SWITCHOVER, model.promoteMode()); - Assertions.assertEquals(ReplicationPromoteOption.PLANNED, model.promoteOption()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ResourceProvidersCheckMigrationNameAvailabilityWithRMockTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ResourceProvidersCheckMigrationNameAvailabilityWithRMockTests.java deleted file mode 100644 index 5dcc37b14e93c..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ResourceProvidersCheckMigrationNameAvailabilityWithRMockTests.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager; -import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.MigrationNameAvailabilityResourceInner; -import com.azure.resourcemanager.postgresqlflexibleserver.models.MigrationNameAvailabilityResource; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ResourceProvidersCheckMigrationNameAvailabilityWithRMockTests { - @Test - public void testCheckMigrationNameAvailabilityWithResponse() throws Exception { - String responseStr - = "{\"name\":\"tqyryuzcbmqqv\",\"type\":\"mv\",\"nameAvailable\":true,\"reason\":\"AlreadyExists\",\"message\":\"xo\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - PostgreSqlManager manager = PostgreSqlManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - MigrationNameAvailabilityResource response = manager.resourceProviders() - .checkMigrationNameAvailabilityWithResponse("qscazuawxtz", "puamwabzxr", "xcushs", - new MigrationNameAvailabilityResourceInner().withName("haivm").withType("yasflvgsgzwy"), - com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("tqyryuzcbmqqv", response.name()); - Assertions.assertEquals("mv", response.type()); - } -} 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 de4819a85468d..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/RestartParameterTests.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.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 389a73eb09a39..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServerBackupInnerTests.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.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\":\"Customer On-Demand\",\"completedTime\":\"2021-02-10T03:30:23Z\",\"source\":\"x\"},\"id\":\"ivyqniwbybrkxvd\",\"name\":\"mjgr\",\"type\":\"fwvuk\"}") - .toObject(ServerBackupInner.class); - Assertions.assertEquals(Origin.CUSTOMER_ON_DEMAND, 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.CUSTOMER_ON_DEMAND) - .withCompletedTime(OffsetDateTime.parse("2021-02-10T03:30:23Z")) - .withSource("x"); - model = BinaryData.fromObject(model).toObject(ServerBackupInner.class); - Assertions.assertEquals(Origin.CUSTOMER_ON_DEMAND, 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 1fd20caacddc6..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServerBackupListResultTests.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.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\":\"Customer On-Demand\",\"completedTime\":\"2021-08-18T11:52:54Z\",\"source\":\"hkryhtn\"},\"id\":\"czwlokjyem\",\"name\":\"kvnipjoxz\",\"type\":\"nchgej\"}],\"nextLink\":\"odmailzyd\"}") - .toObject(ServerBackupListResult.class); - Assertions.assertEquals(Origin.CUSTOMER_ON_DEMAND, 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.CUSTOMER_ON_DEMAND) - .withCompletedTime(OffsetDateTime.parse("2021-08-18T11:52:54Z")) - .withSource("hkryhtn"))) - .withNextLink("odmailzyd"); - model = BinaryData.fromObject(model).toObject(ServerBackupListResult.class); - Assertions.assertEquals(Origin.CUSTOMER_ON_DEMAND, 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 fe9fe126c0df0..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServerBackupPropertiesTests.java +++ /dev/null @@ -1,35 +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\":\"Customer On-Demand\",\"completedTime\":\"2021-02-24T15:23:22Z\",\"source\":\"cs\"}") - .toObject(ServerBackupProperties.class); - Assertions.assertEquals(Origin.CUSTOMER_ON_DEMAND, 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.CUSTOMER_ON_DEMAND) - .withCompletedTime(OffsetDateTime.parse("2021-02-24T15:23:22Z")) - .withSource("cs"); - model = BinaryData.fromObject(model).toObject(ServerBackupProperties.class); - Assertions.assertEquals(Origin.CUSTOMER_ON_DEMAND, 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/ServerCapabilitiesListMockTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServerCapabilitiesListMockTests.java deleted file mode 100644 index e7201e0b0a616..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServerCapabilitiesListMockTests.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.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager; -import com.azure.resourcemanager.postgresqlflexibleserver.models.FlexibleServerCapability; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ServerCapabilitiesListMockTests { - @Test - public void testList() throws Exception { - String responseStr - = "{\"value\":[{\"name\":\"jvpglydzgk\",\"supportedServerEditions\":[{\"name\":\"ev\",\"defaultSkuName\":\"epr\",\"supportedStorageEditions\":[{\"name\":\"wytpzdmovz\",\"defaultStorageSizeMb\":1753829479410952479,\"supportedStorageMb\":[{}],\"status\":\"Visible\",\"reason\":\"dflgzuri\"}],\"supportedServerSkus\":[{\"name\":\"cx\",\"vCores\":103057298,\"supportedIops\":1221508981,\"supportedMemoryPerVcoreMb\":7263296405580029992,\"supportedZones\":[\"mlqtmldgxob\",\"irclnpk\",\"iayz\"],\"supportedHaMode\":[\"ZoneRedundant\",\"SameZone\",\"ZoneRedundant\",\"ZoneRedundant\"],\"status\":\"Disabled\",\"reason\":\"jlb\"},{\"name\":\"qvkjlmxho\",\"vCores\":298942523,\"supportedIops\":1117354707,\"supportedMemoryPerVcoreMb\":5593659060766409421,\"supportedZones\":[\"umbnraauzzp\",\"jazysdzhezwwvaiq\",\"uvvfonkp\",\"hqyikvy\"],\"supportedHaMode\":[\"ZoneRedundant\"],\"status\":\"Default\",\"reason\":\"uwmncs\"},{\"name\":\"ijf\",\"vCores\":671639646,\"supportedIops\":263453714,\"supportedMemoryPerVcoreMb\":7136773832934056620,\"supportedZones\":[\"sgbdhuz\",\"gnjdgkynscliqhz\",\"h\"],\"supportedHaMode\":[\"SameZone\",\"SameZone\",\"ZoneRedundant\"],\"status\":\"Visible\",\"reason\":\"otppnv\"}],\"status\":\"Visible\",\"reason\":\"hihfrbbcevqagtlt\"},{\"name\":\"lfkqojpy\",\"defaultSkuName\":\"gtrd\",\"supportedStorageEditions\":[{\"name\":\"mzzs\",\"defaultStorageSizeMb\":911542749738488125,\"supportedStorageMb\":[{},{},{},{}],\"status\":\"Available\",\"reason\":\"xmprafwg\"},{\"name\":\"hocxvdfffwafqrou\",\"defaultStorageSizeMb\":5073586645904040665,\"supportedStorageMb\":[{},{},{},{}],\"status\":\"Visible\",\"reason\":\"r\"}],\"supportedServerSkus\":[{\"name\":\"n\",\"vCores\":1824103868,\"supportedIops\":35410717,\"supportedMemoryPerVcoreMb\":5535477679816636437,\"supportedZones\":[\"moy\",\"cdyuibhmfdnbzyd\",\"f\"],\"supportedHaMode\":[\"SameZone\",\"SameZone\",\"SameZone\",\"ZoneRedundant\"],\"status\":\"Available\",\"reason\":\"rvhmgor\"},{\"name\":\"ukiscvwmzhw\",\"vCores\":157711526,\"supportedIops\":57384767,\"supportedMemoryPerVcoreMb\":7279041380388525299,\"supportedZones\":[\"cbtgnhnz\"],\"supportedHaMode\":[\"ZoneRedundant\",\"SameZone\",\"ZoneRedundant\",\"ZoneRedundant\"],\"status\":\"Available\",\"reason\":\"lqhy\"},{\"name\":\"vodggxdbee\",\"vCores\":1327302833,\"supportedIops\":1658504364,\"supportedMemoryPerVcoreMb\":1833714202725458886,\"supportedZones\":[\"iaa\"],\"supportedHaMode\":[\"SameZone\",\"SameZone\",\"ZoneRedundant\",\"SameZone\"],\"status\":\"Visible\",\"reason\":\"bylyrfgia\"}],\"status\":\"Disabled\",\"reason\":\"jocqwogfnzjvusf\"}],\"supportedServerVersions\":[{\"name\":\"ozuxylfsbtkadpys\",\"supportedVersionsToUpgrade\":[\"btgkbugrjqctoj\",\"mi\",\"of\",\"eypefojyqd\"],\"status\":\"Visible\",\"reason\":\"lcplc\"},{\"name\":\"hihihlhzdsqtzbsr\",\"supportedVersionsToUpgrade\":[\"wcjhfgmv\"],\"status\":\"Disabled\",\"reason\":\"txmwoteyow\"}],\"fastProvisioningSupported\":\"Disabled\",\"supportedFastProvisioningEditions\":[{\"supportedTier\":\"ekqvgqouwif\",\"supportedSku\":\"pjwyiv\",\"supportedStorageGb\":18074725,\"supportedServerVersions\":\"xcvhrfs\",\"serverCount\":1587826907,\"status\":\"Disabled\",\"reason\":\"ttikteusqczkvykl\"},{\"supportedTier\":\"byjaffmmf\",\"supportedSku\":\"cqc\",\"supportedStorageGb\":661332141,\"supportedServerVersions\":\"qibrtalme\",\"serverCount\":38344578,\"status\":\"Disabled\",\"reason\":\"slqxi\"},{\"supportedTier\":\"rmooizqse\",\"supportedSku\":\"xiutcx\",\"supportedStorageGb\":2081194366,\"supportedServerVersions\":\"y\",\"serverCount\":1111738970,\"status\":\"Visible\",\"reason\":\"e\"}],\"geoBackupSupported\":\"Enabled\",\"zoneRedundantHaSupported\":\"Disabled\",\"zoneRedundantHaAndGeoBackupSupported\":\"Enabled\",\"storageAutoGrowthSupported\":\"Enabled\",\"onlineResizeSupported\":\"Disabled\",\"restricted\":\"Disabled\",\"status\":\"Visible\",\"reason\":\"kkzjcjbtrga\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - 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.serverCapabilities().list("tqedcgzulwm", "rqzz", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("jvpglydzgk", response.iterator().next().name()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServerSkuCapabilityTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServerSkuCapabilityTests.java deleted file mode 100644 index 754ff8161a578..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServerSkuCapabilityTests.java +++ /dev/null @@ -1,23 +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.ServerSkuCapability; - -public final class ServerSkuCapabilityTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ServerSkuCapability model = BinaryData.fromString( - "{\"name\":\"uesnzwdejbavo\",\"vCores\":669466066,\"supportedIops\":1432436623,\"supportedMemoryPerVcoreMb\":3481078275751928230,\"supportedZones\":[\"qvudwxdndnvowgu\",\"jugwdkcglhsl\",\"zj\"],\"supportedHaMode\":[\"ZoneRedundant\"],\"status\":\"Disabled\",\"reason\":\"ixhbkuofqweykhm\"}") - .toObject(ServerSkuCapability.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ServerSkuCapability model = new ServerSkuCapability(); - model = BinaryData.fromObject(model).toObject(ServerSkuCapability.class); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServerSkuTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServerSkuTests.java deleted file mode 100644 index a9cf647e45593..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServerSkuTests.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.ServerSku; -import com.azure.resourcemanager.postgresqlflexibleserver.models.SkuTier; -import org.junit.jupiter.api.Assertions; - -public final class ServerSkuTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ServerSku model - = BinaryData.fromString("{\"name\":\"gkfpaga\",\"tier\":\"MemoryOptimized\"}").toObject(ServerSku.class); - Assertions.assertEquals("gkfpaga", model.name()); - Assertions.assertEquals(SkuTier.MEMORY_OPTIMIZED, model.tier()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ServerSku model = new ServerSku().withName("gkfpaga").withTier(SkuTier.MEMORY_OPTIMIZED); - model = BinaryData.fromObject(model).toObject(ServerSku.class); - Assertions.assertEquals("gkfpaga", model.name()); - Assertions.assertEquals(SkuTier.MEMORY_OPTIMIZED, model.tier()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServerThreatProtectionListResultTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServerThreatProtectionListResultTests.java deleted file mode 100644 index 5fe5852420f6c..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServerThreatProtectionListResultTests.java +++ /dev/null @@ -1,23 +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.ServerThreatProtectionListResult; - -public final class ServerThreatProtectionListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ServerThreatProtectionListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"state\":\"Disabled\",\"creationTime\":\"2021-01-02T14:34:14Z\"},\"id\":\"twqmsniffcdmqnr\",\"name\":\"jlpijnkrx\",\"type\":\"rddh\"},{\"properties\":{\"state\":\"Enabled\",\"creationTime\":\"2021-10-24T17:40:19Z\"},\"id\":\"zronasxift\",\"name\":\"zq\",\"type\":\"zh\"},{\"properties\":{\"state\":\"Disabled\",\"creationTime\":\"2021-11-23T02:30:56Z\"},\"id\":\"ogczhonnxkrlg\",\"name\":\"yhmossxkkg\",\"type\":\"h\"},{\"properties\":{\"state\":\"Enabled\",\"creationTime\":\"2021-07-14T05:25:31Z\"},\"id\":\"bdhqxvcxgf\",\"name\":\"pdso\",\"type\":\"bshrnsvbuswd\"}],\"nextLink\":\"yybyc\"}") - .toObject(ServerThreatProtectionListResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ServerThreatProtectionListResult model = new ServerThreatProtectionListResult(); - model = BinaryData.fromObject(model).toObject(ServerThreatProtectionListResult.class); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServerThreatProtectionPropertiesTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServerThreatProtectionPropertiesTests.java deleted file mode 100644 index 57460b8eae1ac..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServerThreatProtectionPropertiesTests.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.fluent.models.ServerThreatProtectionProperties; -import com.azure.resourcemanager.postgresqlflexibleserver.models.ThreatProtectionState; -import org.junit.jupiter.api.Assertions; - -public final class ServerThreatProtectionPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ServerThreatProtectionProperties model - = BinaryData.fromString("{\"state\":\"Enabled\",\"creationTime\":\"2021-06-25T00:23:13Z\"}") - .toObject(ServerThreatProtectionProperties.class); - Assertions.assertEquals(ThreatProtectionState.ENABLED, model.state()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ServerThreatProtectionProperties model - = new ServerThreatProtectionProperties().withState(ThreatProtectionState.ENABLED); - model = BinaryData.fromObject(model).toObject(ServerThreatProtectionProperties.class); - Assertions.assertEquals(ThreatProtectionState.ENABLED, model.state()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServerThreatProtectionSettingsCreateOrUpdateMockTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServerThreatProtectionSettingsCreateOrUpdateMockTests.java deleted file mode 100644 index 9d5725fdd6c19..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServerThreatProtectionSettingsCreateOrUpdateMockTests.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager; -import com.azure.resourcemanager.postgresqlflexibleserver.models.ServerThreatProtectionSettingsModel; -import com.azure.resourcemanager.postgresqlflexibleserver.models.ThreatProtectionName; -import com.azure.resourcemanager.postgresqlflexibleserver.models.ThreatProtectionState; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ServerThreatProtectionSettingsCreateOrUpdateMockTests { - @Test - public void testCreateOrUpdate() throws Exception { - String responseStr - = "{\"properties\":{\"state\":\"Disabled\",\"creationTime\":\"2021-08-26T01:20:28Z\"},\"id\":\"p\",\"name\":\"ilkmk\",\"type\":\"holvdn\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - PostgreSqlManager manager = PostgreSqlManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ServerThreatProtectionSettingsModel response = manager.serverThreatProtectionSettings() - .define(ThreatProtectionName.DEFAULT) - .withExistingFlexibleServer("vqylkmqpzoyhl", "bcg") - .withState(ThreatProtectionState.DISABLED) - .create(); - - Assertions.assertEquals(ThreatProtectionState.DISABLED, response.state()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServerThreatProtectionSettingsGetWithResponseMockTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServerThreatProtectionSettingsGetWithResponseMockTests.java deleted file mode 100644 index b1c169b6e9fe2..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServerThreatProtectionSettingsGetWithResponseMockTests.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.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager; -import com.azure.resourcemanager.postgresqlflexibleserver.models.ServerThreatProtectionSettingsModel; -import com.azure.resourcemanager.postgresqlflexibleserver.models.ThreatProtectionName; -import com.azure.resourcemanager.postgresqlflexibleserver.models.ThreatProtectionState; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ServerThreatProtectionSettingsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"state\":\"Enabled\",\"creationTime\":\"2021-10-30T16:37:34Z\"},\"id\":\"btozipqwje\",\"name\":\"mur\",\"type\":\"xxgewpk\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - PostgreSqlManager manager = PostgreSqlManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ServerThreatProtectionSettingsModel response = manager.serverThreatProtectionSettings() - .getWithResponse("n", "gox", ThreatProtectionName.DEFAULT, com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(ThreatProtectionState.ENABLED, response.state()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServerThreatProtectionSettingsListByServerMockTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServerThreatProtectionSettingsListByServerMockTests.java deleted file mode 100644 index b2e93368bf5ce..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServerThreatProtectionSettingsListByServerMockTests.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.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager; -import com.azure.resourcemanager.postgresqlflexibleserver.models.ServerThreatProtectionSettingsModel; -import com.azure.resourcemanager.postgresqlflexibleserver.models.ThreatProtectionState; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ServerThreatProtectionSettingsListByServerMockTests { - @Test - public void testListByServer() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"state\":\"Enabled\",\"creationTime\":\"2021-01-01T06:59:38Z\"},\"id\":\"ynpdkvgfab\",\"name\":\"iyji\",\"type\":\"uzphdugnei\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - 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.serverThreatProtectionSettings() - .listByServer("cugswvxwlmzqw", "vtxnjmxmcuqud", com.azure.core.util.Context.NONE); - - Assertions.assertEquals(ThreatProtectionState.ENABLED, response.iterator().next().state()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServerThreatProtectionSettingsModelInnerTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServerThreatProtectionSettingsModelInnerTests.java deleted file mode 100644 index 723f81eb48676..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServerThreatProtectionSettingsModelInnerTests.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.fluent.models.ServerThreatProtectionSettingsModelInner; -import com.azure.resourcemanager.postgresqlflexibleserver.models.ThreatProtectionState; -import org.junit.jupiter.api.Assertions; - -public final class ServerThreatProtectionSettingsModelInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ServerThreatProtectionSettingsModelInner model = BinaryData.fromString( - "{\"properties\":{\"state\":\"Disabled\",\"creationTime\":\"2021-09-24T12:06:55Z\"},\"id\":\"rtkfawnopq\",\"name\":\"ikyzirtxdy\",\"type\":\"x\"}") - .toObject(ServerThreatProtectionSettingsModelInner.class); - Assertions.assertEquals(ThreatProtectionState.DISABLED, model.state()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ServerThreatProtectionSettingsModelInner model - = new ServerThreatProtectionSettingsModelInner().withState(ThreatProtectionState.DISABLED); - model = BinaryData.fromObject(model).toObject(ServerThreatProtectionSettingsModelInner.class); - Assertions.assertEquals(ThreatProtectionState.DISABLED, model.state()); - } -} 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 d6f6e79e6900f..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServerVersionCapabilityTests.java +++ /dev/null @@ -1,23 +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\":\"evfyexfwhybcib\",\"supportedVersionsToUpgrade\":[\"dcsi\",\"ynnaam\",\"ectehf\"],\"status\":\"Available\",\"reason\":\"jeyp\"}") - .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 924afbc513996..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServersDeleteMockTests.java +++ /dev/null @@ -1,33 +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.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ServersDeleteMockTests { - @Test - public void testDelete() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - 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("kan", "jpdn", 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 2516edf1acfb9..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServersRestartMockTests.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.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager; -import com.azure.resourcemanager.postgresqlflexibleserver.models.FailoverMode; -import com.azure.resourcemanager.postgresqlflexibleserver.models.RestartParameter; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ServersRestartMockTests { - @Test - public void testRestart() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - 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("kelvidizozsdb", "cxjmonfdgnwncyp", - new RestartParameter().withRestartWithFailover(false).withFailoverMode(FailoverMode.PLANNED_FAILOVER), - 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 1121c1f7c05da..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServersStartMockTests.java +++ /dev/null @@ -1,33 +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.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ServersStartMockTests { - @Test - public void testStart() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - 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("tvuqjctzenkeifzz", "mkdasv", 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 edbb68d1debbd..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServersStopMockTests.java +++ /dev/null @@ -1,33 +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.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ServersStopMockTests { - @Test - public void testStop() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - 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("lyhb", "cu", 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 baaa0358d4f37..0000000000000 --- 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\":\"deemao\",\"tier\":\"MemoryOptimized\"}").toObject(Sku.class); - Assertions.assertEquals("deemao", model.name()); - Assertions.assertEquals(SkuTier.MEMORY_OPTIMIZED, model.tier()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Sku model = new Sku().withName("deemao").withTier(SkuTier.MEMORY_OPTIMIZED); - model = BinaryData.fromObject(model).toObject(Sku.class); - Assertions.assertEquals("deemao", model.name()); - Assertions.assertEquals(SkuTier.MEMORY_OPTIMIZED, 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 00401b8b14db9..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/StorageEditionCapabilityTests.java +++ /dev/null @@ -1,23 +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\":\"vvtpgvdfgio\",\"defaultStorageSizeMb\":7982526886149094942,\"supportedStorageMb\":[{\"supportedIops\":1101541772,\"supportedMaximumIops\":2113328566,\"storageSizeMb\":4041514178689305651,\"maximumStorageSizeMb\":6623521547442247310,\"supportedThroughput\":1408526617,\"supportedMaximumThroughput\":2132514098,\"defaultIopsTier\":\"rxdq\",\"supportedIopsTiers\":[{\"name\":\"thz\",\"iops\":2050810494,\"status\":\"Default\",\"reason\":\"bhj\"}],\"status\":\"Available\",\"reason\":\"ehoqfbowskan\"},{\"supportedIops\":1420716073,\"supportedMaximumIops\":1440760803,\"storageSizeMb\":450756782993701005,\"maximumStorageSizeMb\":5423629655028728584,\"supportedThroughput\":1787263849,\"supportedMaximumThroughput\":1920401593,\"defaultIopsTier\":\"drvyn\",\"supportedIopsTiers\":[{\"name\":\"phrcgyncoc\",\"iops\":1827981696,\"status\":\"Available\",\"reason\":\"mcoo\"},{\"name\":\"xlzevgbmqjqabcy\",\"iops\":1896643633,\"status\":\"Disabled\",\"reason\":\"lzu\"},{\"name\":\"c\",\"iops\":1704525857,\"status\":\"Available\",\"reason\":\"acfi\"}],\"status\":\"Visible\",\"reason\":\"bxetqgtzxdpn\"}],\"status\":\"Visible\",\"reason\":\"wxrjfeallnwsub\"}") - .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 ce223ffa746a2..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/StorageMbCapabilityTests.java +++ /dev/null @@ -1,23 +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( - "{\"supportedIops\":1455725061,\"supportedMaximumIops\":2067310250,\"storageSizeMb\":4579526250927488523,\"maximumStorageSizeMb\":1760019269315707973,\"supportedThroughput\":1097907718,\"supportedMaximumThroughput\":1460212605,\"defaultIopsTier\":\"qwoochcbon\",\"supportedIopsTiers\":[{\"name\":\"vlrxnjeaseiph\",\"iops\":10648381,\"status\":\"Default\",\"reason\":\"eyy\"},{\"name\":\"nj\",\"iops\":147839675,\"status\":\"Disabled\",\"reason\":\"rhpdjpjumas\"}],\"status\":\"Visible\",\"reason\":\"pqyegualhbxxh\"}") - .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 ea69438822695..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/StorageTests.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.postgresqlflexibleserver.models.AzureManagedDiskPerformanceTiers; -import com.azure.resourcemanager.postgresqlflexibleserver.models.Storage; -import com.azure.resourcemanager.postgresqlflexibleserver.models.StorageAutoGrow; -import com.azure.resourcemanager.postgresqlflexibleserver.models.StorageType; -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\":378740699,\"autoGrow\":\"Enabled\",\"tier\":\"P30\",\"iops\":838222488,\"throughput\":1787960878,\"type\":\"PremiumV2_LRS\"}") - .toObject(Storage.class); - Assertions.assertEquals(378740699, model.storageSizeGB()); - Assertions.assertEquals(StorageAutoGrow.ENABLED, model.autoGrow()); - Assertions.assertEquals(AzureManagedDiskPerformanceTiers.P30, model.tier()); - Assertions.assertEquals(838222488, model.iops()); - Assertions.assertEquals(1787960878, model.throughput()); - Assertions.assertEquals(StorageType.PREMIUM_V2_LRS, model.type()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Storage model = new Storage().withStorageSizeGB(378740699) - .withAutoGrow(StorageAutoGrow.ENABLED) - .withTier(AzureManagedDiskPerformanceTiers.P30) - .withIops(838222488) - .withThroughput(1787960878) - .withType(StorageType.PREMIUM_V2_LRS); - model = BinaryData.fromObject(model).toObject(Storage.class); - Assertions.assertEquals(378740699, model.storageSizeGB()); - Assertions.assertEquals(StorageAutoGrow.ENABLED, model.autoGrow()); - Assertions.assertEquals(AzureManagedDiskPerformanceTiers.P30, model.tier()); - Assertions.assertEquals(838222488, model.iops()); - Assertions.assertEquals(1787960878, model.throughput()); - Assertions.assertEquals(StorageType.PREMIUM_V2_LRS, model.type()); - } -} 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 76c4afc4a7cf1..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/StorageTierCapabilityTests.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.StorageTierCapability; - -public final class StorageTierCapabilityTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - StorageTierCapability model = BinaryData - .fromString( - "{\"name\":\"jzzvdud\",\"iops\":621270176,\"status\":\"Visible\",\"reason\":\"hotwmcynpwlbjnp\"}") - .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 5489ac6f47681..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/UserAssignedIdentityTests.java +++ /dev/null @@ -1,49 +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\":{\"hahvljuahaq\":{\"principalId\":\"kv\",\"clientId\":\"elmqk\"}},\"type\":\"SystemAssigned\",\"tenantId\":\"dhmdua\"}") - .toObject(UserAssignedIdentity.class); - Assertions.assertEquals("kv", model.userAssignedIdentities().get("hahvljuahaq").principalId()); - Assertions.assertEquals("elmqk", model.userAssignedIdentities().get("hahvljuahaq").clientId()); - Assertions.assertEquals(IdentityType.SYSTEM_ASSIGNED, model.type()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - UserAssignedIdentity model = new UserAssignedIdentity() - .withUserAssignedIdentities( - mapOf("hahvljuahaq", new UserIdentity().withPrincipalId("kv").withClientId("elmqk"))) - .withType(IdentityType.SYSTEM_ASSIGNED); - model = BinaryData.fromObject(model).toObject(UserAssignedIdentity.class); - Assertions.assertEquals("kv", model.userAssignedIdentities().get("hahvljuahaq").principalId()); - Assertions.assertEquals("elmqk", model.userAssignedIdentities().get("hahvljuahaq").clientId()); - Assertions.assertEquals(IdentityType.SYSTEM_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 ec7496c72dcd0..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/UserIdentityTests.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.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\":\"exq\",\"clientId\":\"fadmws\"}").toObject(UserIdentity.class); - Assertions.assertEquals("exq", model.principalId()); - Assertions.assertEquals("fadmws", model.clientId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - UserIdentity model = new UserIdentity().withPrincipalId("exq").withClientId("fadmws"); - model = BinaryData.fromObject(model).toObject(UserIdentity.class); - Assertions.assertEquals("exq", model.principalId()); - Assertions.assertEquals("fadmws", model.clientId()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ValidationDetailsTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ValidationDetailsTests.java deleted file mode 100644 index 55625b15a20e8..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ValidationDetailsTests.java +++ /dev/null @@ -1,105 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.postgresqlflexibleserver.models.DbLevelValidationStatus; -import com.azure.resourcemanager.postgresqlflexibleserver.models.ValidationDetails; -import com.azure.resourcemanager.postgresqlflexibleserver.models.ValidationMessage; -import com.azure.resourcemanager.postgresqlflexibleserver.models.ValidationState; -import com.azure.resourcemanager.postgresqlflexibleserver.models.ValidationSummaryItem; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ValidationDetailsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ValidationDetails model = BinaryData.fromString( - "{\"status\":\"Failed\",\"validationStartTimeInUtc\":\"2021-10-25T10:37:02Z\",\"validationEndTimeInUtc\":\"2020-12-24T15:22:03Z\",\"serverLevelValidationDetails\":[{\"type\":\"wosytxitcskf\",\"state\":\"Failed\",\"messages\":[{\"state\":\"Succeeded\",\"message\":\"kkezzikhlyfjhdgq\"},{\"state\":\"Failed\",\"message\":\"dunyg\"},{\"state\":\"Succeeded\",\"message\":\"db\"}]},{\"type\":\"atpxl\",\"state\":\"Succeeded\",\"messages\":[{\"state\":\"Failed\",\"message\":\"a\"},{\"state\":\"Warning\",\"message\":\"arm\"}]}],\"dbLevelValidationDetails\":[{\"databaseName\":\"jsjqbjhhyx\",\"startedOn\":\"2021-08-08T09:59:53Z\",\"endedOn\":\"2021-08-21T13:48:09Z\",\"summary\":[{\"type\":\"uhpkxkgymar\",\"state\":\"Succeeded\",\"messages\":[{},{},{}]},{\"type\":\"qugjhkycube\",\"state\":\"Failed\",\"messages\":[{},{},{},{}]}]},{\"databaseName\":\"fwqmzqalkrmn\",\"startedOn\":\"2021-01-22T20:56:52Z\",\"endedOn\":\"2021-12-03T00:29:17Z\",\"summary\":[{\"type\":\"qudf\",\"state\":\"Succeeded\",\"messages\":[{}]},{\"type\":\"aabjyvayffimrz\",\"state\":\"Failed\",\"messages\":[{},{},{}]}]}]}") - .toObject(ValidationDetails.class); - Assertions.assertEquals(ValidationState.FAILED, model.status()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-25T10:37:02Z"), model.validationStartTimeInUtc()); - Assertions.assertEquals(OffsetDateTime.parse("2020-12-24T15:22:03Z"), model.validationEndTimeInUtc()); - Assertions.assertEquals("wosytxitcskf", model.serverLevelValidationDetails().get(0).type()); - Assertions.assertEquals(ValidationState.FAILED, model.serverLevelValidationDetails().get(0).state()); - Assertions.assertEquals(ValidationState.SUCCEEDED, - model.serverLevelValidationDetails().get(0).messages().get(0).state()); - Assertions.assertEquals("kkezzikhlyfjhdgq", - model.serverLevelValidationDetails().get(0).messages().get(0).message()); - Assertions.assertEquals("jsjqbjhhyx", model.dbLevelValidationDetails().get(0).databaseName()); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-08T09:59:53Z"), - model.dbLevelValidationDetails().get(0).startedOn()); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-21T13:48:09Z"), - model.dbLevelValidationDetails().get(0).endedOn()); - Assertions.assertEquals("uhpkxkgymar", model.dbLevelValidationDetails().get(0).summary().get(0).type()); - Assertions.assertEquals(ValidationState.SUCCEEDED, - model.dbLevelValidationDetails().get(0).summary().get(0).state()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ValidationDetails model - = new ValidationDetails().withStatus(ValidationState.FAILED) - .withValidationStartTimeInUtc(OffsetDateTime.parse("2021-10-25T10:37:02Z")) - .withValidationEndTimeInUtc(OffsetDateTime.parse("2020-12-24T15:22:03Z")) - .withServerLevelValidationDetails( - Arrays.asList( - new ValidationSummaryItem().withType("wosytxitcskf") - .withState(ValidationState.FAILED) - .withMessages(Arrays.asList( - new ValidationMessage().withState(ValidationState.SUCCEEDED) - .withMessage("kkezzikhlyfjhdgq"), - new ValidationMessage().withState(ValidationState.FAILED).withMessage("dunyg"), - new ValidationMessage().withState(ValidationState.SUCCEEDED).withMessage("db"))), - new ValidationSummaryItem().withType("atpxl") - .withState(ValidationState.SUCCEEDED) - .withMessages(Arrays.asList( - new ValidationMessage().withState(ValidationState.FAILED).withMessage("a"), - new ValidationMessage().withState(ValidationState.WARNING).withMessage("arm"))))) - .withDbLevelValidationDetails(Arrays.asList( - new DbLevelValidationStatus().withDatabaseName("jsjqbjhhyx") - .withStartedOn(OffsetDateTime.parse("2021-08-08T09:59:53Z")) - .withEndedOn(OffsetDateTime.parse("2021-08-21T13:48:09Z")) - .withSummary(Arrays.asList( - new ValidationSummaryItem().withType("uhpkxkgymar") - .withState(ValidationState.SUCCEEDED) - .withMessages(Arrays.asList(new ValidationMessage(), new ValidationMessage(), - new ValidationMessage())), - new ValidationSummaryItem().withType("qugjhkycube") - .withState(ValidationState.FAILED) - .withMessages(Arrays.asList(new ValidationMessage(), new ValidationMessage(), - new ValidationMessage(), new ValidationMessage())))), - new DbLevelValidationStatus().withDatabaseName("fwqmzqalkrmn") - .withStartedOn(OffsetDateTime.parse("2021-01-22T20:56:52Z")) - .withEndedOn(OffsetDateTime.parse("2021-12-03T00:29:17Z")) - .withSummary(Arrays.asList( - new ValidationSummaryItem().withType("qudf") - .withState(ValidationState.SUCCEEDED) - .withMessages(Arrays.asList(new ValidationMessage())), - new ValidationSummaryItem().withType("aabjyvayffimrz") - .withState(ValidationState.FAILED) - .withMessages(Arrays.asList(new ValidationMessage(), new ValidationMessage(), - new ValidationMessage())))))); - model = BinaryData.fromObject(model).toObject(ValidationDetails.class); - Assertions.assertEquals(ValidationState.FAILED, model.status()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-25T10:37:02Z"), model.validationStartTimeInUtc()); - Assertions.assertEquals(OffsetDateTime.parse("2020-12-24T15:22:03Z"), model.validationEndTimeInUtc()); - Assertions.assertEquals("wosytxitcskf", model.serverLevelValidationDetails().get(0).type()); - Assertions.assertEquals(ValidationState.FAILED, model.serverLevelValidationDetails().get(0).state()); - Assertions.assertEquals(ValidationState.SUCCEEDED, - model.serverLevelValidationDetails().get(0).messages().get(0).state()); - Assertions.assertEquals("kkezzikhlyfjhdgq", - model.serverLevelValidationDetails().get(0).messages().get(0).message()); - Assertions.assertEquals("jsjqbjhhyx", model.dbLevelValidationDetails().get(0).databaseName()); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-08T09:59:53Z"), - model.dbLevelValidationDetails().get(0).startedOn()); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-21T13:48:09Z"), - model.dbLevelValidationDetails().get(0).endedOn()); - Assertions.assertEquals("uhpkxkgymar", model.dbLevelValidationDetails().get(0).summary().get(0).type()); - Assertions.assertEquals(ValidationState.SUCCEEDED, - model.dbLevelValidationDetails().get(0).summary().get(0).state()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ValidationMessageTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ValidationMessageTests.java deleted file mode 100644 index 0a6ea42e91dd5..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ValidationMessageTests.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.ValidationMessage; -import com.azure.resourcemanager.postgresqlflexibleserver.models.ValidationState; -import org.junit.jupiter.api.Assertions; - -public final class ValidationMessageTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ValidationMessage model - = BinaryData.fromString("{\"state\":\"Failed\",\"message\":\"ubpaxhe\"}").toObject(ValidationMessage.class); - Assertions.assertEquals(ValidationState.FAILED, model.state()); - Assertions.assertEquals("ubpaxhe", model.message()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ValidationMessage model = new ValidationMessage().withState(ValidationState.FAILED).withMessage("ubpaxhe"); - model = BinaryData.fromObject(model).toObject(ValidationMessage.class); - Assertions.assertEquals(ValidationState.FAILED, model.state()); - Assertions.assertEquals("ubpaxhe", model.message()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ValidationSummaryItemTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ValidationSummaryItemTests.java deleted file mode 100644 index 87e02f9973565..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ValidationSummaryItemTests.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.models.ValidationMessage; -import com.azure.resourcemanager.postgresqlflexibleserver.models.ValidationState; -import com.azure.resourcemanager.postgresqlflexibleserver.models.ValidationSummaryItem; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ValidationSummaryItemTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ValidationSummaryItem model = BinaryData.fromString( - "{\"type\":\"gsexne\",\"state\":\"Warning\",\"messages\":[{\"state\":\"Warning\",\"message\":\"ewzsyyceuzsoib\"},{\"state\":\"Failed\",\"message\":\"frxtrthzvaytdwk\"}]}") - .toObject(ValidationSummaryItem.class); - Assertions.assertEquals("gsexne", model.type()); - Assertions.assertEquals(ValidationState.WARNING, model.state()); - Assertions.assertEquals(ValidationState.WARNING, model.messages().get(0).state()); - Assertions.assertEquals("ewzsyyceuzsoib", model.messages().get(0).message()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ValidationSummaryItem model - = new ValidationSummaryItem().withType("gsexne") - .withState(ValidationState.WARNING) - .withMessages(Arrays.asList( - new ValidationMessage().withState(ValidationState.WARNING).withMessage("ewzsyyceuzsoib"), - new ValidationMessage().withState(ValidationState.FAILED).withMessage("frxtrthzvaytdwk"))); - model = BinaryData.fromObject(model).toObject(ValidationSummaryItem.class); - Assertions.assertEquals("gsexne", model.type()); - Assertions.assertEquals(ValidationState.WARNING, model.state()); - Assertions.assertEquals(ValidationState.WARNING, model.messages().get(0).state()); - Assertions.assertEquals("ewzsyyceuzsoib", model.messages().get(0).message()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/VirtualEndpointResourceForPatchTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/VirtualEndpointResourceForPatchTests.java deleted file mode 100644 index f4aeaefad778c..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/VirtualEndpointResourceForPatchTests.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.VirtualEndpointResourceForPatch; -import com.azure.resourcemanager.postgresqlflexibleserver.models.VirtualEndpointType; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class VirtualEndpointResourceForPatchTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - VirtualEndpointResourceForPatch model = BinaryData.fromString( - "{\"properties\":{\"endpointType\":\"ReadWrite\",\"members\":[\"yhwzdgiruj\"],\"virtualEndpoints\":[\"omvzzbtd\",\"qvpn\",\"yujviylwdshfssn\"]}}") - .toObject(VirtualEndpointResourceForPatch.class); - Assertions.assertEquals(VirtualEndpointType.READ_WRITE, model.endpointType()); - Assertions.assertEquals("yhwzdgiruj", model.members().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - VirtualEndpointResourceForPatch model - = new VirtualEndpointResourceForPatch().withEndpointType(VirtualEndpointType.READ_WRITE) - .withMembers(Arrays.asList("yhwzdgiruj")); - model = BinaryData.fromObject(model).toObject(VirtualEndpointResourceForPatch.class); - Assertions.assertEquals(VirtualEndpointType.READ_WRITE, model.endpointType()); - Assertions.assertEquals("yhwzdgiruj", model.members().get(0)); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/VirtualEndpointResourceInnerTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/VirtualEndpointResourceInnerTests.java deleted file mode 100644 index 8b92e1e397d33..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/VirtualEndpointResourceInnerTests.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.fluent.models.VirtualEndpointResourceInner; -import com.azure.resourcemanager.postgresqlflexibleserver.models.VirtualEndpointType; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class VirtualEndpointResourceInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - VirtualEndpointResourceInner model = BinaryData.fromString( - "{\"id\":\"psew\",\"name\":\"oi\",\"type\":\"ukry\",\"properties\":{\"endpointType\":\"ReadWrite\",\"members\":[\"ox\",\"rgguf\",\"yaomtb\",\"hhavgrvkffovjz\"],\"virtualEndpoints\":[\"bibgjmfxumv\",\"cluyovwxnbkf\"]}}") - .toObject(VirtualEndpointResourceInner.class); - Assertions.assertEquals(VirtualEndpointType.READ_WRITE, model.endpointType()); - Assertions.assertEquals("ox", model.members().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - VirtualEndpointResourceInner model - = new VirtualEndpointResourceInner().withEndpointType(VirtualEndpointType.READ_WRITE) - .withMembers(Arrays.asList("ox", "rgguf", "yaomtb", "hhavgrvkffovjz")); - model = BinaryData.fromObject(model).toObject(VirtualEndpointResourceInner.class); - Assertions.assertEquals(VirtualEndpointType.READ_WRITE, model.endpointType()); - Assertions.assertEquals("ox", model.members().get(0)); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/VirtualEndpointResourcePropertiesTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/VirtualEndpointResourcePropertiesTests.java deleted file mode 100644 index 438a382432291..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/VirtualEndpointResourcePropertiesTests.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.fluent.models.VirtualEndpointResourceProperties; -import com.azure.resourcemanager.postgresqlflexibleserver.models.VirtualEndpointType; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class VirtualEndpointResourcePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - VirtualEndpointResourceProperties model = BinaryData.fromString( - "{\"endpointType\":\"ReadWrite\",\"members\":[\"frymsgaojfmwnc\"],\"virtualEndpoints\":[\"rfh\",\"rctym\",\"xoftpipiwyczu\"]}") - .toObject(VirtualEndpointResourceProperties.class); - Assertions.assertEquals(VirtualEndpointType.READ_WRITE, model.endpointType()); - Assertions.assertEquals("frymsgaojfmwnc", model.members().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - VirtualEndpointResourceProperties model - = new VirtualEndpointResourceProperties().withEndpointType(VirtualEndpointType.READ_WRITE) - .withMembers(Arrays.asList("frymsgaojfmwnc")); - model = BinaryData.fromObject(model).toObject(VirtualEndpointResourceProperties.class); - Assertions.assertEquals(VirtualEndpointType.READ_WRITE, model.endpointType()); - Assertions.assertEquals("frymsgaojfmwnc", model.members().get(0)); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/VirtualEndpointsCreateMockTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/VirtualEndpointsCreateMockTests.java deleted file mode 100644 index 0eeaa446f3ab6..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/VirtualEndpointsCreateMockTests.java +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager; -import com.azure.resourcemanager.postgresqlflexibleserver.models.VirtualEndpointResource; -import com.azure.resourcemanager.postgresqlflexibleserver.models.VirtualEndpointType; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class VirtualEndpointsCreateMockTests { - @Test - public void testCreate() throws Exception { - String responseStr - = "{\"id\":\"uicbuewmrsw\",\"name\":\"lx\",\"type\":\"rhwpus\",\"properties\":{\"endpointType\":\"ReadWrite\",\"members\":[\"gpdohzj\",\"atucoigebxncn\"],\"virtualEndpoints\":[\"pbnwgfmxjgcg\",\"jbgdlfgtdysnaquf\"]}}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - PostgreSqlManager manager = PostgreSqlManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - VirtualEndpointResource response = manager.virtualEndpoints() - .define("bauiropi") - .withExistingFlexibleServer("rjvzuyt", "rmlmuowo") - .withEndpointType(VirtualEndpointType.READ_WRITE) - .withMembers(Arrays.asList("rd")) - .create(); - - Assertions.assertEquals(VirtualEndpointType.READ_WRITE, response.endpointType()); - Assertions.assertEquals("gpdohzj", response.members().get(0)); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/VirtualEndpointsGetWithResponseMockTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/VirtualEndpointsGetWithResponseMockTests.java deleted file mode 100644 index bc1ba74fc2b50..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/VirtualEndpointsGetWithResponseMockTests.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.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager; -import com.azure.resourcemanager.postgresqlflexibleserver.models.VirtualEndpointResource; -import com.azure.resourcemanager.postgresqlflexibleserver.models.VirtualEndpointType; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class VirtualEndpointsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - String responseStr - = "{\"id\":\"jqirwrw\",\"name\":\"oxffif\",\"type\":\"wrsnewmozqvbu\",\"properties\":{\"endpointType\":\"ReadWrite\",\"members\":[\"ycxhxzgaztta\",\"o\",\"dvmfqhppub\"],\"virtualEndpoints\":[\"epdfgkmtdherng\",\"tcjuahokqto\"]}}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - PostgreSqlManager manager = PostgreSqlManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - VirtualEndpointResource response = manager.virtualEndpoints() - .getWithResponse("viauogphua", "tvt", "ukyefchnmnahmnxh", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(VirtualEndpointType.READ_WRITE, response.endpointType()); - Assertions.assertEquals("ycxhxzgaztta", response.members().get(0)); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/VirtualEndpointsListByServerMockTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/VirtualEndpointsListByServerMockTests.java deleted file mode 100644 index bbdf822032e6e..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/VirtualEndpointsListByServerMockTests.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.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager; -import com.azure.resourcemanager.postgresqlflexibleserver.models.VirtualEndpointResource; -import com.azure.resourcemanager.postgresqlflexibleserver.models.VirtualEndpointType; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class VirtualEndpointsListByServerMockTests { - @Test - public void testListByServer() throws Exception { - String responseStr - = "{\"value\":[{\"id\":\"whslwkoj\",\"name\":\"l\",\"type\":\"npdwr\",\"properties\":{\"endpointType\":\"ReadWrite\",\"members\":[\"gsnnf\"],\"virtualEndpoints\":[\"tefypococtfjgti\"]}}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - 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.virtualEndpoints().listByServer("kauxof", "hfphwpnulaiywze", com.azure.core.util.Context.NONE); - - Assertions.assertEquals(VirtualEndpointType.READ_WRITE, response.iterator().next().endpointType()); - Assertions.assertEquals("gsnnf", response.iterator().next().members().get(0)); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/VirtualEndpointsListResultTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/VirtualEndpointsListResultTests.java deleted file mode 100644 index 9d12a3d557ce5..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/VirtualEndpointsListResultTests.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.VirtualEndpointResourceInner; -import com.azure.resourcemanager.postgresqlflexibleserver.models.VirtualEndpointType; -import com.azure.resourcemanager.postgresqlflexibleserver.models.VirtualEndpointsListResult; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class VirtualEndpointsListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - VirtualEndpointsListResult model = BinaryData.fromString( - "{\"value\":[{\"id\":\"pqjlihhyusps\",\"name\":\"sdvlmfwdgzxulucv\",\"type\":\"mrsreuzvxurisjnh\",\"properties\":{\"endpointType\":\"ReadWrite\",\"members\":[\"jzgxmrhublwp\",\"esutrgjupauutpw\",\"qhih\"],\"virtualEndpoints\":[\"g\"]}}],\"nextLink\":\"pnfqntcyp\"}") - .toObject(VirtualEndpointsListResult.class); - Assertions.assertEquals(VirtualEndpointType.READ_WRITE, model.value().get(0).endpointType()); - Assertions.assertEquals("jzgxmrhublwp", model.value().get(0).members().get(0)); - Assertions.assertEquals("pnfqntcyp", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - VirtualEndpointsListResult model - = new VirtualEndpointsListResult() - .withValue( - Arrays.asList(new VirtualEndpointResourceInner().withEndpointType(VirtualEndpointType.READ_WRITE) - .withMembers(Arrays.asList("jzgxmrhublwp", "esutrgjupauutpw", "qhih")))) - .withNextLink("pnfqntcyp"); - model = BinaryData.fromObject(model).toObject(VirtualEndpointsListResult.class); - Assertions.assertEquals(VirtualEndpointType.READ_WRITE, model.value().get(0).endpointType()); - Assertions.assertEquals("jzgxmrhublwp", model.value().get(0).members().get(0)); - Assertions.assertEquals("pnfqntcyp", model.nextLink()); - } -} 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 f91f16a6f5877..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/VirtualNetworkSubnetUsageParameterTests.java +++ /dev/null @@ -1,26 +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\":\"jv\"}") - .toObject(VirtualNetworkSubnetUsageParameter.class); - Assertions.assertEquals("jv", model.virtualNetworkArmResourceId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - VirtualNetworkSubnetUsageParameter model - = new VirtualNetworkSubnetUsageParameter().withVirtualNetworkArmResourceId("jv"); - model = BinaryData.fromObject(model).toObject(VirtualNetworkSubnetUsageParameter.class); - Assertions.assertEquals("jv", 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 884be31835b87..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/VirtualNetworkSubnetUsageResultInnerTests.java +++ /dev/null @@ -1,23 +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\":\"wkslir\",\"usage\":1648418859978390426},{\"subnetName\":\"vydfceacvlhvygdy\",\"usage\":2478564510622036028},{\"subnetName\":\"twnawjslbiwkojgc\",\"usage\":2684891506891853322}],\"location\":\"mznbaeqphch\",\"subscriptionId\":\"rn\"}") - .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 4ec3c76129d02..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/VirtualNetworkSubnetUsagesExecuteWithResponseMockTests.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.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager; -import com.azure.resourcemanager.postgresqlflexibleserver.models.VirtualNetworkSubnetUsageParameter; -import com.azure.resourcemanager.postgresqlflexibleserver.models.VirtualNetworkSubnetUsageResult; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class VirtualNetworkSubnetUsagesExecuteWithResponseMockTests { - @Test - public void testExecuteWithResponse() throws Exception { - String responseStr - = "{\"delegatedSubnetsUsage\":[{\"subnetName\":\"leziunjxdfzant\",\"usage\":7973738400365966100},{\"subnetName\":\"yamlbnse\",\"usage\":6409376933110730693},{\"subnetName\":\"vpilg\",\"usage\":2023691682107427976}],\"location\":\"agmdit\",\"subscriptionId\":\"eiookjbsah\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - 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("qbctqha", - new VirtualNetworkSubnetUsageParameter().withVirtualNetworkArmResourceId("jrwdkqz"), - com.azure.core.util.Context.NONE) - .getValue(); - - } -}