diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/CHANGELOG.md b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/CHANGELOG.md index de2eb0d7c1bf2..3448b7fff2ed7 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/CHANGELOG.md +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/CHANGELOG.md @@ -1,14 +1,478 @@ # Release History -## 1.1.0-beta.4 (Unreleased) +## 1.0.0-beta.1 (2024-09-25) -### Features Added +- Azure Resource Manager PostgreSqlServer client library for Java. This package contains Microsoft Azure SDK for PostgreSqlServer 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). ### Breaking Changes -### Bugs Fixed +* `models.NodeTypeCapability` was removed + +* `models.StorageMBCapability` was removed + +* `models.HyperscaleNodeEditionCapability` was removed + +* `models.CapabilityProperties` was removed + +* `PostgreSqlManager$Configurable` was removed + +* `models.VcoreCapability` was removed + +* `PostgreSqlManager` was removed + +#### `models.StorageTierCapability` was modified + +* `java.lang.Long iops()` -> `java.lang.Integer iops()` +* `tierName()` was removed +* `isBaseline()` was removed +* `java.lang.String status()` -> `models.CapabilityStatus status()` + +#### `models.FastProvisioningEditionCapability` was modified + +* `java.lang.Long supportedStorageGb()` -> `java.lang.Integer supportedStorageGb()` + +#### `models.ServerVersionCapability` was modified + +* `supportedVcores()` was removed +* `java.lang.String status()` -> `models.CapabilityStatus status()` + +#### `models.FlexibleServerEditionCapability` was modified + +* `java.lang.String status()` -> `models.CapabilityStatus status()` +* `supportedServerVersions()` was removed + +#### `models.StorageEditionCapability` was modified + +* `supportedStorageMB()` was removed +* `java.lang.String status()` -> `models.CapabilityStatus status()` + +### Features Added + +* `models.ServerThreatProtectionSettingsModel$UpdateStages` was added + +* `models.ExecutionStatus` was added + +* `models.MigrationResource$Definition` was added + +* `models.LogFiles` was added + +* `models.ThreatProtectionState` was added + +* `models.MigrationResourceListResult` was added + +* `models.ServerThreatProtectionSettingsModel` was added + +* `models.LtrBackupResponse` was added + +* `models.MigrationOption` was added + +* `models.PrivateLinkResource` was added + +* `models.Migrations` was added + +* `models.Replica` was added + +* `models.ServerThreatProtectionSettingsModel$Update` was added + +* `models.MigrationMode` was added + +* `models.LtrBackupRequest` was added + +* `models.FlexibleServersTriggerLtrPreBackupResponse` was added + +* `models.ZoneRedundantHaSupportedEnum` was added + +* `models.ValidationState` was added + +* `models.ReadReplicaPromoteMode` was added + +* `models.PrivateEndpointConnectionProvisioningState` was added + +* `models.MigrationResourceForPatch` was added + +* `models.ServerThreatProtectionListResult` was added + +* `models.RestrictedEnum` was added + +* `models.PrivateLinkResources` was added + +* `models.VirtualEndpoints` was added + +* `models.OverwriteDbsInTargetEnum` was added + +* `models.VirtualEndpointResource$Definition` was added + +* `models.MigrationState` was added + +* `PostgreSqlServerManager` was added + +* `models.CapabilityStatus` was added + +* `models.AzureManagedDiskPerformanceTiers` was added + +* `models.StorageAutoGrowthSupportedEnum` was added + +* `models.PrivateLinkServiceConnectionState` was added + +* `models.MigrationResource$Update` was added + +* `models.VirtualEndpointResource$Update` was added + +* `models.ResourceProviders` was added + +* `models.PrivateLinkResourceListResult` was added + +* `models.MigrationStatus` was added + +* `models.PrivateEndpointConnections` was added + +* `models.StartDataMigrationEnum` was added + +* `models.ZoneRedundantHaAndGeoBackupSupportedEnum` was added + +* `models.StorageMbCapability` was added + +* `models.OnlineResizeSupportedEnum` was added + +* `models.MigrationNameAvailabilityResource` was added + +* `models.ServerSku` was added + +* `models.ThreatProtectionName` was added + +* `models.PrivateEndpoint` was added + +* `models.BackupStoreDetails` was added + +* `models.ServerThreatProtectionSettingsModel$Definition` was added + +* `models.MigrationResource$UpdateStages` was added + +* `models.FlexibleServers` was added + +* `models.LogicalReplicationOnSourceDbEnum` was added + +* `models.MigrationDbState` was added + +* `models.KeyStatusEnum` was added + +* `models.CancelEnum` was added + +* `models.MigrationListFilter` was added + +* `models.FlexibleServerCapability` was added + +* `models.ReplicationState` was added + +* `models.PrivateEndpointServiceConnectionStatus` was added + +* `models.CapabilityBase` was added + +* `models.MigrationNameAvailabilityReason` was added + +* `models.LtrBackupOperations` was added + +* `models.LtrServerBackupOperation` was added + +* `models.ServerCapabilities` was added + +* `models.ValidationDetails` was added + +* `models.ReplicationPromoteOption` was added + +* `models.FastProvisioningSupportedEnum` was added + +* `models.LogFile` was added + +* `models.VirtualEndpointResourceForPatch` was added + +* `models.BackupRequestBase` was added + +* `models.ServerSkuCapability` was added + +* `models.StorageType` was added + +* `models.ValidationMessage` was added + +* `models.VirtualEndpointResource` was added + +* `models.SourceType` was added + +* `models.LogFileListResult` was added + +* `models.StorageAutoGrow` was added + +* `models.PrivateEndpointConnectionOperations` was added + +* `models.VirtualEndpointsListResult` was added + +* `models.BackupSettings` was added + +* `models.MigrationSubStateDetails` was added + +* `models.LtrServerBackupOperationList` was added + +* `models.PrivateEndpointConnectionListResult` was added + +* `models.DbMigrationStatus` was added + +* `models.MigrateRolesEnum` was added + +* `models.ValidationSummaryItem` was added + +* `models.LtrPreBackupRequest` was added + +* `models.LtrPreBackupResponse` was added + +* `models.ServerThreatProtectionSettingsModel$DefinitionStages` was added + +* `models.MigrationResource` was added + +* `models.HaMode` was added + +* `models.GeoBackupSupportedEnum` was added + +* `models.MigrationSecretParameters` was added + +* `models.TriggerCutoverEnum` was added + +* `models.VirtualEndpointType` was added + +* `models.DbLevelValidationStatus` was added + +* `models.ServerThreatProtectionSettings` was added + +* `models.MigrationResource$DefinitionStages` was added + +* `models.MigrationSubState` was added + +* `models.PrivateEndpointConnection` was added + +* `models.VirtualEndpointResource$DefinitionStages` was added + +* `models.DbServerMetadata` was added + +* `models.FlexibleServersTriggerLtrPreBackupHeaders` was added + +* `models.AdminCredentials` was added + +* `models.VirtualEndpointResource$UpdateStages` was added + +* `PostgreSqlServerManager$Configurable` was added + +* `models.SslMode` was added + +#### `models.Backup` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.StorageTierCapability` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added +* `reason()` was added + +#### `models.HighAvailability` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.VirtualNetworkSubnetUsageParameter` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.Backups` was modified + +* `delete(java.lang.String,java.lang.String,java.lang.String,com.azure.core.util.Context)` was added +* `create(java.lang.String,java.lang.String,java.lang.String)` was added +* `delete(java.lang.String,java.lang.String,java.lang.String)` was added +* `create(java.lang.String,java.lang.String,java.lang.String,com.azure.core.util.Context)` was added + +#### `models.ActiveDirectoryAdministratorAdd` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.CheckNameAvailabilityResponse` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.FastProvisioningEditionCapability` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added +* `serverCount()` was added +* `supportedTier()` was added +* `status()` was added +* `reason()` was added + +#### `models.Storage` was modified + +* `withThroughput(java.lang.Integer)` was added +* `withType(models.StorageType)` was added +* `tier()` was added +* `withTier(models.AzureManagedDiskPerformanceTiers)` was added +* `iops()` was added +* `fromJson(com.azure.json.JsonReader)` was added +* `autoGrow()` was added +* `type()` was added +* `throughput()` was added +* `withIops(java.lang.Integer)` was added +* `withAutoGrow(models.StorageAutoGrow)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.UserIdentity` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.OperationDisplay` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.UserAssignedIdentity` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.DelegatedSubnetUsage` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.ServerForUpdate` was modified + +* `withReplica(models.Replica)` was added +* `replica()` was added +* `fromJson(com.azure.json.JsonReader)` was added +* `administratorLogin()` was added +* `toJson(com.azure.json.JsonWriter)` was added +* `withAdministratorLogin(java.lang.String)` was added + +#### `models.DatabaseListResult` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.FirewallRuleListResult` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.DataEncryption` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `withGeoBackupEncryptionKeyStatus(models.KeyStatusEnum)` was added +* `withPrimaryEncryptionKeyStatus(models.KeyStatusEnum)` was added +* `withGeoBackupKeyUri(java.lang.String)` was added +* `geoBackupUserAssignedIdentityId()` was added +* `geoBackupKeyUri()` was added +* `fromJson(com.azure.json.JsonReader)` was added +* `primaryEncryptionKeyStatus()` was added +* `geoBackupEncryptionKeyStatus()` was added +* `withGeoBackupUserAssignedIdentityId(java.lang.String)` was added + +#### `models.RestartParameter` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.ServerVersionCapability` was modified + +* `reason()` was added +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.AdministratorListResult` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.FlexibleServerEditionCapability` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `defaultSkuName()` was added +* `reason()` was added +* `supportedServerSkus()` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.CapabilitiesListResult` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.ConfigurationForUpdate` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.Operation` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.ServerBackupListResult` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.MaintenanceWindow` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.Network` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `withPublicNetworkAccess(models.ServerPublicNetworkAccessState)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.Sku` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.ConfigurationListResult` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.CheckNameAvailabilityRequest` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.Server$Update` was modified + +* `withReplica(models.Replica)` was added +* `withAdministratorLogin(java.lang.String)` was added + +#### `models.Server` was modified + +* `privateEndpointConnections()` was added +* `replica()` was added + +#### `models.ServerListResult` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.StorageEditionCapability` was modified + +* `reason()` was added +* `supportedStorageMb()` was added +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added +* `defaultStorageSizeMb()` was added + +#### `models.AuthConfig` was modified -### Other Changes +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added ## 1.1.0-beta.3 (2024-04-18) diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/README.md b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/README.md index a1f3f818854c0..d829e89766f10 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/README.md +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/README.md @@ -1,8 +1,8 @@ -# Azure Resource Manager PostgreSql client library for Java +# Azure Resource Manager PostgreSqlServer client library for Java -Azure Resource Manager PostgreSql client library for Java. +Azure Resource Manager PostgreSqlServer client library for Java. -This package contains Microsoft Azure SDK for PostgreSql Management SDK. The Microsoft Azure management API provides create, read, update, and delete functionality for Azure PostgreSQL resources including servers, databases, firewall rules, VNET rules, security alert policies, log files and configurations with new business model. Package tag package-flexibleserver-2023-12-01-preview. 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 PostgreSqlServer 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). ## 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-beta.3 + 1.1.0-beta.4 ``` [//]: # ({x-version-update-end}) @@ -45,22 +45,18 @@ Azure Management Libraries require a `TokenCredential` implementation for authen ### Authentication -By default, Microsoft Entra ID token authentication depends on correct configuration of the following environment variables. +Microsoft Entra ID token authentication relies on the [credential class][azure_identity_credentials] from [Azure Identity][azure_identity] package. -- `AZURE_CLIENT_ID` for Azure client ID. -- `AZURE_TENANT_ID` for Azure tenant ID. -- `AZURE_CLIENT_SECRET` or `AZURE_CLIENT_CERTIFICATE_PATH` for client secret or client certificate. +Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment variable. -In addition, Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment variable. - -With above configuration, `azure` client can be authenticated using the following code: +Assuming the use of the `DefaultAzureCredential` credential class, the client can be authenticated using the following code: ```java AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); TokenCredential credential = new DefaultAzureCredentialBuilder() .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) .build(); -PostgreSqlManager manager = PostgreSqlManager +PostgreSqlServerManager manager = PostgreSqlServerManager .authenticate(credential, profile); ``` @@ -120,6 +116,7 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m [jdk]: https://learn.microsoft.com/azure/developer/java/fundamentals/ [azure_subscription]: https://azure.microsoft.com/free/ [azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity +[azure_identity_credentials]: https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/identity/azure-identity#credentials [azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-http-netty [authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/AUTH.md [design]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/DESIGN.md diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/SAMPLE.md b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/SAMPLE.md index f37d9e424efed..e44357c07c141 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/SAMPLE.md +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/SAMPLE.md @@ -10,6 +10,8 @@ ## Backups +- [Create](#backups_create) +- [Delete](#backups_delete) - [Get](#backups_get) - [ListByServer](#backups_listbyserver) @@ -91,10 +93,6 @@ - [Get](#privatelinkresources_get) - [ListByServer](#privatelinkresources_listbyserver) -## QuotaUsages - -- [List](#quotausages_list) - ## Replicas - [ListByServer](#replicas_listbyserver) @@ -146,15 +144,17 @@ import com.azure.resourcemanager.postgresqlflexibleserver.models.PrincipalType; */ public final class AdministratorsCreateSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/AdministratorAdd.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/AdministratorAdd. + * json */ /** * Sample code: Adds an Active DIrectory Administrator for the server. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ public static void addsAnActiveDIrectoryAdministratorForTheServer( - com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.administrators() .define("oooooooo-oooo-oooo-oooo-oooooooooooo") .withExistingFlexibleServer("testrg", "testserver") @@ -174,15 +174,17 @@ public final class AdministratorsCreateSamples { */ public final class AdministratorsDeleteSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/AdministratorDelete.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * AdministratorDelete.json */ /** * Sample code: AdministratorDelete. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ public static void - administratorDelete(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + administratorDelete(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.administrators() .delete("testrg", "testserver", "oooooooo-oooo-oooo-oooo-oooooooooooo", com.azure.core.util.Context.NONE); } @@ -197,14 +199,16 @@ public final class AdministratorsDeleteSamples { */ public final class AdministratorsGetSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/AdministratorGet.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/AdministratorGet. + * json */ /** * Sample code: ServerGet. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ - public static void serverGet(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + public static void serverGet(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.administrators() .getWithResponse("testrg", "pgtestsvc1", "oooooooo-oooo-oooo-oooo-oooooooooooo", com.azure.core.util.Context.NONE); @@ -220,20 +224,69 @@ public final class AdministratorsGetSamples { */ public final class AdministratorsListByServerSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/AdministratorsListByServer.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * AdministratorsListByServer.json */ /** * Sample code: AdministratorsListByServer. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ public static void - administratorsListByServer(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + administratorsListByServer(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.administrators().listByServer("testrg", "pgtestsvc1", com.azure.core.util.Context.NONE); } } ``` +### Backups_Create + +```java +/** + * Samples for Backups Create. + */ +public final class BackupsCreateSamples { + /* + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/BackupCreate.json + */ + /** + * Sample code: Create a new Backup for a flexible server. + * + * @param manager Entry point to PostgreSqlServerManager. + */ + public static void createANewBackupForAFlexibleServer( + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { + manager.backups() + .create("TestGroup", "postgresqltestserver", "backup_20210615T160516", com.azure.core.util.Context.NONE); + } +} +``` + +### Backups_Delete + +```java +/** + * Samples for Backups Delete. + */ +public final class BackupsDeleteSamples { + /* + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/BackupDelete.json + */ + /** + * Sample code: Delete a specific backup. + * + * @param manager Entry point to PostgreSqlServerManager. + */ + public static void + deleteASpecificBackup(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { + manager.backups().delete("TestGroup", "testserver", "backup_20210615T160516", com.azure.core.util.Context.NONE); + } +} +``` + ### Backups_Get ```java @@ -242,15 +295,16 @@ public final class AdministratorsListByServerSamples { */ public final class BackupsGetSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/BackupGet.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/BackupGet.json */ /** * Sample code: Get a backup for a server. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ public static void - getABackupForAServer(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + getABackupForAServer(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.backups() .getWithResponse("TestGroup", "postgresqltestserver", "daily_20210615T160516", com.azure.core.util.Context.NONE); @@ -266,15 +320,17 @@ public final class BackupsGetSamples { */ public final class BackupsListByServerSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/BackupListByServer.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/BackupListByServer + * .json */ /** * Sample code: List backups for a server. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ public static void - listBackupsForAServer(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + listBackupsForAServer(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.backups().listByServer("TestGroup", "postgresqltestserver", com.azure.core.util.Context.NONE); } } @@ -290,14 +346,17 @@ import com.azure.resourcemanager.postgresqlflexibleserver.models.CheckNameAvaila */ public final class CheckNameAvailabilityExecuteSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/CheckNameAvailability.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * CheckNameAvailability.json */ /** * Sample code: NameAvailability. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ - public static void nameAvailability(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + public static void + nameAvailability(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.checkNameAvailabilities() .executeWithResponse(new CheckNameAvailabilityRequest().withName("name1") .withType("Microsoft.DBforPostgreSQL/flexibleServers"), com.azure.core.util.Context.NONE); @@ -315,14 +374,17 @@ import com.azure.resourcemanager.postgresqlflexibleserver.models.CheckNameAvaila */ public final class CheckNameAvailabilityWithLocationExecuteSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/CheckNameAvailabilityLocationBased.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * CheckNameAvailabilityLocationBased.json */ /** * Sample code: NameAvailability. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ - public static void nameAvailability(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + public static void + nameAvailability(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.checkNameAvailabilityWithLocations() .executeWithResponse("westus", new CheckNameAvailabilityRequest().withName("name1") .withType("Microsoft.DBforPostgreSQL/flexibleServers"), com.azure.core.util.Context.NONE); @@ -338,14 +400,17 @@ public final class CheckNameAvailabilityWithLocationExecuteSamples { */ public final class ConfigurationsGetSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/ConfigurationGet.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ConfigurationGet. + * json */ /** * Sample code: ConfigurationGet. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ - public static void configurationGet(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + public static void + configurationGet(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.configurations() .getWithResponse("testrg", "testserver", "array_nulls", com.azure.core.util.Context.NONE); } @@ -360,14 +425,17 @@ public final class ConfigurationsGetSamples { */ public final class ConfigurationsListByServerSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/ConfigurationListByServer.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * ConfigurationListByServer.json */ /** * Sample code: ConfigurationList. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ - public static void configurationList(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + public static void + configurationList(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.configurations().listByServer("testrg", "testserver", com.azure.core.util.Context.NONE); } } @@ -381,15 +449,17 @@ public final class ConfigurationsListByServerSamples { */ public final class ConfigurationsPutSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/ConfigurationUpdate.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * ConfigurationUpdate.json */ /** * Sample code: Update a user configuration. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ public static void - updateAUserConfiguration(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + updateAUserConfiguration(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.configurations() .define("event_scheduler") .withExistingFlexibleServer("testrg", "testserver") @@ -410,15 +480,17 @@ import com.azure.resourcemanager.postgresqlflexibleserver.models.Configuration; */ public final class ConfigurationsUpdateSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/ConfigurationUpdate.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * ConfigurationUpdate.json */ /** * Sample code: Update a user configuration. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ public static void - updateAUserConfiguration(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + updateAUserConfiguration(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { Configuration resource = manager.configurations() .getWithResponse("testrg", "testserver", "event_scheduler", com.azure.core.util.Context.NONE) .getValue(); @@ -435,14 +507,17 @@ public final class ConfigurationsUpdateSamples { */ public final class DatabasesCreateSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/DatabaseCreate.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/DatabaseCreate. + * json */ /** * Sample code: Create a database. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ - public static void createADatabase(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + public static void + createADatabase(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.databases() .define("db1") .withExistingFlexibleServer("TestGroup", "testserver") @@ -461,14 +536,17 @@ public final class DatabasesCreateSamples { */ public final class DatabasesDeleteSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/DatabaseDelete.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/DatabaseDelete. + * json */ /** * Sample code: Delete a database. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ - public static void deleteADatabase(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + public static void + deleteADatabase(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.databases().delete("TestGroup", "testserver", "db1", com.azure.core.util.Context.NONE); } } @@ -482,14 +560,16 @@ public final class DatabasesDeleteSamples { */ public final class DatabasesGetSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/DatabaseGet.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/DatabaseGet.json */ /** * Sample code: Get a database. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ - public static void getADatabase(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + public static void + getADatabase(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.databases().getWithResponse("TestGroup", "testserver", "db1", com.azure.core.util.Context.NONE); } } @@ -503,15 +583,17 @@ public final class DatabasesGetSamples { */ public final class DatabasesListByServerSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/DatabasesListByServer.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * DatabasesListByServer.json */ /** * Sample code: List databases in a server. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ public static void - listDatabasesInAServer(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + listDatabasesInAServer(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.databases().listByServer("TestGroup", "testserver", com.azure.core.util.Context.NONE); } } @@ -525,15 +607,17 @@ public final class DatabasesListByServerSamples { */ public final class FirewallRulesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/FirewallRuleCreate.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/FirewallRuleCreate + * .json */ /** * Sample code: FirewallRuleCreate. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ public static void - firewallRuleCreate(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + firewallRuleCreate(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.firewallRules() .define("rule1") .withExistingFlexibleServer("testrg", "testserver") @@ -552,15 +636,17 @@ public final class FirewallRulesCreateOrUpdateSamples { */ public final class FirewallRulesDeleteSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/FirewallRuleDelete.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/FirewallRuleDelete + * .json */ /** * Sample code: FirewallRuleDelete. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ public static void - firewallRuleDelete(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + firewallRuleDelete(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.firewallRules().delete("testrg", "testserver", "rule1", com.azure.core.util.Context.NONE); } } @@ -574,14 +660,17 @@ public final class FirewallRulesDeleteSamples { */ public final class FirewallRulesGetSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/FirewallRuleGet.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/FirewallRuleGet. + * json */ /** * Sample code: FirewallRuleList. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ - public static void firewallRuleList(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + public static void + firewallRuleList(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.firewallRules().getWithResponse("testrg", "testserver", "rule1", com.azure.core.util.Context.NONE); } } @@ -595,14 +684,17 @@ public final class FirewallRulesGetSamples { */ public final class FirewallRulesListByServerSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/FirewallRuleListByServer.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * FirewallRuleListByServer.json */ /** * Sample code: FirewallRuleList. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ - public static void firewallRuleList(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + public static void + firewallRuleList(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.firewallRules().listByServer("testrg", "testserver", com.azure.core.util.Context.NONE); } } @@ -621,15 +713,17 @@ import java.util.Arrays; */ public final class FlexibleServerStartLtrBackupSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/LongTermRetentionBackup.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * LongTermRetentionBackup.json */ /** * Sample code: Sample_ExecuteBackup. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ public static void - sampleExecuteBackup(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + sampleExecuteBackup(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.flexibleServers() .startLtrBackup("rgLongTermRetention", "pgsqlltrtestserver", new LtrBackupRequest().withBackupSettings(new BackupSettings().withBackupName("backup1")) @@ -650,14 +744,17 @@ import com.azure.resourcemanager.postgresqlflexibleserver.models.LtrPreBackupReq */ public final class FlexibleServerTriggerLtrPreBackupSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/LongTermRetentionPreBackup.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * LongTermRetentionPreBackup.json */ /** * Sample code: Sample_Prebackup. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ - public static void samplePrebackup(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + public static void + samplePrebackup(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.flexibleServers() .triggerLtrPreBackupWithResponse("rgLongTermRetention", "pgsqlltrtestserver", new LtrPreBackupRequest().withBackupSettings(new BackupSettings().withBackupName("backup1")), @@ -674,15 +771,17 @@ public final class FlexibleServerTriggerLtrPreBackupSamples { */ public final class GetPrivateDnsZoneSuffixExecuteSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/GetPrivateDnsZoneSuffix.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * GetPrivateDnsZoneSuffix.json */ /** * Sample code: GetPrivateDnsZoneSuffix. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ public static void - getPrivateDnsZoneSuffix(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + getPrivateDnsZoneSuffix(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.getPrivateDnsZoneSuffixes().executeWithResponse(com.azure.core.util.Context.NONE); } } @@ -696,15 +795,18 @@ public final class GetPrivateDnsZoneSuffixExecuteSamples { */ public final class LocationBasedCapabilitiesExecuteSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/CapabilitiesByLocation.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * CapabilitiesByLocation.json */ /** * Sample code: CapabilitiesList. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ - public static void capabilitiesList(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { - manager.locationBasedCapabilities().execute("westus", com.azure.core.util.Context.NONE); + public static void + capabilitiesList(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { + manager.locationBasedCapabilities().execute("eastus", com.azure.core.util.Context.NONE); } } ``` @@ -717,15 +819,17 @@ public final class LocationBasedCapabilitiesExecuteSamples { */ public final class LogFilesListByServerSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/LogFilesListByServer.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * LogFilesListByServer.json */ /** * Sample code: List all server log files for a server. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ - public static void - listAllServerLogFilesForAServer(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + public static void listAllServerLogFilesForAServer( + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.logFiles().listByServer("testrg", "postgresqltestsvc1", com.azure.core.util.Context.NONE); } } @@ -739,14 +843,16 @@ public final class LogFilesListByServerSamples { */ public final class LtrBackupOperationsGetSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/LongTermRetentionOperationGet.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * LongTermRetentionOperationGet.json */ /** * Sample code: Sample. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ - public static void sample(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + public static void sample(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.ltrBackupOperations() .getWithResponse("rgLongTermRetention", "pgsqlltrtestserver", "backup1", com.azure.core.util.Context.NONE); } @@ -761,15 +867,17 @@ public final class LtrBackupOperationsGetSamples { */ public final class LtrBackupOperationsListByServerSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/LongTermRetentionOperationListByServer.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * LongTermRetentionOperationListByServer.json */ /** * Sample code: Sample List of Long Tern Retention Operations by Flexible Server. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ public static void sampleListOfLongTernRetentionOperationsByFlexibleServer( - com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.ltrBackupOperations() .listByServer("rgLongTermRetention", "pgsqlltrtestserver", com.azure.core.util.Context.NONE); } @@ -794,15 +902,17 @@ import java.util.Arrays; */ public final class MigrationsCreateSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/Migrations_Create_With_PrivateEndpoint_Servers.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * Migrations_Create_With_PrivateEndpoint_Servers.json */ /** * Sample code: Migrations Create with private endpoint. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ public static void migrationsCreateWithPrivateEndpoint( - com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.migrations() .define("testmigration") .withRegion("westus") @@ -821,15 +931,17 @@ public final class MigrationsCreateSamples { } /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/Migrations_Create_With_Roles.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * Migrations_Create_With_Roles.json */ /** * Sample code: Migrations Create with roles. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ public static void - migrationsCreateWithRoles(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + migrationsCreateWithRoles(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.migrations() .define("testmigration") .withRegion("westus") @@ -847,15 +959,17 @@ public final class MigrationsCreateSamples { } /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/Migrations_Create_Validate_Only.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * Migrations_Create_Validate_Only.json */ /** * Sample code: Create Pre-migration Validation. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ - public static void - createPreMigrationValidation(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + public static void createPreMigrationValidation( + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.migrations() .define("testmigration") .withRegion("westus") @@ -873,15 +987,17 @@ public final class MigrationsCreateSamples { } /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/Migrations_Create_With_Other_Users.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * Migrations_Create_With_Other_Users.json */ /** * Sample code: Migrations Create by passing user names. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ public static void migrationsCreateByPassingUserNames( - com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.migrations() .define("testmigration") .withRegion("westus") @@ -899,14 +1015,17 @@ public final class MigrationsCreateSamples { } /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/Migrations_Create.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/Migrations_Create. + * json */ /** * Sample code: Migrations_Create. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ - public static void migrationsCreate(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + public static void + migrationsCreate(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.migrations() .define("testmigration") .withRegion("westus") @@ -925,15 +1044,17 @@ public final class MigrationsCreateSamples { } /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/Migrations_Create_Other_SourceTypes_Validate_Migrate.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * Migrations_Create_Other_SourceTypes_Validate_Migrate.json */ /** * Sample code: Create Migration with other source types for Validate and Migrate. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ public static void createMigrationWithOtherSourceTypesForValidateAndMigrate( - com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.migrations() .define("testmigration") .withRegion("westus") @@ -961,14 +1082,17 @@ public final class MigrationsCreateSamples { */ public final class MigrationsDeleteSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/Migrations_Delete.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/Migrations_Delete. + * json */ /** * Sample code: Migrations_Delete. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ - public static void migrationsDelete(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + public static void + migrationsDelete(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.migrations() .deleteWithResponse("ffffffff-ffff-ffff-ffff-ffffffffffff", "testrg", "testtarget", "testmigration", com.azure.core.util.Context.NONE); @@ -984,74 +1108,85 @@ public final class MigrationsDeleteSamples { */ public final class MigrationsGetSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/Migrations_GetMigrationWithSuccessfulValidationOnly.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * Migrations_GetMigrationWithSuccessfulValidationOnly.json */ /** * Sample code: Migrations_GetMigrationWithSuccessfulValidationOnly. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ public static void migrationsGetMigrationWithSuccessfulValidationOnly( - com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.migrations() .getWithResponse("ffffffff-ffff-ffff-ffff-ffffffffffff", "testrg", "testtarget", "testmigrationwithsuccessfulvalidationonly", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/Migrations_Get.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/Migrations_Get. + * json */ /** * Sample code: Migrations_Get. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ - public static void migrationsGet(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + public static void + migrationsGet(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.migrations() .getWithResponse("ffffffff-ffff-ffff-ffff-ffffffffffff", "testrg", "testtarget", "testmigration", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/Migrations_GetMigrationWithSuccessfulValidationButMigrationFailure.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * Migrations_GetMigrationWithSuccessfulValidationButMigrationFailure.json */ /** * Sample code: Migrations_GetMigrationWithSuccessfulValidationButMigrationFailure. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ public static void migrationsGetMigrationWithSuccessfulValidationButMigrationFailure( - com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.migrations() .getWithResponse("ffffffff-ffff-ffff-ffff-ffffffffffff", "testrg", "testtarget", "testmigrationwithsuccessfulvalidationbutmigrationfailure", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/Migrations_GetMigrationWithSuccessfulValidationAndMigration.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * Migrations_GetMigrationWithSuccessfulValidationAndMigration.json */ /** * Sample code: Migrations_GetMigrationWithSuccessfulValidationAndMigration. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ public static void migrationsGetMigrationWithSuccessfulValidationAndMigration( - com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.migrations() .getWithResponse("ffffffff-ffff-ffff-ffff-ffffffffffff", "testrg", "testtarget", "testmigrationwithsuccessfulvalidationandmigration", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/Migrations_GetMigrationWithValidationFailures.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * Migrations_GetMigrationWithValidationFailures.json */ /** * Sample code: Migrations_GetMigrationWithValidationFailures. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ public static void migrationsGetMigrationWithValidationFailures( - com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.migrations() .getWithResponse("ffffffff-ffff-ffff-ffff-ffffffffffff", "testrg", "testtarget", "testmigrationwithvalidationfailure", com.azure.core.util.Context.NONE); @@ -1069,15 +1204,17 @@ import com.azure.resourcemanager.postgresqlflexibleserver.models.MigrationListFi */ public final class MigrationsListByTargetServerSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/Migrations_ListByTargetServer.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * Migrations_ListByTargetServer.json */ /** * Sample code: Migrations_ListByTargetServer. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ - public static void - migrationsListByTargetServer(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + public static void migrationsListByTargetServer( + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.migrations() .listByTargetServer("ffffffff-ffff-ffff-ffff-ffffffffffff", "testrg", "testtarget", MigrationListFilter.ALL, com.azure.core.util.Context.NONE); @@ -1097,14 +1234,17 @@ import com.azure.resourcemanager.postgresqlflexibleserver.models.MigrationResour */ public final class MigrationsUpdateSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/Migrations_Cancel.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/Migrations_Cancel. + * json */ /** * Sample code: Cancel migration. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ - public static void cancelMigration(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + public static void + cancelMigration(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { MigrationResource resource = manager.migrations() .getWithResponse("ffffffff-ffff-ffff-ffff-ffffffffffff", "testrg", "testtarget", "testmigration", com.azure.core.util.Context.NONE) @@ -1113,14 +1253,17 @@ public final class MigrationsUpdateSamples { } /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/Migrations_Update.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/Migrations_Update. + * json */ /** * Sample code: Migrations_Update. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ - public static void migrationsUpdate(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + public static void + migrationsUpdate(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { MigrationResource resource = manager.migrations() .getWithResponse("ffffffff-ffff-ffff-ffff-ffffffffffff", "testrg", "testtarget", "testmigration", com.azure.core.util.Context.NONE) @@ -1138,14 +1281,16 @@ public final class MigrationsUpdateSamples { */ public final class OperationsListSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/OperationList.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/OperationList.json */ /** * Sample code: OperationList. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ - public static void operationList(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + public static void + operationList(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.operations().listWithResponse(com.azure.core.util.Context.NONE); } } @@ -1159,15 +1304,17 @@ public final class OperationsListSamples { */ public final class PrivateEndpointConnectionOperationDeleteSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/PrivateEndpointConnectionDelete.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * PrivateEndpointConnectionDelete.json */ /** * Sample code: Deletes a private endpoint connection with a given name. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ public static void deletesAPrivateEndpointConnectionWithAGivenName( - com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.privateEndpointConnectionOperations() .delete("Default", "test-svr", "private-endpoint-connection-name.1fa229cd-bf3f-47f0-8c49-afb36723997e", com.azure.core.util.Context.NONE); @@ -1187,15 +1334,17 @@ import com.azure.resourcemanager.postgresqlflexibleserver.models.PrivateLinkServ */ public final class PrivateEndpointConnectionOperationUpdateSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/PrivateEndpointConnectionUpdate.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * PrivateEndpointConnectionUpdate.json */ /** * Sample code: Approve or reject a private endpoint connection with a given name. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ public static void approveOrRejectAPrivateEndpointConnectionWithAGivenName( - com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.privateEndpointConnectionOperations() .update("Default", "test-svr", "private-endpoint-connection-name.1fa229cd-bf3f-47f0-8c49-afb36723997e", new PrivateEndpointConnectionInner().withPrivateLinkServiceConnectionState( @@ -1214,15 +1363,17 @@ public final class PrivateEndpointConnectionOperationUpdateSamples { */ public final class PrivateEndpointConnectionsGetSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/PrivateEndpointConnectionGet.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * PrivateEndpointConnectionGet.json */ /** * Sample code: Gets private endpoint connection. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ - public static void - getsPrivateEndpointConnection(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + public static void getsPrivateEndpointConnection( + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.privateEndpointConnections() .getWithResponse("Default", "test-svr", "private-endpoint-connection-name.1fa229cd-bf3f-47f0-8c49-afb36723997e", @@ -1239,15 +1390,17 @@ public final class PrivateEndpointConnectionsGetSamples { */ public final class PrivateEndpointConnectionsListByServerSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/PrivateEndpointConnectionList.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * PrivateEndpointConnectionList.json */ /** * Sample code: Gets list of private endpoint connections on a server. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ public static void getsListOfPrivateEndpointConnectionsOnAServer( - com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.privateEndpointConnections().listByServer("Default", "test-svr", com.azure.core.util.Context.NONE); } } @@ -1261,15 +1414,17 @@ public final class PrivateEndpointConnectionsListByServerSamples { */ public final class PrivateLinkResourcesGetSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/PrivateLinkResourcesGet.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * PrivateLinkResourcesGet.json */ /** * Sample code: Gets a private link resource for PostgreSQL. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ public static void getsAPrivateLinkResourceForPostgreSQL( - com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.privateLinkResources().getWithResponse("Default", "test-svr", "plr", com.azure.core.util.Context.NONE); } } @@ -1283,42 +1438,22 @@ public final class PrivateLinkResourcesGetSamples { */ public final class PrivateLinkResourcesListByServerSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/PrivateLinkResourcesList.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * PrivateLinkResourcesList.json */ /** * Sample code: Gets private link resources for PostgreSQL. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ public static void getsPrivateLinkResourcesForPostgreSQL( - com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.privateLinkResources().listByServer("Default", "test-svr", com.azure.core.util.Context.NONE); } } ``` -### QuotaUsages_List - -```java -/** - * Samples for QuotaUsages List. - */ -public final class QuotaUsagesListSamples { - /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-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 @@ -1327,15 +1462,17 @@ public final class QuotaUsagesListSamples { */ public final class ReplicasListByServerSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/ReplicasListByServer.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * ReplicasListByServer.json */ /** * Sample code: ReplicasListByServer. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ public static void - replicasListByServer(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + replicasListByServer(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.replicas().listByServer("testrg", "sourcepgservername", com.azure.core.util.Context.NONE); } } @@ -1351,15 +1488,17 @@ import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.Migratio */ public final class ResourceProviderCheckMigrationNameAvailabilitySamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/CheckMigrationNameAvailability.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * CheckMigrationNameAvailability.json */ /** * Sample code: CheckMigrationNameAvailability. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ - public static void - checkMigrationNameAvailability(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + public static void checkMigrationNameAvailability( + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.resourceProviders() .checkMigrationNameAvailabilityWithResponse("ffffffff-ffff-ffff-ffff-ffffffffffff", "testrg", "testtarget", new MigrationNameAvailabilityResourceInner().withName("name1") @@ -1377,15 +1516,17 @@ public final class ResourceProviderCheckMigrationNameAvailabilitySamples { */ public final class ServerCapabilitiesListSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/ServerCapabilities.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ServerCapabilities + * .json */ /** * Sample code: ServerCapabilitiesList. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ public static void - serverCapabilitiesList(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + serverCapabilitiesList(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.serverCapabilities().list("testrg", "pgtestsvc4", com.azure.core.util.Context.NONE); } } @@ -1403,15 +1544,17 @@ import com.azure.resourcemanager.postgresqlflexibleserver.models.ThreatProtectio */ public final class ServerThreatProtectionSettingsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/ServerThreatProtectionSettingsCreateOrUpdate.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * ServerThreatProtectionSettingsCreateOrUpdate.json */ /** * Sample code: Update a server's Threat Protection settings. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ public static void updateAServerSThreatProtectionSettings( - com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { ServerThreatProtectionSettingsModel resource = manager.serverThreatProtectionSettings() .getWithResponse("threatprotection-4799", "threatprotection-6440", ThreatProtectionName.DEFAULT, com.azure.core.util.Context.NONE) @@ -1431,15 +1574,17 @@ import com.azure.resourcemanager.postgresqlflexibleserver.models.ThreatProtectio */ public final class ServerThreatProtectionSettingsGetSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/ServerThreatProtectionSettingsGet.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * ServerThreatProtectionSettingsGet.json */ /** * Sample code: Get a server's Threat Protection settings. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ public static void getAServerSThreatProtectionSettings( - com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.serverThreatProtectionSettings() .getWithResponse("threatprotection-6852", "threatprotection-2080", ThreatProtectionName.DEFAULT, com.azure.core.util.Context.NONE); @@ -1455,15 +1600,17 @@ public final class ServerThreatProtectionSettingsGetSamples { */ public final class ServerThreatProtectionSettingsListByServerSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/ServerThreatProtectionSettingsListByServer.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * ServerThreatProtectionSettingsListByServer.json */ /** * Sample code: Get a server's Advanced Threat Protection settings. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ public static void getAServerSAdvancedThreatProtectionSettings( - com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.serverThreatProtectionSettings() .listByServer("threatprotection-6852", "threatprotection-2080", com.azure.core.util.Context.NONE); } @@ -1502,15 +1649,17 @@ import java.util.Map; */ public final class ServersCreateSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/ServerCreateWithDataEncryptionEnabled.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * ServerCreateWithDataEncryptionEnabled.json */ /** * Sample code: ServerCreateWithDataEncryptionEnabled. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ public static void serverCreateWithDataEncryptionEnabled( - com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.servers() .define("pgtestsvc4") .withRegion("westus") @@ -1542,15 +1691,17 @@ public final class ServersCreateSamples { } /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/ServerCreateReviveDropped.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * ServerCreateReviveDropped.json */ /** * Sample code: ServerCreateReviveDropped. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ public static void - serverCreateReviveDropped(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + serverCreateReviveDropped(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.servers() .define("pgtestsvc5-rev") .withRegion("westus") @@ -1563,15 +1714,17 @@ public final class ServersCreateSamples { } /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/ServerCreateGeoRestoreWithDataEncryptionEnabled.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * ServerCreateGeoRestoreWithDataEncryptionEnabled.json */ /** * Sample code: Create a database as a geo-restore in geo-paired location. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ public static void createADatabaseAsAGeoRestoreInGeoPairedLocation( - com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.servers() .define("pgtestsvc5geo") .withRegion("eastus") @@ -1596,14 +1749,16 @@ public final class ServersCreateSamples { } /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/ServerCreate.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ServerCreate.json */ /** * Sample code: Create a new server. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ - public static void createANewServer(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + public static void + createANewServer(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.servers() .define("pgtestsvc4") .withRegion("westus") @@ -1628,15 +1783,17 @@ public final class ServersCreateSamples { } /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/ServerCreateWithAadAuthEnabled.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * ServerCreateWithAadAuthEnabled.json */ /** * Sample code: Create a new server with active directory authentication enabled. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ public static void createANewServerWithActiveDirectoryAuthenticationEnabled( - com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.servers() .define("pgtestsvc4") .withRegion("westus") @@ -1665,15 +1822,17 @@ public final class ServersCreateSamples { } /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/ServerCreateReplica.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * ServerCreateReplica.json */ /** * Sample code: ServerCreateReplica. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ public static void - serverCreateReplica(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + serverCreateReplica(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.servers() .define("pgtestsvc5rep") .withRegion("westus") @@ -1695,15 +1854,17 @@ public final class ServersCreateSamples { } /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/ServerCreatePointInTimeRestore.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * ServerCreatePointInTimeRestore.json */ /** * Sample code: Create a database as a point in time restore. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ public static void createADatabaseAsAPointInTimeRestore( - com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.servers() .define("pgtestsvc5") .withRegion("westus") @@ -1737,14 +1898,16 @@ public final class ServersCreateSamples { */ public final class ServersDeleteSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/ServerDelete.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ServerDelete.json */ /** * Sample code: ServerDelete. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ - public static void serverDelete(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + public static void + serverDelete(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.servers().delete("testrg", "testserver", com.azure.core.util.Context.NONE); } } @@ -1758,39 +1921,45 @@ public final class ServersDeleteSamples { */ public final class ServersGetByResourceGroupSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/ServerGetWithPrivateEndpoints.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * ServerGetWithPrivateEndpoints.json */ /** * Sample code: ServerGetWithPrivateEndpoints. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ - public static void - serverGetWithPrivateEndpoints(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + public static void serverGetWithPrivateEndpoints( + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.servers().getByResourceGroupWithResponse("testrg", "pgtestsvc2", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/ServerGet.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ServerGet.json */ /** * Sample code: ServerGet. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ - public static void serverGet(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + public static void serverGet(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.servers().getByResourceGroupWithResponse("testrg", "pgtestsvc1", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/ServerGetWithVnet.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ServerGetWithVnet. + * json */ /** * Sample code: ServerGetWithVnet. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ - public static void serverGetWithVnet(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + public static void + serverGetWithVnet(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.servers().getByResourceGroupWithResponse("testrg", "pgtestsvc4", com.azure.core.util.Context.NONE); } } @@ -1804,14 +1973,15 @@ public final class ServersGetByResourceGroupSamples { */ public final class ServersListSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/ServerList.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ServerList.json */ /** * Sample code: ServerList. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ - public static void serverList(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + public static void serverList(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.servers().list(com.azure.core.util.Context.NONE); } } @@ -1825,15 +1995,17 @@ public final class ServersListSamples { */ public final class ServersListByResourceGroupSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/ServerListByResourceGroup.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * ServerListByResourceGroup.json */ /** * Sample code: ServerListByResourceGroup. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ public static void - serverListByResourceGroup(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + serverListByResourceGroup(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.servers().listByResourceGroup("testrg", com.azure.core.util.Context.NONE); } } @@ -1850,27 +2022,31 @@ import com.azure.resourcemanager.postgresqlflexibleserver.models.RestartParamete */ public final class ServersRestartSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/ServerRestart.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ServerRestart.json */ /** * Sample code: ServerRestart. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ - public static void serverRestart(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + public static void + serverRestart(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.servers().restart("testrg", "testserver", null, com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/ServerRestartWithFailover.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * ServerRestartWithFailover.json */ /** * Sample code: ServerRestartWithFailover. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ public static void - serverRestartWithFailover(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + serverRestartWithFailover(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.servers() .restart("testrg", "testserver", new RestartParameter().withRestartWithFailover(true).withFailoverMode(FailoverMode.FORCED_FAILOVER), @@ -1887,14 +2063,15 @@ public final class ServersRestartSamples { */ public final class ServersStartSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/ServerStart.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ServerStart.json */ /** * Sample code: ServerStart. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ - public static void serverStart(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + public static void serverStart(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.servers().start("testrg", "testserver", com.azure.core.util.Context.NONE); } } @@ -1908,14 +2085,15 @@ public final class ServersStartSamples { */ public final class ServersStopSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/ServerStop.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ServerStop.json */ /** * Sample code: ServerStop. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ - public static void serverStop(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + public static void serverStop(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.servers().stop("testrg", "testserver", com.azure.core.util.Context.NONE); } } @@ -1953,15 +2131,17 @@ import java.util.Map; */ public final class ServersUpdateSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/ServerUpdateWithAadAuthEnabled.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * ServerUpdateWithAadAuthEnabled.json */ /** * Sample code: ServerUpdateWithAadAuthEnabled. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ - public static void - serverUpdateWithAadAuthEnabled(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + public static void serverUpdateWithAadAuthEnabled( + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { Server resource = manager.servers() .getByResourceGroupWithResponse("TestGroup", "pgtestsvc4", com.azure.core.util.Context.NONE) .getValue(); @@ -1980,15 +2160,17 @@ public final class ServersUpdateSamples { } /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/ServerUpdateWithDataEncryptionEnabled.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * ServerUpdateWithDataEncryptionEnabled.json */ /** * Sample code: ServerUpdateWithDataEncryptionEnabled. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ public static void serverUpdateWithDataEncryptionEnabled( - com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { Server resource = manager.servers() .getByResourceGroupWithResponse("TestGroup", "pgtestsvc4", com.azure.core.util.Context.NONE) .getValue(); @@ -2013,17 +2195,19 @@ public final class ServersUpdateSamples { } /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/PromoteReplicaAsPlannedSwitchover.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * PromoteReplicaAsPlannedSwitchover.json */ /** * Sample code: SwitchOver a replica server as planned, i.e. it will wait for replication to complete before * promoting replica as Primary and original primary as replica. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ public static void switchOverAReplicaServerAsPlannedIEItWillWaitForReplicationToCompleteBeforePromotingReplicaAsPrimaryAndOriginalPrimaryAsReplica( - com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { Server resource = manager.servers() .getByResourceGroupWithResponse("testResourceGroup", "pgtestsvc4-replica", com.azure.core.util.Context.NONE) .getValue(); @@ -2034,17 +2218,19 @@ public final class ServersUpdateSamples { } /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/PromoteReplicaAsForcedSwitchover.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * PromoteReplicaAsForcedSwitchover.json */ /** * Sample code: SwitchOver a replica server as forced, i.e. it will replica as Primary and original primary as * replica immediately without waiting for primary and replica to be in sync. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ public static void switchOverAReplicaServerAsForcedIEItWillReplicaAsPrimaryAndOriginalPrimaryAsReplicaImmediatelyWithoutWaitingForPrimaryAndReplicaToBeInSync( - com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { Server resource = manager.servers() .getByResourceGroupWithResponse("testResourceGroup", "pgtestsvc4-replica", com.azure.core.util.Context.NONE) .getValue(); @@ -2055,14 +2241,16 @@ public final class ServersUpdateSamples { } /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/ServerUpdate.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ServerUpdate.json */ /** * Sample code: ServerUpdate. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ - public static void serverUpdate(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + public static void + serverUpdate(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { Server resource = manager.servers() .getByResourceGroupWithResponse("TestGroup", "pgtestsvc4", com.azure.core.util.Context.NONE) .getValue(); @@ -2078,15 +2266,17 @@ public final class ServersUpdateSamples { } /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/ServerUpdateWithMajorVersionUpgrade.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * ServerUpdateWithMajorVersionUpgrade.json */ /** * Sample code: ServerUpdateWithMajorVersionUpgrade. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ public static void serverUpdateWithMajorVersionUpgrade( - com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { Server resource = manager.servers() .getByResourceGroupWithResponse("testrg", "pgtestsvc4", com.azure.core.util.Context.NONE) .getValue(); @@ -2094,15 +2284,17 @@ public final class ServersUpdateSamples { } /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/ServerUpdateWithCustomerMaintenanceWindow.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * ServerUpdateWithCustomerMaintenanceWindow.json */ /** * Sample code: ServerUpdateWithCustomerMaintenanceWindow. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ public static void serverUpdateWithCustomerMaintenanceWindow( - com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { Server resource = manager.servers() .getByResourceGroupWithResponse("testrg", "pgtestsvc4", com.azure.core.util.Context.NONE) .getValue(); @@ -2116,17 +2308,19 @@ public final class ServersUpdateSamples { } /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/PromoteReplicaAsForcedStandaloneServer.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * PromoteReplicaAsForcedStandaloneServer.json */ /** * Sample code: Promote a replica server as a Standalone server as forced, i.e. it will promote a replica server * immediately without waiting for primary and replica to be in sync. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ public static void promoteAReplicaServerAsAStandaloneServerAsForcedIEItWillPromoteAReplicaServerImmediatelyWithoutWaitingForPrimaryAndReplicaToBeInSync( - com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { Server resource = manager.servers() .getByResourceGroupWithResponse("testResourceGroup", "pgtestsvc4-replica", com.azure.core.util.Context.NONE) .getValue(); @@ -2137,16 +2331,18 @@ public final class ServersUpdateSamples { } /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/PromoteReplicaAsPlannedStandaloneServer.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * PromoteReplicaAsPlannedStandaloneServer.json */ /** * Sample code: Promote a replica server as a Standalone server as planned, i.e. it will wait for replication to * complete. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ public static void promoteAReplicaServerAsAStandaloneServerAsPlannedIEItWillWaitForReplicationToComplete( - com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { Server resource = manager.servers() .getByResourceGroupWithResponse("testResourceGroup", "pgtestsvc4-replica", com.azure.core.util.Context.NONE) .getValue(); @@ -2181,15 +2377,17 @@ import java.util.Arrays; */ public final class VirtualEndpointsCreateSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/VirtualEndpointCreate.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * VirtualEndpointCreate.json */ /** * Sample code: Create a new virtual endpoint for a flexible server. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ public static void createANewVirtualEndpointForAFlexibleServer( - com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.virtualEndpoints() .define("pgVirtualEndpoint1") .withExistingFlexibleServer("testrg", "pgtestsvc4") @@ -2208,15 +2406,17 @@ public final class VirtualEndpointsCreateSamples { */ public final class VirtualEndpointsDeleteSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/VirtualEndpointDelete.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * VirtualEndpointDelete.json */ /** * Sample code: Delete a virtual endpoint. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ public static void - deleteAVirtualEndpoint(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + deleteAVirtualEndpoint(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.virtualEndpoints() .delete("testrg", "pgtestsvc4", "pgVirtualEndpoint1", com.azure.core.util.Context.NONE); } @@ -2231,15 +2431,17 @@ public final class VirtualEndpointsDeleteSamples { */ public final class VirtualEndpointsGetSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/VirtualEndpointsGet.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * VirtualEndpointsGet.json */ /** * Sample code: Get a virtual endpoint. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ public static void - getAVirtualEndpoint(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + getAVirtualEndpoint(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.virtualEndpoints() .getWithResponse("testrg", "pgtestsvc4", "pgVirtualEndpoint1", com.azure.core.util.Context.NONE); } @@ -2254,15 +2456,17 @@ public final class VirtualEndpointsGetSamples { */ public final class VirtualEndpointsListByServerSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/VirtualEndpointsListByServer.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * VirtualEndpointsListByServer.json */ /** * Sample code: VirtualEndpointListByServer. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ - public static void - virtualEndpointListByServer(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + public static void virtualEndpointListByServer( + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.virtualEndpoints().listByServer("testrg", "pgtestsvc4", com.azure.core.util.Context.NONE); } } @@ -2280,15 +2484,17 @@ import java.util.Arrays; */ public final class VirtualEndpointsUpdateSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/VirtualEndpointUpdate.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * VirtualEndpointUpdate.json */ /** * Sample code: Update a virtual endpoint for a server to update the. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ public static void updateAVirtualEndpointForAServerToUpdateThe( - com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { VirtualEndpointResource resource = manager.virtualEndpoints() .getWithResponse("testrg", "pgtestsvc4", "pgVirtualEndpoint1", com.azure.core.util.Context.NONE) .getValue(); @@ -2310,15 +2516,17 @@ import com.azure.resourcemanager.postgresqlflexibleserver.models.VirtualNetworkS */ public final class VirtualNetworkSubnetUsageExecuteSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/VirtualNetworkSubnetUsage.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * VirtualNetworkSubnetUsage.json */ /** * Sample code: VirtualNetworkSubnetUsageList. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ - public static void - virtualNetworkSubnetUsageList(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + public static void virtualNetworkSubnetUsageList( + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.virtualNetworkSubnetUsages() .executeWithResponse("westus", new VirtualNetworkSubnetUsageParameter().withVirtualNetworkArmResourceId( "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/testvnet"), diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/pom.xml b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/pom.xml index 9ac6af349f048..133c36d315f59 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/pom.xml +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/pom.xml @@ -17,8 +17,8 @@ 1.1.0-beta.4 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-2023-12-01-preview. + Microsoft Azure SDK for PostgreSqlServer Management + This package contains Microsoft Azure SDK for PostgreSqlServer 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. https://github.com/Azure/azure-sdk-for-java @@ -48,6 +48,11 @@ true + + com.azure + azure-json + 1.3.0 + com.azure azure-core 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/PostgreSqlServerManager.java similarity index 92% rename from sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/PostgreSqlManager.java rename to sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/PostgreSqlServerManager.java index a0468b360fe58..aca6a052e7a44 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/PostgreSqlServerManager.java @@ -23,7 +23,7 @@ import com.azure.core.management.profile.AzureProfile; import com.azure.core.util.Configuration; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.postgresqlflexibleserver.fluent.PostgreSqlManagementClient; +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.PostgreSqlServerManagementClient; import com.azure.resourcemanager.postgresqlflexibleserver.implementation.AdministratorsImpl; import com.azure.resourcemanager.postgresqlflexibleserver.implementation.BackupsImpl; import com.azure.resourcemanager.postgresqlflexibleserver.implementation.CheckNameAvailabilitiesImpl; @@ -38,11 +38,10 @@ import com.azure.resourcemanager.postgresqlflexibleserver.implementation.LtrBackupOperationsImpl; import com.azure.resourcemanager.postgresqlflexibleserver.implementation.MigrationsImpl; import com.azure.resourcemanager.postgresqlflexibleserver.implementation.OperationsImpl; -import com.azure.resourcemanager.postgresqlflexibleserver.implementation.PostgreSqlManagementClientBuilder; +import com.azure.resourcemanager.postgresqlflexibleserver.implementation.PostgreSqlServerManagementClientBuilder; 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; @@ -67,7 +66,6 @@ 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; @@ -83,12 +81,12 @@ import java.util.stream.Collectors; /** - * Entry point to PostgreSqlManager. + * Entry point to PostgreSqlServerManager. * 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. */ -public final class PostgreSqlManager { +public final class PostgreSqlServerManager { private Administrators administrators; private Backups backups; @@ -127,8 +125,6 @@ public final class PostgreSqlManager { private PrivateLinkResources privateLinkResources; - private QuotaUsages quotaUsages; - private Replicas replicas; private LogFiles logFiles; @@ -139,12 +135,12 @@ public final class PostgreSqlManager { private VirtualNetworkSubnetUsages virtualNetworkSubnetUsages; - private final PostgreSqlManagementClient clientObject; + private final PostgreSqlServerManagementClient clientObject; - private PostgreSqlManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { + private PostgreSqlServerManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); Objects.requireNonNull(profile, "'profile' cannot be null."); - this.clientObject = new PostgreSqlManagementClientBuilder().pipeline(httpPipeline) + this.clientObject = new PostgreSqlServerManagementClientBuilder().pipeline(httpPipeline) .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) .subscriptionId(profile.getSubscriptionId()) .defaultPollInterval(defaultPollInterval) @@ -152,38 +148,38 @@ private PostgreSqlManager(HttpPipeline httpPipeline, AzureProfile profile, Durat } /** - * Creates an instance of PostgreSql service API entry point. + * Creates an instance of PostgreSqlServer service API entry point. * * @param credential the credential to use. * @param profile the Azure profile for client. - * @return the PostgreSql service API instance. + * @return the PostgreSqlServer service API instance. */ - public static PostgreSqlManager authenticate(TokenCredential credential, AzureProfile profile) { + public static PostgreSqlServerManager authenticate(TokenCredential credential, AzureProfile profile) { Objects.requireNonNull(credential, "'credential' cannot be null."); Objects.requireNonNull(profile, "'profile' cannot be null."); return configure().authenticate(credential, profile); } /** - * Creates an instance of PostgreSql service API entry point. + * Creates an instance of PostgreSqlServer service API entry point. * * @param httpPipeline the {@link HttpPipeline} configured with Azure authentication credential. * @param profile the Azure profile for client. - * @return the PostgreSql service API instance. + * @return the PostgreSqlServer service API instance. */ - public static PostgreSqlManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) { + public static PostgreSqlServerManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) { Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); Objects.requireNonNull(profile, "'profile' cannot be null."); - return new PostgreSqlManager(httpPipeline, profile, null); + return new PostgreSqlServerManager(httpPipeline, profile, null); } /** - * Gets a Configurable instance that can be used to create PostgreSqlManager with optional configuration. + * Gets a Configurable instance that can be used to create PostgreSqlServerManager with optional configuration. * * @return the Configurable instance allowing configurations. */ public static Configurable configure() { - return new PostgreSqlManager.Configurable(); + return new PostgreSqlServerManager.Configurable(); } /** @@ -288,13 +284,13 @@ public Configurable withDefaultPollInterval(Duration defaultPollInterval) { } /** - * Creates an instance of PostgreSql service API entry point. + * Creates an instance of PostgreSqlServer service API entry point. * * @param credential the credential to use. * @param profile the Azure profile for client. - * @return the PostgreSql service API instance. + * @return the PostgreSqlServer service API instance. */ - public PostgreSqlManager authenticate(TokenCredential credential, AzureProfile profile) { + public PostgreSqlServerManager authenticate(TokenCredential credential, AzureProfile profile) { Objects.requireNonNull(credential, "'credential' cannot be null."); Objects.requireNonNull(profile, "'profile' cannot be null."); @@ -303,7 +299,7 @@ public PostgreSqlManager authenticate(TokenCredential credential, AzureProfile p .append("-") .append("com.azure.resourcemanager.postgresqlflexibleserver") .append("/") - .append("1.1.0-beta.3"); + .append("1.0.0-beta.1"); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { userAgentBuilder.append(" (") .append(Configuration.getGlobalConfiguration().get("java.version")) @@ -345,7 +341,7 @@ public PostgreSqlManager authenticate(TokenCredential credential, AzureProfile p HttpPipeline httpPipeline = new HttpPipelineBuilder().httpClient(httpClient) .policies(policies.toArray(new HttpPipelinePolicy[0])) .build(); - return new PostgreSqlManager(httpPipeline, profile, defaultPollInterval); + return new PostgreSqlServerManager(httpPipeline, profile, defaultPollInterval); } } @@ -583,18 +579,6 @@ 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. * @@ -659,12 +643,12 @@ public VirtualNetworkSubnetUsages virtualNetworkSubnetUsages() { } /** - * Gets wrapped service client PostgreSqlManagementClient providing direct access to the underlying auto-generated - * API implementation, based on Azure REST API. + * Gets wrapped service client PostgreSqlServerManagementClient providing direct access to the underlying + * auto-generated API implementation, based on Azure REST API. * - * @return Wrapped service client PostgreSqlManagementClient. + * @return Wrapped service client PostgreSqlServerManagementClient. */ - public PostgreSqlManagementClient serviceClient() { + public PostgreSqlServerManagementClient serviceClient() { return this.clientObject; } } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/BackupsClient.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/BackupsClient.java index 4b4ef7d1a6e14..02ac67d512187 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/BackupsClient.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/BackupsClient.java @@ -9,14 +9,223 @@ import com.azure.core.http.rest.PagedFlux; import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; import com.azure.core.util.Context; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.ServerBackupInner; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; /** * An instance of this class provides access to all the operations defined in BackupsClient. */ public interface BackupsClient { + /** + * Create a specific backup for PostgreSQL flexible server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param backupName The name of the backup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return server backup properties along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono>> createWithResponseAsync(String resourceGroupName, String serverName, + String backupName); + + /** + * Create a specific backup for PostgreSQL flexible server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param backupName The name of the backup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of server backup properties. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + PollerFlux, ServerBackupInner> beginCreateAsync(String resourceGroupName, + String serverName, String backupName); + + /** + * Create a specific backup for PostgreSQL flexible server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param backupName The name of the backup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of server backup properties. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ServerBackupInner> beginCreate(String resourceGroupName, + String serverName, String backupName); + + /** + * Create a specific backup for PostgreSQL flexible server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param backupName The name of the backup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of server backup properties. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ServerBackupInner> beginCreate(String resourceGroupName, + String serverName, String backupName, Context context); + + /** + * Create a specific backup for PostgreSQL flexible server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param backupName The name of the backup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return server backup properties on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono createAsync(String resourceGroupName, String serverName, String backupName); + + /** + * Create a specific backup for PostgreSQL flexible server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param backupName The name of the backup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return server backup properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ServerBackupInner create(String resourceGroupName, String serverName, String backupName); + + /** + * Create a specific backup for PostgreSQL flexible server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param backupName The name of the backup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return server backup properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ServerBackupInner create(String resourceGroupName, String serverName, String backupName, Context context); + + /** + * Deletes a specific backup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param backupName The name of the backup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono>> deleteWithResponseAsync(String resourceGroupName, String serverName, + String backupName); + + /** + * Deletes a specific backup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param backupName The name of the backup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String serverName, String backupName); + + /** + * Deletes a specific backup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param backupName The name of the backup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String serverName, String backupName); + + /** + * Deletes a specific backup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param backupName The name of the backup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String serverName, String backupName, + Context context); + + /** + * Deletes a specific backup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param backupName The name of the backup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono deleteAsync(String resourceGroupName, String serverName, String backupName); + + /** + * Deletes a specific backup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param backupName The name of the backup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String serverName, String backupName); + + /** + * Deletes a specific backup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param backupName The name of the backup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String serverName, String backupName, Context context); + /** * Get specific backup for a given server. * 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/PostgreSqlServerManagementClient.java similarity index 95% rename from sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/PostgreSqlManagementClient.java rename to sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/PostgreSqlServerManagementClient.java index 6c7757cc61049..ac5111c62e018 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/PostgreSqlServerManagementClient.java @@ -8,9 +8,9 @@ import java.time.Duration; /** - * The interface for PostgreSqlManagementClient class. + * The interface for PostgreSqlServerManagementClient class. */ -public interface PostgreSqlManagementClient { +public interface PostgreSqlServerManagementClient { /** * Gets The ID of the target subscription. The value must be an UUID. * @@ -179,13 +179,6 @@ 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. * 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 deleted file mode 100644 index 59ed9de674a3d..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/QuotaUsagesClient.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (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/models/ActiveDirectoryAdministratorInner.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/ActiveDirectoryAdministratorInner.java index 777cba1bb74c3..472a9c5f83661 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/ActiveDirectoryAdministratorInner.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/ActiveDirectoryAdministratorInner.java @@ -8,8 +8,11 @@ import com.azure.core.management.ProxyResource; import com.azure.core.management.SystemData; import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.postgresqlflexibleserver.models.PrincipalType; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; /** * Represents an Active Directory administrator. @@ -19,15 +22,28 @@ public final class ActiveDirectoryAdministratorInner extends ProxyResource { /* * Properties of the active directory administrator. */ - @JsonProperty(value = "properties", required = true) private AdministratorProperties innerProperties = new AdministratorProperties(); /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) 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 ActiveDirectoryAdministratorInner class. */ @@ -52,6 +68,36 @@ 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 principalType property: The principal type used to represent the type of Active Directory Administrator. * @@ -160,4 +206,51 @@ public void validate() { } private static final ClientLogger LOGGER = new ClientLogger(ActiveDirectoryAdministratorInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ActiveDirectoryAdministratorInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ActiveDirectoryAdministratorInner 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 ActiveDirectoryAdministratorInner. + */ + public static ActiveDirectoryAdministratorInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ActiveDirectoryAdministratorInner deserializedActiveDirectoryAdministratorInner + = new ActiveDirectoryAdministratorInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedActiveDirectoryAdministratorInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedActiveDirectoryAdministratorInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedActiveDirectoryAdministratorInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedActiveDirectoryAdministratorInner.innerProperties + = AdministratorProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedActiveDirectoryAdministratorInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedActiveDirectoryAdministratorInner; + }); + } } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/AdministratorProperties.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/AdministratorProperties.java index 3d1af6b11bd30..4b5870a0954e5 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/AdministratorProperties.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/AdministratorProperties.java @@ -5,36 +5,36 @@ package com.azure.resourcemanager.postgresqlflexibleserver.fluent.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.models.PrincipalType; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; /** * The properties of an Active Directory administrator. */ @Fluent -public final class AdministratorProperties { +public final class AdministratorProperties implements JsonSerializable { /* * The principal type used to represent the type of Active Directory Administrator. */ - @JsonProperty(value = "principalType") private PrincipalType principalType; /* * Active Directory administrator principal name. */ - @JsonProperty(value = "principalName") private String principalName; /* * The objectId of the Active Directory administrator. */ - @JsonProperty(value = "objectId") private String objectId; /* * The tenantId of the Active Directory administrator. */ - @JsonProperty(value = "tenantId") private String tenantId; /** @@ -130,4 +130,49 @@ public AdministratorProperties withTenantId(String tenantId) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("principalType", this.principalType == null ? null : this.principalType.toString()); + jsonWriter.writeStringField("principalName", this.principalName); + jsonWriter.writeStringField("objectId", this.objectId); + jsonWriter.writeStringField("tenantId", this.tenantId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AdministratorProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AdministratorProperties 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 AdministratorProperties. + */ + public static AdministratorProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AdministratorProperties deserializedAdministratorProperties = new AdministratorProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("principalType".equals(fieldName)) { + deserializedAdministratorProperties.principalType = PrincipalType.fromString(reader.getString()); + } else if ("principalName".equals(fieldName)) { + deserializedAdministratorProperties.principalName = reader.getString(); + } else if ("objectId".equals(fieldName)) { + deserializedAdministratorProperties.objectId = reader.getString(); + } else if ("tenantId".equals(fieldName)) { + deserializedAdministratorProperties.tenantId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAdministratorProperties; + }); + } } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/AdministratorPropertiesForAdd.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/AdministratorPropertiesForAdd.java index 323aac3fd0988..c13a9e87357e1 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/AdministratorPropertiesForAdd.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/AdministratorPropertiesForAdd.java @@ -5,30 +5,31 @@ package com.azure.resourcemanager.postgresqlflexibleserver.fluent.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.models.PrincipalType; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; /** * The properties of an Active Directory administrator. */ @Fluent -public final class AdministratorPropertiesForAdd { +public final class AdministratorPropertiesForAdd implements JsonSerializable { /* * The principal type used to represent the type of Active Directory Administrator. */ - @JsonProperty(value = "principalType") private PrincipalType principalType; /* * Active Directory administrator principal name. */ - @JsonProperty(value = "principalName") private String principalName; /* * The tenantId of the Active Directory administrator. */ - @JsonProperty(value = "tenantId") private String tenantId; /** @@ -104,4 +105,48 @@ public AdministratorPropertiesForAdd withTenantId(String tenantId) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("principalType", this.principalType == null ? null : this.principalType.toString()); + jsonWriter.writeStringField("principalName", this.principalName); + jsonWriter.writeStringField("tenantId", this.tenantId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AdministratorPropertiesForAdd from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AdministratorPropertiesForAdd 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 AdministratorPropertiesForAdd. + */ + public static AdministratorPropertiesForAdd fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AdministratorPropertiesForAdd deserializedAdministratorPropertiesForAdd + = new AdministratorPropertiesForAdd(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("principalType".equals(fieldName)) { + deserializedAdministratorPropertiesForAdd.principalType + = PrincipalType.fromString(reader.getString()); + } else if ("principalName".equals(fieldName)) { + deserializedAdministratorPropertiesForAdd.principalName = reader.getString(); + } else if ("tenantId".equals(fieldName)) { + deserializedAdministratorPropertiesForAdd.tenantId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAdministratorPropertiesForAdd; + }); + } } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/ConfigurationInner.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/ConfigurationInner.java index efca974664e0c..2ddcc39e8fc75 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/ConfigurationInner.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/ConfigurationInner.java @@ -7,8 +7,11 @@ 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.ConfigurationDataType; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; /** * Represents a Configuration. @@ -18,15 +21,28 @@ public final class ConfigurationInner extends ProxyResource { /* * The properties of a configuration. */ - @JsonProperty(value = "properties") private ConfigurationProperties innerProperties; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) 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 ConfigurationInner class. */ @@ -52,7 +68,37 @@ public SystemData systemData() { } /** - * Get the value property: Value of the configuration. + * 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 value property: Value of the configuration. Required to update the configuration. * * @return the value value. */ @@ -61,7 +107,7 @@ public String value() { } /** - * Set the value property: Value of the configuration. + * Set the value property: Value of the configuration. Required to update the configuration. * * @param value the value value to set. * @return the ConfigurationInner object itself. @@ -111,7 +157,7 @@ public String allowedValues() { } /** - * Get the source property: Source of the configuration. + * Get the source property: Source of the configuration. Required to update the configuration. * * @return the source value. */ @@ -120,7 +166,7 @@ public String source() { } /** - * Set the source property: Source of the configuration. + * Set the source property: Source of the configuration. Required to update the configuration. * * @param source the source value to set. * @return the ConfigurationInner object itself. @@ -188,4 +234,49 @@ public void validate() { 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 ConfigurationInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ConfigurationInner 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 ConfigurationInner. + */ + public static ConfigurationInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ConfigurationInner deserializedConfigurationInner = new ConfigurationInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedConfigurationInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedConfigurationInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedConfigurationInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedConfigurationInner.innerProperties = ConfigurationProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedConfigurationInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedConfigurationInner; + }); + } } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/ConfigurationProperties.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/ConfigurationProperties.java index a26cc1ee156f3..2557185782c2d 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/ConfigurationProperties.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/ConfigurationProperties.java @@ -5,78 +5,71 @@ package com.azure.resourcemanager.postgresqlflexibleserver.fluent.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.models.ConfigurationDataType; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; /** * The properties of a configuration. */ @Fluent -public final class ConfigurationProperties { +public final class ConfigurationProperties implements JsonSerializable { /* - * Value of the configuration. + * Value of the configuration. Required to update the configuration. */ - @JsonProperty(value = "value") private String value; /* * Description of the configuration. */ - @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) private String description; /* * Default value of the configuration. */ - @JsonProperty(value = "defaultValue", access = JsonProperty.Access.WRITE_ONLY) private String defaultValue; /* * Data type of the configuration. */ - @JsonProperty(value = "dataType", access = JsonProperty.Access.WRITE_ONLY) private ConfigurationDataType dataType; /* * Allowed values of the configuration. */ - @JsonProperty(value = "allowedValues", access = JsonProperty.Access.WRITE_ONLY) private String allowedValues; /* - * Source of the configuration. + * Source of the configuration. Required to update the configuration. */ - @JsonProperty(value = "source") private String source; /* * Configuration dynamic or static. */ - @JsonProperty(value = "isDynamicConfig", access = JsonProperty.Access.WRITE_ONLY) private Boolean isDynamicConfig; /* * Configuration read-only or not. */ - @JsonProperty(value = "isReadOnly", access = JsonProperty.Access.WRITE_ONLY) private Boolean isReadOnly; /* * Configuration is pending restart or not. */ - @JsonProperty(value = "isConfigPendingRestart", access = JsonProperty.Access.WRITE_ONLY) private Boolean isConfigPendingRestart; /* * Configuration unit. */ - @JsonProperty(value = "unit", access = JsonProperty.Access.WRITE_ONLY) private String unit; /* * Configuration documentation link. */ - @JsonProperty(value = "documentationLink", access = JsonProperty.Access.WRITE_ONLY) private String documentationLink; /** @@ -86,7 +79,7 @@ public ConfigurationProperties() { } /** - * Get the value property: Value of the configuration. + * Get the value property: Value of the configuration. Required to update the configuration. * * @return the value value. */ @@ -95,7 +88,7 @@ public String value() { } /** - * Set the value property: Value of the configuration. + * Set the value property: Value of the configuration. Required to update the configuration. * * @param value the value value to set. * @return the ConfigurationProperties object itself. @@ -142,7 +135,7 @@ public String allowedValues() { } /** - * Get the source property: Source of the configuration. + * Get the source property: Source of the configuration. Required to update the configuration. * * @return the source value. */ @@ -151,7 +144,7 @@ public String source() { } /** - * Set the source property: Source of the configuration. + * Set the source property: Source of the configuration. Required to update the configuration. * * @param source the source value to set. * @return the ConfigurationProperties object itself. @@ -213,4 +206,62 @@ public String documentationLink() { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", this.value); + jsonWriter.writeStringField("source", this.source); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ConfigurationProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ConfigurationProperties 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 ConfigurationProperties. + */ + public static ConfigurationProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ConfigurationProperties deserializedConfigurationProperties = new ConfigurationProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedConfigurationProperties.value = reader.getString(); + } else if ("description".equals(fieldName)) { + deserializedConfigurationProperties.description = reader.getString(); + } else if ("defaultValue".equals(fieldName)) { + deserializedConfigurationProperties.defaultValue = reader.getString(); + } else if ("dataType".equals(fieldName)) { + deserializedConfigurationProperties.dataType = ConfigurationDataType.fromString(reader.getString()); + } else if ("allowedValues".equals(fieldName)) { + deserializedConfigurationProperties.allowedValues = reader.getString(); + } else if ("source".equals(fieldName)) { + deserializedConfigurationProperties.source = reader.getString(); + } else if ("isDynamicConfig".equals(fieldName)) { + deserializedConfigurationProperties.isDynamicConfig = reader.getNullable(JsonReader::getBoolean); + } else if ("isReadOnly".equals(fieldName)) { + deserializedConfigurationProperties.isReadOnly = reader.getNullable(JsonReader::getBoolean); + } else if ("isConfigPendingRestart".equals(fieldName)) { + deserializedConfigurationProperties.isConfigPendingRestart + = reader.getNullable(JsonReader::getBoolean); + } else if ("unit".equals(fieldName)) { + deserializedConfigurationProperties.unit = reader.getString(); + } else if ("documentationLink".equals(fieldName)) { + deserializedConfigurationProperties.documentationLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedConfigurationProperties; + }); + } } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/DatabaseInner.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/DatabaseInner.java index 744ca3ed12acc..bb0ddcb7f6a6b 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/DatabaseInner.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/DatabaseInner.java @@ -7,7 +7,10 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.ProxyResource; import com.azure.core.management.SystemData; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Represents a Database. @@ -17,15 +20,28 @@ public final class DatabaseInner extends ProxyResource { /* * The properties of a database. */ - @JsonProperty(value = "properties") private DatabaseProperties innerProperties; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) 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 DatabaseInner class. */ @@ -50,6 +66,36 @@ 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 charset property: The charset of the database. * @@ -106,4 +152,49 @@ public void validate() { 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 DatabaseInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DatabaseInner 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 DatabaseInner. + */ + public static DatabaseInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DatabaseInner deserializedDatabaseInner = new DatabaseInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedDatabaseInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedDatabaseInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedDatabaseInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedDatabaseInner.innerProperties = DatabaseProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedDatabaseInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedDatabaseInner; + }); + } } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/DatabaseProperties.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/DatabaseProperties.java index 6f74dd0af06cf..d36bf2b3659aa 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/DatabaseProperties.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/DatabaseProperties.java @@ -5,23 +5,25 @@ package com.azure.resourcemanager.postgresqlflexibleserver.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +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 properties of a database. */ @Fluent -public final class DatabaseProperties { +public final class DatabaseProperties implements JsonSerializable { /* * The charset of the database. */ - @JsonProperty(value = "charset") private String charset; /* * The collation of the database. */ - @JsonProperty(value = "collation") private String collation; /** @@ -77,4 +79,43 @@ public DatabaseProperties withCollation(String collation) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("charset", this.charset); + jsonWriter.writeStringField("collation", this.collation); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DatabaseProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DatabaseProperties 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 DatabaseProperties. + */ + public static DatabaseProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DatabaseProperties deserializedDatabaseProperties = new DatabaseProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("charset".equals(fieldName)) { + deserializedDatabaseProperties.charset = reader.getString(); + } else if ("collation".equals(fieldName)) { + deserializedDatabaseProperties.collation = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDatabaseProperties; + }); + } } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/FirewallRuleInner.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/FirewallRuleInner.java index 8d31aae3c0437..4494702a88ec9 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/FirewallRuleInner.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/FirewallRuleInner.java @@ -8,7 +8,10 @@ import com.azure.core.management.ProxyResource; import com.azure.core.management.SystemData; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Represents a server firewall rule. @@ -18,15 +21,28 @@ public final class FirewallRuleInner extends ProxyResource { /* * The properties of a firewall rule. */ - @JsonProperty(value = "properties", required = true) private FirewallRuleProperties innerProperties = new FirewallRuleProperties(); /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) 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 FirewallRuleInner class. */ @@ -51,6 +67,36 @@ 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 startIpAddress property: The start IP address of the server firewall rule. Must be IPv4 format. * @@ -113,4 +159,49 @@ public void validate() { } private static final ClientLogger LOGGER = new ClientLogger(FirewallRuleInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FirewallRuleInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FirewallRuleInner 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 FirewallRuleInner. + */ + public static FirewallRuleInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FirewallRuleInner deserializedFirewallRuleInner = new FirewallRuleInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedFirewallRuleInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedFirewallRuleInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedFirewallRuleInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedFirewallRuleInner.innerProperties = FirewallRuleProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedFirewallRuleInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedFirewallRuleInner; + }); + } } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/FirewallRuleProperties.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/FirewallRuleProperties.java index ce9bfb43aae35..52e91af5d16d0 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/FirewallRuleProperties.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/FirewallRuleProperties.java @@ -6,23 +6,25 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +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 properties of a server firewall rule. */ @Fluent -public final class FirewallRuleProperties { +public final class FirewallRuleProperties implements JsonSerializable { /* * The start IP address of the server firewall rule. Must be IPv4 format. */ - @JsonProperty(value = "startIpAddress", required = true) private String startIpAddress; /* * The end IP address of the server firewall rule. Must be IPv4 format. */ - @JsonProperty(value = "endIpAddress", required = true) private String endIpAddress; /** @@ -90,4 +92,44 @@ public void validate() { } private static final ClientLogger LOGGER = new ClientLogger(FirewallRuleProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("startIpAddress", this.startIpAddress); + jsonWriter.writeStringField("endIpAddress", this.endIpAddress); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FirewallRuleProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FirewallRuleProperties 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 FirewallRuleProperties. + */ + public static FirewallRuleProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FirewallRuleProperties deserializedFirewallRuleProperties = new FirewallRuleProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("startIpAddress".equals(fieldName)) { + deserializedFirewallRuleProperties.startIpAddress = reader.getString(); + } else if ("endIpAddress".equals(fieldName)) { + deserializedFirewallRuleProperties.endIpAddress = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedFirewallRuleProperties; + }); + } } 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 c16d8c39e52b1..ddf05ffe6f1cf 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 @@ -5,7 +5,11 @@ package com.azure.resourcemanager.postgresqlflexibleserver.fluent.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.postgresqlflexibleserver.models.CapabilityBase; +import com.azure.resourcemanager.postgresqlflexibleserver.models.CapabilityStatus; import com.azure.resourcemanager.postgresqlflexibleserver.models.FastProvisioningEditionCapability; import com.azure.resourcemanager.postgresqlflexibleserver.models.FastProvisioningSupportedEnum; import com.azure.resourcemanager.postgresqlflexibleserver.models.FlexibleServerEditionCapability; @@ -16,7 +20,7 @@ import com.azure.resourcemanager.postgresqlflexibleserver.models.StorageAutoGrowthSupportedEnum; import com.azure.resourcemanager.postgresqlflexibleserver.models.ZoneRedundantHaAndGeoBackupSupportedEnum; import com.azure.resourcemanager.postgresqlflexibleserver.models.ZoneRedundantHaSupportedEnum; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** @@ -27,69 +31,76 @@ public final class FlexibleServerCapabilityInner extends CapabilityBase { /* * Name of flexible servers capability */ - @JsonProperty(value = "name") private String name; /* * List of supported flexible server editions */ - @JsonProperty(value = "supportedServerEditions", access = JsonProperty.Access.WRITE_ONLY) private List supportedServerEditions; /* * The list of server versions supported for this capability. */ - @JsonProperty(value = "supportedServerVersions", access = JsonProperty.Access.WRITE_ONLY) private List supportedServerVersions; /* - * Gets a value indicating whether fast provisioning is supported. "Enabled" means fast provisioning is supported. "Disabled" stands for fast provisioning is not supported. + * Gets a value indicating whether fast provisioning is supported. "Enabled" means fast provisioning is supported. + * "Disabled" stands for fast provisioning is not supported. */ - @JsonProperty(value = "fastProvisioningSupported", access = JsonProperty.Access.WRITE_ONLY) private FastProvisioningSupportedEnum fastProvisioningSupported; /* * List of supported server editions for fast provisioning */ - @JsonProperty(value = "supportedFastProvisioningEditions", access = JsonProperty.Access.WRITE_ONLY) private List supportedFastProvisioningEditions; /* - * Determines if geo-backup is supported in this region. "Enabled" means geo-backup is supported. "Disabled" stands for geo-back is not supported. + * Determines if geo-backup is supported in this region. "Enabled" means geo-backup is supported. "Disabled" stands + * for geo-back is not supported. */ - @JsonProperty(value = "geoBackupSupported", access = JsonProperty.Access.WRITE_ONLY) private GeoBackupSupportedEnum geoBackupSupported; /* - * A value indicating whether Zone Redundant HA is supported in this region. "Enabled" means zone redundant HA is supported. "Disabled" stands for zone redundant HA is not supported. + * A value indicating whether Zone Redundant HA is supported in this region. "Enabled" means zone redundant HA is + * supported. "Disabled" stands for zone redundant HA is not supported. */ - @JsonProperty(value = "zoneRedundantHaSupported", access = JsonProperty.Access.WRITE_ONLY) private ZoneRedundantHaSupportedEnum zoneRedundantHaSupported; /* - * A value indicating whether Zone Redundant HA and Geo-backup is supported in this region. "Enabled" means zone redundant HA and geo-backup is supported. "Disabled" stands for zone redundant HA and geo-backup is not supported. + * A value indicating whether Zone Redundant HA and Geo-backup is supported in this region. "Enabled" means zone + * redundant HA and geo-backup is supported. "Disabled" stands for zone redundant HA and geo-backup is not + * supported. */ - @JsonProperty(value = "zoneRedundantHaAndGeoBackupSupported", access = JsonProperty.Access.WRITE_ONLY) private ZoneRedundantHaAndGeoBackupSupportedEnum zoneRedundantHaAndGeoBackupSupported; /* - * A value indicating whether storage auto-grow is supported in this region. "Enabled" means storage auto-grow is supported. "Disabled" stands for storage auto-grow is not supported. + * A value indicating whether storage auto-grow is supported in this region. "Enabled" means storage auto-grow is + * supported. "Disabled" stands for storage auto-grow is not supported. */ - @JsonProperty(value = "storageAutoGrowthSupported", access = JsonProperty.Access.WRITE_ONLY) private StorageAutoGrowthSupportedEnum storageAutoGrowthSupported; /* - * A value indicating whether online resize is supported in this region for the given subscription. "Enabled" means storage online resize is supported. "Disabled" means storage online resize is not supported. + * A value indicating whether online resize is supported in this region for the given subscription. "Enabled" means + * storage online resize is supported. "Disabled" means storage online resize is not supported. */ - @JsonProperty(value = "onlineResizeSupported", access = JsonProperty.Access.WRITE_ONLY) private OnlineResizeSupportedEnum onlineResizeSupported; /* - * A value indicating whether this region is restricted. "Enabled" means region is restricted. "Disabled" stands for region is not restricted. + * A value indicating whether this region is restricted. "Enabled" means region is restricted. "Disabled" stands for + * region is not restricted. */ - @JsonProperty(value = "restricted", access = JsonProperty.Access.WRITE_ONLY) private RestrictedEnum restricted; + /* + * The reason for the capability not being available. + */ + private String reason; + + /* + * The status of the capability. + */ + private CapabilityStatus status; + /** * Creates an instance of FlexibleServerCapabilityInner class. */ @@ -215,6 +226,26 @@ public RestrictedEnum restricted() { return this.restricted; } + /** + * Get the reason property: The reason for the capability not being available. + * + * @return the reason value. + */ + @Override + public String reason() { + return this.reason; + } + + /** + * Get the status property: The status of the capability. + * + * @return the status value. + */ + @Override + public CapabilityStatus status() { + return this.status; + } + /** * Validates the instance. * @@ -222,7 +253,6 @@ public RestrictedEnum restricted() { */ @Override public void validate() { - super.validate(); if (supportedServerEditions() != null) { supportedServerEditions().forEach(e -> e.validate()); } @@ -233,4 +263,79 @@ public void validate() { supportedFastProvisioningEditions().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FlexibleServerCapabilityInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FlexibleServerCapabilityInner 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 FlexibleServerCapabilityInner. + */ + public static FlexibleServerCapabilityInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FlexibleServerCapabilityInner deserializedFlexibleServerCapabilityInner + = new FlexibleServerCapabilityInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("status".equals(fieldName)) { + deserializedFlexibleServerCapabilityInner.status = CapabilityStatus.fromString(reader.getString()); + } else if ("reason".equals(fieldName)) { + deserializedFlexibleServerCapabilityInner.reason = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedFlexibleServerCapabilityInner.name = reader.getString(); + } else if ("supportedServerEditions".equals(fieldName)) { + List supportedServerEditions + = reader.readArray(reader1 -> FlexibleServerEditionCapability.fromJson(reader1)); + deserializedFlexibleServerCapabilityInner.supportedServerEditions = supportedServerEditions; + } else if ("supportedServerVersions".equals(fieldName)) { + List supportedServerVersions + = reader.readArray(reader1 -> ServerVersionCapability.fromJson(reader1)); + deserializedFlexibleServerCapabilityInner.supportedServerVersions = supportedServerVersions; + } else if ("fastProvisioningSupported".equals(fieldName)) { + deserializedFlexibleServerCapabilityInner.fastProvisioningSupported + = FastProvisioningSupportedEnum.fromString(reader.getString()); + } else if ("supportedFastProvisioningEditions".equals(fieldName)) { + List supportedFastProvisioningEditions + = reader.readArray(reader1 -> FastProvisioningEditionCapability.fromJson(reader1)); + deserializedFlexibleServerCapabilityInner.supportedFastProvisioningEditions + = supportedFastProvisioningEditions; + } else if ("geoBackupSupported".equals(fieldName)) { + deserializedFlexibleServerCapabilityInner.geoBackupSupported + = GeoBackupSupportedEnum.fromString(reader.getString()); + } else if ("zoneRedundantHaSupported".equals(fieldName)) { + deserializedFlexibleServerCapabilityInner.zoneRedundantHaSupported + = ZoneRedundantHaSupportedEnum.fromString(reader.getString()); + } else if ("zoneRedundantHaAndGeoBackupSupported".equals(fieldName)) { + deserializedFlexibleServerCapabilityInner.zoneRedundantHaAndGeoBackupSupported + = ZoneRedundantHaAndGeoBackupSupportedEnum.fromString(reader.getString()); + } else if ("storageAutoGrowthSupported".equals(fieldName)) { + deserializedFlexibleServerCapabilityInner.storageAutoGrowthSupported + = StorageAutoGrowthSupportedEnum.fromString(reader.getString()); + } else if ("onlineResizeSupported".equals(fieldName)) { + deserializedFlexibleServerCapabilityInner.onlineResizeSupported + = OnlineResizeSupportedEnum.fromString(reader.getString()); + } else if ("restricted".equals(fieldName)) { + deserializedFlexibleServerCapabilityInner.restricted + = RestrictedEnum.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedFlexibleServerCapabilityInner; + }); + } } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/LogFileInner.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/LogFileInner.java index afa898bd1f6df..24ea03ff48f58 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/LogFileInner.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/LogFileInner.java @@ -7,7 +7,10 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.ProxyResource; import com.azure.core.management.SystemData; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; /** @@ -18,15 +21,28 @@ public final class LogFileInner extends ProxyResource { /* * The properties of a logFile. */ - @JsonProperty(value = "properties") private LogFileProperties innerProperties; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; + /* + * 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 LogFileInner class. */ @@ -51,6 +67,36 @@ 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 createdTime property: Creation timestamp of the log file. * @@ -176,4 +222,49 @@ public void validate() { 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 LogFileInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LogFileInner 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 LogFileInner. + */ + public static LogFileInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LogFileInner deserializedLogFileInner = new LogFileInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedLogFileInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedLogFileInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedLogFileInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedLogFileInner.innerProperties = LogFileProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedLogFileInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedLogFileInner; + }); + } } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/LogFileProperties.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/LogFileProperties.java index 5dae643968217..33fca6e804c6d 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/LogFileProperties.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/LogFileProperties.java @@ -5,42 +5,43 @@ package com.azure.resourcemanager.postgresqlflexibleserver.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +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; /** * The properties of a logFile. */ @Fluent -public final class LogFileProperties { +public final class LogFileProperties implements JsonSerializable { /* * Creation timestamp of the log file. */ - @JsonProperty(value = "createdTime") private OffsetDateTime createdTime; /* * Last modified timestamp of the log file. */ - @JsonProperty(value = "lastModifiedTime") private OffsetDateTime lastModifiedTime; /* * The size in kb of the logFile. */ - @JsonProperty(value = "sizeInKb") private Long sizeInKb; /* * Type of the log file. */ - @JsonProperty(value = "type") private String type; /* * The url to download the log file from. */ - @JsonProperty(value = "url") private String url; /** @@ -156,4 +157,58 @@ public LogFileProperties withUrl(String url) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("createdTime", + this.createdTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.createdTime)); + jsonWriter.writeStringField("lastModifiedTime", + this.lastModifiedTime == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastModifiedTime)); + jsonWriter.writeNumberField("sizeInKb", this.sizeInKb); + jsonWriter.writeStringField("type", this.type); + jsonWriter.writeStringField("url", this.url); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LogFileProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LogFileProperties 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 LogFileProperties. + */ + public static LogFileProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LogFileProperties deserializedLogFileProperties = new LogFileProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("createdTime".equals(fieldName)) { + deserializedLogFileProperties.createdTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("lastModifiedTime".equals(fieldName)) { + deserializedLogFileProperties.lastModifiedTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("sizeInKb".equals(fieldName)) { + deserializedLogFileProperties.sizeInKb = reader.getNullable(JsonReader::getLong); + } else if ("type".equals(fieldName)) { + deserializedLogFileProperties.type = reader.getString(); + } else if ("url".equals(fieldName)) { + deserializedLogFileProperties.url = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedLogFileProperties; + }); + } } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/LtrBackupOperationResponseProperties.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/LtrBackupOperationResponseProperties.java index 7fc16e1be0d38..86979a58aba91 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/LtrBackupOperationResponseProperties.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/LtrBackupOperationResponseProperties.java @@ -5,74 +5,72 @@ package com.azure.resourcemanager.postgresqlflexibleserver.fluent.models; import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; import com.azure.core.util.logging.ClientLogger; +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.ExecutionStatus; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; /** * Response for the backup request. */ @Fluent -public final class LtrBackupOperationResponseProperties { +public final class LtrBackupOperationResponseProperties + implements JsonSerializable { /* * Size of datasource in bytes */ - @JsonProperty(value = "datasourceSizeInBytes") private Long datasourceSizeInBytes; /* * Data transferred in bytes */ - @JsonProperty(value = "dataTransferredInBytes") private Long dataTransferredInBytes; /* * Name of Backup operation */ - @JsonProperty(value = "backupName") private String backupName; /* - * Metadata to be stored in RP. Store everything that will be required to perform a successful restore using this Recovery point. e.g. Versions, DataFormat etc + * Metadata to be stored in RP. Store everything that will be required to perform a successful restore using this + * Recovery point. e.g. Versions, DataFormat etc */ - @JsonProperty(value = "backupMetadata") private String backupMetadata; /* * Service-set extensible enum indicating the status of operation */ - @JsonProperty(value = "status", required = true) private ExecutionStatus status; /* * Start time of the operation. */ - @JsonProperty(value = "startTime", required = true) private OffsetDateTime startTime; /* * End time of the operation. */ - @JsonProperty(value = "endTime") private OffsetDateTime endTime; /* * PercentageCompleted */ - @JsonProperty(value = "percentComplete") private Double percentComplete; /* * The error code. */ - @JsonProperty(value = "errorCode", access = JsonProperty.Access.WRITE_ONLY) private String errorCode; /* * The error message. */ - @JsonProperty(value = "errorMessage", access = JsonProperty.Access.WRITE_ONLY) private String errorMessage; /** @@ -280,4 +278,75 @@ public void validate() { } private static final ClientLogger LOGGER = new ClientLogger(LtrBackupOperationResponseProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + jsonWriter.writeStringField("startTime", + this.startTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.startTime)); + jsonWriter.writeNumberField("datasourceSizeInBytes", this.datasourceSizeInBytes); + jsonWriter.writeNumberField("dataTransferredInBytes", this.dataTransferredInBytes); + jsonWriter.writeStringField("backupName", this.backupName); + jsonWriter.writeStringField("backupMetadata", this.backupMetadata); + jsonWriter.writeStringField("endTime", + this.endTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.endTime)); + jsonWriter.writeNumberField("percentComplete", this.percentComplete); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LtrBackupOperationResponseProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LtrBackupOperationResponseProperties 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 LtrBackupOperationResponseProperties. + */ + public static LtrBackupOperationResponseProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LtrBackupOperationResponseProperties deserializedLtrBackupOperationResponseProperties + = new LtrBackupOperationResponseProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("status".equals(fieldName)) { + deserializedLtrBackupOperationResponseProperties.status + = ExecutionStatus.fromString(reader.getString()); + } else if ("startTime".equals(fieldName)) { + deserializedLtrBackupOperationResponseProperties.startTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("datasourceSizeInBytes".equals(fieldName)) { + deserializedLtrBackupOperationResponseProperties.datasourceSizeInBytes + = reader.getNullable(JsonReader::getLong); + } else if ("dataTransferredInBytes".equals(fieldName)) { + deserializedLtrBackupOperationResponseProperties.dataTransferredInBytes + = reader.getNullable(JsonReader::getLong); + } else if ("backupName".equals(fieldName)) { + deserializedLtrBackupOperationResponseProperties.backupName = reader.getString(); + } else if ("backupMetadata".equals(fieldName)) { + deserializedLtrBackupOperationResponseProperties.backupMetadata = reader.getString(); + } else if ("endTime".equals(fieldName)) { + deserializedLtrBackupOperationResponseProperties.endTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("percentComplete".equals(fieldName)) { + deserializedLtrBackupOperationResponseProperties.percentComplete + = reader.getNullable(JsonReader::getDouble); + } else if ("errorCode".equals(fieldName)) { + deserializedLtrBackupOperationResponseProperties.errorCode = reader.getString(); + } else if ("errorMessage".equals(fieldName)) { + deserializedLtrBackupOperationResponseProperties.errorMessage = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedLtrBackupOperationResponseProperties; + }); + } } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/LtrBackupResponseInner.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/LtrBackupResponseInner.java index d838496e46fff..bbedaaf574961 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/LtrBackupResponseInner.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/LtrBackupResponseInner.java @@ -5,19 +5,22 @@ package com.azure.resourcemanager.postgresqlflexibleserver.fluent.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.models.ExecutionStatus; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.time.OffsetDateTime; /** * Response for the LTR backup API call. */ @Fluent -public final class LtrBackupResponseInner { +public final class LtrBackupResponseInner implements JsonSerializable { /* * Long Term Retention Backup Operation Resource Properties */ - @JsonProperty(value = "properties") private LtrBackupOperationResponseProperties innerProperties; /** @@ -249,4 +252,41 @@ public void validate() { 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 LtrBackupResponseInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LtrBackupResponseInner 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 LtrBackupResponseInner. + */ + public static LtrBackupResponseInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LtrBackupResponseInner deserializedLtrBackupResponseInner = new LtrBackupResponseInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("properties".equals(fieldName)) { + deserializedLtrBackupResponseInner.innerProperties + = LtrBackupOperationResponseProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedLtrBackupResponseInner; + }); + } } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/LtrPreBackupResponseInner.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/LtrPreBackupResponseInner.java index ed59cf5c3ca12..e7c116634f0a6 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/LtrPreBackupResponseInner.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/LtrPreBackupResponseInner.java @@ -6,17 +6,20 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Response for the LTR pre-backup API call. */ @Fluent -public final class LtrPreBackupResponseInner { +public final class LtrPreBackupResponseInner implements JsonSerializable { /* * Additional Properties for the pre backup response */ - @JsonProperty(value = "properties", required = true) private LtrPreBackupResponseProperties innerProperties = new LtrPreBackupResponseProperties(); /** @@ -75,4 +78,42 @@ public void validate() { } private static final ClientLogger LOGGER = new ClientLogger(LtrPreBackupResponseInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LtrPreBackupResponseInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LtrPreBackupResponseInner 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 LtrPreBackupResponseInner. + */ + public static LtrPreBackupResponseInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LtrPreBackupResponseInner deserializedLtrPreBackupResponseInner = new LtrPreBackupResponseInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("properties".equals(fieldName)) { + deserializedLtrPreBackupResponseInner.innerProperties + = LtrPreBackupResponseProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedLtrPreBackupResponseInner; + }); + } } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/LtrPreBackupResponseProperties.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/LtrPreBackupResponseProperties.java index be360b95b1e6b..bb2f3db3604f2 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/LtrPreBackupResponseProperties.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/LtrPreBackupResponseProperties.java @@ -5,17 +5,21 @@ package com.azure.resourcemanager.postgresqlflexibleserver.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Response for the pre-backup request. */ @Fluent -public final class LtrPreBackupResponseProperties { +public final class LtrPreBackupResponseProperties implements JsonSerializable { /* - * Number of storage containers the plugin will use during backup. More than one containers may be used for size limitations, parallelism, or redundancy etc. + * Number of storage containers the plugin will use during backup. More than one containers may be used for size + * limitations, parallelism, or redundancy etc. */ - @JsonProperty(value = "numberOfContainers", required = true) private int numberOfContainers; /** @@ -53,4 +57,42 @@ public LtrPreBackupResponseProperties withNumberOfContainers(int numberOfContain */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeIntField("numberOfContainers", this.numberOfContainers); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LtrPreBackupResponseProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LtrPreBackupResponseProperties 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 LtrPreBackupResponseProperties. + */ + public static LtrPreBackupResponseProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LtrPreBackupResponseProperties deserializedLtrPreBackupResponseProperties + = new LtrPreBackupResponseProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("numberOfContainers".equals(fieldName)) { + deserializedLtrPreBackupResponseProperties.numberOfContainers = reader.getInt(); + } else { + reader.skipChildren(); + } + } + + return deserializedLtrPreBackupResponseProperties; + }); + } } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/LtrServerBackupOperationInner.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/LtrServerBackupOperationInner.java index 251b3cf063c29..bbc401a8c1a4a 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/LtrServerBackupOperationInner.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/LtrServerBackupOperationInner.java @@ -7,8 +7,11 @@ 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.ExecutionStatus; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.time.OffsetDateTime; /** @@ -19,15 +22,28 @@ public final class LtrServerBackupOperationInner extends ProxyResource { /* * Long Term Retention Backup Operation Resource Properties */ - @JsonProperty(value = "properties") private LtrBackupOperationResponseProperties innerProperties; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; + /* + * 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 LtrServerBackupOperationInner class. */ @@ -52,6 +68,36 @@ 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 datasourceSizeInBytes property: Size of datasource in bytes. * @@ -266,4 +312,51 @@ public void validate() { 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 LtrServerBackupOperationInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LtrServerBackupOperationInner 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 LtrServerBackupOperationInner. + */ + public static LtrServerBackupOperationInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LtrServerBackupOperationInner deserializedLtrServerBackupOperationInner + = new LtrServerBackupOperationInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedLtrServerBackupOperationInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedLtrServerBackupOperationInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedLtrServerBackupOperationInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedLtrServerBackupOperationInner.innerProperties + = LtrBackupOperationResponseProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedLtrServerBackupOperationInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedLtrServerBackupOperationInner; + }); + } } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/MigrationNameAvailabilityResourceInner.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/MigrationNameAvailabilityResourceInner.java index dcd43849e1d76..1831ad0bad995 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/MigrationNameAvailabilityResourceInner.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/MigrationNameAvailabilityResourceInner.java @@ -6,42 +6,42 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; +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.MigrationNameAvailabilityReason; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; /** * Represents a migration name's availability. */ @Fluent -public final class MigrationNameAvailabilityResourceInner { +public final class MigrationNameAvailabilityResourceInner + implements JsonSerializable { /* * The resource name to verify. */ - @JsonProperty(value = "name", required = true) private String name; /* * The type of the resource. */ - @JsonProperty(value = "type", required = true) private String type; /* * Indicates whether the resource name is available. */ - @JsonProperty(value = "nameAvailable", access = JsonProperty.Access.WRITE_ONLY) private Boolean nameAvailable; /* * Migration name availability reason */ - @JsonProperty(value = "reason", access = JsonProperty.Access.WRITE_ONLY) private MigrationNameAvailabilityReason reason; /* * Migration name availability message. */ - @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) private String message; /** @@ -136,4 +136,53 @@ public void validate() { } private static final ClientLogger LOGGER = new ClientLogger(MigrationNameAvailabilityResourceInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("type", this.type); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MigrationNameAvailabilityResourceInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MigrationNameAvailabilityResourceInner 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 MigrationNameAvailabilityResourceInner. + */ + public static MigrationNameAvailabilityResourceInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MigrationNameAvailabilityResourceInner deserializedMigrationNameAvailabilityResourceInner + = new MigrationNameAvailabilityResourceInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedMigrationNameAvailabilityResourceInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedMigrationNameAvailabilityResourceInner.type = reader.getString(); + } else if ("nameAvailable".equals(fieldName)) { + deserializedMigrationNameAvailabilityResourceInner.nameAvailable + = reader.getNullable(JsonReader::getBoolean); + } else if ("reason".equals(fieldName)) { + deserializedMigrationNameAvailabilityResourceInner.reason + = MigrationNameAvailabilityReason.fromString(reader.getString()); + } else if ("message".equals(fieldName)) { + deserializedMigrationNameAvailabilityResourceInner.message = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedMigrationNameAvailabilityResourceInner; + }); + } } 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 f67145c760397..cb2b052bd6e89 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 @@ -7,6 +7,9 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.Resource; 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.CancelEnum; import com.azure.resourcemanager.postgresqlflexibleserver.models.DbServerMetadata; import com.azure.resourcemanager.postgresqlflexibleserver.models.LogicalReplicationOnSourceDbEnum; @@ -20,7 +23,7 @@ import com.azure.resourcemanager.postgresqlflexibleserver.models.SslMode; import com.azure.resourcemanager.postgresqlflexibleserver.models.StartDataMigrationEnum; import com.azure.resourcemanager.postgresqlflexibleserver.models.TriggerCutoverEnum; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.time.OffsetDateTime; import java.util.List; import java.util.Map; @@ -33,15 +36,28 @@ public final class MigrationResourceInner extends Resource { /* * Migration resource properties. */ - @JsonProperty(value = "properties") private MigrationResourceProperties innerProperties; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; + /* + * 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 MigrationResourceInner class. */ @@ -66,6 +82,36 @@ 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; + } + /** * {@inheritDoc} */ @@ -267,8 +313,8 @@ public MigrationResourceInner withSourceDbServerResourceId(String sourceDbServer } /** - * Get the sourceDbServerFullyQualifiedDomainName property: Source server fully qualified domain name or ip. It is a - * optional value, if customer provide it, dms will always use it for connection. + * Get the sourceDbServerFullyQualifiedDomainName property: Source server fully qualified domain name (FQDN) or IP + * address. It is a optional value, if customer provide it, migration service will always use it for connection. * * @return the sourceDbServerFullyQualifiedDomainName value. */ @@ -277,8 +323,8 @@ public String sourceDbServerFullyQualifiedDomainName() { } /** - * Set the sourceDbServerFullyQualifiedDomainName property: Source server fully qualified domain name or ip. It is a - * optional value, if customer provide it, dms will always use it for connection. + * Set the sourceDbServerFullyQualifiedDomainName property: Source server fully qualified domain name (FQDN) or IP + * address. It is a optional value, if customer provide it, migration service will always use it for connection. * * @param sourceDbServerFullyQualifiedDomainName the sourceDbServerFullyQualifiedDomainName value to set. * @return the MigrationResourceInner object itself. @@ -302,8 +348,8 @@ public String targetDbServerResourceId() { } /** - * Get the targetDbServerFullyQualifiedDomainName property: Target server fully qualified domain name or ip. It is a - * optional value, if customer provide it, dms will always use it for connection. + * Get the targetDbServerFullyQualifiedDomainName property: Target server fully qualified domain name (FQDN) or IP + * address. It is a optional value, if customer provide it, migration service will always use it for connection. * * @return the targetDbServerFullyQualifiedDomainName value. */ @@ -312,8 +358,8 @@ public String targetDbServerFullyQualifiedDomainName() { } /** - * Set the targetDbServerFullyQualifiedDomainName property: Target server fully qualified domain name or ip. It is a - * optional value, if customer provide it, dms will always use it for connection. + * Set the targetDbServerFullyQualifiedDomainName property: Target server fully qualified domain name (FQDN) or IP + * address. It is a optional value, if customer provide it, migration service will always use it for connection. * * @param targetDbServerFullyQualifiedDomainName the targetDbServerFullyQualifiedDomainName value to set. * @return the MigrationResourceInner object itself. @@ -626,4 +672,56 @@ public void validate() { innerProperties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MigrationResourceInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MigrationResourceInner 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 MigrationResourceInner. + */ + public static MigrationResourceInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MigrationResourceInner deserializedMigrationResourceInner = new MigrationResourceInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMigrationResourceInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedMigrationResourceInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedMigrationResourceInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedMigrationResourceInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedMigrationResourceInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedMigrationResourceInner.innerProperties = MigrationResourceProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedMigrationResourceInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedMigrationResourceInner; + }); + } } 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 eaed11e2f7966..c70cd83bd17af 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 @@ -5,6 +5,11 @@ 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.CancelEnum; import com.azure.resourcemanager.postgresqlflexibleserver.models.DbServerMetadata; import com.azure.resourcemanager.postgresqlflexibleserver.models.LogicalReplicationOnSourceDbEnum; @@ -18,163 +23,146 @@ import com.azure.resourcemanager.postgresqlflexibleserver.models.SslMode; import com.azure.resourcemanager.postgresqlflexibleserver.models.StartDataMigrationEnum; import com.azure.resourcemanager.postgresqlflexibleserver.models.TriggerCutoverEnum; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; import java.util.List; /** * Migration resource properties. */ @Fluent -public final class MigrationResourceProperties { +public final class MigrationResourceProperties implements JsonSerializable { /* * ID for migration, a GUID. */ - @JsonProperty(value = "migrationId", access = JsonProperty.Access.WRITE_ONLY) private String migrationId; /* * Current status of migration */ - @JsonProperty(value = "currentStatus", access = JsonProperty.Access.WRITE_ONLY) private MigrationStatus currentStatus; /* * ResourceId of the private endpoint migration instance */ - @JsonProperty(value = "migrationInstanceResourceId") private String migrationInstanceResourceId; /* * There are two types of migration modes Online and Offline */ - @JsonProperty(value = "migrationMode") private MigrationMode migrationMode; /* * This indicates the supported Migration option for the migration */ - @JsonProperty(value = "migrationOption") private MigrationOption migrationOption; /* - * migration source server type : OnPremises, AWS, GCP, AzureVM, PostgreSQLSingleServer, AWS_RDS, AWS_AURORA, AWS_EC2, GCP_CloudSQL, GCP_AlloyDB, GCP_Compute, or EDB + * migration source server type : OnPremises, AWS, GCP, AzureVM, PostgreSQLSingleServer, AWS_RDS, AWS_AURORA, + * AWS_EC2, GCP_CloudSQL, GCP_AlloyDB, GCP_Compute, or EDB */ - @JsonProperty(value = "sourceType") private SourceType sourceType; /* - * SSL modes for migration. Default SSL mode for PostgreSQLSingleServer is VerifyFull and Prefer for other source types + * SSL modes for migration. Default SSL mode for PostgreSQLSingleServer is VerifyFull and Prefer for other source + * types */ - @JsonProperty(value = "sslMode") private SslMode sslMode; /* * Metadata of the source database server */ - @JsonProperty(value = "sourceDbServerMetadata", access = JsonProperty.Access.WRITE_ONLY) private DbServerMetadata sourceDbServerMetadata; /* * Metadata of the target database server */ - @JsonProperty(value = "targetDbServerMetadata", access = JsonProperty.Access.WRITE_ONLY) private DbServerMetadata targetDbServerMetadata; /* - * ResourceId of the source database server in case the sourceType is PostgreSQLSingleServer. For other source types this should be ipaddress:port@username or hostname:port@username + * ResourceId of the source database server in case the sourceType is PostgreSQLSingleServer. For other source types + * this should be ipaddress:port@username or hostname:port@username */ - @JsonProperty(value = "sourceDbServerResourceId") private String sourceDbServerResourceId; /* - * Source server fully qualified domain name or ip. It is a optional value, if customer provide it, dms will always use it for connection + * Source server fully qualified domain name (FQDN) or IP address. It is a optional value, if customer provide it, + * migration service will always use it for connection */ - @JsonProperty(value = "sourceDbServerFullyQualifiedDomainName") private String sourceDbServerFullyQualifiedDomainName; /* * ResourceId of the source database server */ - @JsonProperty(value = "targetDbServerResourceId", access = JsonProperty.Access.WRITE_ONLY) private String targetDbServerResourceId; /* - * Target server fully qualified domain name or ip. It is a optional value, if customer provide it, dms will always use it for connection + * Target server fully qualified domain name (FQDN) or IP address. It is a optional value, if customer provide it, + * migration service will always use it for connection */ - @JsonProperty(value = "targetDbServerFullyQualifiedDomainName") private String targetDbServerFullyQualifiedDomainName; /* * Migration secret parameters */ - @JsonProperty(value = "secretParameters") private MigrationSecretParameters secretParameters; /* * Number of databases to migrate */ - @JsonProperty(value = "dbsToMigrate") private List dbsToMigrate; /* * Indicates whether to setup LogicalReplicationOnSourceDb, if needed */ - @JsonProperty(value = "setupLogicalReplicationOnSourceDbIfNeeded") private LogicalReplicationOnSourceDbEnum setupLogicalReplicationOnSourceDbIfNeeded; /* - * Indicates whether the databases on the target server can be overwritten, if already present. If set to False, the migration workflow will wait for a confirmation, if it detects that the database already exists. + * Indicates whether the databases on the target server can be overwritten, if already present. If set to False, the + * migration workflow will wait for a confirmation, if it detects that the database already exists. */ - @JsonProperty(value = "overwriteDbsInTarget") private OverwriteDbsInTargetEnum overwriteDbsInTarget; /* * Start time in UTC for migration window */ - @JsonProperty(value = "migrationWindowStartTimeInUtc") private OffsetDateTime migrationWindowStartTimeInUtc; /* * End time in UTC for migration window */ - @JsonProperty(value = "migrationWindowEndTimeInUtc") private OffsetDateTime migrationWindowEndTimeInUtc; /* * To migrate roles and permissions we need to send this flag as True */ - @JsonProperty(value = "migrateRoles") private MigrateRolesEnum migrateRoles; /* * Indicates whether the data migration should start right away */ - @JsonProperty(value = "startDataMigration") private StartDataMigrationEnum startDataMigration; /* * To trigger cutover for entire migration we need to send this flag as True */ - @JsonProperty(value = "triggerCutover") private TriggerCutoverEnum triggerCutover; /* - * When you want to trigger cutover for specific databases send triggerCutover flag as True and database names in this array + * When you want to trigger cutover for specific databases send triggerCutover flag as True and database names in + * this array */ - @JsonProperty(value = "dbsToTriggerCutoverOn") private List dbsToTriggerCutoverOn; /* * To trigger cancel for entire migration we need to send this flag as True */ - @JsonProperty(value = "cancel") private CancelEnum cancel; /* * When you want to trigger cancel for specific databases send cancel flag as True and database names in this array */ - @JsonProperty(value = "dbsToCancelMigrationOn") private List dbsToCancelMigrationOn; /** @@ -348,8 +336,8 @@ public MigrationResourceProperties withSourceDbServerResourceId(String sourceDbS } /** - * Get the sourceDbServerFullyQualifiedDomainName property: Source server fully qualified domain name or ip. It is a - * optional value, if customer provide it, dms will always use it for connection. + * Get the sourceDbServerFullyQualifiedDomainName property: Source server fully qualified domain name (FQDN) or IP + * address. It is a optional value, if customer provide it, migration service will always use it for connection. * * @return the sourceDbServerFullyQualifiedDomainName value. */ @@ -358,8 +346,8 @@ public String sourceDbServerFullyQualifiedDomainName() { } /** - * Set the sourceDbServerFullyQualifiedDomainName property: Source server fully qualified domain name or ip. It is a - * optional value, if customer provide it, dms will always use it for connection. + * Set the sourceDbServerFullyQualifiedDomainName property: Source server fully qualified domain name (FQDN) or IP + * address. It is a optional value, if customer provide it, migration service will always use it for connection. * * @param sourceDbServerFullyQualifiedDomainName the sourceDbServerFullyQualifiedDomainName value to set. * @return the MigrationResourceProperties object itself. @@ -380,8 +368,8 @@ public String targetDbServerResourceId() { } /** - * Get the targetDbServerFullyQualifiedDomainName property: Target server fully qualified domain name or ip. It is a - * optional value, if customer provide it, dms will always use it for connection. + * Get the targetDbServerFullyQualifiedDomainName property: Target server fully qualified domain name (FQDN) or IP + * address. It is a optional value, if customer provide it, migration service will always use it for connection. * * @return the targetDbServerFullyQualifiedDomainName value. */ @@ -390,8 +378,8 @@ public String targetDbServerFullyQualifiedDomainName() { } /** - * Set the targetDbServerFullyQualifiedDomainName property: Target server fully qualified domain name or ip. It is a - * optional value, if customer provide it, dms will always use it for connection. + * Set the targetDbServerFullyQualifiedDomainName property: Target server fully qualified domain name (FQDN) or IP + * address. It is a optional value, if customer provide it, migration service will always use it for connection. * * @param targetDbServerFullyQualifiedDomainName the targetDbServerFullyQualifiedDomainName value to set. * @return the MigrationResourceProperties object itself. @@ -672,4 +660,137 @@ public void validate() { secretParameters().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("migrationInstanceResourceId", this.migrationInstanceResourceId); + jsonWriter.writeStringField("migrationMode", this.migrationMode == null ? null : this.migrationMode.toString()); + jsonWriter.writeStringField("migrationOption", + this.migrationOption == null ? null : this.migrationOption.toString()); + jsonWriter.writeStringField("sourceType", this.sourceType == null ? null : this.sourceType.toString()); + jsonWriter.writeStringField("sslMode", this.sslMode == null ? null : this.sslMode.toString()); + jsonWriter.writeStringField("sourceDbServerResourceId", this.sourceDbServerResourceId); + jsonWriter.writeStringField("sourceDbServerFullyQualifiedDomainName", + this.sourceDbServerFullyQualifiedDomainName); + jsonWriter.writeStringField("targetDbServerFullyQualifiedDomainName", + this.targetDbServerFullyQualifiedDomainName); + jsonWriter.writeJsonField("secretParameters", this.secretParameters); + jsonWriter.writeArrayField("dbsToMigrate", this.dbsToMigrate, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("setupLogicalReplicationOnSourceDbIfNeeded", + this.setupLogicalReplicationOnSourceDbIfNeeded == null + ? null + : this.setupLogicalReplicationOnSourceDbIfNeeded.toString()); + jsonWriter.writeStringField("overwriteDbsInTarget", + this.overwriteDbsInTarget == null ? null : this.overwriteDbsInTarget.toString()); + jsonWriter.writeStringField("migrationWindowStartTimeInUtc", + this.migrationWindowStartTimeInUtc == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.migrationWindowStartTimeInUtc)); + jsonWriter.writeStringField("migrationWindowEndTimeInUtc", + this.migrationWindowEndTimeInUtc == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.migrationWindowEndTimeInUtc)); + jsonWriter.writeStringField("migrateRoles", this.migrateRoles == null ? null : this.migrateRoles.toString()); + jsonWriter.writeStringField("startDataMigration", + this.startDataMigration == null ? null : this.startDataMigration.toString()); + jsonWriter.writeStringField("triggerCutover", + this.triggerCutover == null ? null : this.triggerCutover.toString()); + jsonWriter.writeArrayField("dbsToTriggerCutoverOn", this.dbsToTriggerCutoverOn, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("cancel", this.cancel == null ? null : this.cancel.toString()); + jsonWriter.writeArrayField("dbsToCancelMigrationOn", this.dbsToCancelMigrationOn, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MigrationResourceProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MigrationResourceProperties 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 MigrationResourceProperties. + */ + public static MigrationResourceProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MigrationResourceProperties deserializedMigrationResourceProperties = new MigrationResourceProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("migrationId".equals(fieldName)) { + deserializedMigrationResourceProperties.migrationId = reader.getString(); + } else if ("currentStatus".equals(fieldName)) { + deserializedMigrationResourceProperties.currentStatus = MigrationStatus.fromJson(reader); + } else if ("migrationInstanceResourceId".equals(fieldName)) { + deserializedMigrationResourceProperties.migrationInstanceResourceId = reader.getString(); + } else if ("migrationMode".equals(fieldName)) { + deserializedMigrationResourceProperties.migrationMode + = MigrationMode.fromString(reader.getString()); + } else if ("migrationOption".equals(fieldName)) { + deserializedMigrationResourceProperties.migrationOption + = MigrationOption.fromString(reader.getString()); + } else if ("sourceType".equals(fieldName)) { + deserializedMigrationResourceProperties.sourceType = SourceType.fromString(reader.getString()); + } else if ("sslMode".equals(fieldName)) { + deserializedMigrationResourceProperties.sslMode = SslMode.fromString(reader.getString()); + } else if ("sourceDbServerMetadata".equals(fieldName)) { + deserializedMigrationResourceProperties.sourceDbServerMetadata = DbServerMetadata.fromJson(reader); + } else if ("targetDbServerMetadata".equals(fieldName)) { + deserializedMigrationResourceProperties.targetDbServerMetadata = DbServerMetadata.fromJson(reader); + } else if ("sourceDbServerResourceId".equals(fieldName)) { + deserializedMigrationResourceProperties.sourceDbServerResourceId = reader.getString(); + } else if ("sourceDbServerFullyQualifiedDomainName".equals(fieldName)) { + deserializedMigrationResourceProperties.sourceDbServerFullyQualifiedDomainName = reader.getString(); + } else if ("targetDbServerResourceId".equals(fieldName)) { + deserializedMigrationResourceProperties.targetDbServerResourceId = reader.getString(); + } else if ("targetDbServerFullyQualifiedDomainName".equals(fieldName)) { + deserializedMigrationResourceProperties.targetDbServerFullyQualifiedDomainName = reader.getString(); + } else if ("secretParameters".equals(fieldName)) { + deserializedMigrationResourceProperties.secretParameters + = MigrationSecretParameters.fromJson(reader); + } else if ("dbsToMigrate".equals(fieldName)) { + List dbsToMigrate = reader.readArray(reader1 -> reader1.getString()); + deserializedMigrationResourceProperties.dbsToMigrate = dbsToMigrate; + } else if ("setupLogicalReplicationOnSourceDbIfNeeded".equals(fieldName)) { + deserializedMigrationResourceProperties.setupLogicalReplicationOnSourceDbIfNeeded + = LogicalReplicationOnSourceDbEnum.fromString(reader.getString()); + } else if ("overwriteDbsInTarget".equals(fieldName)) { + deserializedMigrationResourceProperties.overwriteDbsInTarget + = OverwriteDbsInTargetEnum.fromString(reader.getString()); + } else if ("migrationWindowStartTimeInUtc".equals(fieldName)) { + deserializedMigrationResourceProperties.migrationWindowStartTimeInUtc = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("migrationWindowEndTimeInUtc".equals(fieldName)) { + deserializedMigrationResourceProperties.migrationWindowEndTimeInUtc = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("migrateRoles".equals(fieldName)) { + deserializedMigrationResourceProperties.migrateRoles + = MigrateRolesEnum.fromString(reader.getString()); + } else if ("startDataMigration".equals(fieldName)) { + deserializedMigrationResourceProperties.startDataMigration + = StartDataMigrationEnum.fromString(reader.getString()); + } else if ("triggerCutover".equals(fieldName)) { + deserializedMigrationResourceProperties.triggerCutover + = TriggerCutoverEnum.fromString(reader.getString()); + } else if ("dbsToTriggerCutoverOn".equals(fieldName)) { + List dbsToTriggerCutoverOn = reader.readArray(reader1 -> reader1.getString()); + deserializedMigrationResourceProperties.dbsToTriggerCutoverOn = dbsToTriggerCutoverOn; + } else if ("cancel".equals(fieldName)) { + deserializedMigrationResourceProperties.cancel = CancelEnum.fromString(reader.getString()); + } else if ("dbsToCancelMigrationOn".equals(fieldName)) { + List dbsToCancelMigrationOn = reader.readArray(reader1 -> reader1.getString()); + deserializedMigrationResourceProperties.dbsToCancelMigrationOn = dbsToCancelMigrationOn; + } else { + reader.skipChildren(); + } + } + + return deserializedMigrationResourceProperties; + }); + } } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/MigrationResourcePropertiesForPatch.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/MigrationResourcePropertiesForPatch.java index d7bd92a7b6746..cc06de081e585 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/MigrationResourcePropertiesForPatch.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/MigrationResourcePropertiesForPatch.java @@ -5,6 +5,11 @@ 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.CancelEnum; import com.azure.resourcemanager.postgresqlflexibleserver.models.LogicalReplicationOnSourceDbEnum; import com.azure.resourcemanager.postgresqlflexibleserver.models.MigrateRolesEnum; @@ -13,103 +18,94 @@ import com.azure.resourcemanager.postgresqlflexibleserver.models.OverwriteDbsInTargetEnum; import com.azure.resourcemanager.postgresqlflexibleserver.models.StartDataMigrationEnum; import com.azure.resourcemanager.postgresqlflexibleserver.models.TriggerCutoverEnum; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; import java.util.List; /** * Migration resource properties for patch. */ @Fluent -public final class MigrationResourcePropertiesForPatch { +public final class MigrationResourcePropertiesForPatch + implements JsonSerializable { /* * ResourceId of the source database server */ - @JsonProperty(value = "sourceDbServerResourceId") private String sourceDbServerResourceId; /* - * Source server fully qualified domain name or ip. It is a optional value, if customer provide it, dms will always use it for connection + * Source server fully qualified domain name (FQDN) or IP address. It is a optional value, if customer provide it, + * migration service will always use it for connection */ - @JsonProperty(value = "sourceDbServerFullyQualifiedDomainName") private String sourceDbServerFullyQualifiedDomainName; /* - * Target server fully qualified domain name or ip. It is a optional value, if customer provide it, dms will always use it for connection + * Target server fully qualified domain name (FQDN) or IP address. It is a optional value, if customer provide it, + * migration service will always use it for connection */ - @JsonProperty(value = "targetDbServerFullyQualifiedDomainName") private String targetDbServerFullyQualifiedDomainName; /* * Migration secret parameters */ - @JsonProperty(value = "secretParameters") private MigrationSecretParameters secretParameters; /* * Number of databases to migrate */ - @JsonProperty(value = "dbsToMigrate") private List dbsToMigrate; /* * Indicates whether to setup LogicalReplicationOnSourceDb, if needed */ - @JsonProperty(value = "setupLogicalReplicationOnSourceDbIfNeeded") private LogicalReplicationOnSourceDbEnum setupLogicalReplicationOnSourceDbIfNeeded; /* - * Indicates whether the databases on the target server can be overwritten, if already present. If set to False, the migration workflow will wait for a confirmation, if it detects that the database already exists. + * Indicates whether the databases on the target server can be overwritten, if already present. If set to False, the + * migration workflow will wait for a confirmation, if it detects that the database already exists. */ - @JsonProperty(value = "overwriteDbsInTarget") private OverwriteDbsInTargetEnum overwriteDbsInTarget; /* * Start time in UTC for migration window */ - @JsonProperty(value = "migrationWindowStartTimeInUtc") private OffsetDateTime migrationWindowStartTimeInUtc; /* * To migrate roles and permissions we need to send this flag as True */ - @JsonProperty(value = "migrateRoles") private MigrateRolesEnum migrateRoles; /* * Indicates whether the data migration should start right away */ - @JsonProperty(value = "startDataMigration") private StartDataMigrationEnum startDataMigration; /* * To trigger cutover for entire migration we need to send this flag as True */ - @JsonProperty(value = "triggerCutover") private TriggerCutoverEnum triggerCutover; /* - * When you want to trigger cutover for specific databases send triggerCutover flag as True and database names in this array + * When you want to trigger cutover for specific databases send triggerCutover flag as True and database names in + * this array */ - @JsonProperty(value = "dbsToTriggerCutoverOn") private List dbsToTriggerCutoverOn; /* * To trigger cancel for entire migration we need to send this flag as True */ - @JsonProperty(value = "cancel") private CancelEnum cancel; /* * When you want to trigger cancel for specific databases send cancel flag as True and database names in this array */ - @JsonProperty(value = "dbsToCancelMigrationOn") private List dbsToCancelMigrationOn; /* * There are two types of migration modes Online and Offline */ - @JsonProperty(value = "migrationMode") private MigrationMode migrationMode; /** @@ -139,8 +135,8 @@ public MigrationResourcePropertiesForPatch withSourceDbServerResourceId(String s } /** - * Get the sourceDbServerFullyQualifiedDomainName property: Source server fully qualified domain name or ip. It is a - * optional value, if customer provide it, dms will always use it for connection. + * Get the sourceDbServerFullyQualifiedDomainName property: Source server fully qualified domain name (FQDN) or IP + * address. It is a optional value, if customer provide it, migration service will always use it for connection. * * @return the sourceDbServerFullyQualifiedDomainName value. */ @@ -149,8 +145,8 @@ public String sourceDbServerFullyQualifiedDomainName() { } /** - * Set the sourceDbServerFullyQualifiedDomainName property: Source server fully qualified domain name or ip. It is a - * optional value, if customer provide it, dms will always use it for connection. + * Set the sourceDbServerFullyQualifiedDomainName property: Source server fully qualified domain name (FQDN) or IP + * address. It is a optional value, if customer provide it, migration service will always use it for connection. * * @param sourceDbServerFullyQualifiedDomainName the sourceDbServerFullyQualifiedDomainName value to set. * @return the MigrationResourcePropertiesForPatch object itself. @@ -162,8 +158,8 @@ public String sourceDbServerFullyQualifiedDomainName() { } /** - * Get the targetDbServerFullyQualifiedDomainName property: Target server fully qualified domain name or ip. It is a - * optional value, if customer provide it, dms will always use it for connection. + * Get the targetDbServerFullyQualifiedDomainName property: Target server fully qualified domain name (FQDN) or IP + * address. It is a optional value, if customer provide it, migration service will always use it for connection. * * @return the targetDbServerFullyQualifiedDomainName value. */ @@ -172,8 +168,8 @@ public String targetDbServerFullyQualifiedDomainName() { } /** - * Set the targetDbServerFullyQualifiedDomainName property: Target server fully qualified domain name or ip. It is a - * optional value, if customer provide it, dms will always use it for connection. + * Set the targetDbServerFullyQualifiedDomainName property: Target server fully qualified domain name (FQDN) or IP + * address. It is a optional value, if customer provide it, migration service will always use it for connection. * * @param targetDbServerFullyQualifiedDomainName the targetDbServerFullyQualifiedDomainName value to set. * @return the MigrationResourcePropertiesForPatch object itself. @@ -446,4 +442,109 @@ public void validate() { secretParameters().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("sourceDbServerResourceId", this.sourceDbServerResourceId); + jsonWriter.writeStringField("sourceDbServerFullyQualifiedDomainName", + this.sourceDbServerFullyQualifiedDomainName); + jsonWriter.writeStringField("targetDbServerFullyQualifiedDomainName", + this.targetDbServerFullyQualifiedDomainName); + jsonWriter.writeJsonField("secretParameters", this.secretParameters); + jsonWriter.writeArrayField("dbsToMigrate", this.dbsToMigrate, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("setupLogicalReplicationOnSourceDbIfNeeded", + this.setupLogicalReplicationOnSourceDbIfNeeded == null + ? null + : this.setupLogicalReplicationOnSourceDbIfNeeded.toString()); + jsonWriter.writeStringField("overwriteDbsInTarget", + this.overwriteDbsInTarget == null ? null : this.overwriteDbsInTarget.toString()); + jsonWriter.writeStringField("migrationWindowStartTimeInUtc", + this.migrationWindowStartTimeInUtc == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.migrationWindowStartTimeInUtc)); + jsonWriter.writeStringField("migrateRoles", this.migrateRoles == null ? null : this.migrateRoles.toString()); + jsonWriter.writeStringField("startDataMigration", + this.startDataMigration == null ? null : this.startDataMigration.toString()); + jsonWriter.writeStringField("triggerCutover", + this.triggerCutover == null ? null : this.triggerCutover.toString()); + jsonWriter.writeArrayField("dbsToTriggerCutoverOn", this.dbsToTriggerCutoverOn, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("cancel", this.cancel == null ? null : this.cancel.toString()); + jsonWriter.writeArrayField("dbsToCancelMigrationOn", this.dbsToCancelMigrationOn, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("migrationMode", this.migrationMode == null ? null : this.migrationMode.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MigrationResourcePropertiesForPatch from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MigrationResourcePropertiesForPatch 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 MigrationResourcePropertiesForPatch. + */ + public static MigrationResourcePropertiesForPatch fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MigrationResourcePropertiesForPatch deserializedMigrationResourcePropertiesForPatch + = new MigrationResourcePropertiesForPatch(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("sourceDbServerResourceId".equals(fieldName)) { + deserializedMigrationResourcePropertiesForPatch.sourceDbServerResourceId = reader.getString(); + } else if ("sourceDbServerFullyQualifiedDomainName".equals(fieldName)) { + deserializedMigrationResourcePropertiesForPatch.sourceDbServerFullyQualifiedDomainName + = reader.getString(); + } else if ("targetDbServerFullyQualifiedDomainName".equals(fieldName)) { + deserializedMigrationResourcePropertiesForPatch.targetDbServerFullyQualifiedDomainName + = reader.getString(); + } else if ("secretParameters".equals(fieldName)) { + deserializedMigrationResourcePropertiesForPatch.secretParameters + = MigrationSecretParameters.fromJson(reader); + } else if ("dbsToMigrate".equals(fieldName)) { + List dbsToMigrate = reader.readArray(reader1 -> reader1.getString()); + deserializedMigrationResourcePropertiesForPatch.dbsToMigrate = dbsToMigrate; + } else if ("setupLogicalReplicationOnSourceDbIfNeeded".equals(fieldName)) { + deserializedMigrationResourcePropertiesForPatch.setupLogicalReplicationOnSourceDbIfNeeded + = LogicalReplicationOnSourceDbEnum.fromString(reader.getString()); + } else if ("overwriteDbsInTarget".equals(fieldName)) { + deserializedMigrationResourcePropertiesForPatch.overwriteDbsInTarget + = OverwriteDbsInTargetEnum.fromString(reader.getString()); + } else if ("migrationWindowStartTimeInUtc".equals(fieldName)) { + deserializedMigrationResourcePropertiesForPatch.migrationWindowStartTimeInUtc = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("migrateRoles".equals(fieldName)) { + deserializedMigrationResourcePropertiesForPatch.migrateRoles + = MigrateRolesEnum.fromString(reader.getString()); + } else if ("startDataMigration".equals(fieldName)) { + deserializedMigrationResourcePropertiesForPatch.startDataMigration + = StartDataMigrationEnum.fromString(reader.getString()); + } else if ("triggerCutover".equals(fieldName)) { + deserializedMigrationResourcePropertiesForPatch.triggerCutover + = TriggerCutoverEnum.fromString(reader.getString()); + } else if ("dbsToTriggerCutoverOn".equals(fieldName)) { + List dbsToTriggerCutoverOn = reader.readArray(reader1 -> reader1.getString()); + deserializedMigrationResourcePropertiesForPatch.dbsToTriggerCutoverOn = dbsToTriggerCutoverOn; + } else if ("cancel".equals(fieldName)) { + deserializedMigrationResourcePropertiesForPatch.cancel = CancelEnum.fromString(reader.getString()); + } else if ("dbsToCancelMigrationOn".equals(fieldName)) { + List dbsToCancelMigrationOn = reader.readArray(reader1 -> reader1.getString()); + deserializedMigrationResourcePropertiesForPatch.dbsToCancelMigrationOn = dbsToCancelMigrationOn; + } else if ("migrationMode".equals(fieldName)) { + deserializedMigrationResourcePropertiesForPatch.migrationMode + = MigrationMode.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedMigrationResourcePropertiesForPatch; + }); + } } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/NameAvailabilityInner.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/NameAvailabilityInner.java index e43a7e1cb9f0b..79b7c74de662b 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/NameAvailabilityInner.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/NameAvailabilityInner.java @@ -5,9 +5,12 @@ package com.azure.resourcemanager.postgresqlflexibleserver.fluent.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.postgresqlflexibleserver.models.CheckNameAvailabilityReason; import com.azure.resourcemanager.postgresqlflexibleserver.models.CheckNameAvailabilityResponse; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; /** * Represents a resource name availability. @@ -17,13 +20,11 @@ public final class NameAvailabilityInner extends CheckNameAvailabilityResponse { /* * name of the PostgreSQL server. */ - @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) private String name; /* * type of the server */ - @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) private String type; /** @@ -84,6 +85,52 @@ public NameAvailabilityInner withMessage(String message) { */ @Override public void validate() { - super.validate(); + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("nameAvailable", nameAvailable()); + jsonWriter.writeStringField("reason", reason() == null ? null : reason().toString()); + jsonWriter.writeStringField("message", message()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NameAvailabilityInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NameAvailabilityInner 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 NameAvailabilityInner. + */ + public static NameAvailabilityInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NameAvailabilityInner deserializedNameAvailabilityInner = new NameAvailabilityInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("nameAvailable".equals(fieldName)) { + deserializedNameAvailabilityInner.withNameAvailable(reader.getNullable(JsonReader::getBoolean)); + } else if ("reason".equals(fieldName)) { + deserializedNameAvailabilityInner + .withReason(CheckNameAvailabilityReason.fromString(reader.getString())); + } else if ("message".equals(fieldName)) { + deserializedNameAvailabilityInner.withMessage(reader.getString()); + } else if ("name".equals(fieldName)) { + deserializedNameAvailabilityInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedNameAvailabilityInner.type = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedNameAvailabilityInner; + }); } } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/OperationListResultInner.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/OperationListResultInner.java index 72240b7214891..3cf4df3efece3 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/OperationListResultInner.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/OperationListResultInner.java @@ -5,26 +5,28 @@ package com.azure.resourcemanager.postgresqlflexibleserver.fluent.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.models.Operation; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * A list of resource provider operations. */ @Fluent -public final class OperationListResultInner { +public final class OperationListResultInner implements JsonSerializable { /* * Collection of available operation details */ - @JsonProperty(value = "value") private List value; /* * URL client should use to fetch the next page (per server side paging). * It's null for now, added for future use. */ - @JsonProperty(value = "nextLink") private String nextLink; /** @@ -85,4 +87,44 @@ public void validate() { 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 OperationListResultInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationListResultInner 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 OperationListResultInner. + */ + public static OperationListResultInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationListResultInner deserializedOperationListResultInner = new OperationListResultInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> Operation.fromJson(reader1)); + deserializedOperationListResultInner.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedOperationListResultInner.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedOperationListResultInner; + }); + } } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/PrivateEndpointConnectionInner.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/PrivateEndpointConnectionInner.java index 8288e28a0ddaa..552be83a6fb41 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/PrivateEndpointConnectionInner.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/PrivateEndpointConnectionInner.java @@ -7,10 +7,13 @@ 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.PrivateEndpoint; import com.azure.resourcemanager.postgresqlflexibleserver.models.PrivateEndpointConnectionProvisioningState; import com.azure.resourcemanager.postgresqlflexibleserver.models.PrivateLinkServiceConnectionState; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** @@ -21,15 +24,28 @@ public final class PrivateEndpointConnectionInner extends ProxyResource { /* * Resource properties. */ - @JsonProperty(value = "properties") private PrivateEndpointConnectionProperties innerProperties; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; + /* + * 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 PrivateEndpointConnectionInner class. */ @@ -54,6 +70,36 @@ 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 groupIds property: The group ids for the private endpoint resource. * @@ -131,4 +177,51 @@ public void validate() { 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 PrivateEndpointConnectionInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateEndpointConnectionInner 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 PrivateEndpointConnectionInner. + */ + public static PrivateEndpointConnectionInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateEndpointConnectionInner deserializedPrivateEndpointConnectionInner + = new PrivateEndpointConnectionInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedPrivateEndpointConnectionInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedPrivateEndpointConnectionInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedPrivateEndpointConnectionInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedPrivateEndpointConnectionInner.innerProperties + = PrivateEndpointConnectionProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedPrivateEndpointConnectionInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateEndpointConnectionInner; + }); + } } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/PrivateEndpointConnectionProperties.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/PrivateEndpointConnectionProperties.java index d1295dc950384..6eec6c8820447 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/PrivateEndpointConnectionProperties.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/PrivateEndpointConnectionProperties.java @@ -6,39 +6,40 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; +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.PrivateEndpoint; import com.azure.resourcemanager.postgresqlflexibleserver.models.PrivateEndpointConnectionProvisioningState; import com.azure.resourcemanager.postgresqlflexibleserver.models.PrivateLinkServiceConnectionState; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * Properties of the private endpoint connection. */ @Fluent -public final class PrivateEndpointConnectionProperties { +public final class PrivateEndpointConnectionProperties + implements JsonSerializable { /* * The group ids for the private endpoint resource. */ - @JsonProperty(value = "groupIds", access = JsonProperty.Access.WRITE_ONLY) private List groupIds; /* * The private endpoint resource. */ - @JsonProperty(value = "privateEndpoint") private PrivateEndpoint privateEndpoint; /* * A collection of information about the state of the connection between service consumer and provider. */ - @JsonProperty(value = "privateLinkServiceConnectionState", required = true) private PrivateLinkServiceConnectionState privateLinkServiceConnectionState; /* * The provisioning state of the private endpoint connection resource. */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) private PrivateEndpointConnectionProvisioningState provisioningState; /** @@ -127,4 +128,52 @@ public void validate() { } private static final ClientLogger LOGGER = new ClientLogger(PrivateEndpointConnectionProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("privateLinkServiceConnectionState", this.privateLinkServiceConnectionState); + jsonWriter.writeJsonField("privateEndpoint", this.privateEndpoint); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateEndpointConnectionProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateEndpointConnectionProperties 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 PrivateEndpointConnectionProperties. + */ + public static PrivateEndpointConnectionProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateEndpointConnectionProperties deserializedPrivateEndpointConnectionProperties + = new PrivateEndpointConnectionProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("privateLinkServiceConnectionState".equals(fieldName)) { + deserializedPrivateEndpointConnectionProperties.privateLinkServiceConnectionState + = PrivateLinkServiceConnectionState.fromJson(reader); + } else if ("groupIds".equals(fieldName)) { + List groupIds = reader.readArray(reader1 -> reader1.getString()); + deserializedPrivateEndpointConnectionProperties.groupIds = groupIds; + } else if ("privateEndpoint".equals(fieldName)) { + deserializedPrivateEndpointConnectionProperties.privateEndpoint = PrivateEndpoint.fromJson(reader); + } else if ("provisioningState".equals(fieldName)) { + deserializedPrivateEndpointConnectionProperties.provisioningState + = PrivateEndpointConnectionProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateEndpointConnectionProperties; + }); + } } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/PrivateLinkResourceInner.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/PrivateLinkResourceInner.java index f23808c8ab237..6d7d16f405db7 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/PrivateLinkResourceInner.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/PrivateLinkResourceInner.java @@ -7,7 +7,10 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.ProxyResource; import com.azure.core.management.SystemData; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; /** @@ -18,15 +21,28 @@ public final class PrivateLinkResourceInner extends ProxyResource { /* * Resource properties. */ - @JsonProperty(value = "properties") private PrivateLinkResourceProperties innerProperties; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; + /* + * 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 PrivateLinkResourceInner class. */ @@ -51,6 +67,36 @@ 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 groupId property: The private link resource group id. * @@ -102,4 +148,50 @@ public void validate() { 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 PrivateLinkResourceInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateLinkResourceInner 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 PrivateLinkResourceInner. + */ + public static PrivateLinkResourceInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateLinkResourceInner deserializedPrivateLinkResourceInner = new PrivateLinkResourceInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedPrivateLinkResourceInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedPrivateLinkResourceInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedPrivateLinkResourceInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedPrivateLinkResourceInner.innerProperties + = PrivateLinkResourceProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedPrivateLinkResourceInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateLinkResourceInner; + }); + } } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/PrivateLinkResourceProperties.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/PrivateLinkResourceProperties.java index 16dae8755b3b4..034019a0998d1 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/PrivateLinkResourceProperties.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/PrivateLinkResourceProperties.java @@ -5,30 +5,31 @@ package com.azure.resourcemanager.postgresqlflexibleserver.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +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.util.List; /** * Properties of a private link resource. */ @Fluent -public final class PrivateLinkResourceProperties { +public final class PrivateLinkResourceProperties implements JsonSerializable { /* * The private link resource group id. */ - @JsonProperty(value = "groupId", access = JsonProperty.Access.WRITE_ONLY) private String groupId; /* * The private link resource required member names. */ - @JsonProperty(value = "requiredMembers", access = JsonProperty.Access.WRITE_ONLY) private List requiredMembers; /* * The private link resource private link DNS zone name. */ - @JsonProperty(value = "requiredZoneNames") private List requiredZoneNames; /** @@ -82,4 +83,48 @@ public PrivateLinkResourceProperties withRequiredZoneNames(List required */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("requiredZoneNames", this.requiredZoneNames, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateLinkResourceProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateLinkResourceProperties 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 PrivateLinkResourceProperties. + */ + public static PrivateLinkResourceProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateLinkResourceProperties deserializedPrivateLinkResourceProperties + = new PrivateLinkResourceProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("groupId".equals(fieldName)) { + deserializedPrivateLinkResourceProperties.groupId = reader.getString(); + } else if ("requiredMembers".equals(fieldName)) { + List requiredMembers = reader.readArray(reader1 -> reader1.getString()); + deserializedPrivateLinkResourceProperties.requiredMembers = requiredMembers; + } else if ("requiredZoneNames".equals(fieldName)) { + List requiredZoneNames = reader.readArray(reader1 -> reader1.getString()); + deserializedPrivateLinkResourceProperties.requiredZoneNames = requiredZoneNames; + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateLinkResourceProperties; + }); + } } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/QuotaUsageInner.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/QuotaUsageInner.java deleted file mode 100644 index d54139daff781..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/QuotaUsageInner.java +++ /dev/null @@ -1,162 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresqlflexibleserver.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.postgresqlflexibleserver.models.NameProperty; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * Quota usage for flexible servers. - */ -@Fluent -public final class QuotaUsageInner { - /* - * Name of quota usage for flexible servers - */ - @JsonProperty(value = "name") - private NameProperty name; - - /* - * Quota limit - */ - @JsonProperty(value = "limit") - private Long limit; - - /* - * Quota unit - */ - @JsonProperty(value = "unit") - private String unit; - - /* - * Current Quota usage value - */ - @JsonProperty(value = "currentValue") - private Long currentValue; - - /* - * Fully qualified ARM resource Id - */ - @JsonProperty(value = "id") - private String id; - - /** - * Creates an instance of QuotaUsageInner class. - */ - public QuotaUsageInner() { - } - - /** - * Get the name property: Name of quota usage for flexible servers. - * - * @return the name value. - */ - public NameProperty name() { - return this.name; - } - - /** - * Set the name property: Name of quota usage for flexible servers. - * - * @param name the name value to set. - * @return the QuotaUsageInner object itself. - */ - public QuotaUsageInner withName(NameProperty name) { - this.name = name; - return this; - } - - /** - * Get the limit property: Quota limit. - * - * @return the limit value. - */ - public Long limit() { - return this.limit; - } - - /** - * Set the limit property: Quota limit. - * - * @param limit the limit value to set. - * @return the QuotaUsageInner object itself. - */ - public QuotaUsageInner withLimit(Long limit) { - this.limit = limit; - return this; - } - - /** - * Get the unit property: Quota unit. - * - * @return the unit value. - */ - public String unit() { - return this.unit; - } - - /** - * Set the unit property: Quota unit. - * - * @param unit the unit value to set. - * @return the QuotaUsageInner object itself. - */ - public QuotaUsageInner withUnit(String unit) { - this.unit = unit; - return this; - } - - /** - * Get the currentValue property: Current Quota usage value. - * - * @return the currentValue value. - */ - public Long currentValue() { - return this.currentValue; - } - - /** - * Set the currentValue property: Current Quota usage value. - * - * @param currentValue the currentValue value to set. - * @return the QuotaUsageInner object itself. - */ - public QuotaUsageInner withCurrentValue(Long currentValue) { - this.currentValue = currentValue; - return this; - } - - /** - * Get the id property: Fully qualified ARM resource Id. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Set the id property: Fully qualified ARM resource Id. - * - * @param id the id value to set. - * @return the QuotaUsageInner object itself. - */ - public QuotaUsageInner withId(String id) { - this.id = id; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (name() != null) { - name().validate(); - } - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/ServerBackupInner.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/ServerBackupInner.java index 62123874d7800..f50e0ed884a7f 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/ServerBackupInner.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/ServerBackupInner.java @@ -7,8 +7,11 @@ 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.Origin; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.time.OffsetDateTime; /** @@ -19,15 +22,28 @@ public final class ServerBackupInner extends ProxyResource { /* * The properties of a server backup. */ - @JsonProperty(value = "properties") private ServerBackupProperties innerProperties; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) 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 ServerBackupInner class. */ @@ -52,6 +68,36 @@ 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 backupType property: Backup type. * @@ -131,4 +177,49 @@ public void validate() { 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 ServerBackupInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ServerBackupInner 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 ServerBackupInner. + */ + public static ServerBackupInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ServerBackupInner deserializedServerBackupInner = new ServerBackupInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedServerBackupInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedServerBackupInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedServerBackupInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedServerBackupInner.innerProperties = ServerBackupProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedServerBackupInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedServerBackupInner; + }); + } } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/ServerBackupProperties.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/ServerBackupProperties.java index 1a32bef05433b..745949a9fc920 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/ServerBackupProperties.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/ServerBackupProperties.java @@ -5,31 +5,34 @@ 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.Origin; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; /** * The properties of a server backup. */ @Fluent -public final class ServerBackupProperties { +public final class ServerBackupProperties implements JsonSerializable { /* * Backup type. */ - @JsonProperty(value = "backupType") private Origin backupType; /* * Backup completed time (ISO8601 format). */ - @JsonProperty(value = "completedTime") private OffsetDateTime completedTime; /* * Backup source */ - @JsonProperty(value = "source") private String source; /** @@ -105,4 +108,48 @@ public ServerBackupProperties withSource(String source) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("backupType", this.backupType == null ? null : this.backupType.toString()); + jsonWriter.writeStringField("completedTime", + this.completedTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.completedTime)); + jsonWriter.writeStringField("source", this.source); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ServerBackupProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ServerBackupProperties 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 ServerBackupProperties. + */ + public static ServerBackupProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ServerBackupProperties deserializedServerBackupProperties = new ServerBackupProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("backupType".equals(fieldName)) { + deserializedServerBackupProperties.backupType = Origin.fromString(reader.getString()); + } else if ("completedTime".equals(fieldName)) { + deserializedServerBackupProperties.completedTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("source".equals(fieldName)) { + deserializedServerBackupProperties.source = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedServerBackupProperties; + }); + } } 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 a90ff6ddc6eb3..dc708a9932a1b 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 @@ -7,6 +7,9 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.Resource; 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.AuthConfig; import com.azure.resourcemanager.postgresqlflexibleserver.models.Backup; import com.azure.resourcemanager.postgresqlflexibleserver.models.CreateMode; @@ -21,7 +24,7 @@ import com.azure.resourcemanager.postgresqlflexibleserver.models.Sku; import com.azure.resourcemanager.postgresqlflexibleserver.models.Storage; import com.azure.resourcemanager.postgresqlflexibleserver.models.UserAssignedIdentity; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.time.OffsetDateTime; import java.util.List; import java.util.Map; @@ -34,27 +37,38 @@ public final class ServerInner extends Resource { /* * The SKU (pricing tier) of the server. */ - @JsonProperty(value = "sku") private Sku sku; /* * Describes the identity of the application. */ - @JsonProperty(value = "identity") private UserAssignedIdentity identity; /* * Properties of the server. */ - @JsonProperty(value = "properties") private ServerProperties innerProperties; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) 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 ServerInner class. */ @@ -119,6 +133,36 @@ 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; + } + /** * {@inheritDoc} */ @@ -579,4 +623,62 @@ public void validate() { innerProperties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("sku", this.sku); + jsonWriter.writeJsonField("identity", this.identity); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ServerInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ServerInner 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 ServerInner. + */ + public static ServerInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ServerInner deserializedServerInner = new ServerInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedServerInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedServerInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedServerInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedServerInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedServerInner.withTags(tags); + } else if ("sku".equals(fieldName)) { + deserializedServerInner.sku = Sku.fromJson(reader); + } else if ("identity".equals(fieldName)) { + deserializedServerInner.identity = UserAssignedIdentity.fromJson(reader); + } else if ("properties".equals(fieldName)) { + deserializedServerInner.innerProperties = ServerProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedServerInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedServerInner; + }); + } } 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 71c4c30f16950..b1ebfc56b6879 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 @@ -5,6 +5,11 @@ 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.AuthConfig; import com.azure.resourcemanager.postgresqlflexibleserver.models.Backup; import com.azure.resourcemanager.postgresqlflexibleserver.models.CreateMode; @@ -17,139 +22,124 @@ import com.azure.resourcemanager.postgresqlflexibleserver.models.ServerState; import com.azure.resourcemanager.postgresqlflexibleserver.models.ServerVersion; import com.azure.resourcemanager.postgresqlflexibleserver.models.Storage; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; import java.util.List; /** * The properties of a server. */ @Fluent -public final class ServerProperties { +public final class ServerProperties implements JsonSerializable { /* - * The administrator's login name of a server. Can only be specified when the server is being created (and is required for creation). + * The administrator's login name of a server. Can only be specified when the server is being created (and is + * required for creation). */ - @JsonProperty(value = "administratorLogin") private String administratorLogin; /* * The administrator login password (required for server creation). */ - @JsonProperty(value = "administratorLoginPassword") private String administratorLoginPassword; /* * PostgreSQL Server version. */ - @JsonProperty(value = "version") private ServerVersion version; /* * The minor version of the server. */ - @JsonProperty(value = "minorVersion", access = JsonProperty.Access.WRITE_ONLY) private String minorVersion; /* * A state of a server that is visible to user. */ - @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) private ServerState state; /* * The fully qualified domain name of a server. */ - @JsonProperty(value = "fullyQualifiedDomainName", access = JsonProperty.Access.WRITE_ONLY) private String fullyQualifiedDomainName; /* * Storage properties of a server. */ - @JsonProperty(value = "storage") private Storage storage; /* * AuthConfig properties of a server. */ - @JsonProperty(value = "authConfig") private AuthConfig authConfig; /* * Data encryption properties of a server. */ - @JsonProperty(value = "dataEncryption") private DataEncryption dataEncryption; /* * Backup properties of a server. */ - @JsonProperty(value = "backup") private Backup backup; /* - * Network properties of a server. This Network property is required to be passed only in case you want the server to be Private access server. + * Network properties of a server. This Network property is required to be passed only in case you want the server + * to be Private access server. */ - @JsonProperty(value = "network") private Network network; /* * High availability properties of a server. */ - @JsonProperty(value = "highAvailability") private HighAvailability highAvailability; /* * Maintenance window properties of a server. */ - @JsonProperty(value = "maintenanceWindow") private MaintenanceWindow maintenanceWindow; /* - * The source server resource ID to restore from. It's required when 'createMode' is 'PointInTimeRestore' or 'GeoRestore' or 'Replica' or 'ReviveDropped'. This property is returned only for Replica server + * The source server resource ID to restore from. It's required when 'createMode' is 'PointInTimeRestore' or + * 'GeoRestore' or 'Replica' or 'ReviveDropped'. This property is returned only for Replica server */ - @JsonProperty(value = "sourceServerResourceId") private String sourceServerResourceId; /* - * Restore point creation time (ISO8601 format), specifying the time to restore from. It's required when 'createMode' is 'PointInTimeRestore' or 'GeoRestore' or 'ReviveDropped'. + * Restore point creation time (ISO8601 format), specifying the time to restore from. It's required when + * 'createMode' is 'PointInTimeRestore' or 'GeoRestore' or 'ReviveDropped'. */ - @JsonProperty(value = "pointInTimeUTC") private OffsetDateTime pointInTimeUtc; /* * availability zone information of the server. */ - @JsonProperty(value = "availabilityZone") private String availabilityZone; /* * Replication role of the server */ - @JsonProperty(value = "replicationRole") private ReplicationRole replicationRole; /* * Replicas allowed for a server. */ - @JsonProperty(value = "replicaCapacity", access = JsonProperty.Access.WRITE_ONLY) private Integer replicaCapacity; /* - * Replica properties of a server. These Replica properties are required to be passed only in case you want to Promote a server. + * Replica properties of a server. These Replica properties are required to be passed only in case you want to + * Promote a server. */ - @JsonProperty(value = "replica") private Replica replica; /* * The mode to create a new PostgreSQL server. */ - @JsonProperty(value = "createMode") private CreateMode createMode; /* * List of private endpoint connections associated with the specified resource. */ - @JsonProperty(value = "privateEndpointConnections", access = JsonProperty.Access.WRITE_ONLY) private List privateEndpointConnections; /** @@ -570,4 +560,100 @@ public void validate() { privateEndpointConnections().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("administratorLogin", this.administratorLogin); + jsonWriter.writeStringField("administratorLoginPassword", this.administratorLoginPassword); + jsonWriter.writeStringField("version", this.version == null ? null : this.version.toString()); + jsonWriter.writeJsonField("storage", this.storage); + jsonWriter.writeJsonField("authConfig", this.authConfig); + jsonWriter.writeJsonField("dataEncryption", this.dataEncryption); + jsonWriter.writeJsonField("backup", this.backup); + jsonWriter.writeJsonField("network", this.network); + jsonWriter.writeJsonField("highAvailability", this.highAvailability); + jsonWriter.writeJsonField("maintenanceWindow", this.maintenanceWindow); + jsonWriter.writeStringField("sourceServerResourceId", this.sourceServerResourceId); + jsonWriter.writeStringField("pointInTimeUTC", + this.pointInTimeUtc == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.pointInTimeUtc)); + jsonWriter.writeStringField("availabilityZone", this.availabilityZone); + jsonWriter.writeStringField("replicationRole", + this.replicationRole == null ? null : this.replicationRole.toString()); + jsonWriter.writeJsonField("replica", this.replica); + jsonWriter.writeStringField("createMode", this.createMode == null ? null : this.createMode.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ServerProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ServerProperties 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 ServerProperties. + */ + public static ServerProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ServerProperties deserializedServerProperties = new ServerProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("administratorLogin".equals(fieldName)) { + deserializedServerProperties.administratorLogin = reader.getString(); + } else if ("administratorLoginPassword".equals(fieldName)) { + deserializedServerProperties.administratorLoginPassword = reader.getString(); + } else if ("version".equals(fieldName)) { + deserializedServerProperties.version = ServerVersion.fromString(reader.getString()); + } else if ("minorVersion".equals(fieldName)) { + deserializedServerProperties.minorVersion = reader.getString(); + } else if ("state".equals(fieldName)) { + deserializedServerProperties.state = ServerState.fromString(reader.getString()); + } else if ("fullyQualifiedDomainName".equals(fieldName)) { + deserializedServerProperties.fullyQualifiedDomainName = reader.getString(); + } else if ("storage".equals(fieldName)) { + deserializedServerProperties.storage = Storage.fromJson(reader); + } else if ("authConfig".equals(fieldName)) { + deserializedServerProperties.authConfig = AuthConfig.fromJson(reader); + } else if ("dataEncryption".equals(fieldName)) { + deserializedServerProperties.dataEncryption = DataEncryption.fromJson(reader); + } else if ("backup".equals(fieldName)) { + deserializedServerProperties.backup = Backup.fromJson(reader); + } else if ("network".equals(fieldName)) { + deserializedServerProperties.network = Network.fromJson(reader); + } else if ("highAvailability".equals(fieldName)) { + deserializedServerProperties.highAvailability = HighAvailability.fromJson(reader); + } else if ("maintenanceWindow".equals(fieldName)) { + deserializedServerProperties.maintenanceWindow = MaintenanceWindow.fromJson(reader); + } else if ("sourceServerResourceId".equals(fieldName)) { + deserializedServerProperties.sourceServerResourceId = reader.getString(); + } else if ("pointInTimeUTC".equals(fieldName)) { + deserializedServerProperties.pointInTimeUtc = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("availabilityZone".equals(fieldName)) { + deserializedServerProperties.availabilityZone = reader.getString(); + } else if ("replicationRole".equals(fieldName)) { + deserializedServerProperties.replicationRole = ReplicationRole.fromString(reader.getString()); + } else if ("replicaCapacity".equals(fieldName)) { + deserializedServerProperties.replicaCapacity = reader.getNullable(JsonReader::getInt); + } else if ("replica".equals(fieldName)) { + deserializedServerProperties.replica = Replica.fromJson(reader); + } else if ("createMode".equals(fieldName)) { + deserializedServerProperties.createMode = CreateMode.fromString(reader.getString()); + } else if ("privateEndpointConnections".equals(fieldName)) { + List privateEndpointConnections + = reader.readArray(reader1 -> PrivateEndpointConnectionInner.fromJson(reader1)); + deserializedServerProperties.privateEndpointConnections = privateEndpointConnections; + } else { + reader.skipChildren(); + } + } + + return deserializedServerProperties; + }); + } } 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 cc9452f0f02d0..fc7b07dfd9cff 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 @@ -5,6 +5,10 @@ package com.azure.resourcemanager.postgresqlflexibleserver.fluent.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.models.AuthConfig; import com.azure.resourcemanager.postgresqlflexibleserver.models.Backup; import com.azure.resourcemanager.postgresqlflexibleserver.models.CreateModeForUpdate; @@ -16,83 +20,79 @@ import com.azure.resourcemanager.postgresqlflexibleserver.models.ReplicationRole; import com.azure.resourcemanager.postgresqlflexibleserver.models.ServerVersion; import com.azure.resourcemanager.postgresqlflexibleserver.models.Storage; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; /** * The ServerPropertiesForUpdate model. */ @Fluent -public final class ServerPropertiesForUpdate { +public final class ServerPropertiesForUpdate implements JsonSerializable { + /* + * The administrator's login name of a server. Can only be specified when the server is trying to switch to password + * authentication and does not have default administrator login. + */ + private String administratorLogin; + /* * The password of the administrator login. */ - @JsonProperty(value = "administratorLoginPassword") private String administratorLoginPassword; /* * PostgreSQL Server version. Version 16 is currently not supported for MVU. */ - @JsonProperty(value = "version") private ServerVersion version; /* * Storage properties of a server. */ - @JsonProperty(value = "storage") private Storage storage; /* * Backup properties of a server. */ - @JsonProperty(value = "backup") private Backup backup; /* * High availability properties of a server. */ - @JsonProperty(value = "highAvailability") private HighAvailability highAvailability; /* * Maintenance window properties of a server. */ - @JsonProperty(value = "maintenanceWindow") private MaintenanceWindow maintenanceWindow; /* * AuthConfig properties of a server. */ - @JsonProperty(value = "authConfig") private AuthConfig authConfig; /* * Data encryption properties of a server. */ - @JsonProperty(value = "dataEncryption") private DataEncryption dataEncryption; /* * The mode to update a new PostgreSQL server. */ - @JsonProperty(value = "createMode") private CreateModeForUpdate createMode; /* * Replication role of the server */ - @JsonProperty(value = "replicationRole") private ReplicationRole replicationRole; /* - * Replica properties of a server. These Replica properties are required to be passed only in case you want to Promote a server. + * Replica properties of a server. These Replica properties are required to be passed only in case you want to + * Promote a server. */ - @JsonProperty(value = "replica") private Replica replica; /* - * Network properties of a server. These are required to be passed only in case if server is a private access server. + * Network properties of a server. These are required to be passed only in case if server is a private access + * server. */ - @JsonProperty(value = "network") private Network network; /** @@ -101,6 +101,28 @@ public final class ServerPropertiesForUpdate { public ServerPropertiesForUpdate() { } + /** + * Get the administratorLogin property: The administrator's login name of a server. Can only be specified when the + * server is trying to switch to password authentication and does not have default administrator login. + * + * @return the administratorLogin value. + */ + public String administratorLogin() { + return this.administratorLogin; + } + + /** + * Set the administratorLogin property: The administrator's login name of a server. Can only be specified when the + * server is trying to switch to password authentication and does not have default administrator login. + * + * @param administratorLogin the administratorLogin value to set. + * @return the ServerPropertiesForUpdate object itself. + */ + public ServerPropertiesForUpdate withAdministratorLogin(String administratorLogin) { + this.administratorLogin = administratorLogin; + return this; + } + /** * Get the administratorLoginPassword property: The password of the administrator login. * @@ -376,4 +398,79 @@ public void validate() { network().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("administratorLogin", this.administratorLogin); + jsonWriter.writeStringField("administratorLoginPassword", this.administratorLoginPassword); + jsonWriter.writeStringField("version", this.version == null ? null : this.version.toString()); + jsonWriter.writeJsonField("storage", this.storage); + jsonWriter.writeJsonField("backup", this.backup); + jsonWriter.writeJsonField("highAvailability", this.highAvailability); + jsonWriter.writeJsonField("maintenanceWindow", this.maintenanceWindow); + jsonWriter.writeJsonField("authConfig", this.authConfig); + jsonWriter.writeJsonField("dataEncryption", this.dataEncryption); + jsonWriter.writeStringField("createMode", this.createMode == null ? null : this.createMode.toString()); + jsonWriter.writeStringField("replicationRole", + this.replicationRole == null ? null : this.replicationRole.toString()); + jsonWriter.writeJsonField("replica", this.replica); + jsonWriter.writeJsonField("network", this.network); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ServerPropertiesForUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ServerPropertiesForUpdate 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 ServerPropertiesForUpdate. + */ + public static ServerPropertiesForUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ServerPropertiesForUpdate deserializedServerPropertiesForUpdate = new ServerPropertiesForUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("administratorLogin".equals(fieldName)) { + deserializedServerPropertiesForUpdate.administratorLogin = reader.getString(); + } else if ("administratorLoginPassword".equals(fieldName)) { + deserializedServerPropertiesForUpdate.administratorLoginPassword = reader.getString(); + } else if ("version".equals(fieldName)) { + deserializedServerPropertiesForUpdate.version = ServerVersion.fromString(reader.getString()); + } else if ("storage".equals(fieldName)) { + deserializedServerPropertiesForUpdate.storage = Storage.fromJson(reader); + } else if ("backup".equals(fieldName)) { + deserializedServerPropertiesForUpdate.backup = Backup.fromJson(reader); + } else if ("highAvailability".equals(fieldName)) { + deserializedServerPropertiesForUpdate.highAvailability = HighAvailability.fromJson(reader); + } else if ("maintenanceWindow".equals(fieldName)) { + deserializedServerPropertiesForUpdate.maintenanceWindow = MaintenanceWindow.fromJson(reader); + } else if ("authConfig".equals(fieldName)) { + deserializedServerPropertiesForUpdate.authConfig = AuthConfig.fromJson(reader); + } else if ("dataEncryption".equals(fieldName)) { + deserializedServerPropertiesForUpdate.dataEncryption = DataEncryption.fromJson(reader); + } else if ("createMode".equals(fieldName)) { + deserializedServerPropertiesForUpdate.createMode + = CreateModeForUpdate.fromString(reader.getString()); + } else if ("replicationRole".equals(fieldName)) { + deserializedServerPropertiesForUpdate.replicationRole + = ReplicationRole.fromString(reader.getString()); + } else if ("replica".equals(fieldName)) { + deserializedServerPropertiesForUpdate.replica = Replica.fromJson(reader); + } else if ("network".equals(fieldName)) { + deserializedServerPropertiesForUpdate.network = Network.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedServerPropertiesForUpdate; + }); + } } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/ServerThreatProtectionProperties.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/ServerThreatProtectionProperties.java index 1047b281ba6ff..1bb3dd4d31217 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/ServerThreatProtectionProperties.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/ServerThreatProtectionProperties.java @@ -5,26 +5,30 @@ package com.azure.resourcemanager.postgresqlflexibleserver.fluent.models; import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; import com.azure.core.util.logging.ClientLogger; +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.ThreatProtectionState; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.time.OffsetDateTime; /** * Properties of server Threat Protection state. */ @Fluent -public final class ServerThreatProtectionProperties { +public final class ServerThreatProtectionProperties implements JsonSerializable { /* - * Specifies the state of the Threat Protection, whether it is enabled or disabled or a state has not been applied yet on the specific server. + * Specifies the state of the Threat Protection, whether it is enabled or disabled or a state has not been applied + * yet on the specific server. */ - @JsonProperty(value = "state", required = true) private ThreatProtectionState state; /* * Specifies the UTC creation time of the policy. */ - @JsonProperty(value = "creationTime", access = JsonProperty.Access.WRITE_ONLY) private OffsetDateTime creationTime; /** @@ -78,4 +82,46 @@ public void validate() { } private static final ClientLogger LOGGER = new ClientLogger(ServerThreatProtectionProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("state", this.state == null ? null : this.state.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ServerThreatProtectionProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ServerThreatProtectionProperties 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 ServerThreatProtectionProperties. + */ + public static ServerThreatProtectionProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ServerThreatProtectionProperties deserializedServerThreatProtectionProperties + = new ServerThreatProtectionProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("state".equals(fieldName)) { + deserializedServerThreatProtectionProperties.state + = ThreatProtectionState.fromString(reader.getString()); + } else if ("creationTime".equals(fieldName)) { + deserializedServerThreatProtectionProperties.creationTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedServerThreatProtectionProperties; + }); + } } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/ServerThreatProtectionSettingsModelInner.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/ServerThreatProtectionSettingsModelInner.java index d16dcc2bc3ee8..a7682fb968875 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/ServerThreatProtectionSettingsModelInner.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/ServerThreatProtectionSettingsModelInner.java @@ -7,8 +7,11 @@ 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.ThreatProtectionState; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.time.OffsetDateTime; /** @@ -19,15 +22,28 @@ public final class ServerThreatProtectionSettingsModelInner extends ProxyResourc /* * Advanced Threat Protection properties. */ - @JsonProperty(value = "properties") private ServerThreatProtectionProperties innerProperties; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; + /* + * 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 ServerThreatProtectionSettingsModelInner class. */ @@ -52,6 +68,36 @@ 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 state property: Specifies the state of the Threat Protection, whether it is enabled or disabled or a * state has not been applied yet on the specific server. @@ -96,4 +142,51 @@ public void validate() { 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 ServerThreatProtectionSettingsModelInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ServerThreatProtectionSettingsModelInner 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 ServerThreatProtectionSettingsModelInner. + */ + public static ServerThreatProtectionSettingsModelInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ServerThreatProtectionSettingsModelInner deserializedServerThreatProtectionSettingsModelInner + = new ServerThreatProtectionSettingsModelInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedServerThreatProtectionSettingsModelInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedServerThreatProtectionSettingsModelInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedServerThreatProtectionSettingsModelInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedServerThreatProtectionSettingsModelInner.innerProperties + = ServerThreatProtectionProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedServerThreatProtectionSettingsModelInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedServerThreatProtectionSettingsModelInner; + }); + } } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/VirtualEndpointResourceInner.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/VirtualEndpointResourceInner.java index 00c775750129b..eace4556e332e 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/VirtualEndpointResourceInner.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/VirtualEndpointResourceInner.java @@ -6,9 +6,12 @@ import com.azure.core.annotation.Fluent; 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.VirtualEndpointResourceForPatch; import com.azure.resourcemanager.postgresqlflexibleserver.models.VirtualEndpointType; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** @@ -17,29 +20,31 @@ @Fluent public final class VirtualEndpointResourceInner extends VirtualEndpointResourceForPatch { /* - * Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + * Fully qualified resource ID for the resource. E.g. + * "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" */ - @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) private String id; /* * The name of the resource */ - @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) private String name; /* * The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" */ - @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) private String type; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; + /* + * Properties of the virtual endpoint resource. + */ + private VirtualEndpointResourceProperties innerProperties; + /** * Creates an instance of VirtualEndpointResourceInner class. */ @@ -85,23 +90,69 @@ public SystemData systemData() { } /** - * {@inheritDoc} + * Get the innerProperties property: Properties of the virtual endpoint resource. + * + * @return the innerProperties value. + */ + private VirtualEndpointResourceProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the endpointType property: The endpoint type for the virtual endpoint. + * + * @return the endpointType value. + */ + public VirtualEndpointType endpointType() { + return this.innerProperties() == null ? null : this.innerProperties().endpointType(); + } + + /** + * Set the endpointType property: The endpoint type for the virtual endpoint. + * + * @param endpointType the endpointType value to set. + * @return the VirtualEndpointResourceInner object itself. */ - @Override public VirtualEndpointResourceInner withEndpointType(VirtualEndpointType endpointType) { - super.withEndpointType(endpointType); + if (this.innerProperties() == null) { + this.innerProperties = new VirtualEndpointResourceProperties(); + } + this.innerProperties().withEndpointType(endpointType); return this; } /** - * {@inheritDoc} + * Get the members property: List of members for a virtual endpoint. + * + * @return the members value. + */ + public List members() { + return this.innerProperties() == null ? null : this.innerProperties().members(); + } + + /** + * Set the members property: List of members for a virtual endpoint. + * + * @param members the members value to set. + * @return the VirtualEndpointResourceInner object itself. */ - @Override public VirtualEndpointResourceInner withMembers(List members) { - super.withMembers(members); + if (this.innerProperties() == null) { + this.innerProperties = new VirtualEndpointResourceProperties(); + } + this.innerProperties().withMembers(members); return this; } + /** + * Get the virtualEndpoints property: List of virtual endpoints for a server. + * + * @return the virtualEndpoints value. + */ + public List virtualEndpoints() { + return this.innerProperties() == null ? null : this.innerProperties().virtualEndpoints(); + } + /** * Validates the instance. * @@ -109,6 +160,53 @@ public VirtualEndpointResourceInner withMembers(List members) { */ @Override public void validate() { - super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", innerProperties()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VirtualEndpointResourceInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VirtualEndpointResourceInner 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 VirtualEndpointResourceInner. + */ + public static VirtualEndpointResourceInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VirtualEndpointResourceInner deserializedVirtualEndpointResourceInner = new VirtualEndpointResourceInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("properties".equals(fieldName)) { + deserializedVirtualEndpointResourceInner.innerProperties + = VirtualEndpointResourceProperties.fromJson(reader); + } else if ("id".equals(fieldName)) { + deserializedVirtualEndpointResourceInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedVirtualEndpointResourceInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedVirtualEndpointResourceInner.type = reader.getString(); + } else if ("systemData".equals(fieldName)) { + deserializedVirtualEndpointResourceInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedVirtualEndpointResourceInner; + }); } } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/VirtualEndpointResourceProperties.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/VirtualEndpointResourceProperties.java index e2636d85b435c..1d2a47e228fa7 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/VirtualEndpointResourceProperties.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/VirtualEndpointResourceProperties.java @@ -5,31 +5,32 @@ package com.azure.resourcemanager.postgresqlflexibleserver.fluent.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.models.VirtualEndpointType; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * The properties of a virtual endpoint. */ @Fluent -public final class VirtualEndpointResourceProperties { +public final class VirtualEndpointResourceProperties implements JsonSerializable { /* * The endpoint type for the virtual endpoint. */ - @JsonProperty(value = "endpointType") private VirtualEndpointType endpointType; /* * List of members for a virtual endpoint */ - @JsonProperty(value = "members") private List members; /* * List of virtual endpoints for a server */ - @JsonProperty(value = "virtualEndpoints", access = JsonProperty.Access.WRITE_ONLY) private List virtualEndpoints; /** @@ -94,4 +95,49 @@ public List virtualEndpoints() { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("endpointType", this.endpointType == null ? null : this.endpointType.toString()); + jsonWriter.writeArrayField("members", this.members, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VirtualEndpointResourceProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VirtualEndpointResourceProperties 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 VirtualEndpointResourceProperties. + */ + public static VirtualEndpointResourceProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VirtualEndpointResourceProperties deserializedVirtualEndpointResourceProperties + = new VirtualEndpointResourceProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("endpointType".equals(fieldName)) { + deserializedVirtualEndpointResourceProperties.endpointType + = VirtualEndpointType.fromString(reader.getString()); + } else if ("members".equals(fieldName)) { + List members = reader.readArray(reader1 -> reader1.getString()); + deserializedVirtualEndpointResourceProperties.members = members; + } else if ("virtualEndpoints".equals(fieldName)) { + List virtualEndpoints = reader.readArray(reader1 -> reader1.getString()); + deserializedVirtualEndpointResourceProperties.virtualEndpoints = virtualEndpoints; + } else { + reader.skipChildren(); + } + } + + return deserializedVirtualEndpointResourceProperties; + }); + } } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/VirtualNetworkSubnetUsageResultInner.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/VirtualNetworkSubnetUsageResultInner.java index 97f24ab84646d..66e0660b04384 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/VirtualNetworkSubnetUsageResultInner.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/VirtualNetworkSubnetUsageResultInner.java @@ -5,31 +5,33 @@ package com.azure.resourcemanager.postgresqlflexibleserver.fluent.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.models.DelegatedSubnetUsage; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * Virtual network subnet usage data. */ @Immutable -public final class VirtualNetworkSubnetUsageResultInner { +public final class VirtualNetworkSubnetUsageResultInner + implements JsonSerializable { /* * The delegatedSubnetsUsage property. */ - @JsonProperty(value = "delegatedSubnetsUsage", access = JsonProperty.Access.WRITE_ONLY) private List delegatedSubnetsUsage; /* * location of the delegated subnet usage */ - @JsonProperty(value = "location", access = JsonProperty.Access.WRITE_ONLY) private String location; /* * subscriptionId of the delegated subnet usage */ - @JsonProperty(value = "subscriptionId", access = JsonProperty.Access.WRITE_ONLY) private String subscriptionId; /** @@ -75,4 +77,46 @@ public void validate() { delegatedSubnetsUsage().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VirtualNetworkSubnetUsageResultInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VirtualNetworkSubnetUsageResultInner 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 VirtualNetworkSubnetUsageResultInner. + */ + public static VirtualNetworkSubnetUsageResultInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VirtualNetworkSubnetUsageResultInner deserializedVirtualNetworkSubnetUsageResultInner + = new VirtualNetworkSubnetUsageResultInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("delegatedSubnetsUsage".equals(fieldName)) { + List delegatedSubnetsUsage + = reader.readArray(reader1 -> DelegatedSubnetUsage.fromJson(reader1)); + deserializedVirtualNetworkSubnetUsageResultInner.delegatedSubnetsUsage = delegatedSubnetsUsage; + } else if ("location".equals(fieldName)) { + deserializedVirtualNetworkSubnetUsageResultInner.location = reader.getString(); + } else if ("subscriptionId".equals(fieldName)) { + deserializedVirtualNetworkSubnetUsageResultInner.subscriptionId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedVirtualNetworkSubnetUsageResultInner; + }); + } } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/package-info.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/package-info.java index 0e1a8c2fca79c..b445783ac8043 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/package-info.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/package-info.java @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. /** - * Package containing the inner data models for PostgreSqlManagementClient. + * Package containing the inner data models for PostgreSqlServerManagementClient. * 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. diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/package-info.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/package-info.java index f06dd5765fa30..d213c46a0f2e5 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/package-info.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/package-info.java @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. /** - * Package containing the service clients for PostgreSqlManagementClient. + * Package containing the service clients for PostgreSqlServerManagementClient. * 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. diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/ActiveDirectoryAdministratorImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/ActiveDirectoryAdministratorImpl.java index 1c7a2d41d9471..3237571c35dae 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/ActiveDirectoryAdministratorImpl.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/ActiveDirectoryAdministratorImpl.java @@ -15,10 +15,10 @@ public final class ActiveDirectoryAdministratorImpl implements ActiveDirectoryAdministrator, ActiveDirectoryAdministrator.Definition { private ActiveDirectoryAdministratorInner innerObject; - private final com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager; + private final com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager serviceManager; ActiveDirectoryAdministratorImpl(ActiveDirectoryAdministratorInner innerObject, - com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager) { + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } @@ -59,7 +59,7 @@ public ActiveDirectoryAdministratorInner innerModel() { return this.innerObject; } - private com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager() { + private com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager() { return this.serviceManager; } @@ -92,7 +92,7 @@ public ActiveDirectoryAdministrator create(Context context) { } ActiveDirectoryAdministratorImpl(String name, - com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager) { + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager serviceManager) { this.innerObject = new ActiveDirectoryAdministratorInner(); this.serviceManager = serviceManager; this.objectId = name; diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/AdministratorsClientImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/AdministratorsClientImpl.java index fee0ddadcfab8..6e1e4e2ad9d1c 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/AdministratorsClientImpl.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/AdministratorsClientImpl.java @@ -51,25 +51,25 @@ public final class AdministratorsClientImpl implements AdministratorsClient { /** * The service client containing this operation class. */ - private final PostgreSqlManagementClientImpl client; + private final PostgreSqlServerManagementClientImpl client; /** * Initializes an instance of AdministratorsClientImpl. * * @param client the instance of the service client containing this operation class. */ - AdministratorsClientImpl(PostgreSqlManagementClientImpl client) { + AdministratorsClientImpl(PostgreSqlServerManagementClientImpl client) { this.service = RestProxy.create(AdministratorsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for PostgreSqlManagementClientAdministrators to be used by the proxy - * service to perform REST calls. + * The interface defining all the services for PostgreSqlServerManagementClientAdministrators to be used by the + * proxy service to perform REST calls. */ @Host("{$host}") - @ServiceInterface(name = "PostgreSqlManagement") + @ServiceInterface(name = "PostgreSqlServerMana") public interface AdministratorsService { @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/administrators/{objectId}") @@ -868,9 +868,7 @@ public PagedIterable listByServer(String reso /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @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. @@ -897,9 +895,7 @@ private Mono> listByServerNextS /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @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. diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/AdministratorsImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/AdministratorsImpl.java index 99a09fbdd089f..f0c4802eb4a58 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/AdministratorsImpl.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/AdministratorsImpl.java @@ -19,10 +19,10 @@ public final class AdministratorsImpl implements Administrators { private final AdministratorsClient innerClient; - private final com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager; + private final com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager serviceManager; public AdministratorsImpl(AdministratorsClient innerClient, - com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager) { + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } @@ -151,7 +151,7 @@ private AdministratorsClient serviceClient() { return this.innerClient; } - private com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager() { + private com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager() { return this.serviceManager; } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/BackupsClientImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/BackupsClientImpl.java index e52435a749b5c..bd4c5c5e2f42f 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/BackupsClientImpl.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/BackupsClientImpl.java @@ -4,6 +4,7 @@ package com.azure.resourcemanager.postgresqlflexibleserver.implementation; +import com.azure.core.annotation.Delete; import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; @@ -11,6 +12,7 @@ import com.azure.core.annotation.Host; import com.azure.core.annotation.HostParam; import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; import com.azure.core.annotation.QueryParam; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -23,11 +25,16 @@ import com.azure.core.http.rest.Response; import com.azure.core.http.rest.RestProxy; import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.postgresqlflexibleserver.fluent.BackupsClient; import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.ServerBackupInner; import com.azure.resourcemanager.postgresqlflexibleserver.models.ServerBackupListResult; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; /** @@ -42,25 +49,43 @@ public final class BackupsClientImpl implements BackupsClient { /** * The service client containing this operation class. */ - private final PostgreSqlManagementClientImpl client; + private final PostgreSqlServerManagementClientImpl client; /** * Initializes an instance of BackupsClientImpl. * * @param client the instance of the service client containing this operation class. */ - BackupsClientImpl(PostgreSqlManagementClientImpl client) { + BackupsClientImpl(PostgreSqlServerManagementClientImpl client) { this.service = RestProxy.create(BackupsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for PostgreSqlManagementClientBackups to be used by the proxy service to - * perform REST calls. + * The interface defining all the services for PostgreSqlServerManagementClientBackups to be used by the proxy + * service to perform REST calls. */ @Host("{$host}") - @ServiceInterface(name = "PostgreSqlManagement") + @ServiceInterface(name = "PostgreSqlServerMana") public interface BackupsService { + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/backups/{backupName}") + @ExpectedResponses({ 200, 201, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("serverName") String serverName, + @PathParam("backupName") String backupName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/backups/{backupName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("serverName") String serverName, + @PathParam("backupName") String backupName, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/backups/{backupName}") @ExpectedResponses({ 200 }) @@ -88,6 +113,449 @@ Mono> listByServerNext( @HeaderParam("Accept") String accept, Context context); } + /** + * Create a specific backup for PostgreSQL flexible server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param backupName The name of the backup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return server backup properties along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> createWithResponseAsync(String resourceGroupName, String serverName, + String backupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serverName == null) { + return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); + } + if (backupName == null) { + return Mono.error(new IllegalArgumentException("Parameter backupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.create(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serverName, backupName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a specific backup for PostgreSQL flexible server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param backupName The name of the backup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return server backup properties along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync(String resourceGroupName, String serverName, + String backupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serverName == null) { + return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); + } + if (backupName == null) { + return Mono.error(new IllegalArgumentException("Parameter backupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.create(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, serverName, backupName, accept, context); + } + + /** + * Create a specific backup for PostgreSQL flexible server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param backupName The name of the backup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of server backup properties. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux, ServerBackupInner> beginCreateAsync(String resourceGroupName, + String serverName, String backupName) { + Mono>> mono = createWithResponseAsync(resourceGroupName, serverName, backupName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + ServerBackupInner.class, ServerBackupInner.class, this.client.getContext()); + } + + /** + * Create a specific backup for PostgreSQL flexible server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param backupName The name of the backup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of server backup properties. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ServerBackupInner> beginCreateAsync(String resourceGroupName, + String serverName, String backupName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createWithResponseAsync(resourceGroupName, serverName, backupName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + ServerBackupInner.class, ServerBackupInner.class, context); + } + + /** + * Create a specific backup for PostgreSQL flexible server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param backupName The name of the backup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of server backup properties. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ServerBackupInner> beginCreate(String resourceGroupName, + String serverName, String backupName) { + return this.beginCreateAsync(resourceGroupName, serverName, backupName).getSyncPoller(); + } + + /** + * Create a specific backup for PostgreSQL flexible server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param backupName The name of the backup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of server backup properties. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ServerBackupInner> beginCreate(String resourceGroupName, + String serverName, String backupName, Context context) { + return this.beginCreateAsync(resourceGroupName, serverName, backupName, context).getSyncPoller(); + } + + /** + * Create a specific backup for PostgreSQL flexible server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param backupName The name of the backup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return server backup properties on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createAsync(String resourceGroupName, String serverName, String backupName) { + return beginCreateAsync(resourceGroupName, serverName, backupName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a specific backup for PostgreSQL flexible server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param backupName The name of the backup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return server backup properties on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync(String resourceGroupName, String serverName, String backupName, + Context context) { + return beginCreateAsync(resourceGroupName, serverName, backupName, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a specific backup for PostgreSQL flexible server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param backupName The name of the backup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return server backup properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ServerBackupInner create(String resourceGroupName, String serverName, String backupName) { + return createAsync(resourceGroupName, serverName, backupName).block(); + } + + /** + * Create a specific backup for PostgreSQL flexible server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param backupName The name of the backup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return server backup properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ServerBackupInner create(String resourceGroupName, String serverName, String backupName, Context context) { + return createAsync(resourceGroupName, serverName, backupName, context).block(); + } + + /** + * Deletes a specific backup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param backupName The name of the backup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> deleteWithResponseAsync(String resourceGroupName, String serverName, + String backupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serverName == null) { + return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); + } + if (backupName == null) { + return Mono.error(new IllegalArgumentException("Parameter backupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serverName, backupName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a specific backup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param backupName The name of the backup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String serverName, + String backupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serverName == null) { + return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); + } + if (backupName == null) { + return Mono.error(new IllegalArgumentException("Parameter backupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, serverName, backupName, accept, context); + } + + /** + * Deletes a specific backup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param backupName The name of the backup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String serverName, + String backupName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, serverName, backupName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Deletes a specific backup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param backupName The name of the backup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String serverName, + String backupName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, serverName, backupName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Deletes a specific backup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param backupName The name of the backup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String serverName, + String backupName) { + return this.beginDeleteAsync(resourceGroupName, serverName, backupName).getSyncPoller(); + } + + /** + * Deletes a specific backup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param backupName The name of the backup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String serverName, + String backupName, Context context) { + return this.beginDeleteAsync(resourceGroupName, serverName, backupName, context).getSyncPoller(); + } + + /** + * Deletes a specific backup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param backupName The name of the backup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deleteAsync(String resourceGroupName, String serverName, String backupName) { + return beginDeleteAsync(resourceGroupName, serverName, backupName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a specific backup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param backupName The name of the backup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String serverName, String backupName, Context context) { + return beginDeleteAsync(resourceGroupName, serverName, backupName, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a specific backup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param backupName The name of the backup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String serverName, String backupName) { + deleteAsync(resourceGroupName, serverName, backupName).block(); + } + + /** + * Deletes a specific backup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param backupName The name of the backup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String serverName, String backupName, Context context) { + deleteAsync(resourceGroupName, serverName, backupName, context).block(); + } + /** * Get specific backup for a given server. * @@ -360,9 +828,7 @@ public PagedIterable listByServer(String resourceGroupName, S /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @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. @@ -388,9 +854,7 @@ private Mono> listByServerNextSinglePageAsync(S /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @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. diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/BackupsImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/BackupsImpl.java index 5dedfd2aa6b56..f1b6fa2450e68 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/BackupsImpl.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/BackupsImpl.java @@ -19,14 +19,40 @@ public final class BackupsImpl implements Backups { private final BackupsClient innerClient; - private final com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager; + private final com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager serviceManager; public BackupsImpl(BackupsClient innerClient, - com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager) { + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } + public ServerBackup create(String resourceGroupName, String serverName, String backupName) { + ServerBackupInner inner = this.serviceClient().create(resourceGroupName, serverName, backupName); + if (inner != null) { + return new ServerBackupImpl(inner, this.manager()); + } else { + return null; + } + } + + public ServerBackup create(String resourceGroupName, String serverName, String backupName, Context context) { + ServerBackupInner inner = this.serviceClient().create(resourceGroupName, serverName, backupName, context); + if (inner != null) { + return new ServerBackupImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String serverName, String backupName) { + this.serviceClient().delete(resourceGroupName, serverName, backupName); + } + + public void delete(String resourceGroupName, String serverName, String backupName, Context context) { + this.serviceClient().delete(resourceGroupName, serverName, backupName, context); + } + public Response getWithResponse(String resourceGroupName, String serverName, String backupName, Context context) { Response inner @@ -63,7 +89,7 @@ private BackupsClient serviceClient() { return this.innerClient; } - private com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager() { + private com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager() { return this.serviceManager; } } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/CheckNameAvailabilitiesClientImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/CheckNameAvailabilitiesClientImpl.java index 201a89fb21345..d1074d44649c6 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/CheckNameAvailabilitiesClientImpl.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/CheckNameAvailabilitiesClientImpl.java @@ -39,25 +39,25 @@ public final class CheckNameAvailabilitiesClientImpl implements CheckNameAvailab /** * The service client containing this operation class. */ - private final PostgreSqlManagementClientImpl client; + private final PostgreSqlServerManagementClientImpl client; /** * Initializes an instance of CheckNameAvailabilitiesClientImpl. * * @param client the instance of the service client containing this operation class. */ - CheckNameAvailabilitiesClientImpl(PostgreSqlManagementClientImpl client) { + CheckNameAvailabilitiesClientImpl(PostgreSqlServerManagementClientImpl client) { this.service = RestProxy.create(CheckNameAvailabilitiesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for PostgreSqlManagementClientCheckNameAvailabilities to be used by the - * proxy service to perform REST calls. + * The interface defining all the services for PostgreSqlServerManagementClientCheckNameAvailabilities to be used by + * the proxy service to perform REST calls. */ @Host("{$host}") - @ServiceInterface(name = "PostgreSqlManagement") + @ServiceInterface(name = "PostgreSqlServerMana") public interface CheckNameAvailabilitiesService { @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/providers/Microsoft.DBforPostgreSQL/checkNameAvailability") diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/CheckNameAvailabilitiesImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/CheckNameAvailabilitiesImpl.java index f2687b661f162..fced965642d10 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/CheckNameAvailabilitiesImpl.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/CheckNameAvailabilitiesImpl.java @@ -19,10 +19,10 @@ public final class CheckNameAvailabilitiesImpl implements CheckNameAvailabilitie private final CheckNameAvailabilitiesClient innerClient; - private final com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager; + private final com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager serviceManager; public CheckNameAvailabilitiesImpl(CheckNameAvailabilitiesClient innerClient, - com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager) { + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } @@ -52,7 +52,7 @@ private CheckNameAvailabilitiesClient serviceClient() { return this.innerClient; } - private com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager() { + private com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager() { return this.serviceManager; } } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/CheckNameAvailabilityWithLocationsClientImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/CheckNameAvailabilityWithLocationsClientImpl.java index a003ced3fd13f..89a1f6b789344 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/CheckNameAvailabilityWithLocationsClientImpl.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/CheckNameAvailabilityWithLocationsClientImpl.java @@ -39,25 +39,25 @@ public final class CheckNameAvailabilityWithLocationsClientImpl implements Check /** * The service client containing this operation class. */ - private final PostgreSqlManagementClientImpl client; + private final PostgreSqlServerManagementClientImpl client; /** * Initializes an instance of CheckNameAvailabilityWithLocationsClientImpl. * * @param client the instance of the service client containing this operation class. */ - CheckNameAvailabilityWithLocationsClientImpl(PostgreSqlManagementClientImpl client) { + CheckNameAvailabilityWithLocationsClientImpl(PostgreSqlServerManagementClientImpl client) { this.service = RestProxy.create(CheckNameAvailabilityWithLocationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for PostgreSqlManagementClientCheckNameAvailabilityWithLocations to be - * used by the proxy service to perform REST calls. + * The interface defining all the services for PostgreSqlServerManagementClientCheckNameAvailabilityWithLocations to + * be used by the proxy service to perform REST calls. */ @Host("{$host}") - @ServiceInterface(name = "PostgreSqlManagement") + @ServiceInterface(name = "PostgreSqlServerMana") public interface CheckNameAvailabilityWithLocationsService { @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/providers/Microsoft.DBforPostgreSQL/locations/{locationName}/checkNameAvailability") diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/CheckNameAvailabilityWithLocationsImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/CheckNameAvailabilityWithLocationsImpl.java index 5ef22f95fa7ee..708cb0153bb41 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/CheckNameAvailabilityWithLocationsImpl.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/CheckNameAvailabilityWithLocationsImpl.java @@ -19,10 +19,10 @@ public final class CheckNameAvailabilityWithLocationsImpl implements CheckNameAv private final CheckNameAvailabilityWithLocationsClient innerClient; - private final com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager; + private final com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager serviceManager; public CheckNameAvailabilityWithLocationsImpl(CheckNameAvailabilityWithLocationsClient innerClient, - com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager) { + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } @@ -52,7 +52,7 @@ private CheckNameAvailabilityWithLocationsClient serviceClient() { return this.innerClient; } - private com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager() { + private com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager() { return this.serviceManager; } } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/ConfigurationImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/ConfigurationImpl.java index eff6375328f55..f2fe9831b1073 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/ConfigurationImpl.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/ConfigurationImpl.java @@ -14,7 +14,7 @@ public final class ConfigurationImpl implements Configuration, Configuration.Definition, Configuration.Update { private ConfigurationInner innerObject; - private final com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager; + private final com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager serviceManager; public String id() { return this.innerModel().id(); @@ -84,7 +84,7 @@ public ConfigurationInner innerModel() { return this.innerObject; } - private com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager() { + private com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager() { return this.serviceManager; } @@ -117,7 +117,7 @@ public Configuration create(Context context) { } ConfigurationImpl(String name, - com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager) { + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager serviceManager) { this.innerObject = new ConfigurationInner(); this.serviceManager = serviceManager; this.configurationName = name; @@ -143,7 +143,7 @@ public Configuration apply(Context context) { } ConfigurationImpl(ConfigurationInner innerObject, - com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager) { + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/ConfigurationsClientImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/ConfigurationsClientImpl.java index 15ca05436c6cf..cd39bf5e6a18e 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/ConfigurationsClientImpl.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/ConfigurationsClientImpl.java @@ -51,25 +51,25 @@ public final class ConfigurationsClientImpl implements ConfigurationsClient { /** * The service client containing this operation class. */ - private final PostgreSqlManagementClientImpl client; + private final PostgreSqlServerManagementClientImpl client; /** * Initializes an instance of ConfigurationsClientImpl. * * @param client the instance of the service client containing this operation class. */ - ConfigurationsClientImpl(PostgreSqlManagementClientImpl client) { + ConfigurationsClientImpl(PostgreSqlServerManagementClientImpl client) { this.service = RestProxy.create(ConfigurationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for PostgreSqlManagementClientConfigurations to be used by the proxy - * service to perform REST calls. + * The interface defining all the services for PostgreSqlServerManagementClientConfigurations to be used by the + * proxy service to perform REST calls. */ @Host("{$host}") - @ServiceInterface(name = "PostgreSqlManagement") + @ServiceInterface(name = "PostgreSqlServerMana") public interface ConfigurationsService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/configurations") @@ -902,9 +902,7 @@ public ConfigurationInner put(String resourceGroupName, String serverName, Strin /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @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. @@ -931,9 +929,7 @@ private Mono> listByServerNextSinglePageAsync( /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @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. diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/ConfigurationsImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/ConfigurationsImpl.java index 3b4799cbdd76b..fcda9885b5fac 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/ConfigurationsImpl.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/ConfigurationsImpl.java @@ -19,10 +19,10 @@ public final class ConfigurationsImpl implements Configurations { private final ConfigurationsClient innerClient; - private final com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager; + private final com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager serviceManager; public ConfigurationsImpl(ConfigurationsClient innerClient, - com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager) { + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } @@ -101,7 +101,7 @@ private ConfigurationsClient serviceClient() { return this.innerClient; } - private com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager() { + private com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager() { return this.serviceManager; } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/DatabaseImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/DatabaseImpl.java index a4dd44e2f7a45..fd5893e461497 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/DatabaseImpl.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/DatabaseImpl.java @@ -12,10 +12,10 @@ public final class DatabaseImpl implements Database, Database.Definition { private DatabaseInner innerObject; - private final com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager; + private final com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager serviceManager; DatabaseImpl(DatabaseInner innerObject, - com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager) { + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } @@ -48,7 +48,7 @@ public DatabaseInner innerModel() { return this.innerObject; } - private com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager() { + private com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager() { return this.serviceManager; } @@ -78,7 +78,8 @@ public Database create(Context context) { return this; } - DatabaseImpl(String name, com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager) { + DatabaseImpl(String name, + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager serviceManager) { this.innerObject = new DatabaseInner(); this.serviceManager = serviceManager; this.databaseName = name; diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/DatabasesClientImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/DatabasesClientImpl.java index c65243406b8b7..5fd97db51d6d5 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/DatabasesClientImpl.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/DatabasesClientImpl.java @@ -50,25 +50,25 @@ public final class DatabasesClientImpl implements DatabasesClient { /** * The service client containing this operation class. */ - private final PostgreSqlManagementClientImpl client; + private final PostgreSqlServerManagementClientImpl client; /** * Initializes an instance of DatabasesClientImpl. * * @param client the instance of the service client containing this operation class. */ - DatabasesClientImpl(PostgreSqlManagementClientImpl client) { + DatabasesClientImpl(PostgreSqlServerManagementClientImpl client) { this.service = RestProxy.create(DatabasesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for PostgreSqlManagementClientDatabases to be used by the proxy service - * to perform REST calls. + * The interface defining all the services for PostgreSqlServerManagementClientDatabases to be used by the proxy + * service to perform REST calls. */ @Host("{$host}") - @ServiceInterface(name = "PostgreSqlManagement") + @ServiceInterface(name = "PostgreSqlServerMana") public interface DatabasesService { @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/databases/{databaseName}") @@ -853,9 +853,7 @@ public PagedIterable listByServer(String resourceGroupName, Strin /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @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. @@ -881,9 +879,7 @@ private Mono> listByServerNextSinglePageAsync(Strin /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @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. diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/DatabasesImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/DatabasesImpl.java index e8f622f1b408e..eed8ba23c93ba 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/DatabasesImpl.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/DatabasesImpl.java @@ -19,10 +19,10 @@ public final class DatabasesImpl implements Databases { private final DatabasesClient innerClient; - private final com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager; + private final com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager serviceManager; public DatabasesImpl(DatabasesClient innerClient, - com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager) { + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } @@ -146,7 +146,7 @@ private DatabasesClient serviceClient() { return this.innerClient; } - private com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager() { + private com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager() { return this.serviceManager; } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/FirewallRuleImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/FirewallRuleImpl.java index 79631545bd344..7d603b48228be 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/FirewallRuleImpl.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/FirewallRuleImpl.java @@ -12,7 +12,7 @@ public final class FirewallRuleImpl implements FirewallRule, FirewallRule.Definition, FirewallRule.Update { private FirewallRuleInner innerObject; - private final com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager; + private final com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager serviceManager; public String id() { return this.innerModel().id(); @@ -46,7 +46,7 @@ public FirewallRuleInner innerModel() { return this.innerObject; } - private com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager() { + private com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager() { return this.serviceManager; } @@ -76,7 +76,8 @@ public FirewallRule create(Context context) { return this; } - FirewallRuleImpl(String name, com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager) { + FirewallRuleImpl(String name, + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager serviceManager) { this.innerObject = new FirewallRuleInner(); this.serviceManager = serviceManager; this.firewallRuleName = name; @@ -101,7 +102,7 @@ public FirewallRule apply(Context context) { } FirewallRuleImpl(FirewallRuleInner innerObject, - com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager) { + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/FirewallRulesClientImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/FirewallRulesClientImpl.java index 91356280e91d7..87f5e1e2d9f31 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/FirewallRulesClientImpl.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/FirewallRulesClientImpl.java @@ -50,25 +50,25 @@ public final class FirewallRulesClientImpl implements FirewallRulesClient { /** * The service client containing this operation class. */ - private final PostgreSqlManagementClientImpl client; + private final PostgreSqlServerManagementClientImpl client; /** * Initializes an instance of FirewallRulesClientImpl. * * @param client the instance of the service client containing this operation class. */ - FirewallRulesClientImpl(PostgreSqlManagementClientImpl client) { + FirewallRulesClientImpl(PostgreSqlServerManagementClientImpl client) { this.service = RestProxy.create(FirewallRulesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for PostgreSqlManagementClientFirewallRules to be used by the proxy + * The interface defining all the services for PostgreSqlServerManagementClientFirewallRules to be used by the proxy * service to perform REST calls. */ @Host("{$host}") - @ServiceInterface(name = "PostgreSqlManagement") + @ServiceInterface(name = "PostgreSqlServerMana") public interface FirewallRulesService { @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/firewallRules/{firewallRuleName}") @@ -871,9 +871,7 @@ public PagedIterable listByServer(String resourceGroupName, S /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @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. @@ -899,9 +897,7 @@ private Mono> listByServerNextSinglePageAsync(S /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @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. diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/FirewallRulesImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/FirewallRulesImpl.java index ef96a6108bfa4..11f7c2f6ed80f 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/FirewallRulesImpl.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/FirewallRulesImpl.java @@ -19,10 +19,10 @@ public final class FirewallRulesImpl implements FirewallRules { private final FirewallRulesClient innerClient; - private final com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager; + private final com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager serviceManager; public FirewallRulesImpl(FirewallRulesClient innerClient, - com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager) { + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } @@ -147,7 +147,7 @@ private FirewallRulesClient serviceClient() { return this.innerClient; } - private com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager() { + private com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager() { return this.serviceManager; } 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..1688e123786f3 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 @@ -23,10 +23,10 @@ public final class FlexibleServerCapabilityImpl implements FlexibleServerCapability { private FlexibleServerCapabilityInner innerObject; - private final com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager; + private final com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager serviceManager; FlexibleServerCapabilityImpl(FlexibleServerCapabilityInner innerObject, - com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager) { + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } @@ -102,7 +102,7 @@ public FlexibleServerCapabilityInner innerModel() { return this.innerObject; } - private com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager() { + private com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager() { return this.serviceManager; } } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/FlexibleServersClientImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/FlexibleServersClientImpl.java index 646ae7b3c6b6b..531084f185f69 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/FlexibleServersClientImpl.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/FlexibleServersClientImpl.java @@ -47,25 +47,25 @@ public final class FlexibleServersClientImpl implements FlexibleServersClient { /** * The service client containing this operation class. */ - private final PostgreSqlManagementClientImpl client; + private final PostgreSqlServerManagementClientImpl client; /** * Initializes an instance of FlexibleServersClientImpl. * * @param client the instance of the service client containing this operation class. */ - FlexibleServersClientImpl(PostgreSqlManagementClientImpl client) { + FlexibleServersClientImpl(PostgreSqlServerManagementClientImpl client) { this.service = RestProxy.create(FlexibleServersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for PostgreSqlManagementClientFlexibleServers to be used by the proxy - * service to perform REST calls. + * The interface defining all the services for PostgreSqlServerManagementClientFlexibleServers to be used by the + * proxy service to perform REST calls. */ @Host("{$host}") - @ServiceInterface(name = "PostgreSqlManagement") + @ServiceInterface(name = "PostgreSqlServerMana") public interface FlexibleServersService { @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/ltrPreBackup") diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/FlexibleServersImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/FlexibleServersImpl.java index d5f1f6d4fbd6d..f0edfbe316aa4 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/FlexibleServersImpl.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/FlexibleServersImpl.java @@ -23,10 +23,10 @@ public final class FlexibleServersImpl implements FlexibleServers { private final FlexibleServersClient innerClient; - private final com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager; + private final com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager serviceManager; public FlexibleServersImpl(FlexibleServersClient innerClient, - com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager) { + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } @@ -78,7 +78,7 @@ private FlexibleServersClient serviceClient() { return this.innerClient; } - private com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager() { + private com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager() { return this.serviceManager; } } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/GetPrivateDnsZoneSuffixesClientImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/GetPrivateDnsZoneSuffixesClientImpl.java index d26733f7bca5b..1144ea3f6392e 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/GetPrivateDnsZoneSuffixesClientImpl.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/GetPrivateDnsZoneSuffixesClientImpl.java @@ -35,25 +35,25 @@ public final class GetPrivateDnsZoneSuffixesClientImpl implements GetPrivateDnsZ /** * The service client containing this operation class. */ - private final PostgreSqlManagementClientImpl client; + private final PostgreSqlServerManagementClientImpl client; /** * Initializes an instance of GetPrivateDnsZoneSuffixesClientImpl. * * @param client the instance of the service client containing this operation class. */ - GetPrivateDnsZoneSuffixesClientImpl(PostgreSqlManagementClientImpl client) { + GetPrivateDnsZoneSuffixesClientImpl(PostgreSqlServerManagementClientImpl client) { this.service = RestProxy.create(GetPrivateDnsZoneSuffixesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for PostgreSqlManagementClientGetPrivateDnsZoneSuffixes to be used by the - * proxy service to perform REST calls. + * The interface defining all the services for PostgreSqlServerManagementClientGetPrivateDnsZoneSuffixes to be used + * by the proxy service to perform REST calls. */ @Host("{$host}") - @ServiceInterface(name = "PostgreSqlManagement") + @ServiceInterface(name = "PostgreSqlServerMana") public interface GetPrivateDnsZoneSuffixesService { @Headers({ "Content-Type: application/json" }) @Post("/providers/Microsoft.DBforPostgreSQL/getPrivateDnsZoneSuffix") diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/GetPrivateDnsZoneSuffixesImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/GetPrivateDnsZoneSuffixesImpl.java index 3f7112b8a7067..1d6ae8cdac22e 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/GetPrivateDnsZoneSuffixesImpl.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/GetPrivateDnsZoneSuffixesImpl.java @@ -15,10 +15,10 @@ public final class GetPrivateDnsZoneSuffixesImpl implements GetPrivateDnsZoneSuf private final GetPrivateDnsZoneSuffixesClient innerClient; - private final com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager; + private final com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager serviceManager; public GetPrivateDnsZoneSuffixesImpl(GetPrivateDnsZoneSuffixesClient innerClient, - com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager) { + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } @@ -35,7 +35,7 @@ private GetPrivateDnsZoneSuffixesClient serviceClient() { return this.innerClient; } - private com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager() { + private com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager() { return this.serviceManager; } } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/LocationBasedCapabilitiesClientImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/LocationBasedCapabilitiesClientImpl.java index 929ab987066b4..bff6e28337b1b 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/LocationBasedCapabilitiesClientImpl.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/LocationBasedCapabilitiesClientImpl.java @@ -42,25 +42,25 @@ public final class LocationBasedCapabilitiesClientImpl implements LocationBasedC /** * The service client containing this operation class. */ - private final PostgreSqlManagementClientImpl client; + private final PostgreSqlServerManagementClientImpl client; /** * Initializes an instance of LocationBasedCapabilitiesClientImpl. * * @param client the instance of the service client containing this operation class. */ - LocationBasedCapabilitiesClientImpl(PostgreSqlManagementClientImpl client) { + LocationBasedCapabilitiesClientImpl(PostgreSqlServerManagementClientImpl client) { this.service = RestProxy.create(LocationBasedCapabilitiesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for PostgreSqlManagementClientLocationBasedCapabilities to be used by the - * proxy service to perform REST calls. + * The interface defining all the services for PostgreSqlServerManagementClientLocationBasedCapabilities to be used + * by the proxy service to perform REST calls. */ @Host("{$host}") - @ServiceInterface(name = "PostgreSqlManagement") + @ServiceInterface(name = "PostgreSqlServerMana") public interface LocationBasedCapabilitiesService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.DBforPostgreSQL/locations/{locationName}/capabilities") @@ -210,9 +210,7 @@ public PagedIterable execute(String locationName, /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @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. @@ -239,9 +237,7 @@ private Mono> executeNextSinglePage /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @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. diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/LocationBasedCapabilitiesImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/LocationBasedCapabilitiesImpl.java index 84cbacf72601e..182446a492ecc 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/LocationBasedCapabilitiesImpl.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/LocationBasedCapabilitiesImpl.java @@ -17,10 +17,10 @@ public final class LocationBasedCapabilitiesImpl implements LocationBasedCapabil private final LocationBasedCapabilitiesClient innerClient; - private final com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager; + private final com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager serviceManager; public LocationBasedCapabilitiesImpl(LocationBasedCapabilitiesClient innerClient, - com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager) { + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } @@ -39,7 +39,7 @@ private LocationBasedCapabilitiesClient serviceClient() { return this.innerClient; } - private com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager() { + private com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager() { return this.serviceManager; } } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/LogFileImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/LogFileImpl.java index 2d19fdc0fa478..b4ae2480f26e1 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/LogFileImpl.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/LogFileImpl.java @@ -12,10 +12,10 @@ public final class LogFileImpl implements LogFile { private LogFileInner innerObject; - private final com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager; + private final com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager serviceManager; LogFileImpl(LogFileInner innerObject, - com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager) { + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } @@ -60,7 +60,7 @@ public LogFileInner innerModel() { return this.innerObject; } - private com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager() { + private com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager() { return this.serviceManager; } } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/LogFilesClientImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/LogFilesClientImpl.java index 948e4fffc4ba0..af5e3965d5b3f 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/LogFilesClientImpl.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/LogFilesClientImpl.java @@ -42,24 +42,24 @@ public final class LogFilesClientImpl implements LogFilesClient { /** * The service client containing this operation class. */ - private final PostgreSqlManagementClientImpl client; + private final PostgreSqlServerManagementClientImpl client; /** * Initializes an instance of LogFilesClientImpl. * * @param client the instance of the service client containing this operation class. */ - LogFilesClientImpl(PostgreSqlManagementClientImpl client) { + LogFilesClientImpl(PostgreSqlServerManagementClientImpl client) { this.service = RestProxy.create(LogFilesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for PostgreSqlManagementClientLogFiles to be used by the proxy service to - * perform REST calls. + * The interface defining all the services for PostgreSqlServerManagementClientLogFiles to be used by the proxy + * service to perform REST calls. */ @Host("{$host}") - @ServiceInterface(name = "PostgreSqlManagement") + @ServiceInterface(name = "PostgreSqlServerMana") public interface LogFilesService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/logFiles") @@ -220,9 +220,7 @@ public PagedIterable listByServer(String resourceGroupName, String /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @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. @@ -248,9 +246,7 @@ private Mono> listByServerNextSinglePageAsync(String /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @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. diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/LogFilesImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/LogFilesImpl.java index 9112ad94efdbd..c9f00b79c6184 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/LogFilesImpl.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/LogFilesImpl.java @@ -17,10 +17,10 @@ public final class LogFilesImpl implements LogFiles { private final LogFilesClient innerClient; - private final com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager; + private final com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager serviceManager; public LogFilesImpl(LogFilesClient innerClient, - com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager) { + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } @@ -39,7 +39,7 @@ private LogFilesClient serviceClient() { return this.innerClient; } - private com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager() { + private com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager() { return this.serviceManager; } } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/LtrBackupOperationsClientImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/LtrBackupOperationsClientImpl.java index 9d49c86533787..f4be35ca6eb4b 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/LtrBackupOperationsClientImpl.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/LtrBackupOperationsClientImpl.java @@ -42,25 +42,25 @@ public final class LtrBackupOperationsClientImpl implements LtrBackupOperationsC /** * The service client containing this operation class. */ - private final PostgreSqlManagementClientImpl client; + private final PostgreSqlServerManagementClientImpl client; /** * Initializes an instance of LtrBackupOperationsClientImpl. * * @param client the instance of the service client containing this operation class. */ - LtrBackupOperationsClientImpl(PostgreSqlManagementClientImpl client) { + LtrBackupOperationsClientImpl(PostgreSqlServerManagementClientImpl client) { this.service = RestProxy.create(LtrBackupOperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for PostgreSqlManagementClientLtrBackupOperations to be used by the proxy - * service to perform REST calls. + * The interface defining all the services for PostgreSqlServerManagementClientLtrBackupOperations to be used by the + * proxy service to perform REST calls. */ @Host("{$host}") - @ServiceInterface(name = "PostgreSqlManagement") + @ServiceInterface(name = "PostgreSqlServerMana") public interface LtrBackupOperationsService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/ltrBackupOperations/{backupName}") @@ -373,9 +373,7 @@ public PagedIterable listByServer(String resource /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @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. @@ -402,9 +400,7 @@ private Mono> listByServerNextSingl /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @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. diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/LtrBackupOperationsImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/LtrBackupOperationsImpl.java index 4e1f59c589011..c1962970bd1f9 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/LtrBackupOperationsImpl.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/LtrBackupOperationsImpl.java @@ -19,10 +19,10 @@ public final class LtrBackupOperationsImpl implements LtrBackupOperations { private final LtrBackupOperationsClient innerClient; - private final com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager; + private final com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager serviceManager; public LtrBackupOperationsImpl(LtrBackupOperationsClient innerClient, - com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager) { + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } @@ -65,7 +65,7 @@ private LtrBackupOperationsClient serviceClient() { return this.innerClient; } - private com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager() { + private com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager() { return this.serviceManager; } } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/LtrBackupResponseImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/LtrBackupResponseImpl.java index 41eb434947e86..a4c62958c759a 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/LtrBackupResponseImpl.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/LtrBackupResponseImpl.java @@ -12,10 +12,10 @@ public final class LtrBackupResponseImpl implements LtrBackupResponse { private LtrBackupResponseInner innerObject; - private final com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager; + private final com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager serviceManager; LtrBackupResponseImpl(LtrBackupResponseInner innerObject, - com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager) { + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } @@ -64,7 +64,7 @@ public LtrBackupResponseInner innerModel() { return this.innerObject; } - private com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager() { + private com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager() { return this.serviceManager; } } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/LtrPreBackupResponseImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/LtrPreBackupResponseImpl.java index d879eded772c1..444d2a8b804d1 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/LtrPreBackupResponseImpl.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/LtrPreBackupResponseImpl.java @@ -10,10 +10,10 @@ public final class LtrPreBackupResponseImpl implements LtrPreBackupResponse { private LtrPreBackupResponseInner innerObject; - private final com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager; + private final com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager serviceManager; LtrPreBackupResponseImpl(LtrPreBackupResponseInner innerObject, - com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager) { + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } @@ -26,7 +26,7 @@ public LtrPreBackupResponseInner innerModel() { return this.innerObject; } - private com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager() { + private com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager() { return this.serviceManager; } } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/LtrServerBackupOperationImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/LtrServerBackupOperationImpl.java index 98fc756d0f7a9..376ceba3bb9b8 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/LtrServerBackupOperationImpl.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/LtrServerBackupOperationImpl.java @@ -13,10 +13,10 @@ public final class LtrServerBackupOperationImpl implements LtrServerBackupOperation { private LtrServerBackupOperationInner innerObject; - private final com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager; + private final com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager serviceManager; LtrServerBackupOperationImpl(LtrServerBackupOperationInner innerObject, - com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager) { + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } @@ -81,7 +81,7 @@ public LtrServerBackupOperationInner innerModel() { return this.innerObject; } - private com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager() { + private com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager() { return this.serviceManager; } } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/MigrationNameAvailabilityResourceImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/MigrationNameAvailabilityResourceImpl.java index 55e995c46e738..94288fa261f62 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/MigrationNameAvailabilityResourceImpl.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/MigrationNameAvailabilityResourceImpl.java @@ -11,10 +11,10 @@ public final class MigrationNameAvailabilityResourceImpl implements MigrationNameAvailabilityResource { private MigrationNameAvailabilityResourceInner innerObject; - private final com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager; + private final com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager serviceManager; MigrationNameAvailabilityResourceImpl(MigrationNameAvailabilityResourceInner innerObject, - com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager) { + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } @@ -43,7 +43,7 @@ public MigrationNameAvailabilityResourceInner innerModel() { return this.innerObject; } - private com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager() { + private com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager() { return this.serviceManager; } } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/MigrationResourceImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/MigrationResourceImpl.java index fd46bca857a32..5b4d9bf06e037 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/MigrationResourceImpl.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/MigrationResourceImpl.java @@ -32,7 +32,7 @@ public final class MigrationResourceImpl implements MigrationResource, MigrationResource.Definition, MigrationResource.Update { private MigrationResourceInner innerObject; - private final com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager; + private final com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager serviceManager; public String id() { return this.innerModel().id(); @@ -194,7 +194,7 @@ public MigrationResourceInner innerModel() { return this.innerObject; } - private com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager() { + private com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager() { return this.serviceManager; } @@ -235,7 +235,7 @@ public MigrationResource create(Context context) { } MigrationResourceImpl(String name, - com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager) { + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager serviceManager) { this.innerObject = new MigrationResourceInner(); this.serviceManager = serviceManager; this.migrationName = name; @@ -265,7 +265,7 @@ public MigrationResource apply(Context context) { } MigrationResourceImpl(MigrationResourceInner innerObject, - com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager) { + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; this.subscriptionId = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "subscriptions"); diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/MigrationsClientImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/MigrationsClientImpl.java index 56cd4c422e689..1c899c9719444 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/MigrationsClientImpl.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/MigrationsClientImpl.java @@ -48,25 +48,25 @@ public final class MigrationsClientImpl implements MigrationsClient { /** * The service client containing this operation class. */ - private final PostgreSqlManagementClientImpl client; + private final PostgreSqlServerManagementClientImpl client; /** * Initializes an instance of MigrationsClientImpl. * * @param client the instance of the service client containing this operation class. */ - MigrationsClientImpl(PostgreSqlManagementClientImpl client) { + MigrationsClientImpl(PostgreSqlServerManagementClientImpl client) { this.service = RestProxy.create(MigrationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for PostgreSqlManagementClientMigrations to be used by the proxy service - * to perform REST calls. + * The interface defining all the services for PostgreSqlServerManagementClientMigrations to be used by the proxy + * service to perform REST calls. */ @Host("{$host}") - @ServiceInterface(name = "PostgreSqlManagement") + @ServiceInterface(name = "PostgreSqlServerMana") public interface MigrationsService { @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{targetDbServerName}/migrations/{migrationName}") @@ -900,9 +900,7 @@ public PagedIterable listByTargetServer(String subscript /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @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. @@ -929,9 +927,7 @@ private Mono> listByTargetServerNextSingle /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @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. diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/MigrationsImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/MigrationsImpl.java index f5f7fee79ce37..38480cdb48858 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/MigrationsImpl.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/MigrationsImpl.java @@ -20,10 +20,10 @@ public final class MigrationsImpl implements Migrations { private final MigrationsClient innerClient; - private final com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager; + private final com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager serviceManager; public MigrationsImpl(MigrationsClient innerClient, - com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager) { + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } @@ -177,7 +177,7 @@ private MigrationsClient serviceClient() { return this.innerClient; } - private com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager() { + private com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager() { return this.serviceManager; } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/NameAvailabilityImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/NameAvailabilityImpl.java index a6c3cc180e8a8..46f035c63db0f 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/NameAvailabilityImpl.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/NameAvailabilityImpl.java @@ -11,10 +11,10 @@ public final class NameAvailabilityImpl implements NameAvailability { private NameAvailabilityInner innerObject; - private final com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager; + private final com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager serviceManager; NameAvailabilityImpl(NameAvailabilityInner innerObject, - com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager) { + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } @@ -43,7 +43,7 @@ public NameAvailabilityInner innerModel() { return this.innerObject; } - private com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager() { + private com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager() { return this.serviceManager; } } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/OperationListResultImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/OperationListResultImpl.java index 72b44ea76a168..313c91037d71b 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/OperationListResultImpl.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/OperationListResultImpl.java @@ -13,10 +13,10 @@ public final class OperationListResultImpl implements OperationListResult { private OperationListResultInner innerObject; - private final com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager; + private final com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager serviceManager; OperationListResultImpl(OperationListResultInner innerObject, - com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager) { + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } @@ -38,7 +38,7 @@ public OperationListResultInner innerModel() { return this.innerObject; } - private com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager() { + private com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager() { return this.serviceManager; } } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/OperationsClientImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/OperationsClientImpl.java index d0dc22382967c..d4040e5ed2ea9 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/OperationsClientImpl.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/OperationsClientImpl.java @@ -36,25 +36,25 @@ public final class OperationsClientImpl implements OperationsClient { /** * The service client containing this operation class. */ - private final PostgreSqlManagementClientImpl client; + private final PostgreSqlServerManagementClientImpl client; /** * Initializes an instance of OperationsClientImpl. * * @param client the instance of the service client containing this operation class. */ - OperationsClientImpl(PostgreSqlManagementClientImpl client) { + OperationsClientImpl(PostgreSqlServerManagementClientImpl client) { this.service = RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for PostgreSqlManagementClientOperations to be used by the proxy service - * to perform REST calls. + * The interface defining all the services for PostgreSqlServerManagementClientOperations to be used by the proxy + * service to perform REST calls. */ @Host("{$host}") - @ServiceInterface(name = "PostgreSqlManagement") + @ServiceInterface(name = "PostgreSqlServerMana") public interface OperationsService { @Headers({ "Content-Type: application/json" }) @Get("/providers/Microsoft.DBforPostgreSQL/operations") diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/OperationsImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/OperationsImpl.java index 31c5934e5b806..28b0a9348ca23 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/OperationsImpl.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/OperationsImpl.java @@ -18,10 +18,10 @@ public final class OperationsImpl implements Operations { private final OperationsClient innerClient; - private final com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager; + private final com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager serviceManager; public OperationsImpl(OperationsClient innerClient, - com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager) { + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } @@ -49,7 +49,7 @@ private OperationsClient serviceClient() { return this.innerClient; } - private com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager() { + private com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager() { return this.serviceManager; } } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/PostgreSqlManagementClientBuilder.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/PostgreSqlServerManagementClientBuilder.java similarity index 69% rename from sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/PostgreSqlManagementClientBuilder.java rename to sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/PostgreSqlServerManagementClientBuilder.java index 64d250e2957bb..850cff789f0c3 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/PostgreSqlManagementClientBuilder.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/PostgreSqlServerManagementClientBuilder.java @@ -15,10 +15,10 @@ import java.time.Duration; /** - * A builder for creating a new instance of the PostgreSqlManagementClientImpl type. + * A builder for creating a new instance of the PostgreSqlServerManagementClientImpl type. */ -@ServiceClientBuilder(serviceClients = { PostgreSqlManagementClientImpl.class }) -public final class PostgreSqlManagementClientBuilder { +@ServiceClientBuilder(serviceClients = { PostgreSqlServerManagementClientImpl.class }) +public final class PostgreSqlServerManagementClientBuilder { /* * The ID of the target subscription. The value must be an UUID. */ @@ -28,9 +28,9 @@ public final class PostgreSqlManagementClientBuilder { * Sets The ID of the target subscription. The value must be an UUID. * * @param subscriptionId the subscriptionId value. - * @return the PostgreSqlManagementClientBuilder. + * @return the PostgreSqlServerManagementClientBuilder. */ - public PostgreSqlManagementClientBuilder subscriptionId(String subscriptionId) { + public PostgreSqlServerManagementClientBuilder subscriptionId(String subscriptionId) { this.subscriptionId = subscriptionId; return this; } @@ -44,9 +44,9 @@ public PostgreSqlManagementClientBuilder subscriptionId(String subscriptionId) { * Sets server parameter. * * @param endpoint the endpoint value. - * @return the PostgreSqlManagementClientBuilder. + * @return the PostgreSqlServerManagementClientBuilder. */ - public PostgreSqlManagementClientBuilder endpoint(String endpoint) { + public PostgreSqlServerManagementClientBuilder endpoint(String endpoint) { this.endpoint = endpoint; return this; } @@ -60,9 +60,9 @@ public PostgreSqlManagementClientBuilder endpoint(String endpoint) { * Sets The environment to connect to. * * @param environment the environment value. - * @return the PostgreSqlManagementClientBuilder. + * @return the PostgreSqlServerManagementClientBuilder. */ - public PostgreSqlManagementClientBuilder environment(AzureEnvironment environment) { + public PostgreSqlServerManagementClientBuilder environment(AzureEnvironment environment) { this.environment = environment; return this; } @@ -76,9 +76,9 @@ public PostgreSqlManagementClientBuilder environment(AzureEnvironment environmen * Sets The HTTP pipeline to send requests through. * * @param pipeline the pipeline value. - * @return the PostgreSqlManagementClientBuilder. + * @return the PostgreSqlServerManagementClientBuilder. */ - public PostgreSqlManagementClientBuilder pipeline(HttpPipeline pipeline) { + public PostgreSqlServerManagementClientBuilder pipeline(HttpPipeline pipeline) { this.pipeline = pipeline; return this; } @@ -92,9 +92,9 @@ public PostgreSqlManagementClientBuilder pipeline(HttpPipeline pipeline) { * Sets The default poll interval for long-running operation. * * @param defaultPollInterval the defaultPollInterval value. - * @return the PostgreSqlManagementClientBuilder. + * @return the PostgreSqlServerManagementClientBuilder. */ - public PostgreSqlManagementClientBuilder defaultPollInterval(Duration defaultPollInterval) { + public PostgreSqlServerManagementClientBuilder defaultPollInterval(Duration defaultPollInterval) { this.defaultPollInterval = defaultPollInterval; return this; } @@ -108,19 +108,19 @@ public PostgreSqlManagementClientBuilder defaultPollInterval(Duration defaultPol * Sets The serializer to serialize an object into a string. * * @param serializerAdapter the serializerAdapter value. - * @return the PostgreSqlManagementClientBuilder. + * @return the PostgreSqlServerManagementClientBuilder. */ - public PostgreSqlManagementClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { + public PostgreSqlServerManagementClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { this.serializerAdapter = serializerAdapter; return this; } /** - * Builds an instance of PostgreSqlManagementClientImpl with the provided parameters. + * Builds an instance of PostgreSqlServerManagementClientImpl with the provided parameters. * - * @return an instance of PostgreSqlManagementClientImpl. + * @return an instance of PostgreSqlServerManagementClientImpl. */ - public PostgreSqlManagementClientImpl buildClient() { + public PostgreSqlServerManagementClientImpl buildClient() { String localEndpoint = (endpoint != null) ? endpoint : "https://management.azure.com"; AzureEnvironment localEnvironment = (environment != null) ? environment : AzureEnvironment.AZURE; HttpPipeline localPipeline = (pipeline != null) @@ -131,7 +131,7 @@ public PostgreSqlManagementClientImpl buildClient() { SerializerAdapter localSerializerAdapter = (serializerAdapter != null) ? serializerAdapter : SerializerFactory.createDefaultManagementSerializerAdapter(); - PostgreSqlManagementClientImpl client = new PostgreSqlManagementClientImpl(localPipeline, + PostgreSqlServerManagementClientImpl client = new PostgreSqlServerManagementClientImpl(localPipeline, localSerializerAdapter, localDefaultPollInterval, localEnvironment, this.subscriptionId, localEndpoint); return client; } 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/PostgreSqlServerManagementClientImpl.java similarity index 95% rename from sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/PostgreSqlManagementClientImpl.java rename to sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/PostgreSqlServerManagementClientImpl.java index 0eedf5cbe5cf4..c1eeb44a64d6e 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/PostgreSqlServerManagementClientImpl.java @@ -37,11 +37,10 @@ import com.azure.resourcemanager.postgresqlflexibleserver.fluent.LtrBackupOperationsClient; import com.azure.resourcemanager.postgresqlflexibleserver.fluent.MigrationsClient; import com.azure.resourcemanager.postgresqlflexibleserver.fluent.OperationsClient; -import com.azure.resourcemanager.postgresqlflexibleserver.fluent.PostgreSqlManagementClient; +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.PostgreSqlServerManagementClient; 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; @@ -59,10 +58,10 @@ import reactor.core.publisher.Mono; /** - * Initializes a new instance of the PostgreSqlManagementClientImpl type. + * Initializes a new instance of the PostgreSqlServerManagementClientImpl type. */ -@ServiceClient(builder = PostgreSqlManagementClientBuilder.class) -public final class PostgreSqlManagementClientImpl implements PostgreSqlManagementClient { +@ServiceClient(builder = PostgreSqlServerManagementClientBuilder.class) +public final class PostgreSqlServerManagementClientImpl implements PostgreSqlServerManagementClient { /** * The ID of the target subscription. The value must be an UUID. */ @@ -413,20 +412,6 @@ 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. */ @@ -498,7 +483,7 @@ public VirtualNetworkSubnetUsagesClient getVirtualNetworkSubnetUsages() { } /** - * Initializes an instance of PostgreSqlManagementClient client. + * Initializes an instance of PostgreSqlServerManagementClient client. * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. @@ -507,14 +492,14 @@ public VirtualNetworkSubnetUsagesClient getVirtualNetworkSubnetUsages() { * @param subscriptionId The ID of the target subscription. The value must be an UUID. * @param endpoint server parameter. */ - PostgreSqlManagementClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, + PostgreSqlServerManagementClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, Duration defaultPollInterval, AzureEnvironment environment, String subscriptionId, String endpoint) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; this.defaultPollInterval = defaultPollInterval; this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.apiVersion = "2023-12-01-preview"; + this.apiVersion = "2024-08-01"; this.administrators = new AdministratorsClientImpl(this); this.backups = new BackupsClientImpl(this); this.locationBasedCapabilities = new LocationBasedCapabilitiesClientImpl(this); @@ -534,7 +519,6 @@ 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); @@ -668,5 +652,5 @@ public Mono getBodyAsString(Charset charset) { } } - private static final ClientLogger LOGGER = new ClientLogger(PostgreSqlManagementClientImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(PostgreSqlServerManagementClientImpl.class); } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/PrivateEndpointConnectionImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/PrivateEndpointConnectionImpl.java index 1c017e7a0a489..5d3dfd851588a 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/PrivateEndpointConnectionImpl.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/PrivateEndpointConnectionImpl.java @@ -16,10 +16,10 @@ public final class PrivateEndpointConnectionImpl implements PrivateEndpointConnection { private PrivateEndpointConnectionInner innerObject; - private final com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager; + private final com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager serviceManager; PrivateEndpointConnectionImpl(PrivateEndpointConnectionInner innerObject, - com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager) { + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } @@ -65,7 +65,7 @@ public PrivateEndpointConnectionInner innerModel() { return this.innerObject; } - private com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager() { + private com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager() { return this.serviceManager; } } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/PrivateEndpointConnectionOperationsClientImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/PrivateEndpointConnectionOperationsClientImpl.java index d7fa81e0b316e..37e23e0b5406e 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/PrivateEndpointConnectionOperationsClientImpl.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/PrivateEndpointConnectionOperationsClientImpl.java @@ -44,25 +44,25 @@ public final class PrivateEndpointConnectionOperationsClientImpl implements Priv /** * The service client containing this operation class. */ - private final PostgreSqlManagementClientImpl client; + private final PostgreSqlServerManagementClientImpl client; /** * Initializes an instance of PrivateEndpointConnectionOperationsClientImpl. * * @param client the instance of the service client containing this operation class. */ - PrivateEndpointConnectionOperationsClientImpl(PostgreSqlManagementClientImpl client) { + PrivateEndpointConnectionOperationsClientImpl(PostgreSqlServerManagementClientImpl client) { this.service = RestProxy.create(PrivateEndpointConnectionOperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for PostgreSqlManagementClientPrivateEndpointConnectionOperations to be - * used by the proxy service to perform REST calls. + * The interface defining all the services for PostgreSqlServerManagementClientPrivateEndpointConnectionOperations + * to be used by the proxy service to perform REST calls. */ @Host("{$host}") - @ServiceInterface(name = "PostgreSqlManagement") + @ServiceInterface(name = "PostgreSqlServerMana") public interface PrivateEndpointConnectionOperationsService { @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/privateEndpointConnections/{privateEndpointConnectionName}") diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/PrivateEndpointConnectionOperationsImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/PrivateEndpointConnectionOperationsImpl.java index 9ab8e1072a5c3..53cd83a20caad 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/PrivateEndpointConnectionOperationsImpl.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/PrivateEndpointConnectionOperationsImpl.java @@ -16,10 +16,10 @@ public final class PrivateEndpointConnectionOperationsImpl implements PrivateEnd private final PrivateEndpointConnectionOperationsClient innerClient; - private final com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager; + private final com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager serviceManager; public PrivateEndpointConnectionOperationsImpl(PrivateEndpointConnectionOperationsClient innerClient, - com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager) { + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } @@ -59,7 +59,7 @@ private PrivateEndpointConnectionOperationsClient serviceClient() { return this.innerClient; } - private com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager() { + private com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager() { return this.serviceManager; } } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/PrivateEndpointConnectionsClientImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/PrivateEndpointConnectionsClientImpl.java index 6d48e99cf4b25..5b20a880af2fa 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/PrivateEndpointConnectionsClientImpl.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/PrivateEndpointConnectionsClientImpl.java @@ -42,25 +42,25 @@ public final class PrivateEndpointConnectionsClientImpl implements PrivateEndpoi /** * The service client containing this operation class. */ - private final PostgreSqlManagementClientImpl client; + private final PostgreSqlServerManagementClientImpl client; /** * Initializes an instance of PrivateEndpointConnectionsClientImpl. * * @param client the instance of the service client containing this operation class. */ - PrivateEndpointConnectionsClientImpl(PostgreSqlManagementClientImpl client) { + PrivateEndpointConnectionsClientImpl(PostgreSqlServerManagementClientImpl client) { this.service = RestProxy.create(PrivateEndpointConnectionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for PostgreSqlManagementClientPrivateEndpointConnections to be used by - * the proxy service to perform REST calls. + * The interface defining all the services for PostgreSqlServerManagementClientPrivateEndpointConnections to be used + * by the proxy service to perform REST calls. */ @Host("{$host}") - @ServiceInterface(name = "PostgreSqlManagement") + @ServiceInterface(name = "PostgreSqlServerMana") public interface PrivateEndpointConnectionsService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/privateEndpointConnections/{privateEndpointConnectionName}") @@ -370,9 +370,7 @@ public PagedIterable listByServer(String resourc /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @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. @@ -399,9 +397,7 @@ private Mono> listByServerNextSing /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @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. diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/PrivateEndpointConnectionsImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/PrivateEndpointConnectionsImpl.java index c5d58ff63e8ad..96e2c921a230d 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/PrivateEndpointConnectionsImpl.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/PrivateEndpointConnectionsImpl.java @@ -19,10 +19,10 @@ public final class PrivateEndpointConnectionsImpl implements PrivateEndpointConn private final PrivateEndpointConnectionsClient innerClient; - private final com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager; + private final com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager serviceManager; public PrivateEndpointConnectionsImpl(PrivateEndpointConnectionsClient innerClient, - com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager) { + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } @@ -67,7 +67,7 @@ private PrivateEndpointConnectionsClient serviceClient() { return this.innerClient; } - private com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager() { + private com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager() { return this.serviceManager; } } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/PrivateLinkResourceImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/PrivateLinkResourceImpl.java index 23d02b05fac8f..e6cc430b2fd42 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/PrivateLinkResourceImpl.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/PrivateLinkResourceImpl.java @@ -13,10 +13,10 @@ public final class PrivateLinkResourceImpl implements PrivateLinkResource { private PrivateLinkResourceInner innerObject; - private final com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager; + private final com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager serviceManager; PrivateLinkResourceImpl(PrivateLinkResourceInner innerObject, - com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager) { + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } @@ -63,7 +63,7 @@ public PrivateLinkResourceInner innerModel() { return this.innerObject; } - private com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager() { + private com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager() { return this.serviceManager; } } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/PrivateLinkResourcesClientImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/PrivateLinkResourcesClientImpl.java index 69f91fb500f49..251d077d6172a 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/PrivateLinkResourcesClientImpl.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/PrivateLinkResourcesClientImpl.java @@ -42,25 +42,25 @@ public final class PrivateLinkResourcesClientImpl implements PrivateLinkResource /** * The service client containing this operation class. */ - private final PostgreSqlManagementClientImpl client; + private final PostgreSqlServerManagementClientImpl client; /** * Initializes an instance of PrivateLinkResourcesClientImpl. * * @param client the instance of the service client containing this operation class. */ - PrivateLinkResourcesClientImpl(PostgreSqlManagementClientImpl client) { + PrivateLinkResourcesClientImpl(PostgreSqlServerManagementClientImpl client) { this.service = RestProxy.create(PrivateLinkResourcesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for PostgreSqlManagementClientPrivateLinkResources to be used by the - * proxy service to perform REST calls. + * The interface defining all the services for PostgreSqlServerManagementClientPrivateLinkResources to be used by + * the proxy service to perform REST calls. */ @Host("{$host}") - @ServiceInterface(name = "PostgreSqlManagement") + @ServiceInterface(name = "PostgreSqlServerMana") public interface PrivateLinkResourcesService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/privateLinkResources") @@ -366,9 +366,7 @@ public PrivateLinkResourceInner get(String resourceGroupName, String serverName, /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @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. @@ -395,9 +393,7 @@ private Mono> listByServerNextSinglePage /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @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. diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/PrivateLinkResourcesImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/PrivateLinkResourcesImpl.java index 5732b22ec1d56..fbb23e9cbd4f2 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/PrivateLinkResourcesImpl.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/PrivateLinkResourcesImpl.java @@ -19,10 +19,10 @@ public final class PrivateLinkResourcesImpl implements PrivateLinkResources { private final PrivateLinkResourcesClient innerClient; - private final com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager; + private final com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager serviceManager; public PrivateLinkResourcesImpl(PrivateLinkResourcesClient innerClient, - com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager) { + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } @@ -65,7 +65,7 @@ private PrivateLinkResourcesClient serviceClient() { return this.innerClient; } - private com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager() { + private com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager() { return this.serviceManager; } } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/QuotaUsageImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/QuotaUsageImpl.java deleted file mode 100644 index 7e4b096d65810..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/QuotaUsageImpl.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.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 deleted file mode 100644 index 7372bbad2ba7a..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/QuotaUsagesClientImpl.java +++ /dev/null @@ -1,263 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresqlflexibleserver.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.postgresqlflexibleserver.fluent.QuotaUsagesClient; -import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.QuotaUsageInner; -import com.azure.resourcemanager.postgresqlflexibleserver.models.QuotaUsagesListResult; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in QuotaUsagesClient. - */ -public final class QuotaUsagesClientImpl implements QuotaUsagesClient { - /** - * The proxy service used to perform REST calls. - */ - private final QuotaUsagesService service; - - /** - * The service client containing this operation class. - */ - private final PostgreSqlManagementClientImpl client; - - /** - * Initializes an instance of QuotaUsagesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - QuotaUsagesClientImpl(PostgreSqlManagementClientImpl client) { - this.service - = RestProxy.create(QuotaUsagesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for PostgreSqlManagementClientQuotaUsages to be used by the proxy service - * to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "PostgreSqlManagement") - public interface QuotaUsagesService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.DBforPostgreSQL/locations/{locationName}/resourceType/flexibleServers/usages") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("locationName") String locationName, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); - } - - /** - * Get quota usages at specified location in a given subscription. - * - * @param locationName The name of the location. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return quota usages at specified location in a given subscription along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String locationName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (locationName == null) { - return Mono.error(new IllegalArgumentException("Parameter locationName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), locationName, accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get quota usages at specified location in a given subscription. - * - * @param locationName The name of the location. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return quota usages at specified location in a given subscription along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String locationName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (locationName == null) { - return Mono.error(new IllegalArgumentException("Parameter locationName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), locationName, - accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Get quota usages at specified location in a given subscription. - * - * @param locationName The name of the location. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return quota usages at specified location in a given subscription as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(String locationName) { - return new PagedFlux<>(() -> listSinglePageAsync(locationName), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Get quota usages at specified location in a given subscription. - * - * @param locationName The name of the location. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return quota usages at specified location in a given subscription as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String locationName, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(locationName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Get quota usages at specified location in a given subscription. - * - * @param locationName The name of the location. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return quota usages at specified location in a given subscription as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String locationName) { - return new PagedIterable<>(listAsync(locationName)); - } - - /** - * Get quota usages at specified location in a given subscription. - * - * @param locationName The name of the location. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return quota usages at specified location in a given subscription as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String locationName, Context context) { - return new PagedIterable<>(listAsync(locationName, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return capability for the PostgreSQL server along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return capability for the PostgreSQL server along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/QuotaUsagesImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/QuotaUsagesImpl.java deleted file mode 100644 index 47d5bef6e5f69..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/QuotaUsagesImpl.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.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/ReplicasClientImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/ReplicasClientImpl.java index adee427a5123c..3d4fb1c9c4069 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/ReplicasClientImpl.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/ReplicasClientImpl.java @@ -42,24 +42,24 @@ public final class ReplicasClientImpl implements ReplicasClient { /** * The service client containing this operation class. */ - private final PostgreSqlManagementClientImpl client; + private final PostgreSqlServerManagementClientImpl client; /** * Initializes an instance of ReplicasClientImpl. * * @param client the instance of the service client containing this operation class. */ - ReplicasClientImpl(PostgreSqlManagementClientImpl client) { + ReplicasClientImpl(PostgreSqlServerManagementClientImpl client) { this.service = RestProxy.create(ReplicasService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for PostgreSqlManagementClientReplicas to be used by the proxy service to - * perform REST calls. + * The interface defining all the services for PostgreSqlServerManagementClientReplicas to be used by the proxy + * service to perform REST calls. */ @Host("{$host}") - @ServiceInterface(name = "PostgreSqlManagement") + @ServiceInterface(name = "PostgreSqlServerMana") public interface ReplicasService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/replicas") diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/ReplicasImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/ReplicasImpl.java index 2c4ebe0a0346b..26e891b49508f 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/ReplicasImpl.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/ReplicasImpl.java @@ -17,10 +17,10 @@ public final class ReplicasImpl implements Replicas { private final ReplicasClient innerClient; - private final com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager; + private final com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager serviceManager; public ReplicasImpl(ReplicasClient innerClient, - com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager) { + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } @@ -39,7 +39,7 @@ private ReplicasClient serviceClient() { return this.innerClient; } - private com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager() { + private com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager() { return this.serviceManager; } } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/ResourceProvidersClientImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/ResourceProvidersClientImpl.java index 9ab4fe634faf0..1587169cb515d 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/ResourceProvidersClientImpl.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/ResourceProvidersClientImpl.java @@ -38,25 +38,25 @@ public final class ResourceProvidersClientImpl implements ResourceProvidersClien /** * The service client containing this operation class. */ - private final PostgreSqlManagementClientImpl client; + private final PostgreSqlServerManagementClientImpl client; /** * Initializes an instance of ResourceProvidersClientImpl. * * @param client the instance of the service client containing this operation class. */ - ResourceProvidersClientImpl(PostgreSqlManagementClientImpl client) { + ResourceProvidersClientImpl(PostgreSqlServerManagementClientImpl client) { this.service = RestProxy.create(ResourceProvidersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for PostgreSqlManagementClientResourceProviders to be used by the proxy - * service to perform REST calls. + * The interface defining all the services for PostgreSqlServerManagementClientResourceProviders to be used by the + * proxy service to perform REST calls. */ @Host("{$host}") - @ServiceInterface(name = "PostgreSqlManagement") + @ServiceInterface(name = "PostgreSqlServerMana") public interface ResourceProvidersService { @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{targetDbServerName}/checkMigrationNameAvailability") diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/ResourceProvidersImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/ResourceProvidersImpl.java index 391186cd010ac..577164b71f0cc 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/ResourceProvidersImpl.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/ResourceProvidersImpl.java @@ -18,10 +18,10 @@ public final class ResourceProvidersImpl implements ResourceProviders { private final ResourceProvidersClient innerClient; - private final com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager; + private final com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager serviceManager; public ResourceProvidersImpl(ResourceProvidersClient innerClient, - com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager) { + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } @@ -55,7 +55,7 @@ private ResourceProvidersClient serviceClient() { return this.innerClient; } - private com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager() { + private com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager() { return this.serviceManager; } } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/ServerBackupImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/ServerBackupImpl.java index 9390f52c7a325..83a669b1d6673 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/ServerBackupImpl.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/ServerBackupImpl.java @@ -13,10 +13,10 @@ public final class ServerBackupImpl implements ServerBackup { private ServerBackupInner innerObject; - private final com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager; + private final com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager serviceManager; ServerBackupImpl(ServerBackupInner innerObject, - com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager) { + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } @@ -53,7 +53,7 @@ public ServerBackupInner innerModel() { return this.innerObject; } - private com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager() { + private com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager() { return this.serviceManager; } } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/ServerCapabilitiesClientImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/ServerCapabilitiesClientImpl.java index 381dfe464f779..1ff1e1d3061ff 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/ServerCapabilitiesClientImpl.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/ServerCapabilitiesClientImpl.java @@ -42,25 +42,25 @@ public final class ServerCapabilitiesClientImpl implements ServerCapabilitiesCli /** * The service client containing this operation class. */ - private final PostgreSqlManagementClientImpl client; + private final PostgreSqlServerManagementClientImpl client; /** * Initializes an instance of ServerCapabilitiesClientImpl. * * @param client the instance of the service client containing this operation class. */ - ServerCapabilitiesClientImpl(PostgreSqlManagementClientImpl client) { + ServerCapabilitiesClientImpl(PostgreSqlServerManagementClientImpl client) { this.service = RestProxy.create(ServerCapabilitiesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for PostgreSqlManagementClientServerCapabilities to be used by the proxy - * service to perform REST calls. + * The interface defining all the services for PostgreSqlServerManagementClientServerCapabilities to be used by the + * proxy service to perform REST calls. */ @Host("{$host}") - @ServiceInterface(name = "PostgreSqlManagement") + @ServiceInterface(name = "PostgreSqlServerMana") public interface ServerCapabilitiesService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/capabilities") @@ -225,9 +225,7 @@ public PagedIterable list(String resourceGroupNam /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @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. @@ -253,9 +251,7 @@ private Mono> listNextSinglePageAsy /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @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. diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/ServerCapabilitiesImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/ServerCapabilitiesImpl.java index 5695d86fc4583..2d43b1b5d2a12 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/ServerCapabilitiesImpl.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/ServerCapabilitiesImpl.java @@ -17,10 +17,10 @@ public final class ServerCapabilitiesImpl implements ServerCapabilities { private final ServerCapabilitiesClient innerClient; - private final com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager; + private final com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager serviceManager; public ServerCapabilitiesImpl(ServerCapabilitiesClient innerClient, - com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager) { + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } @@ -40,7 +40,7 @@ private ServerCapabilitiesClient serviceClient() { return this.innerClient; } - private com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager() { + private com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager 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 75f61a38a4627..fd36b48f52691 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 @@ -37,7 +37,7 @@ public final class ServerImpl implements Server, Server.Definition, Server.Update { private ServerInner innerObject; - private final com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager; + private final com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager serviceManager; public String id() { return this.innerModel().id(); @@ -183,7 +183,7 @@ public ServerInner innerModel() { return this.innerObject; } - private com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager() { + private com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager() { return this.serviceManager; } @@ -212,7 +212,7 @@ public Server create(Context context) { return this; } - ServerImpl(String name, com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager) { + ServerImpl(String name, com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager serviceManager) { this.innerObject = new ServerInner(); this.serviceManager = serviceManager; this.serverName = name; @@ -238,7 +238,7 @@ public Server apply(Context context) { } ServerImpl(ServerInner innerObject, - com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager) { + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); @@ -326,8 +326,13 @@ public ServerImpl withIdentity(UserAssignedIdentity identity) { } public ServerImpl withAdministratorLogin(String administratorLogin) { - this.innerModel().withAdministratorLogin(administratorLogin); - return this; + if (isInCreateMode()) { + this.innerModel().withAdministratorLogin(administratorLogin); + return this; + } else { + this.updateParameters.withAdministratorLogin(administratorLogin); + return this; + } } public ServerImpl withAdministratorLoginPassword(String administratorLoginPassword) { diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/ServerThreatProtectionSettingsClientImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/ServerThreatProtectionSettingsClientImpl.java index f2c0cc5e9aef1..4757e0e5642ff 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/ServerThreatProtectionSettingsClientImpl.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/ServerThreatProtectionSettingsClientImpl.java @@ -50,25 +50,25 @@ public final class ServerThreatProtectionSettingsClientImpl implements ServerThr /** * The service client containing this operation class. */ - private final PostgreSqlManagementClientImpl client; + private final PostgreSqlServerManagementClientImpl client; /** * Initializes an instance of ServerThreatProtectionSettingsClientImpl. * * @param client the instance of the service client containing this operation class. */ - ServerThreatProtectionSettingsClientImpl(PostgreSqlManagementClientImpl client) { + ServerThreatProtectionSettingsClientImpl(PostgreSqlServerManagementClientImpl client) { this.service = RestProxy.create(ServerThreatProtectionSettingsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for PostgreSqlManagementClientServerThreatProtectionSettings to be used - * by the proxy service to perform REST calls. + * The interface defining all the services for PostgreSqlServerManagementClientServerThreatProtectionSettings to be + * used by the proxy service to perform REST calls. */ @Host("{$host}") - @ServiceInterface(name = "PostgreSqlManagement") + @ServiceInterface(name = "PostgreSqlServerMana") public interface ServerThreatProtectionSettingsService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/advancedThreatProtectionSettings") @@ -660,9 +660,7 @@ public ServerThreatProtectionSettingsModelInner createOrUpdate(String resourceGr /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @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. @@ -691,9 +689,7 @@ public ServerThreatProtectionSettingsModelInner createOrUpdate(String resourceGr /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @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. diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/ServerThreatProtectionSettingsImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/ServerThreatProtectionSettingsImpl.java index 169ad54fde8f5..c6c585f678b10 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/ServerThreatProtectionSettingsImpl.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/ServerThreatProtectionSettingsImpl.java @@ -20,10 +20,10 @@ public final class ServerThreatProtectionSettingsImpl implements ServerThreatPro private final ServerThreatProtectionSettingsClient innerClient; - private final com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager; + private final com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager serviceManager; public ServerThreatProtectionSettingsImpl(ServerThreatProtectionSettingsClient innerClient, - com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager) { + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } @@ -113,7 +113,7 @@ private ServerThreatProtectionSettingsClient serviceClient() { return this.innerClient; } - private com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager() { + private com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager() { return this.serviceManager; } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/ServerThreatProtectionSettingsModelImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/ServerThreatProtectionSettingsModelImpl.java index 19b713529fa16..de807abec7b7d 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/ServerThreatProtectionSettingsModelImpl.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/ServerThreatProtectionSettingsModelImpl.java @@ -16,7 +16,7 @@ public final class ServerThreatProtectionSettingsModelImpl implements ServerThre ServerThreatProtectionSettingsModel.Definition, ServerThreatProtectionSettingsModel.Update { private ServerThreatProtectionSettingsModelInner innerObject; - private final com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager; + private final com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager serviceManager; public String id() { return this.innerModel().id(); @@ -50,7 +50,7 @@ public ServerThreatProtectionSettingsModelInner innerModel() { return this.innerObject; } - private com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager() { + private com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager() { return this.serviceManager; } @@ -82,7 +82,7 @@ public ServerThreatProtectionSettingsModel create(Context context) { } ServerThreatProtectionSettingsModelImpl(ThreatProtectionName name, - com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager) { + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager serviceManager) { this.innerObject = new ServerThreatProtectionSettingsModelInner(); this.serviceManager = serviceManager; this.threatProtectionName = name; @@ -107,7 +107,7 @@ public ServerThreatProtectionSettingsModel apply(Context context) { } ServerThreatProtectionSettingsModelImpl(ServerThreatProtectionSettingsModelInner innerObject, - com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager) { + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/ServersClientImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/ServersClientImpl.java index 42d443a1be3ba..2d984a2153044 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/ServersClientImpl.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/ServersClientImpl.java @@ -54,24 +54,24 @@ public final class ServersClientImpl implements ServersClient { /** * The service client containing this operation class. */ - private final PostgreSqlManagementClientImpl client; + private final PostgreSqlServerManagementClientImpl client; /** * Initializes an instance of ServersClientImpl. * * @param client the instance of the service client containing this operation class. */ - ServersClientImpl(PostgreSqlManagementClientImpl client) { + ServersClientImpl(PostgreSqlServerManagementClientImpl client) { this.service = RestProxy.create(ServersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for PostgreSqlManagementClientServers to be used by the proxy service to - * perform REST calls. + * The interface defining all the services for PostgreSqlServerManagementClientServers to be used by the proxy + * service to perform REST calls. */ @Host("{$host}") - @ServiceInterface(name = "PostgreSqlManagement") + @ServiceInterface(name = "PostgreSqlServerMana") public interface ServersService { @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}") @@ -1841,9 +1841,7 @@ public void stop(String resourceGroupName, String serverName, Context context) { /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @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. @@ -1870,9 +1868,7 @@ private Mono> listByResourceGroupNextSinglePageAsync( /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @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. @@ -1898,9 +1894,7 @@ private Mono> listByResourceGroupNextSinglePageAsync( /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @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. @@ -1925,9 +1919,7 @@ private Mono> listNextSinglePageAsync(String nextLink /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @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. diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/ServersImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/ServersImpl.java index baee87c114dce..5ba86056c0f01 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/ServersImpl.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/ServersImpl.java @@ -20,10 +20,10 @@ public final class ServersImpl implements Servers { private final ServersClient innerClient; - private final com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager; + private final com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager serviceManager; public ServersImpl(ServersClient innerClient, - com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager) { + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } @@ -161,7 +161,7 @@ private ServersClient serviceClient() { return this.innerClient; } - private com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager() { + private com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager() { return this.serviceManager; } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/VirtualEndpointResourceImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/VirtualEndpointResourceImpl.java index a65e150af19de..f130019970844 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/VirtualEndpointResourceImpl.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/VirtualEndpointResourceImpl.java @@ -17,7 +17,7 @@ public final class VirtualEndpointResourceImpl implements VirtualEndpointResource, VirtualEndpointResource.Definition, VirtualEndpointResource.Update { private VirtualEndpointResourceInner innerObject; - private final com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager; + private final com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager serviceManager; public VirtualEndpointType endpointType() { return this.innerModel().endpointType(); @@ -65,7 +65,7 @@ public VirtualEndpointResourceInner innerModel() { return this.innerObject; } - private com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager() { + private com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager() { return this.serviceManager; } @@ -98,7 +98,7 @@ public VirtualEndpointResource create(Context context) { } VirtualEndpointResourceImpl(String name, - com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager) { + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager serviceManager) { this.innerObject = new VirtualEndpointResourceInner(); this.serviceManager = serviceManager; this.virtualEndpointName = name; @@ -124,7 +124,7 @@ public VirtualEndpointResource apply(Context context) { } VirtualEndpointResourceImpl(VirtualEndpointResourceInner innerObject, - com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager) { + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/VirtualEndpointsClientImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/VirtualEndpointsClientImpl.java index ae05ca6affbac..1f2780fbc39d5 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/VirtualEndpointsClientImpl.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/VirtualEndpointsClientImpl.java @@ -52,25 +52,25 @@ public final class VirtualEndpointsClientImpl implements VirtualEndpointsClient /** * The service client containing this operation class. */ - private final PostgreSqlManagementClientImpl client; + private final PostgreSqlServerManagementClientImpl client; /** * Initializes an instance of VirtualEndpointsClientImpl. * * @param client the instance of the service client containing this operation class. */ - VirtualEndpointsClientImpl(PostgreSqlManagementClientImpl client) { + VirtualEndpointsClientImpl(PostgreSqlServerManagementClientImpl client) { this.service = RestProxy.create(VirtualEndpointsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for PostgreSqlManagementClientVirtualEndpoints to be used by the proxy - * service to perform REST calls. + * The interface defining all the services for PostgreSqlServerManagementClientVirtualEndpoints to be used by the + * proxy service to perform REST calls. */ @Host("{$host}") - @ServiceInterface(name = "PostgreSqlManagement") + @ServiceInterface(name = "PostgreSqlServerMana") public interface VirtualEndpointsService { @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/virtualendpoints/{virtualEndpointName}") @@ -1162,9 +1162,7 @@ public PagedIterable listByServer(String resourceG /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @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. @@ -1190,9 +1188,7 @@ private Mono> listByServerNextSingle /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @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. diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/VirtualEndpointsImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/VirtualEndpointsImpl.java index d42cf9fb48dd7..e1994a0e4085f 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/VirtualEndpointsImpl.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/VirtualEndpointsImpl.java @@ -19,10 +19,10 @@ public final class VirtualEndpointsImpl implements VirtualEndpoints { private final VirtualEndpointsClient innerClient; - private final com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager; + private final com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager serviceManager; public VirtualEndpointsImpl(VirtualEndpointsClient innerClient, - com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager) { + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } @@ -150,7 +150,7 @@ private VirtualEndpointsClient serviceClient() { return this.innerClient; } - private com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager() { + private com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager() { return this.serviceManager; } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/VirtualNetworkSubnetUsageResultImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/VirtualNetworkSubnetUsageResultImpl.java index 583664b0a0f26..1f1fe084cd4a1 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/VirtualNetworkSubnetUsageResultImpl.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/VirtualNetworkSubnetUsageResultImpl.java @@ -13,10 +13,10 @@ public final class VirtualNetworkSubnetUsageResultImpl implements VirtualNetworkSubnetUsageResult { private VirtualNetworkSubnetUsageResultInner innerObject; - private final com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager; + private final com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager serviceManager; VirtualNetworkSubnetUsageResultImpl(VirtualNetworkSubnetUsageResultInner innerObject, - com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager) { + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } @@ -42,7 +42,7 @@ public VirtualNetworkSubnetUsageResultInner innerModel() { return this.innerObject; } - private com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager() { + private com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager() { return this.serviceManager; } } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/VirtualNetworkSubnetUsagesClientImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/VirtualNetworkSubnetUsagesClientImpl.java index 4d3cfb41db7ae..816d150930c94 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/VirtualNetworkSubnetUsagesClientImpl.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/VirtualNetworkSubnetUsagesClientImpl.java @@ -39,25 +39,25 @@ public final class VirtualNetworkSubnetUsagesClientImpl implements VirtualNetwor /** * The service client containing this operation class. */ - private final PostgreSqlManagementClientImpl client; + private final PostgreSqlServerManagementClientImpl client; /** * Initializes an instance of VirtualNetworkSubnetUsagesClientImpl. * * @param client the instance of the service client containing this operation class. */ - VirtualNetworkSubnetUsagesClientImpl(PostgreSqlManagementClientImpl client) { + VirtualNetworkSubnetUsagesClientImpl(PostgreSqlServerManagementClientImpl client) { this.service = RestProxy.create(VirtualNetworkSubnetUsagesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for PostgreSqlManagementClientVirtualNetworkSubnetUsages to be used by - * the proxy service to perform REST calls. + * The interface defining all the services for PostgreSqlServerManagementClientVirtualNetworkSubnetUsages to be used + * by the proxy service to perform REST calls. */ @Host("{$host}") - @ServiceInterface(name = "PostgreSqlManagement") + @ServiceInterface(name = "PostgreSqlServerMana") public interface VirtualNetworkSubnetUsagesService { @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/providers/Microsoft.DBforPostgreSQL/locations/{locationName}/checkVirtualNetworkSubnetUsage") diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/VirtualNetworkSubnetUsagesImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/VirtualNetworkSubnetUsagesImpl.java index ec63d80568716..2c75a662f4e52 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/VirtualNetworkSubnetUsagesImpl.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/VirtualNetworkSubnetUsagesImpl.java @@ -19,10 +19,10 @@ public final class VirtualNetworkSubnetUsagesImpl implements VirtualNetworkSubne private final VirtualNetworkSubnetUsagesClient innerClient; - private final com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager; + private final com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager serviceManager; public VirtualNetworkSubnetUsagesImpl(VirtualNetworkSubnetUsagesClient innerClient, - com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager) { + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } @@ -52,7 +52,7 @@ private VirtualNetworkSubnetUsagesClient serviceClient() { return this.innerClient; } - private com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager() { + private com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager() { return this.serviceManager; } } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/package-info.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/package-info.java index e0753268fc2d4..b756f3cf8efb2 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/package-info.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/package-info.java @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. /** - * Package containing the implementations for PostgreSqlManagementClient. + * Package containing the implementations for PostgreSqlServerManagementClient. * 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. diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ActiveDirectoryAdministratorAdd.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ActiveDirectoryAdministratorAdd.java index 94ecc16653554..c101a4fbf7f62 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ActiveDirectoryAdministratorAdd.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ActiveDirectoryAdministratorAdd.java @@ -5,18 +5,21 @@ 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.AdministratorPropertiesForAdd; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; /** * Represents an Active Directory administrator. */ @Fluent -public final class ActiveDirectoryAdministratorAdd { +public final class ActiveDirectoryAdministratorAdd implements JsonSerializable { /* * Properties of the active directory administrator. */ - @JsonProperty(value = "properties") private AdministratorPropertiesForAdd innerProperties; /** @@ -113,4 +116,42 @@ public void validate() { 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 ActiveDirectoryAdministratorAdd from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ActiveDirectoryAdministratorAdd 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 ActiveDirectoryAdministratorAdd. + */ + public static ActiveDirectoryAdministratorAdd fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ActiveDirectoryAdministratorAdd deserializedActiveDirectoryAdministratorAdd + = new ActiveDirectoryAdministratorAdd(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("properties".equals(fieldName)) { + deserializedActiveDirectoryAdministratorAdd.innerProperties + = AdministratorPropertiesForAdd.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedActiveDirectoryAdministratorAdd; + }); + } } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ActiveDirectoryAuthEnum.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ActiveDirectoryAuthEnum.java index 403480c3b388d..0773e47827ad7 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ActiveDirectoryAuthEnum.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ActiveDirectoryAuthEnum.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.postgresqlflexibleserver.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -37,7 +36,6 @@ public ActiveDirectoryAuthEnum() { * @param name a name to look for. * @return the corresponding ActiveDirectoryAuthEnum. */ - @JsonCreator public static ActiveDirectoryAuthEnum fromString(String name) { return fromString(name, ActiveDirectoryAuthEnum.class); } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/AdminCredentials.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/AdminCredentials.java index 19717de9d8906..910670d2d3f88 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/AdminCredentials.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/AdminCredentials.java @@ -6,23 +6,25 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Server admin credentials. */ @Fluent -public final class AdminCredentials { +public final class AdminCredentials implements JsonSerializable { /* * Password for source server. */ - @JsonProperty(value = "sourceServerPassword") private String sourceServerPassword; /* * Password for target server. */ - @JsonProperty(value = "targetServerPassword") private String targetServerPassword; /** @@ -90,4 +92,44 @@ public void validate() { } private static final ClientLogger LOGGER = new ClientLogger(AdminCredentials.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("sourceServerPassword", this.sourceServerPassword); + jsonWriter.writeStringField("targetServerPassword", this.targetServerPassword); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AdminCredentials from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AdminCredentials 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 AdminCredentials. + */ + public static AdminCredentials fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AdminCredentials deserializedAdminCredentials = new AdminCredentials(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("sourceServerPassword".equals(fieldName)) { + deserializedAdminCredentials.sourceServerPassword = reader.getString(); + } else if ("targetServerPassword".equals(fieldName)) { + deserializedAdminCredentials.targetServerPassword = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAdminCredentials; + }); + } } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/AdministratorListResult.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/AdministratorListResult.java index f496ec6efe060..1fdc68ca96fd2 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/AdministratorListResult.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/AdministratorListResult.java @@ -5,25 +5,27 @@ 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.ActiveDirectoryAdministratorInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * A list of active directory administrators. */ @Fluent -public final class AdministratorListResult { +public final class AdministratorListResult implements JsonSerializable { /* * The list of active directory administrators */ - @JsonProperty(value = "value") private List value; /* * The link used to get the next page of active directory. */ - @JsonProperty(value = "nextLink") private String nextLink; /** @@ -82,4 +84,45 @@ public void validate() { 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 AdministratorListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AdministratorListResult 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 AdministratorListResult. + */ + public static AdministratorListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AdministratorListResult deserializedAdministratorListResult = new AdministratorListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> ActiveDirectoryAdministratorInner.fromJson(reader1)); + deserializedAdministratorListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedAdministratorListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAdministratorListResult; + }); + } } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ArmServerKeyType.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ArmServerKeyType.java index 679b1e59ccc23..f1dc83e3bdd62 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ArmServerKeyType.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ArmServerKeyType.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.postgresqlflexibleserver.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -37,7 +36,6 @@ public ArmServerKeyType() { * @param name a name to look for. * @return the corresponding ArmServerKeyType. */ - @JsonCreator public static ArmServerKeyType fromString(String name) { return fromString(name, ArmServerKeyType.class); } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/AuthConfig.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/AuthConfig.java index 4ad0c184e249c..7d2113b95b06c 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/AuthConfig.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/AuthConfig.java @@ -5,29 +5,30 @@ package com.azure.resourcemanager.postgresqlflexibleserver.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Authentication configuration properties of a server. */ @Fluent -public final class AuthConfig { +public final class AuthConfig implements JsonSerializable { /* * If Enabled, Azure Active Directory authentication is enabled. */ - @JsonProperty(value = "activeDirectoryAuth") private ActiveDirectoryAuthEnum activeDirectoryAuth; /* * If Enabled, Password authentication is enabled. */ - @JsonProperty(value = "passwordAuth") private PasswordAuthEnum passwordAuth; /* * Tenant id of the server. */ - @JsonProperty(value = "tenantId") private String tenantId; /** @@ -103,4 +104,47 @@ public AuthConfig withTenantId(String tenantId) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("activeDirectoryAuth", + this.activeDirectoryAuth == null ? null : this.activeDirectoryAuth.toString()); + jsonWriter.writeStringField("passwordAuth", this.passwordAuth == null ? null : this.passwordAuth.toString()); + jsonWriter.writeStringField("tenantId", this.tenantId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AuthConfig from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AuthConfig 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 AuthConfig. + */ + public static AuthConfig fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AuthConfig deserializedAuthConfig = new AuthConfig(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("activeDirectoryAuth".equals(fieldName)) { + deserializedAuthConfig.activeDirectoryAuth = ActiveDirectoryAuthEnum.fromString(reader.getString()); + } else if ("passwordAuth".equals(fieldName)) { + deserializedAuthConfig.passwordAuth = PasswordAuthEnum.fromString(reader.getString()); + } else if ("tenantId".equals(fieldName)) { + deserializedAuthConfig.tenantId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAuthConfig; + }); + } } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/AzureManagedDiskPerformanceTiers.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/AzureManagedDiskPerformanceTiers.java index 45bd49062fe97..bfe642c35cf59 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/AzureManagedDiskPerformanceTiers.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/AzureManagedDiskPerformanceTiers.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.postgresqlflexibleserver.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -97,7 +96,6 @@ public AzureManagedDiskPerformanceTiers() { * @param name a name to look for. * @return the corresponding AzureManagedDiskPerformanceTiers. */ - @JsonCreator public static AzureManagedDiskPerformanceTiers fromString(String name) { return fromString(name, AzureManagedDiskPerformanceTiers.class); } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/Backup.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/Backup.java index 3fd6904bc77c7..fff21b2a63eda 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/Backup.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/Backup.java @@ -5,30 +5,32 @@ package com.azure.resourcemanager.postgresqlflexibleserver.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +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; /** * Backup properties of a server. */ @Fluent -public final class Backup { +public final class Backup implements JsonSerializable { /* * Backup retention days for the server. */ - @JsonProperty(value = "backupRetentionDays") private Integer backupRetentionDays; /* * A value indicating whether Geo-Redundant backup is enabled on the server. */ - @JsonProperty(value = "geoRedundantBackup") private GeoRedundantBackupEnum geoRedundantBackup; /* * The earliest restore point time (ISO8601 format) for server. */ - @JsonProperty(value = "earliestRestoreDate", access = JsonProperty.Access.WRITE_ONLY) private OffsetDateTime earliestRestoreDate; /** @@ -93,4 +95,47 @@ public OffsetDateTime earliestRestoreDate() { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("backupRetentionDays", this.backupRetentionDays); + jsonWriter.writeStringField("geoRedundantBackup", + this.geoRedundantBackup == null ? null : this.geoRedundantBackup.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Backup from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Backup 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 Backup. + */ + public static Backup fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Backup deserializedBackup = new Backup(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("backupRetentionDays".equals(fieldName)) { + deserializedBackup.backupRetentionDays = reader.getNullable(JsonReader::getInt); + } else if ("geoRedundantBackup".equals(fieldName)) { + deserializedBackup.geoRedundantBackup = GeoRedundantBackupEnum.fromString(reader.getString()); + } else if ("earliestRestoreDate".equals(fieldName)) { + deserializedBackup.earliestRestoreDate = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedBackup; + }); + } } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/BackupRequestBase.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/BackupRequestBase.java index a3630ae83c09d..c7d7791a6ffa6 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/BackupRequestBase.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/BackupRequestBase.java @@ -6,17 +6,20 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * BackupRequestBase is the base for all backup request. */ @Fluent -public class BackupRequestBase { +public class BackupRequestBase implements JsonSerializable { /* * Backup Settings */ - @JsonProperty(value = "backupSettings", required = true) private BackupSettings backupSettings; /** @@ -61,4 +64,41 @@ public void validate() { } private static final ClientLogger LOGGER = new ClientLogger(BackupRequestBase.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("backupSettings", this.backupSettings); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BackupRequestBase from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BackupRequestBase 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 BackupRequestBase. + */ + public static BackupRequestBase fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BackupRequestBase deserializedBackupRequestBase = new BackupRequestBase(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("backupSettings".equals(fieldName)) { + deserializedBackupRequestBase.backupSettings = BackupSettings.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedBackupRequestBase; + }); + } } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/BackupSettings.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/BackupSettings.java index ef9bed7357c4f..6a505fb194665 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/BackupSettings.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/BackupSettings.java @@ -6,17 +6,20 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +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 settings for the long term backup. */ @Fluent -public final class BackupSettings { +public final class BackupSettings implements JsonSerializable { /* * Backup Name for the current backup */ - @JsonProperty(value = "backupName", required = true) private String backupName; /** @@ -58,4 +61,41 @@ public void validate() { } private static final ClientLogger LOGGER = new ClientLogger(BackupSettings.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("backupName", this.backupName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BackupSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BackupSettings 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 BackupSettings. + */ + public static BackupSettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BackupSettings deserializedBackupSettings = new BackupSettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("backupName".equals(fieldName)) { + deserializedBackupSettings.backupName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedBackupSettings; + }); + } } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/BackupStoreDetails.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/BackupStoreDetails.java index 88eb7f0dad745..5536be8e80fba 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/BackupStoreDetails.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/BackupStoreDetails.java @@ -6,18 +6,21 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +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.util.List; /** * Details about the target where the backup content will be stored. */ @Fluent -public final class BackupStoreDetails { +public final class BackupStoreDetails implements JsonSerializable { /* * List of SAS uri of storage containers where backup data is to be streamed/copied. */ - @JsonProperty(value = "sasUriList", required = true) private List sasUriList; /** @@ -59,4 +62,42 @@ public void validate() { } private static final ClientLogger LOGGER = new ClientLogger(BackupStoreDetails.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("sasUriList", this.sasUriList, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BackupStoreDetails from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BackupStoreDetails 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 BackupStoreDetails. + */ + public static BackupStoreDetails fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BackupStoreDetails deserializedBackupStoreDetails = new BackupStoreDetails(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("sasUriList".equals(fieldName)) { + List sasUriList = reader.readArray(reader1 -> reader1.getString()); + deserializedBackupStoreDetails.sasUriList = sasUriList; + } else { + reader.skipChildren(); + } + } + + return deserializedBackupStoreDetails; + }); + } } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/Backups.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/Backups.java index 4637cf515479b..e390b3f7cbcfa 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/Backups.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/Backups.java @@ -12,6 +12,58 @@ * Resource collection API of Backups. */ public interface Backups { + /** + * Create a specific backup for PostgreSQL flexible server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param backupName The name of the backup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return server backup properties. + */ + ServerBackup create(String resourceGroupName, String serverName, String backupName); + + /** + * Create a specific backup for PostgreSQL flexible server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param backupName The name of the backup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return server backup properties. + */ + ServerBackup create(String resourceGroupName, String serverName, String backupName, Context context); + + /** + * Deletes a specific backup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param backupName The name of the backup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String serverName, String backupName); + + /** + * Deletes a specific backup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param backupName The name of the backup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String serverName, String backupName, Context context); + /** * Get specific backup for a given server. * diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/CancelEnum.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/CancelEnum.java index 672905b4d7f16..c1b2def216244 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/CancelEnum.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/CancelEnum.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.postgresqlflexibleserver.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -37,7 +36,6 @@ public CancelEnum() { * @param name a name to look for. * @return the corresponding CancelEnum. */ - @JsonCreator public static CancelEnum fromString(String name) { return fromString(name, CancelEnum.class); } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/CapabilitiesListResult.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/CapabilitiesListResult.java index 7bc618502280f..8f86d5a9706e7 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/CapabilitiesListResult.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/CapabilitiesListResult.java @@ -5,25 +5,27 @@ 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.FlexibleServerCapabilityInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * Capability for the PostgreSQL server. */ @Immutable -public final class CapabilitiesListResult { +public final class CapabilitiesListResult implements JsonSerializable { /* * A list of supported capabilities. */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) private List value; /* * Link to retrieve next page of results. */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; /** @@ -60,4 +62,43 @@ public void validate() { value().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CapabilitiesListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CapabilitiesListResult 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 CapabilitiesListResult. + */ + public static CapabilitiesListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CapabilitiesListResult deserializedCapabilitiesListResult = new CapabilitiesListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> FlexibleServerCapabilityInner.fromJson(reader1)); + deserializedCapabilitiesListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedCapabilitiesListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCapabilitiesListResult; + }); + } } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/CapabilityBase.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/CapabilityBase.java index 986c3d83e84d6..61f09fc113a55 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/CapabilityBase.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/CapabilityBase.java @@ -5,23 +5,25 @@ package com.azure.resourcemanager.postgresqlflexibleserver.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Base object for representing capability. */ @Immutable -public class CapabilityBase { +public class CapabilityBase implements JsonSerializable { /* * The status of the capability. */ - @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) private CapabilityStatus status; /* * The reason for the capability not being available. */ - @JsonProperty(value = "reason", access = JsonProperty.Access.WRITE_ONLY) private String reason; /** @@ -39,6 +41,17 @@ public CapabilityStatus status() { return this.status; } + /** + * Set the status property: The status of the capability. + * + * @param status the status value to set. + * @return the CapabilityBase object itself. + */ + CapabilityBase withStatus(CapabilityStatus status) { + this.status = status; + return this; + } + /** * Get the reason property: The reason for the capability not being available. * @@ -48,6 +61,17 @@ public String reason() { return this.reason; } + /** + * Set the reason property: The reason for the capability not being available. + * + * @param reason the reason value to set. + * @return the CapabilityBase object itself. + */ + CapabilityBase withReason(String reason) { + this.reason = reason; + return this; + } + /** * Validates the instance. * @@ -55,4 +79,41 @@ public String reason() { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CapabilityBase from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CapabilityBase 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 CapabilityBase. + */ + public static CapabilityBase fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CapabilityBase deserializedCapabilityBase = new CapabilityBase(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("status".equals(fieldName)) { + deserializedCapabilityBase.status = CapabilityStatus.fromString(reader.getString()); + } else if ("reason".equals(fieldName)) { + deserializedCapabilityBase.reason = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCapabilityBase; + }); + } } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/CapabilityStatus.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/CapabilityStatus.java index 4bf94f2cb52c3..0d721b02130d5 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/CapabilityStatus.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/CapabilityStatus.java @@ -4,9 +4,6 @@ package com.azure.resourcemanager.postgresqlflexibleserver.models; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - /** * The status of the capability. */ @@ -46,7 +43,6 @@ public enum CapabilityStatus { * @param value the serialized value to parse. * @return the parsed CapabilityStatus object, or null if unable to parse. */ - @JsonCreator public static CapabilityStatus fromString(String value) { if (value == null) { return null; @@ -63,7 +59,6 @@ public static CapabilityStatus fromString(String value) { /** * {@inheritDoc} */ - @JsonValue @Override public String toString() { return this.value; diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/CheckNameAvailabilityReason.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/CheckNameAvailabilityReason.java index 5f4e7479786d7..aa9c4a3781c78 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/CheckNameAvailabilityReason.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/CheckNameAvailabilityReason.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.postgresqlflexibleserver.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -37,7 +36,6 @@ public CheckNameAvailabilityReason() { * @param name a name to look for. * @return the corresponding CheckNameAvailabilityReason. */ - @JsonCreator public static CheckNameAvailabilityReason fromString(String name) { return fromString(name, CheckNameAvailabilityReason.class); } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/CheckNameAvailabilityRequest.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/CheckNameAvailabilityRequest.java index 698f493efa80d..24dbb5867c23b 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/CheckNameAvailabilityRequest.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/CheckNameAvailabilityRequest.java @@ -5,23 +5,25 @@ package com.azure.resourcemanager.postgresqlflexibleserver.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +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 check availability request body. */ @Fluent -public final class CheckNameAvailabilityRequest { +public final class CheckNameAvailabilityRequest implements JsonSerializable { /* * The name of the resource for which availability needs to be checked. */ - @JsonProperty(value = "name") private String name; /* * The resource type. */ - @JsonProperty(value = "type") private String type; /** @@ -77,4 +79,43 @@ public CheckNameAvailabilityRequest withType(String type) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("type", this.type); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CheckNameAvailabilityRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CheckNameAvailabilityRequest 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 CheckNameAvailabilityRequest. + */ + public static CheckNameAvailabilityRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CheckNameAvailabilityRequest deserializedCheckNameAvailabilityRequest = new CheckNameAvailabilityRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedCheckNameAvailabilityRequest.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedCheckNameAvailabilityRequest.type = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCheckNameAvailabilityRequest; + }); + } } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/CheckNameAvailabilityResponse.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/CheckNameAvailabilityResponse.java index ff59c8d36acd8..bf855751423e3 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/CheckNameAvailabilityResponse.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/CheckNameAvailabilityResponse.java @@ -5,29 +5,30 @@ package com.azure.resourcemanager.postgresqlflexibleserver.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +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 check availability result. */ @Fluent -public class CheckNameAvailabilityResponse { +public class CheckNameAvailabilityResponse implements JsonSerializable { /* * Indicates if the resource name is available. */ - @JsonProperty(value = "nameAvailable") private Boolean nameAvailable; /* * The reason why the given name is not available. */ - @JsonProperty(value = "reason") private CheckNameAvailabilityReason reason; /* * Detailed reason why the given name is available. */ - @JsonProperty(value = "message") private String message; /** @@ -103,4 +104,49 @@ public CheckNameAvailabilityResponse withMessage(String message) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("nameAvailable", this.nameAvailable); + jsonWriter.writeStringField("reason", this.reason == null ? null : this.reason.toString()); + jsonWriter.writeStringField("message", this.message); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CheckNameAvailabilityResponse from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CheckNameAvailabilityResponse 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 CheckNameAvailabilityResponse. + */ + public static CheckNameAvailabilityResponse fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CheckNameAvailabilityResponse deserializedCheckNameAvailabilityResponse + = new CheckNameAvailabilityResponse(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("nameAvailable".equals(fieldName)) { + deserializedCheckNameAvailabilityResponse.nameAvailable + = reader.getNullable(JsonReader::getBoolean); + } else if ("reason".equals(fieldName)) { + deserializedCheckNameAvailabilityResponse.reason + = CheckNameAvailabilityReason.fromString(reader.getString()); + } else if ("message".equals(fieldName)) { + deserializedCheckNameAvailabilityResponse.message = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCheckNameAvailabilityResponse; + }); + } } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/Configuration.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/Configuration.java index aa6d239286dc2..e42999bd7e06b 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/Configuration.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/Configuration.java @@ -41,7 +41,7 @@ public interface Configuration { SystemData systemData(); /** - * Gets the value property: Value of the configuration. + * Gets the value property: Value of the configuration. Required to update the configuration. * * @return the value value. */ @@ -76,7 +76,7 @@ public interface Configuration { String allowedValues(); /** - * Gets the source property: Source of the configuration. + * Gets the source property: Source of the configuration. Required to update the configuration. * * @return the source value. */ @@ -188,9 +188,9 @@ interface WithCreate extends DefinitionStages.WithValue, DefinitionStages.WithSo */ interface WithValue { /** - * Specifies the value property: Value of the configuration.. + * Specifies the value property: Value of the configuration. Required to update the configuration.. * - * @param value Value of the configuration. + * @param value Value of the configuration. Required to update the configuration. * @return the next definition stage. */ WithCreate withValue(String value); @@ -201,9 +201,9 @@ interface WithValue { */ interface WithSource { /** - * Specifies the source property: Source of the configuration.. + * Specifies the source property: Source of the configuration. Required to update the configuration.. * - * @param source Source of the configuration. + * @param source Source of the configuration. Required to update the configuration. * @return the next definition stage. */ WithCreate withSource(String source); @@ -246,9 +246,9 @@ interface UpdateStages { */ interface WithValue { /** - * Specifies the value property: Value of the configuration.. + * Specifies the value property: Value of the configuration. Required to update the configuration.. * - * @param value Value of the configuration. + * @param value Value of the configuration. Required to update the configuration. * @return the next definition stage. */ Update withValue(String value); @@ -259,9 +259,9 @@ interface WithValue { */ interface WithSource { /** - * Specifies the source property: Source of the configuration.. + * Specifies the source property: Source of the configuration. Required to update the configuration.. * - * @param source Source of the configuration. + * @param source Source of the configuration. Required to update the configuration. * @return the next definition stage. */ Update withSource(String source); diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ConfigurationDataType.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ConfigurationDataType.java index 02f927abe4f93..c087e8eaaf1bb 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ConfigurationDataType.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ConfigurationDataType.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.postgresqlflexibleserver.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -47,7 +46,6 @@ public ConfigurationDataType() { * @param name a name to look for. * @return the corresponding ConfigurationDataType. */ - @JsonCreator public static ConfigurationDataType fromString(String name) { return fromString(name, ConfigurationDataType.class); } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ConfigurationForUpdate.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ConfigurationForUpdate.java index 99d0fed217561..897a06da6a89e 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ConfigurationForUpdate.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ConfigurationForUpdate.java @@ -5,18 +5,21 @@ 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.ConfigurationProperties; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; /** * Represents a Configuration. */ @Fluent -public final class ConfigurationForUpdate { +public final class ConfigurationForUpdate implements JsonSerializable { /* * The properties of a configuration. */ - @JsonProperty(value = "properties") private ConfigurationProperties innerProperties; /** @@ -35,7 +38,7 @@ private ConfigurationProperties innerProperties() { } /** - * Get the value property: Value of the configuration. + * Get the value property: Value of the configuration. Required to update the configuration. * * @return the value value. */ @@ -44,7 +47,7 @@ public String value() { } /** - * Set the value property: Value of the configuration. + * Set the value property: Value of the configuration. Required to update the configuration. * * @param value the value value to set. * @return the ConfigurationForUpdate object itself. @@ -94,7 +97,7 @@ public String allowedValues() { } /** - * Get the source property: Source of the configuration. + * Get the source property: Source of the configuration. Required to update the configuration. * * @return the source value. */ @@ -103,7 +106,7 @@ public String source() { } /** - * Set the source property: Source of the configuration. + * Set the source property: Source of the configuration. Required to update the configuration. * * @param source the source value to set. * @return the ConfigurationForUpdate object itself. @@ -171,4 +174,40 @@ public void validate() { 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 ConfigurationForUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ConfigurationForUpdate 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 ConfigurationForUpdate. + */ + public static ConfigurationForUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ConfigurationForUpdate deserializedConfigurationForUpdate = new ConfigurationForUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("properties".equals(fieldName)) { + deserializedConfigurationForUpdate.innerProperties = ConfigurationProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedConfigurationForUpdate; + }); + } } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ConfigurationListResult.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ConfigurationListResult.java index 4a1a8e69916e9..9061d91ff5f6e 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ConfigurationListResult.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ConfigurationListResult.java @@ -5,25 +5,27 @@ 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.ConfigurationInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * A list of server configurations. */ @Fluent -public final class ConfigurationListResult { +public final class ConfigurationListResult implements JsonSerializable { /* * The list of server configurations. */ - @JsonProperty(value = "value") private List value; /* * The link used to get the next page of operations. */ - @JsonProperty(value = "nextLink") private String nextLink; /** @@ -82,4 +84,44 @@ public void validate() { 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 ConfigurationListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ConfigurationListResult 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 ConfigurationListResult. + */ + public static ConfigurationListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ConfigurationListResult deserializedConfigurationListResult = new ConfigurationListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> ConfigurationInner.fromJson(reader1)); + deserializedConfigurationListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedConfigurationListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedConfigurationListResult; + }); + } } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/CreateMode.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/CreateMode.java index b1fe264f3da05..770389ec932d7 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/CreateMode.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/CreateMode.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.postgresqlflexibleserver.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -62,7 +61,6 @@ public CreateMode() { * @param name a name to look for. * @return the corresponding CreateMode. */ - @JsonCreator public static CreateMode fromString(String name) { return fromString(name, CreateMode.class); } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/CreateModeForUpdate.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/CreateModeForUpdate.java index 75971a4505829..10f4cee8d765c 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/CreateModeForUpdate.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/CreateModeForUpdate.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.postgresqlflexibleserver.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -37,7 +36,6 @@ public CreateModeForUpdate() { * @param name a name to look for. * @return the corresponding CreateModeForUpdate. */ - @JsonCreator public static CreateModeForUpdate fromString(String name) { return fromString(name, CreateModeForUpdate.class); } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/DataEncryption.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/DataEncryption.java index da4aca6fd6e4c..5d5a95ba3a025 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/DataEncryption.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/DataEncryption.java @@ -5,53 +5,50 @@ package com.azure.resourcemanager.postgresqlflexibleserver.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Data encryption properties of a server. */ @Fluent -public final class DataEncryption { +public final class DataEncryption implements JsonSerializable { /* * URI for the key in keyvault for data encryption of the primary server. */ - @JsonProperty(value = "primaryKeyURI") private String primaryKeyUri; /* * Resource Id for the User assigned identity to be used for data encryption of the primary server. */ - @JsonProperty(value = "primaryUserAssignedIdentityId") private String primaryUserAssignedIdentityId; /* * URI for the key in keyvault for data encryption for geo-backup of server. */ - @JsonProperty(value = "geoBackupKeyURI") private String geoBackupKeyUri; /* * Resource Id for the User assigned identity to be used for data encryption for geo-backup of server. */ - @JsonProperty(value = "geoBackupUserAssignedIdentityId") private String geoBackupUserAssignedIdentityId; /* * Data encryption type to depict if it is System Managed vs Azure Key vault. */ - @JsonProperty(value = "type") private ArmServerKeyType type; /* * Primary encryption key status for Data encryption enabled server. */ - @JsonProperty(value = "primaryEncryptionKeyStatus") private KeyStatusEnum primaryEncryptionKeyStatus; /* * Geo-backup encryption key status for Data encryption enabled server. */ - @JsonProperty(value = "geoBackupEncryptionKeyStatus") private KeyStatusEnum geoBackupEncryptionKeyStatus; /** @@ -213,4 +210,62 @@ public DataEncryption withGeoBackupEncryptionKeyStatus(KeyStatusEnum geoBackupEn */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("primaryKeyURI", this.primaryKeyUri); + jsonWriter.writeStringField("primaryUserAssignedIdentityId", this.primaryUserAssignedIdentityId); + jsonWriter.writeStringField("geoBackupKeyURI", this.geoBackupKeyUri); + jsonWriter.writeStringField("geoBackupUserAssignedIdentityId", this.geoBackupUserAssignedIdentityId); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeStringField("primaryEncryptionKeyStatus", + this.primaryEncryptionKeyStatus == null ? null : this.primaryEncryptionKeyStatus.toString()); + jsonWriter.writeStringField("geoBackupEncryptionKeyStatus", + this.geoBackupEncryptionKeyStatus == null ? null : this.geoBackupEncryptionKeyStatus.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DataEncryption from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DataEncryption 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 DataEncryption. + */ + public static DataEncryption fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DataEncryption deserializedDataEncryption = new DataEncryption(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("primaryKeyURI".equals(fieldName)) { + deserializedDataEncryption.primaryKeyUri = reader.getString(); + } else if ("primaryUserAssignedIdentityId".equals(fieldName)) { + deserializedDataEncryption.primaryUserAssignedIdentityId = reader.getString(); + } else if ("geoBackupKeyURI".equals(fieldName)) { + deserializedDataEncryption.geoBackupKeyUri = reader.getString(); + } else if ("geoBackupUserAssignedIdentityId".equals(fieldName)) { + deserializedDataEncryption.geoBackupUserAssignedIdentityId = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedDataEncryption.type = ArmServerKeyType.fromString(reader.getString()); + } else if ("primaryEncryptionKeyStatus".equals(fieldName)) { + deserializedDataEncryption.primaryEncryptionKeyStatus + = KeyStatusEnum.fromString(reader.getString()); + } else if ("geoBackupEncryptionKeyStatus".equals(fieldName)) { + deserializedDataEncryption.geoBackupEncryptionKeyStatus + = KeyStatusEnum.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedDataEncryption; + }); + } } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/DatabaseListResult.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/DatabaseListResult.java index 0a9407fae1543..75079602812bd 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/DatabaseListResult.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/DatabaseListResult.java @@ -5,25 +5,27 @@ 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.DatabaseInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * A List of databases. */ @Fluent -public final class DatabaseListResult { +public final class DatabaseListResult implements JsonSerializable { /* * The list of databases housed in a server */ - @JsonProperty(value = "value") private List value; /* * The link used to get the next page of databases. */ - @JsonProperty(value = "nextLink") private String nextLink; /** @@ -82,4 +84,44 @@ public void validate() { 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 DatabaseListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DatabaseListResult 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 DatabaseListResult. + */ + public static DatabaseListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DatabaseListResult deserializedDatabaseListResult = new DatabaseListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> DatabaseInner.fromJson(reader1)); + deserializedDatabaseListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedDatabaseListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDatabaseListResult; + }); + } } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/DbLevelValidationStatus.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/DbLevelValidationStatus.java index bcd858b8a8708..44d26054c90f0 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/DbLevelValidationStatus.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/DbLevelValidationStatus.java @@ -5,37 +5,39 @@ package com.azure.resourcemanager.postgresqlflexibleserver.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +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; import java.util.List; /** * Validation status summary for an individual database. */ @Fluent -public final class DbLevelValidationStatus { +public final class DbLevelValidationStatus implements JsonSerializable { /* * Name of the database */ - @JsonProperty(value = "databaseName") private String databaseName; /* * Start date-time of a database level validation */ - @JsonProperty(value = "startedOn") private OffsetDateTime startedOn; /* * End date-time of a database level validation */ - @JsonProperty(value = "endedOn") private OffsetDateTime endedOn; /* * Summary of database level validations */ - @JsonProperty(value = "summary") private List summary; /** @@ -134,4 +136,55 @@ public void validate() { summary().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("databaseName", this.databaseName); + jsonWriter.writeStringField("startedOn", + this.startedOn == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.startedOn)); + jsonWriter.writeStringField("endedOn", + this.endedOn == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.endedOn)); + jsonWriter.writeArrayField("summary", this.summary, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DbLevelValidationStatus from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DbLevelValidationStatus 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 DbLevelValidationStatus. + */ + public static DbLevelValidationStatus fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DbLevelValidationStatus deserializedDbLevelValidationStatus = new DbLevelValidationStatus(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("databaseName".equals(fieldName)) { + deserializedDbLevelValidationStatus.databaseName = reader.getString(); + } else if ("startedOn".equals(fieldName)) { + deserializedDbLevelValidationStatus.startedOn = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("endedOn".equals(fieldName)) { + deserializedDbLevelValidationStatus.endedOn = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("summary".equals(fieldName)) { + List summary + = reader.readArray(reader1 -> ValidationSummaryItem.fromJson(reader1)); + deserializedDbLevelValidationStatus.summary = summary; + } else { + reader.skipChildren(); + } + } + + return deserializedDbLevelValidationStatus; + }); + } } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/DbMigrationStatus.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/DbMigrationStatus.java index 3d7af14ec80c3..f12d8f8a8cf76 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/DbMigrationStatus.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/DbMigrationStatus.java @@ -5,108 +5,98 @@ package com.azure.resourcemanager.postgresqlflexibleserver.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +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; /** * Migration status of an individual database. */ @Fluent -public final class DbMigrationStatus { +public final class DbMigrationStatus implements JsonSerializable { /* * Name of the database */ - @JsonProperty(value = "databaseName") private String databaseName; /* * Migration db state of an individual database */ - @JsonProperty(value = "migrationState") private MigrationDbState migrationState; /* * Migration operation of an individual database */ - @JsonProperty(value = "migrationOperation") private String migrationOperation; /* * Start date-time of a migration state */ - @JsonProperty(value = "startedOn") private OffsetDateTime startedOn; /* * End date-time of a migration state */ - @JsonProperty(value = "endedOn") private OffsetDateTime endedOn; /* * Number of tables queued for the migration of a DB */ - @JsonProperty(value = "fullLoadQueuedTables") private Integer fullLoadQueuedTables; /* * Number of tables errored out during the migration of a DB */ - @JsonProperty(value = "fullLoadErroredTables") private Integer fullLoadErroredTables; /* * Number of tables loading during the migration of a DB */ - @JsonProperty(value = "fullLoadLoadingTables") private Integer fullLoadLoadingTables; /* * Number of tables loaded during the migration of a DB */ - @JsonProperty(value = "fullLoadCompletedTables") private Integer fullLoadCompletedTables; /* * CDC update counter */ - @JsonProperty(value = "cdcUpdateCounter") private Integer cdcUpdateCounter; /* * CDC delete counter */ - @JsonProperty(value = "cdcDeleteCounter") private Integer cdcDeleteCounter; /* * CDC insert counter */ - @JsonProperty(value = "cdcInsertCounter") private Integer cdcInsertCounter; /* * CDC applied changes counter */ - @JsonProperty(value = "appliedChanges") private Integer appliedChanges; /* * CDC incoming changes counter */ - @JsonProperty(value = "incomingChanges") private Integer incomingChanges; /* * Lag in seconds between source and target during online phase */ - @JsonProperty(value = "latency") private Integer latency; /* * Error message, if any, for the migration state */ - @JsonProperty(value = "message") private String message; /** @@ -442,4 +432,90 @@ public DbMigrationStatus withMessage(String message) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("databaseName", this.databaseName); + jsonWriter.writeStringField("migrationState", + this.migrationState == null ? null : this.migrationState.toString()); + jsonWriter.writeStringField("migrationOperation", this.migrationOperation); + jsonWriter.writeStringField("startedOn", + this.startedOn == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.startedOn)); + jsonWriter.writeStringField("endedOn", + this.endedOn == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.endedOn)); + jsonWriter.writeNumberField("fullLoadQueuedTables", this.fullLoadQueuedTables); + jsonWriter.writeNumberField("fullLoadErroredTables", this.fullLoadErroredTables); + jsonWriter.writeNumberField("fullLoadLoadingTables", this.fullLoadLoadingTables); + jsonWriter.writeNumberField("fullLoadCompletedTables", this.fullLoadCompletedTables); + jsonWriter.writeNumberField("cdcUpdateCounter", this.cdcUpdateCounter); + jsonWriter.writeNumberField("cdcDeleteCounter", this.cdcDeleteCounter); + jsonWriter.writeNumberField("cdcInsertCounter", this.cdcInsertCounter); + jsonWriter.writeNumberField("appliedChanges", this.appliedChanges); + jsonWriter.writeNumberField("incomingChanges", this.incomingChanges); + jsonWriter.writeNumberField("latency", this.latency); + jsonWriter.writeStringField("message", this.message); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DbMigrationStatus from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DbMigrationStatus 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 DbMigrationStatus. + */ + public static DbMigrationStatus fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DbMigrationStatus deserializedDbMigrationStatus = new DbMigrationStatus(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("databaseName".equals(fieldName)) { + deserializedDbMigrationStatus.databaseName = reader.getString(); + } else if ("migrationState".equals(fieldName)) { + deserializedDbMigrationStatus.migrationState = MigrationDbState.fromString(reader.getString()); + } else if ("migrationOperation".equals(fieldName)) { + deserializedDbMigrationStatus.migrationOperation = reader.getString(); + } else if ("startedOn".equals(fieldName)) { + deserializedDbMigrationStatus.startedOn = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("endedOn".equals(fieldName)) { + deserializedDbMigrationStatus.endedOn = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("fullLoadQueuedTables".equals(fieldName)) { + deserializedDbMigrationStatus.fullLoadQueuedTables = reader.getNullable(JsonReader::getInt); + } else if ("fullLoadErroredTables".equals(fieldName)) { + deserializedDbMigrationStatus.fullLoadErroredTables = reader.getNullable(JsonReader::getInt); + } else if ("fullLoadLoadingTables".equals(fieldName)) { + deserializedDbMigrationStatus.fullLoadLoadingTables = reader.getNullable(JsonReader::getInt); + } else if ("fullLoadCompletedTables".equals(fieldName)) { + deserializedDbMigrationStatus.fullLoadCompletedTables = reader.getNullable(JsonReader::getInt); + } else if ("cdcUpdateCounter".equals(fieldName)) { + deserializedDbMigrationStatus.cdcUpdateCounter = reader.getNullable(JsonReader::getInt); + } else if ("cdcDeleteCounter".equals(fieldName)) { + deserializedDbMigrationStatus.cdcDeleteCounter = reader.getNullable(JsonReader::getInt); + } else if ("cdcInsertCounter".equals(fieldName)) { + deserializedDbMigrationStatus.cdcInsertCounter = reader.getNullable(JsonReader::getInt); + } else if ("appliedChanges".equals(fieldName)) { + deserializedDbMigrationStatus.appliedChanges = reader.getNullable(JsonReader::getInt); + } else if ("incomingChanges".equals(fieldName)) { + deserializedDbMigrationStatus.incomingChanges = reader.getNullable(JsonReader::getInt); + } else if ("latency".equals(fieldName)) { + deserializedDbMigrationStatus.latency = reader.getNullable(JsonReader::getInt); + } else if ("message".equals(fieldName)) { + deserializedDbMigrationStatus.message = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDbMigrationStatus; + }); + } } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/DbServerMetadata.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/DbServerMetadata.java index 24955f0e6ef23..da6bdf736ef31 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/DbServerMetadata.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/DbServerMetadata.java @@ -5,35 +5,35 @@ package com.azure.resourcemanager.postgresqlflexibleserver.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Database server metadata. */ @Fluent -public final class DbServerMetadata { +public final class DbServerMetadata implements JsonSerializable { /* * Location of database server */ - @JsonProperty(value = "location", access = JsonProperty.Access.WRITE_ONLY) private String location; /* * Version for database engine */ - @JsonProperty(value = "version") private String version; /* * Storage size in MB for database server */ - @JsonProperty(value = "storageMb") private Integer storageMb; /* * SKU for the database server. This object is empty for PG single server */ - @JsonProperty(value = "sku") private ServerSku sku; /** @@ -121,4 +121,48 @@ public void validate() { sku().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("version", this.version); + jsonWriter.writeNumberField("storageMb", this.storageMb); + jsonWriter.writeJsonField("sku", this.sku); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DbServerMetadata from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DbServerMetadata 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 DbServerMetadata. + */ + public static DbServerMetadata fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DbServerMetadata deserializedDbServerMetadata = new DbServerMetadata(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("location".equals(fieldName)) { + deserializedDbServerMetadata.location = reader.getString(); + } else if ("version".equals(fieldName)) { + deserializedDbServerMetadata.version = reader.getString(); + } else if ("storageMb".equals(fieldName)) { + deserializedDbServerMetadata.storageMb = reader.getNullable(JsonReader::getInt); + } else if ("sku".equals(fieldName)) { + deserializedDbServerMetadata.sku = ServerSku.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedDbServerMetadata; + }); + } } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/DelegatedSubnetUsage.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/DelegatedSubnetUsage.java index acf16ee4b34cc..3b5db7b5ef9af 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/DelegatedSubnetUsage.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/DelegatedSubnetUsage.java @@ -5,23 +5,25 @@ package com.azure.resourcemanager.postgresqlflexibleserver.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Delegated subnet usage data. */ @Immutable -public final class DelegatedSubnetUsage { +public final class DelegatedSubnetUsage implements JsonSerializable { /* * Name of the delegated subnet for which IP addresses are in use */ - @JsonProperty(value = "subnetName", access = JsonProperty.Access.WRITE_ONLY) private String subnetName; /* * Number of IP addresses used by the delegated subnet */ - @JsonProperty(value = "usage", access = JsonProperty.Access.WRITE_ONLY) private Long usage; /** @@ -55,4 +57,41 @@ public Long usage() { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DelegatedSubnetUsage from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DelegatedSubnetUsage 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 DelegatedSubnetUsage. + */ + public static DelegatedSubnetUsage fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DelegatedSubnetUsage deserializedDelegatedSubnetUsage = new DelegatedSubnetUsage(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("subnetName".equals(fieldName)) { + deserializedDelegatedSubnetUsage.subnetName = reader.getString(); + } else if ("usage".equals(fieldName)) { + deserializedDelegatedSubnetUsage.usage = reader.getNullable(JsonReader::getLong); + } else { + reader.skipChildren(); + } + } + + return deserializedDelegatedSubnetUsage; + }); + } } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ExecutionStatus.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ExecutionStatus.java index 731185d438eaf..b575046a06d15 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ExecutionStatus.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ExecutionStatus.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.postgresqlflexibleserver.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -47,7 +46,6 @@ public ExecutionStatus() { * @param name a name to look for. * @return the corresponding ExecutionStatus. */ - @JsonCreator public static ExecutionStatus fromString(String name) { return fromString(name, ExecutionStatus.class); } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/FailoverMode.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/FailoverMode.java index f77dca3ac3a88..1317f54b100fd 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/FailoverMode.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/FailoverMode.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.postgresqlflexibleserver.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -47,7 +46,6 @@ public FailoverMode() { * @param name a name to look for. * @return the corresponding FailoverMode. */ - @JsonCreator public static FailoverMode fromString(String name) { return fromString(name, FailoverMode.class); } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/FastProvisioningEditionCapability.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/FastProvisioningEditionCapability.java index 6e26a5d14c304..b1027ce6b918f 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/FastProvisioningEditionCapability.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/FastProvisioningEditionCapability.java @@ -5,7 +5,10 @@ package com.azure.resourcemanager.postgresqlflexibleserver.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Represents capability of a fast provisioning edition. @@ -15,33 +18,38 @@ public final class FastProvisioningEditionCapability extends CapabilityBase { /* * Fast provisioning supported tier name */ - @JsonProperty(value = "supportedTier", access = JsonProperty.Access.WRITE_ONLY) private String supportedTier; /* * Fast provisioning supported sku name */ - @JsonProperty(value = "supportedSku", access = JsonProperty.Access.WRITE_ONLY) private String supportedSku; /* * Fast provisioning supported storage in Gb */ - @JsonProperty(value = "supportedStorageGb", access = JsonProperty.Access.WRITE_ONLY) private Integer supportedStorageGb; /* * Fast provisioning supported version */ - @JsonProperty(value = "supportedServerVersions", access = JsonProperty.Access.WRITE_ONLY) private String supportedServerVersions; /* * Count of servers in cache matching the spec */ - @JsonProperty(value = "serverCount", access = JsonProperty.Access.WRITE_ONLY) private Integer serverCount; + /* + * The reason for the capability not being available. + */ + private String reason; + + /* + * The status of the capability. + */ + private CapabilityStatus status; + /** * Creates an instance of FastProvisioningEditionCapability class. */ @@ -93,6 +101,26 @@ public Integer serverCount() { return this.serverCount; } + /** + * Get the reason property: The reason for the capability not being available. + * + * @return the reason value. + */ + @Override + public String reason() { + return this.reason; + } + + /** + * Get the status property: The status of the capability. + * + * @return the status value. + */ + @Override + public CapabilityStatus status() { + return this.status; + } + /** * Validates the instance. * @@ -100,6 +128,55 @@ public Integer serverCount() { */ @Override public void validate() { - super.validate(); + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FastProvisioningEditionCapability from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FastProvisioningEditionCapability 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 FastProvisioningEditionCapability. + */ + public static FastProvisioningEditionCapability fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FastProvisioningEditionCapability deserializedFastProvisioningEditionCapability + = new FastProvisioningEditionCapability(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("status".equals(fieldName)) { + deserializedFastProvisioningEditionCapability.status + = CapabilityStatus.fromString(reader.getString()); + } else if ("reason".equals(fieldName)) { + deserializedFastProvisioningEditionCapability.reason = reader.getString(); + } else if ("supportedTier".equals(fieldName)) { + deserializedFastProvisioningEditionCapability.supportedTier = reader.getString(); + } else if ("supportedSku".equals(fieldName)) { + deserializedFastProvisioningEditionCapability.supportedSku = reader.getString(); + } else if ("supportedStorageGb".equals(fieldName)) { + deserializedFastProvisioningEditionCapability.supportedStorageGb + = reader.getNullable(JsonReader::getInt); + } else if ("supportedServerVersions".equals(fieldName)) { + deserializedFastProvisioningEditionCapability.supportedServerVersions = reader.getString(); + } else if ("serverCount".equals(fieldName)) { + deserializedFastProvisioningEditionCapability.serverCount = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedFastProvisioningEditionCapability; + }); } } 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 9259060abbe37..616b5ac852685 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 @@ -5,7 +5,6 @@ package com.azure.resourcemanager.postgresqlflexibleserver.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -38,7 +37,6 @@ public FastProvisioningSupportedEnum() { * @param name a name to look for. * @return the corresponding FastProvisioningSupportedEnum. */ - @JsonCreator public static FastProvisioningSupportedEnum fromString(String name) { return fromString(name, FastProvisioningSupportedEnum.class); } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/FirewallRuleListResult.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/FirewallRuleListResult.java index 8d432f6d97513..ccc8da72840bb 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/FirewallRuleListResult.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/FirewallRuleListResult.java @@ -5,25 +5,27 @@ 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.FirewallRuleInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * A list of firewall rules. */ @Fluent -public final class FirewallRuleListResult { +public final class FirewallRuleListResult implements JsonSerializable { /* * The list of firewall rules in a server. */ - @JsonProperty(value = "value") private List value; /* * The link used to get the next page of operations. */ - @JsonProperty(value = "nextLink") private String nextLink; /** @@ -82,4 +84,44 @@ public void validate() { 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 FirewallRuleListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FirewallRuleListResult 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 FirewallRuleListResult. + */ + public static FirewallRuleListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FirewallRuleListResult deserializedFirewallRuleListResult = new FirewallRuleListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> FirewallRuleInner.fromJson(reader1)); + deserializedFirewallRuleListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedFirewallRuleListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedFirewallRuleListResult; + }); + } } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/FlexibleServerEditionCapability.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/FlexibleServerEditionCapability.java index 112608e11a9a1..d2c5843c34b8c 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/FlexibleServerEditionCapability.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/FlexibleServerEditionCapability.java @@ -5,7 +5,10 @@ package com.azure.resourcemanager.postgresqlflexibleserver.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; /** @@ -16,27 +19,33 @@ public final class FlexibleServerEditionCapability extends CapabilityBase { /* * Server edition name */ - @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) private String name; /* * Default sku name for the server edition */ - @JsonProperty(value = "defaultSkuName", access = JsonProperty.Access.WRITE_ONLY) private String defaultSkuName; /* * The list of editions supported by this server edition. */ - @JsonProperty(value = "supportedStorageEditions", access = JsonProperty.Access.WRITE_ONLY) private List supportedStorageEditions; /* * List of supported server SKUs. */ - @JsonProperty(value = "supportedServerSkus", access = JsonProperty.Access.WRITE_ONLY) private List supportedServerSkus; + /* + * The reason for the capability not being available. + */ + private String reason; + + /* + * The status of the capability. + */ + private CapabilityStatus status; + /** * Creates an instance of FlexibleServerEditionCapability class. */ @@ -79,6 +88,26 @@ public List supportedServerSkus() { return this.supportedServerSkus; } + /** + * Get the reason property: The reason for the capability not being available. + * + * @return the reason value. + */ + @Override + public String reason() { + return this.reason; + } + + /** + * Get the status property: The status of the capability. + * + * @return the status value. + */ + @Override + public CapabilityStatus status() { + return this.status; + } + /** * Validates the instance. * @@ -86,7 +115,6 @@ public List supportedServerSkus() { */ @Override public void validate() { - super.validate(); if (supportedStorageEditions() != null) { supportedStorageEditions().forEach(e -> e.validate()); } @@ -94,4 +122,55 @@ public void validate() { supportedServerSkus().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FlexibleServerEditionCapability from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FlexibleServerEditionCapability 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 FlexibleServerEditionCapability. + */ + public static FlexibleServerEditionCapability fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FlexibleServerEditionCapability deserializedFlexibleServerEditionCapability + = new FlexibleServerEditionCapability(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("status".equals(fieldName)) { + deserializedFlexibleServerEditionCapability.status + = CapabilityStatus.fromString(reader.getString()); + } else if ("reason".equals(fieldName)) { + deserializedFlexibleServerEditionCapability.reason = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedFlexibleServerEditionCapability.name = reader.getString(); + } else if ("defaultSkuName".equals(fieldName)) { + deserializedFlexibleServerEditionCapability.defaultSkuName = reader.getString(); + } else if ("supportedStorageEditions".equals(fieldName)) { + List supportedStorageEditions + = reader.readArray(reader1 -> StorageEditionCapability.fromJson(reader1)); + deserializedFlexibleServerEditionCapability.supportedStorageEditions = supportedStorageEditions; + } else if ("supportedServerSkus".equals(fieldName)) { + List supportedServerSkus + = reader.readArray(reader1 -> ServerSkuCapability.fromJson(reader1)); + deserializedFlexibleServerEditionCapability.supportedServerSkus = supportedServerSkus; + } else { + reader.skipChildren(); + } + } + + return deserializedFlexibleServerEditionCapability; + }); + } } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/FlexibleServersTriggerLtrPreBackupHeaders.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/FlexibleServersTriggerLtrPreBackupHeaders.java index ebfba0da65ed6..4779a9e1e3596 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/FlexibleServersTriggerLtrPreBackupHeaders.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/FlexibleServersTriggerLtrPreBackupHeaders.java @@ -7,7 +7,6 @@ import com.azure.core.annotation.Fluent; import com.azure.core.http.HttpHeaderName; import com.azure.core.http.HttpHeaders; -import com.fasterxml.jackson.annotation.JsonProperty; /** * The FlexibleServersTriggerLtrPreBackupHeaders model. @@ -17,7 +16,6 @@ public final class FlexibleServersTriggerLtrPreBackupHeaders { /* * The x-ms-request-id property. */ - @JsonProperty(value = "x-ms-request-id") private String xMsRequestId; // HttpHeaders containing the raw property values. 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 a814e59382997..90eb394f96a12 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 @@ -5,7 +5,6 @@ package com.azure.resourcemanager.postgresqlflexibleserver.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -38,7 +37,6 @@ public GeoBackupSupportedEnum() { * @param name a name to look for. * @return the corresponding GeoBackupSupportedEnum. */ - @JsonCreator public static GeoBackupSupportedEnum fromString(String name) { return fromString(name, GeoBackupSupportedEnum.class); } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/GeoRedundantBackupEnum.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/GeoRedundantBackupEnum.java index 4d5e666ccd8c8..d6a4d2d77497a 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/GeoRedundantBackupEnum.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/GeoRedundantBackupEnum.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.postgresqlflexibleserver.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -37,7 +36,6 @@ public GeoRedundantBackupEnum() { * @param name a name to look for. * @return the corresponding GeoRedundantBackupEnum. */ - @JsonCreator public static GeoRedundantBackupEnum fromString(String name) { return fromString(name, GeoRedundantBackupEnum.class); } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/HaMode.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/HaMode.java index 4fb359d7c85e9..bef85a725c036 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/HaMode.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/HaMode.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.postgresqlflexibleserver.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -37,7 +36,6 @@ public HaMode() { * @param name a name to look for. * @return the corresponding HaMode. */ - @JsonCreator public static HaMode fromString(String name) { return fromString(name, HaMode.class); } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/HighAvailability.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/HighAvailability.java index da17334173f7c..0319da6d63a5f 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/HighAvailability.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/HighAvailability.java @@ -5,29 +5,30 @@ package com.azure.resourcemanager.postgresqlflexibleserver.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * High availability properties of a server. */ @Fluent -public final class HighAvailability { +public final class HighAvailability implements JsonSerializable { /* * The HA mode for the server. */ - @JsonProperty(value = "mode") private HighAvailabilityMode mode; /* * A state of a HA server that is visible to user. */ - @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) private ServerHAState state; /* * availability zone information of the standby. */ - @JsonProperty(value = "standbyAvailabilityZone") private String standbyAvailabilityZone; /** @@ -92,4 +93,45 @@ public HighAvailability withStandbyAvailabilityZone(String standbyAvailabilityZo */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("mode", this.mode == null ? null : this.mode.toString()); + jsonWriter.writeStringField("standbyAvailabilityZone", this.standbyAvailabilityZone); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of HighAvailability from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HighAvailability 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 HighAvailability. + */ + public static HighAvailability fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + HighAvailability deserializedHighAvailability = new HighAvailability(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("mode".equals(fieldName)) { + deserializedHighAvailability.mode = HighAvailabilityMode.fromString(reader.getString()); + } else if ("state".equals(fieldName)) { + deserializedHighAvailability.state = ServerHAState.fromString(reader.getString()); + } else if ("standbyAvailabilityZone".equals(fieldName)) { + deserializedHighAvailability.standbyAvailabilityZone = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedHighAvailability; + }); + } } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/HighAvailabilityMode.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/HighAvailabilityMode.java index 430dac145ff7c..6158bbda22016 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/HighAvailabilityMode.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/HighAvailabilityMode.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.postgresqlflexibleserver.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -42,7 +41,6 @@ public HighAvailabilityMode() { * @param name a name to look for. * @return the corresponding HighAvailabilityMode. */ - @JsonCreator public static HighAvailabilityMode fromString(String name) { return fromString(name, HighAvailabilityMode.class); } 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 7c3314c7b988d..e552e69843fe2 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 @@ -5,7 +5,6 @@ package com.azure.resourcemanager.postgresqlflexibleserver.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -37,7 +36,6 @@ public IdentityType() { * @param name a name to look for. * @return the corresponding IdentityType. */ - @JsonCreator public static IdentityType fromString(String name) { return fromString(name, IdentityType.class); } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/KeyStatusEnum.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/KeyStatusEnum.java index cf2f652ff4d0a..d985ad1ea7387 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/KeyStatusEnum.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/KeyStatusEnum.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.postgresqlflexibleserver.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -37,7 +36,6 @@ public KeyStatusEnum() { * @param name a name to look for. * @return the corresponding KeyStatusEnum. */ - @JsonCreator public static KeyStatusEnum fromString(String name) { return fromString(name, KeyStatusEnum.class); } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/LogFileListResult.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/LogFileListResult.java index 05ec090bf0430..83517b041fb42 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/LogFileListResult.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/LogFileListResult.java @@ -5,25 +5,27 @@ 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.LogFileInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * A List of logFiles. */ @Fluent -public final class LogFileListResult { +public final class LogFileListResult implements JsonSerializable { /* * The list of logFiles in a server */ - @JsonProperty(value = "value") private List value; /* * The link used to get the next page of operations. */ - @JsonProperty(value = "nextLink") private String nextLink; /** @@ -82,4 +84,44 @@ public void validate() { 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 LogFileListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LogFileListResult 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 LogFileListResult. + */ + public static LogFileListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LogFileListResult deserializedLogFileListResult = new LogFileListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> LogFileInner.fromJson(reader1)); + deserializedLogFileListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedLogFileListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedLogFileListResult; + }); + } } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/LogicalReplicationOnSourceDbEnum.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/LogicalReplicationOnSourceDbEnum.java index 40b72fb2bc98a..20a461a8ba726 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/LogicalReplicationOnSourceDbEnum.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/LogicalReplicationOnSourceDbEnum.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.postgresqlflexibleserver.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -37,7 +36,6 @@ public LogicalReplicationOnSourceDbEnum() { * @param name a name to look for. * @return the corresponding LogicalReplicationOnSourceDbEnum. */ - @JsonCreator public static LogicalReplicationOnSourceDbEnum fromString(String name) { return fromString(name, LogicalReplicationOnSourceDbEnum.class); } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/LtrBackupRequest.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/LtrBackupRequest.java index c18c23df7a0d1..628431d1e55e8 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/LtrBackupRequest.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/LtrBackupRequest.java @@ -6,7 +6,10 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * The request that is made for a long term retention backup. @@ -16,7 +19,6 @@ public final class LtrBackupRequest extends BackupRequestBase { /* * Backup store detail for target server */ - @JsonProperty(value = "targetDetails", required = true) private BackupStoreDetails targetDetails; /** @@ -61,14 +63,60 @@ public LtrBackupRequest withBackupSettings(BackupSettings backupSettings) { */ @Override public void validate() { - super.validate(); if (targetDetails() == null) { throw LOGGER.atError() .log(new IllegalArgumentException("Missing required property targetDetails in model LtrBackupRequest")); } else { targetDetails().validate(); } + if (backupSettings() == null) { + throw LOGGER.atError() + .log( + new IllegalArgumentException("Missing required property backupSettings in model LtrBackupRequest")); + } else { + backupSettings().validate(); + } } private static final ClientLogger LOGGER = new ClientLogger(LtrBackupRequest.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("backupSettings", backupSettings()); + jsonWriter.writeJsonField("targetDetails", this.targetDetails); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LtrBackupRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LtrBackupRequest 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 LtrBackupRequest. + */ + public static LtrBackupRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LtrBackupRequest deserializedLtrBackupRequest = new LtrBackupRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("backupSettings".equals(fieldName)) { + deserializedLtrBackupRequest.withBackupSettings(BackupSettings.fromJson(reader)); + } else if ("targetDetails".equals(fieldName)) { + deserializedLtrBackupRequest.targetDetails = BackupStoreDetails.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedLtrBackupRequest; + }); + } } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/LtrPreBackupRequest.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/LtrPreBackupRequest.java index ca532f0b6bb7b..df8c8c4e8aeb0 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/LtrPreBackupRequest.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/LtrPreBackupRequest.java @@ -5,6 +5,11 @@ package com.azure.resourcemanager.postgresqlflexibleserver.models; import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * A request that is made for pre-backup. @@ -33,6 +38,51 @@ public LtrPreBackupRequest withBackupSettings(BackupSettings backupSettings) { */ @Override public void validate() { - super.validate(); + if (backupSettings() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property backupSettings in model LtrPreBackupRequest")); + } else { + backupSettings().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(LtrPreBackupRequest.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("backupSettings", backupSettings()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LtrPreBackupRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LtrPreBackupRequest 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 LtrPreBackupRequest. + */ + public static LtrPreBackupRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LtrPreBackupRequest deserializedLtrPreBackupRequest = new LtrPreBackupRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("backupSettings".equals(fieldName)) { + deserializedLtrPreBackupRequest.withBackupSettings(BackupSettings.fromJson(reader)); + } else { + reader.skipChildren(); + } + } + + return deserializedLtrPreBackupRequest; + }); } } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/LtrServerBackupOperationList.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/LtrServerBackupOperationList.java index cb3f2be1cba27..f4976b432b295 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/LtrServerBackupOperationList.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/LtrServerBackupOperationList.java @@ -5,25 +5,27 @@ 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.LtrServerBackupOperationInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * A list of long term retention backup operations for server. */ @Fluent -public final class LtrServerBackupOperationList { +public final class LtrServerBackupOperationList implements JsonSerializable { /* * The list of long term retention server backup operations */ - @JsonProperty(value = "value") private List value; /* * The link used to get the next page of operations. */ - @JsonProperty(value = "nextLink") private String nextLink; /** @@ -82,4 +84,45 @@ public void validate() { 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 LtrServerBackupOperationList from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LtrServerBackupOperationList 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 LtrServerBackupOperationList. + */ + public static LtrServerBackupOperationList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LtrServerBackupOperationList deserializedLtrServerBackupOperationList = new LtrServerBackupOperationList(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> LtrServerBackupOperationInner.fromJson(reader1)); + deserializedLtrServerBackupOperationList.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedLtrServerBackupOperationList.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedLtrServerBackupOperationList; + }); + } } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/MaintenanceWindow.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/MaintenanceWindow.java index 2a2dce7321022..7e6bc5c89cf50 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/MaintenanceWindow.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/MaintenanceWindow.java @@ -5,35 +5,35 @@ package com.azure.resourcemanager.postgresqlflexibleserver.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Maintenance window properties of a server. */ @Fluent -public final class MaintenanceWindow { +public final class MaintenanceWindow implements JsonSerializable { /* * indicates whether custom window is enabled or disabled */ - @JsonProperty(value = "customWindow") private String customWindow; /* * start hour for maintenance window */ - @JsonProperty(value = "startHour") private Integer startHour; /* * start minute for maintenance window */ - @JsonProperty(value = "startMinute") private Integer startMinute; /* * day of week for maintenance window */ - @JsonProperty(value = "dayOfWeek") private Integer dayOfWeek; /** @@ -129,4 +129,49 @@ public MaintenanceWindow withDayOfWeek(Integer dayOfWeek) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("customWindow", this.customWindow); + jsonWriter.writeNumberField("startHour", this.startHour); + jsonWriter.writeNumberField("startMinute", this.startMinute); + jsonWriter.writeNumberField("dayOfWeek", this.dayOfWeek); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MaintenanceWindow from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MaintenanceWindow 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 MaintenanceWindow. + */ + public static MaintenanceWindow fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MaintenanceWindow deserializedMaintenanceWindow = new MaintenanceWindow(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("customWindow".equals(fieldName)) { + deserializedMaintenanceWindow.customWindow = reader.getString(); + } else if ("startHour".equals(fieldName)) { + deserializedMaintenanceWindow.startHour = reader.getNullable(JsonReader::getInt); + } else if ("startMinute".equals(fieldName)) { + deserializedMaintenanceWindow.startMinute = reader.getNullable(JsonReader::getInt); + } else if ("dayOfWeek".equals(fieldName)) { + deserializedMaintenanceWindow.dayOfWeek = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedMaintenanceWindow; + }); + } } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/MigrateRolesEnum.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/MigrateRolesEnum.java index 36dc17a233579..ae42c71581ec5 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/MigrateRolesEnum.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/MigrateRolesEnum.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.postgresqlflexibleserver.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -37,7 +36,6 @@ public MigrateRolesEnum() { * @param name a name to look for. * @return the corresponding MigrateRolesEnum. */ - @JsonCreator public static MigrateRolesEnum fromString(String name) { return fromString(name, MigrateRolesEnum.class); } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/MigrationDbState.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/MigrationDbState.java index 9ab36a1d69776..ed842cf5d76a0 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/MigrationDbState.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/MigrationDbState.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.postgresqlflexibleserver.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -57,7 +56,6 @@ public MigrationDbState() { * @param name a name to look for. * @return the corresponding MigrationDbState. */ - @JsonCreator public static MigrationDbState fromString(String name) { return fromString(name, MigrationDbState.class); } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/MigrationListFilter.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/MigrationListFilter.java index ca4944867f08a..df3ec90e51a89 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/MigrationListFilter.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/MigrationListFilter.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.postgresqlflexibleserver.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -37,7 +36,6 @@ public MigrationListFilter() { * @param name a name to look for. * @return the corresponding MigrationListFilter. */ - @JsonCreator public static MigrationListFilter fromString(String name) { return fromString(name, MigrationListFilter.class); } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/MigrationMode.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/MigrationMode.java index cc6d064b63b0a..36d1106492065 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/MigrationMode.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/MigrationMode.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.postgresqlflexibleserver.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -37,7 +36,6 @@ public MigrationMode() { * @param name a name to look for. * @return the corresponding MigrationMode. */ - @JsonCreator public static MigrationMode fromString(String name) { return fromString(name, MigrationMode.class); } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/MigrationNameAvailabilityReason.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/MigrationNameAvailabilityReason.java index 2bffde89fc096..ba4a94d3a6c9d 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/MigrationNameAvailabilityReason.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/MigrationNameAvailabilityReason.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.postgresqlflexibleserver.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -37,7 +36,6 @@ public MigrationNameAvailabilityReason() { * @param name a name to look for. * @return the corresponding MigrationNameAvailabilityReason. */ - @JsonCreator public static MigrationNameAvailabilityReason fromString(String name) { return fromString(name, MigrationNameAvailabilityReason.class); } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/MigrationOption.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/MigrationOption.java index cc39880e38df4..38200446927cb 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/MigrationOption.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/MigrationOption.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.postgresqlflexibleserver.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -42,7 +41,6 @@ public MigrationOption() { * @param name a name to look for. * @return the corresponding MigrationOption. */ - @JsonCreator public static MigrationOption fromString(String name) { return fromString(name, MigrationOption.class); } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/MigrationResource.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/MigrationResource.java index 5171314f3dd44..3f6c745d66748 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 @@ -133,8 +133,8 @@ public interface MigrationResource { String sourceDbServerResourceId(); /** - * Gets the sourceDbServerFullyQualifiedDomainName property: Source server fully qualified domain name or ip. It is - * a optional value, if customer provide it, dms will always use it for connection. + * Gets the sourceDbServerFullyQualifiedDomainName property: Source server fully qualified domain name (FQDN) or IP + * address. It is a optional value, if customer provide it, migration service will always use it for connection. * * @return the sourceDbServerFullyQualifiedDomainName value. */ @@ -148,8 +148,8 @@ public interface MigrationResource { String targetDbServerResourceId(); /** - * Gets the targetDbServerFullyQualifiedDomainName property: Target server fully qualified domain name or ip. It is - * a optional value, if customer provide it, dms will always use it for connection. + * Gets the targetDbServerFullyQualifiedDomainName property: Target server fully qualified domain name (FQDN) or IP + * address. It is a optional value, if customer provide it, migration service will always use it for connection. * * @return the targetDbServerFullyQualifiedDomainName value. */ @@ -463,10 +463,12 @@ interface WithSourceDbServerResourceId { interface WithSourceDbServerFullyQualifiedDomainName { /** * Specifies the sourceDbServerFullyQualifiedDomainName property: Source server fully qualified domain name - * or ip. It is a optional value, if customer provide it, dms will always use it for connection. + * (FQDN) or IP address. It is a optional value, if customer provide it, migration service will always use + * it for connection. * - * @param sourceDbServerFullyQualifiedDomainName Source server fully qualified domain name or ip. It is a - * optional value, if customer provide it, dms will always use it for connection. + * @param sourceDbServerFullyQualifiedDomainName Source server fully qualified domain name (FQDN) or IP + * address. It is a optional value, if customer provide it, migration service will always use it for + * connection. * @return the next definition stage. */ WithCreate withSourceDbServerFullyQualifiedDomainName(String sourceDbServerFullyQualifiedDomainName); @@ -478,10 +480,12 @@ interface WithSourceDbServerFullyQualifiedDomainName { interface WithTargetDbServerFullyQualifiedDomainName { /** * Specifies the targetDbServerFullyQualifiedDomainName property: Target server fully qualified domain name - * or ip. It is a optional value, if customer provide it, dms will always use it for connection. + * (FQDN) or IP address. It is a optional value, if customer provide it, migration service will always use + * it for connection. * - * @param targetDbServerFullyQualifiedDomainName Target server fully qualified domain name or ip. It is a - * optional value, if customer provide it, dms will always use it for connection. + * @param targetDbServerFullyQualifiedDomainName Target server fully qualified domain name (FQDN) or IP + * address. It is a optional value, if customer provide it, migration service will always use it for + * connection. * @return the next definition stage. */ WithCreate withTargetDbServerFullyQualifiedDomainName(String targetDbServerFullyQualifiedDomainName); @@ -726,10 +730,12 @@ interface WithSourceDbServerResourceId { interface WithSourceDbServerFullyQualifiedDomainName { /** * Specifies the sourceDbServerFullyQualifiedDomainName property: Source server fully qualified domain name - * or ip. It is a optional value, if customer provide it, dms will always use it for connection. + * (FQDN) or IP address. It is a optional value, if customer provide it, migration service will always use + * it for connection. * - * @param sourceDbServerFullyQualifiedDomainName Source server fully qualified domain name or ip. It is a - * optional value, if customer provide it, dms will always use it for connection. + * @param sourceDbServerFullyQualifiedDomainName Source server fully qualified domain name (FQDN) or IP + * address. It is a optional value, if customer provide it, migration service will always use it for + * connection. * @return the next definition stage. */ Update withSourceDbServerFullyQualifiedDomainName(String sourceDbServerFullyQualifiedDomainName); @@ -741,10 +747,12 @@ interface WithSourceDbServerFullyQualifiedDomainName { interface WithTargetDbServerFullyQualifiedDomainName { /** * Specifies the targetDbServerFullyQualifiedDomainName property: Target server fully qualified domain name - * or ip. It is a optional value, if customer provide it, dms will always use it for connection. + * (FQDN) or IP address. It is a optional value, if customer provide it, migration service will always use + * it for connection. * - * @param targetDbServerFullyQualifiedDomainName Target server fully qualified domain name or ip. It is a - * optional value, if customer provide it, dms will always use it for connection. + * @param targetDbServerFullyQualifiedDomainName Target server fully qualified domain name (FQDN) or IP + * address. It is a optional value, if customer provide it, migration service will always use it for + * connection. * @return the next definition stage. */ Update withTargetDbServerFullyQualifiedDomainName(String targetDbServerFullyQualifiedDomainName); diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/MigrationResourceForPatch.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/MigrationResourceForPatch.java index 1aa8f61c1a5ed..b8b0e86a95a7d 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/MigrationResourceForPatch.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/MigrationResourceForPatch.java @@ -5,9 +5,12 @@ 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.MigrationResourcePropertiesForPatch; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.time.OffsetDateTime; import java.util.List; import java.util.Map; @@ -16,18 +19,15 @@ * Represents a migration resource for patch. */ @Fluent -public final class MigrationResourceForPatch { +public final class MigrationResourceForPatch implements JsonSerializable { /* * Migration resource properties. */ - @JsonProperty(value = "properties") private MigrationResourcePropertiesForPatch innerProperties; /* * Application-specific metadata in the form of key-value pairs. */ - @JsonProperty(value = "tags") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; /** @@ -89,8 +89,8 @@ public MigrationResourceForPatch withSourceDbServerResourceId(String sourceDbSer } /** - * Get the sourceDbServerFullyQualifiedDomainName property: Source server fully qualified domain name or ip. It is a - * optional value, if customer provide it, dms will always use it for connection. + * Get the sourceDbServerFullyQualifiedDomainName property: Source server fully qualified domain name (FQDN) or IP + * address. It is a optional value, if customer provide it, migration service will always use it for connection. * * @return the sourceDbServerFullyQualifiedDomainName value. */ @@ -99,8 +99,8 @@ public String sourceDbServerFullyQualifiedDomainName() { } /** - * Set the sourceDbServerFullyQualifiedDomainName property: Source server fully qualified domain name or ip. It is a - * optional value, if customer provide it, dms will always use it for connection. + * Set the sourceDbServerFullyQualifiedDomainName property: Source server fully qualified domain name (FQDN) or IP + * address. It is a optional value, if customer provide it, migration service will always use it for connection. * * @param sourceDbServerFullyQualifiedDomainName the sourceDbServerFullyQualifiedDomainName value to set. * @return the MigrationResourceForPatch object itself. @@ -115,8 +115,8 @@ public String sourceDbServerFullyQualifiedDomainName() { } /** - * Get the targetDbServerFullyQualifiedDomainName property: Target server fully qualified domain name or ip. It is a - * optional value, if customer provide it, dms will always use it for connection. + * Get the targetDbServerFullyQualifiedDomainName property: Target server fully qualified domain name (FQDN) or IP + * address. It is a optional value, if customer provide it, migration service will always use it for connection. * * @return the targetDbServerFullyQualifiedDomainName value. */ @@ -125,8 +125,8 @@ public String targetDbServerFullyQualifiedDomainName() { } /** - * Set the targetDbServerFullyQualifiedDomainName property: Target server fully qualified domain name or ip. It is a - * optional value, if customer provide it, dms will always use it for connection. + * Set the targetDbServerFullyQualifiedDomainName property: Target server fully qualified domain name (FQDN) or IP + * address. It is a optional value, if customer provide it, migration service will always use it for connection. * * @param targetDbServerFullyQualifiedDomainName the targetDbServerFullyQualifiedDomainName value to set. * @return the MigrationResourceForPatch object itself. @@ -439,4 +439,45 @@ public void validate() { innerProperties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MigrationResourceForPatch from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MigrationResourceForPatch 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 MigrationResourceForPatch. + */ + public static MigrationResourceForPatch fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MigrationResourceForPatch deserializedMigrationResourceForPatch = new MigrationResourceForPatch(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("properties".equals(fieldName)) { + deserializedMigrationResourceForPatch.innerProperties + = MigrationResourcePropertiesForPatch.fromJson(reader); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedMigrationResourceForPatch.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedMigrationResourceForPatch; + }); + } } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/MigrationResourceListResult.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/MigrationResourceListResult.java index 00b91107eba83..bc9e2a934a56e 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/MigrationResourceListResult.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/MigrationResourceListResult.java @@ -5,25 +5,27 @@ 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.MigrationResourceInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * A list of migration resources. */ @Immutable -public final class MigrationResourceListResult { +public final class MigrationResourceListResult implements JsonSerializable { /* * A list of migration resources. */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) private List value; /* * The link used to get the next page of migrations. */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; /** @@ -60,4 +62,43 @@ public void validate() { value().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MigrationResourceListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MigrationResourceListResult 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 MigrationResourceListResult. + */ + public static MigrationResourceListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MigrationResourceListResult deserializedMigrationResourceListResult = new MigrationResourceListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> MigrationResourceInner.fromJson(reader1)); + deserializedMigrationResourceListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedMigrationResourceListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedMigrationResourceListResult; + }); + } } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/MigrationSecretParameters.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/MigrationSecretParameters.java index 5ec643ed2abf0..853d1b6d87a4d 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/MigrationSecretParameters.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/MigrationSecretParameters.java @@ -6,29 +6,30 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Migration secret parameters. */ @Fluent -public final class MigrationSecretParameters { +public final class MigrationSecretParameters implements JsonSerializable { /* * Admin credentials for source and target servers */ - @JsonProperty(value = "adminCredentials") private AdminCredentials adminCredentials; /* * Gets or sets the username for the source server. This user need not be an admin. */ - @JsonProperty(value = "sourceServerUsername") private String sourceServerUsername; /* * Gets or sets the username for the target server. This user need not be an admin. */ - @JsonProperty(value = "targetServerUsername") private String targetServerUsername; /** @@ -117,4 +118,47 @@ public void validate() { } private static final ClientLogger LOGGER = new ClientLogger(MigrationSecretParameters.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("adminCredentials", this.adminCredentials); + jsonWriter.writeStringField("sourceServerUsername", this.sourceServerUsername); + jsonWriter.writeStringField("targetServerUsername", this.targetServerUsername); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MigrationSecretParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MigrationSecretParameters 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 MigrationSecretParameters. + */ + public static MigrationSecretParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MigrationSecretParameters deserializedMigrationSecretParameters = new MigrationSecretParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("adminCredentials".equals(fieldName)) { + deserializedMigrationSecretParameters.adminCredentials = AdminCredentials.fromJson(reader); + } else if ("sourceServerUsername".equals(fieldName)) { + deserializedMigrationSecretParameters.sourceServerUsername = reader.getString(); + } else if ("targetServerUsername".equals(fieldName)) { + deserializedMigrationSecretParameters.targetServerUsername = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedMigrationSecretParameters; + }); + } } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/MigrationState.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/MigrationState.java index eb2aa610dc02c..096b4722de9ac 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/MigrationState.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/MigrationState.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.postgresqlflexibleserver.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -62,7 +61,6 @@ public MigrationState() { * @param name a name to look for. * @return the corresponding MigrationState. */ - @JsonCreator public static MigrationState fromString(String name) { return fromString(name, MigrationState.class); } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/MigrationStatus.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/MigrationStatus.java index 09912e72477a0..8843c803a219a 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/MigrationStatus.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/MigrationStatus.java @@ -5,29 +5,30 @@ package com.azure.resourcemanager.postgresqlflexibleserver.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Migration status. */ @Immutable -public final class MigrationStatus { +public final class MigrationStatus implements JsonSerializable { /* * State of migration */ - @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) private MigrationState state; /* * Error message, if any, for the migration state */ - @JsonProperty(value = "error", access = JsonProperty.Access.WRITE_ONLY) private String error; /* * Current Migration sub state details. */ - @JsonProperty(value = "currentSubStateDetails", access = JsonProperty.Access.WRITE_ONLY) private MigrationSubStateDetails currentSubStateDetails; /** @@ -73,4 +74,43 @@ public void validate() { currentSubStateDetails().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MigrationStatus from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MigrationStatus 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 MigrationStatus. + */ + public static MigrationStatus fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MigrationStatus deserializedMigrationStatus = new MigrationStatus(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("state".equals(fieldName)) { + deserializedMigrationStatus.state = MigrationState.fromString(reader.getString()); + } else if ("error".equals(fieldName)) { + deserializedMigrationStatus.error = reader.getString(); + } else if ("currentSubStateDetails".equals(fieldName)) { + deserializedMigrationStatus.currentSubStateDetails = MigrationSubStateDetails.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedMigrationStatus; + }); + } } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/MigrationSubState.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/MigrationSubState.java index c7144b52af36d..71838f0431b8a 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/MigrationSubState.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/MigrationSubState.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.postgresqlflexibleserver.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -93,7 +92,6 @@ public MigrationSubState() { * @param name a name to look for. * @return the corresponding MigrationSubState. */ - @JsonCreator public static MigrationSubState fromString(String name) { return fromString(name, MigrationSubState.class); } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/MigrationSubStateDetails.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/MigrationSubStateDetails.java index a4322dc8c7606..2fcb3f0d63f46 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/MigrationSubStateDetails.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/MigrationSubStateDetails.java @@ -5,32 +5,31 @@ package com.azure.resourcemanager.postgresqlflexibleserver.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; +import 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.util.Map; /** * Migration sub state details. */ @Fluent -public final class MigrationSubStateDetails { +public final class MigrationSubStateDetails implements JsonSerializable { /* * Migration sub state. */ - @JsonProperty(value = "currentSubState", access = JsonProperty.Access.WRITE_ONLY) private MigrationSubState currentSubState; /* * Dictionary of */ - @JsonProperty(value = "dbDetails") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map dbDetails; /* * Details for the validation for migration */ - @JsonProperty(value = "validationDetails") private ValidationDetails validationDetails; /** @@ -105,4 +104,48 @@ public void validate() { validationDetails().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("dbDetails", this.dbDetails, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("validationDetails", this.validationDetails); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MigrationSubStateDetails from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MigrationSubStateDetails 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 MigrationSubStateDetails. + */ + public static MigrationSubStateDetails fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MigrationSubStateDetails deserializedMigrationSubStateDetails = new MigrationSubStateDetails(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("currentSubState".equals(fieldName)) { + deserializedMigrationSubStateDetails.currentSubState + = MigrationSubState.fromString(reader.getString()); + } else if ("dbDetails".equals(fieldName)) { + Map dbDetails + = reader.readMap(reader1 -> DbMigrationStatus.fromJson(reader1)); + deserializedMigrationSubStateDetails.dbDetails = dbDetails; + } else if ("validationDetails".equals(fieldName)) { + deserializedMigrationSubStateDetails.validationDetails = ValidationDetails.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedMigrationSubStateDetails; + }); + } } 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 deleted file mode 100644 index b712e3554f446..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/NameProperty.java +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresqlflexibleserver.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * Name property for quota usage. - */ -@Fluent -public final class NameProperty { - /* - * Name value - */ - @JsonProperty(value = "value") - private String value; - - /* - * Localized name - */ - @JsonProperty(value = "localizedValue") - private String localizedValue; - - /** - * Creates an instance of NameProperty class. - */ - public NameProperty() { - } - - /** - * Get the value property: Name value. - * - * @return the value value. - */ - public String value() { - return this.value; - } - - /** - * Set the value property: Name value. - * - * @param value the value value to set. - * @return the NameProperty object itself. - */ - public NameProperty withValue(String value) { - this.value = value; - return this; - } - - /** - * Get the localizedValue property: Localized name. - * - * @return the localizedValue value. - */ - public String localizedValue() { - return this.localizedValue; - } - - /** - * Set the localizedValue property: Localized name. - * - * @param localizedValue the localizedValue value to set. - * @return the NameProperty object itself. - */ - public NameProperty withLocalizedValue(String localizedValue) { - this.localizedValue = localizedValue; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/Network.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/Network.java index a54927349dec0..cc9b4a861b563 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/Network.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/Network.java @@ -5,29 +5,34 @@ package com.azure.resourcemanager.postgresqlflexibleserver.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Network properties of a server. */ @Fluent -public final class Network { +public final class Network implements JsonSerializable { /* * public network access is enabled or not */ - @JsonProperty(value = "publicNetworkAccess") private ServerPublicNetworkAccessState publicNetworkAccess; /* - * Delegated subnet arm resource id. This is required to be passed during create, in case we want the server to be VNET injected, i.e. Private access server. During update, pass this only if we want to update the value for Private DNS zone. + * Delegated subnet arm resource id. This is required to be passed during create, in case we want the server to be + * VNET injected, i.e. Private access server. During update, pass this only if we want to update the value for + * Private DNS zone. */ - @JsonProperty(value = "delegatedSubnetResourceId") private String delegatedSubnetResourceId; /* - * Private dns zone arm resource id. This is required to be passed during create, in case we want the server to be VNET injected, i.e. Private access server. During update, pass this only if we want to update the value for Private DNS zone. + * Private dns zone arm resource id. This is required to be passed during create, in case we want the server to be + * VNET injected, i.e. Private access server. During update, pass this only if we want to update the value for + * Private DNS zone. */ - @JsonProperty(value = "privateDnsZoneArmResourceId") private String privateDnsZoneArmResourceId; /** @@ -111,4 +116,48 @@ public Network withPrivateDnsZoneArmResourceId(String privateDnsZoneArmResourceI */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("publicNetworkAccess", + this.publicNetworkAccess == null ? null : this.publicNetworkAccess.toString()); + jsonWriter.writeStringField("delegatedSubnetResourceId", this.delegatedSubnetResourceId); + jsonWriter.writeStringField("privateDnsZoneArmResourceId", this.privateDnsZoneArmResourceId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Network from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Network 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 Network. + */ + public static Network fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Network deserializedNetwork = new Network(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("publicNetworkAccess".equals(fieldName)) { + deserializedNetwork.publicNetworkAccess + = ServerPublicNetworkAccessState.fromString(reader.getString()); + } else if ("delegatedSubnetResourceId".equals(fieldName)) { + deserializedNetwork.delegatedSubnetResourceId = reader.getString(); + } else if ("privateDnsZoneArmResourceId".equals(fieldName)) { + deserializedNetwork.privateDnsZoneArmResourceId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedNetwork; + }); + } } 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 10a8d9ca5f99e..2a754a896d969 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 @@ -5,7 +5,6 @@ package com.azure.resourcemanager.postgresqlflexibleserver.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -38,7 +37,6 @@ public OnlineResizeSupportedEnum() { * @param name a name to look for. * @return the corresponding OnlineResizeSupportedEnum. */ - @JsonCreator public static OnlineResizeSupportedEnum fromString(String name) { return fromString(name, OnlineResizeSupportedEnum.class); } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/Operation.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/Operation.java index a68e8feb54222..bc78e30472af8 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/Operation.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/Operation.java @@ -5,44 +5,41 @@ package com.azure.resourcemanager.postgresqlflexibleserver.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; +import 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.util.Map; /** * REST API operation definition. */ @Fluent -public final class Operation { +public final class Operation implements JsonSerializable { /* * The name of the operation being performed on this particular object. */ - @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) private String name; /* * The localized display information for this particular operation or action. */ - @JsonProperty(value = "display", access = JsonProperty.Access.WRITE_ONLY) private OperationDisplay display; /* * Indicates whether the operation is a data action */ - @JsonProperty(value = "isDataAction") private Boolean isDataAction; /* * The intended executor of the operation. */ - @JsonProperty(value = "origin", access = JsonProperty.Access.WRITE_ONLY) private OperationOrigin origin; /* * Additional descriptions for the operation. */ - @JsonProperty(value = "properties", access = JsonProperty.Access.WRITE_ONLY) - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map properties; /** @@ -117,4 +114,49 @@ public void validate() { display().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("isDataAction", this.isDataAction); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Operation from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Operation 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 Operation. + */ + public static Operation fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Operation deserializedOperation = new Operation(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedOperation.name = reader.getString(); + } else if ("display".equals(fieldName)) { + deserializedOperation.display = OperationDisplay.fromJson(reader); + } else if ("isDataAction".equals(fieldName)) { + deserializedOperation.isDataAction = reader.getNullable(JsonReader::getBoolean); + } else if ("origin".equals(fieldName)) { + deserializedOperation.origin = OperationOrigin.fromString(reader.getString()); + } else if ("properties".equals(fieldName)) { + Map properties = reader.readMap(reader1 -> reader1.readUntyped()); + deserializedOperation.properties = properties; + } else { + reader.skipChildren(); + } + } + + return deserializedOperation; + }); + } } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/OperationDisplay.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/OperationDisplay.java index cd19e31ac31a1..5b22250f12e8a 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/OperationDisplay.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/OperationDisplay.java @@ -5,35 +5,35 @@ package com.azure.resourcemanager.postgresqlflexibleserver.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Display metadata associated with the operation. */ @Immutable -public final class OperationDisplay { +public final class OperationDisplay implements JsonSerializable { /* * Operation resource provider name. */ - @JsonProperty(value = "provider", access = JsonProperty.Access.WRITE_ONLY) private String provider; /* * Resource on which the operation is performed. */ - @JsonProperty(value = "resource", access = JsonProperty.Access.WRITE_ONLY) private String resource; /* * Localized friendly name for the operation. */ - @JsonProperty(value = "operation", access = JsonProperty.Access.WRITE_ONLY) private String operation; /* * Operation description. */ - @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) private String description; /** @@ -85,4 +85,45 @@ public String description() { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OperationDisplay from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationDisplay 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 OperationDisplay. + */ + public static OperationDisplay fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationDisplay deserializedOperationDisplay = new OperationDisplay(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provider".equals(fieldName)) { + deserializedOperationDisplay.provider = reader.getString(); + } else if ("resource".equals(fieldName)) { + deserializedOperationDisplay.resource = reader.getString(); + } else if ("operation".equals(fieldName)) { + deserializedOperationDisplay.operation = reader.getString(); + } else if ("description".equals(fieldName)) { + deserializedOperationDisplay.description = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedOperationDisplay; + }); + } } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/OperationOrigin.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/OperationOrigin.java index 8e943016cb268..3b04d1469f676 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/OperationOrigin.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/OperationOrigin.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.postgresqlflexibleserver.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -42,7 +41,6 @@ public OperationOrigin() { * @param name a name to look for. * @return the corresponding OperationOrigin. */ - @JsonCreator public static OperationOrigin fromString(String name) { return fromString(name, OperationOrigin.class); } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/Origin.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/Origin.java index 9be88659f90de..e7d922b5db807 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/Origin.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/Origin.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.postgresqlflexibleserver.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -17,6 +16,11 @@ public final class Origin extends ExpandableStringEnum { */ public static final Origin FULL = fromString("Full"); + /** + * Static value Customer On-Demand for Origin. + */ + public static final Origin CUSTOMER_ON_DEMAND = fromString("Customer On-Demand"); + /** * Creates a new instance of Origin value. * @@ -32,7 +36,6 @@ public Origin() { * @param name a name to look for. * @return the corresponding Origin. */ - @JsonCreator public static Origin fromString(String name) { return fromString(name, Origin.class); } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/OverwriteDbsInTargetEnum.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/OverwriteDbsInTargetEnum.java index 59336eebbe55d..98675472ec450 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/OverwriteDbsInTargetEnum.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/OverwriteDbsInTargetEnum.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.postgresqlflexibleserver.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -38,7 +37,6 @@ public OverwriteDbsInTargetEnum() { * @param name a name to look for. * @return the corresponding OverwriteDbsInTargetEnum. */ - @JsonCreator public static OverwriteDbsInTargetEnum fromString(String name) { return fromString(name, OverwriteDbsInTargetEnum.class); } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/PasswordAuthEnum.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/PasswordAuthEnum.java index c1af34cb25642..51301b7a1c717 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/PasswordAuthEnum.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/PasswordAuthEnum.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.postgresqlflexibleserver.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -37,7 +36,6 @@ public PasswordAuthEnum() { * @param name a name to look for. * @return the corresponding PasswordAuthEnum. */ - @JsonCreator public static PasswordAuthEnum fromString(String name) { return fromString(name, PasswordAuthEnum.class); } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/PrincipalType.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/PrincipalType.java index 7cc55e501a1c9..3303e6a29c14f 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/PrincipalType.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/PrincipalType.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.postgresqlflexibleserver.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -47,7 +46,6 @@ public PrincipalType() { * @param name a name to look for. * @return the corresponding PrincipalType. */ - @JsonCreator public static PrincipalType fromString(String name) { return fromString(name, PrincipalType.class); } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/PrivateEndpoint.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/PrivateEndpoint.java index 886e4583b8f31..b9e02f2cb6123 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/PrivateEndpoint.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/PrivateEndpoint.java @@ -5,17 +5,20 @@ package com.azure.resourcemanager.postgresqlflexibleserver.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +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 private endpoint resource. */ @Immutable -public final class PrivateEndpoint { +public final class PrivateEndpoint implements JsonSerializable { /* * The ARM identifier for private endpoint. */ - @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) private String id; /** @@ -40,4 +43,39 @@ public String id() { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateEndpoint from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateEndpoint 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 PrivateEndpoint. + */ + public static PrivateEndpoint fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateEndpoint deserializedPrivateEndpoint = new PrivateEndpoint(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedPrivateEndpoint.id = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateEndpoint; + }); + } } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/PrivateEndpointConnectionListResult.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/PrivateEndpointConnectionListResult.java index a2cc96cafd387..14523227de143 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/PrivateEndpointConnectionListResult.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/PrivateEndpointConnectionListResult.java @@ -5,25 +5,28 @@ 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.PrivateEndpointConnectionInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * A list of private endpoint connections. */ @Immutable -public final class PrivateEndpointConnectionListResult { +public final class PrivateEndpointConnectionListResult + implements JsonSerializable { /* * Array of results. */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) private List value; /* * The URL to get the next set of results. */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; /** @@ -60,4 +63,44 @@ public void validate() { value().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateEndpointConnectionListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateEndpointConnectionListResult 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 PrivateEndpointConnectionListResult. + */ + public static PrivateEndpointConnectionListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateEndpointConnectionListResult deserializedPrivateEndpointConnectionListResult + = new PrivateEndpointConnectionListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> PrivateEndpointConnectionInner.fromJson(reader1)); + deserializedPrivateEndpointConnectionListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedPrivateEndpointConnectionListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateEndpointConnectionListResult; + }); + } } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/PrivateEndpointConnectionProvisioningState.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/PrivateEndpointConnectionProvisioningState.java index 63881479d3fe7..104ef98f5347b 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/PrivateEndpointConnectionProvisioningState.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/PrivateEndpointConnectionProvisioningState.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.postgresqlflexibleserver.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -48,7 +47,6 @@ public PrivateEndpointConnectionProvisioningState() { * @param name a name to look for. * @return the corresponding PrivateEndpointConnectionProvisioningState. */ - @JsonCreator public static PrivateEndpointConnectionProvisioningState fromString(String name) { return fromString(name, PrivateEndpointConnectionProvisioningState.class); } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/PrivateEndpointServiceConnectionStatus.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/PrivateEndpointServiceConnectionStatus.java index d99d72f3ce41e..19f7edb576b0c 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/PrivateEndpointServiceConnectionStatus.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/PrivateEndpointServiceConnectionStatus.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.postgresqlflexibleserver.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -43,7 +42,6 @@ public PrivateEndpointServiceConnectionStatus() { * @param name a name to look for. * @return the corresponding PrivateEndpointServiceConnectionStatus. */ - @JsonCreator public static PrivateEndpointServiceConnectionStatus fromString(String name) { return fromString(name, PrivateEndpointServiceConnectionStatus.class); } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/PrivateLinkResourceListResult.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/PrivateLinkResourceListResult.java index f1e2a4ce3ff3f..5dc1a8b2446f4 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/PrivateLinkResourceListResult.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/PrivateLinkResourceListResult.java @@ -5,25 +5,27 @@ 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.PrivateLinkResourceInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * A list of private link resources. */ @Immutable -public final class PrivateLinkResourceListResult { +public final class PrivateLinkResourceListResult implements JsonSerializable { /* * Array of results. */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) private List value; /* * Link to retrieve next page of results. */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; /** @@ -60,4 +62,44 @@ public void validate() { value().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateLinkResourceListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateLinkResourceListResult 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 PrivateLinkResourceListResult. + */ + public static PrivateLinkResourceListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateLinkResourceListResult deserializedPrivateLinkResourceListResult + = new PrivateLinkResourceListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> PrivateLinkResourceInner.fromJson(reader1)); + deserializedPrivateLinkResourceListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedPrivateLinkResourceListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateLinkResourceListResult; + }); + } } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/PrivateLinkServiceConnectionState.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/PrivateLinkServiceConnectionState.java index a93cb64b35441..63efa0ff6394b 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/PrivateLinkServiceConnectionState.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/PrivateLinkServiceConnectionState.java @@ -5,29 +5,30 @@ package com.azure.resourcemanager.postgresqlflexibleserver.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * A collection of information about the state of the connection between service consumer and provider. */ @Fluent -public final class PrivateLinkServiceConnectionState { +public final class PrivateLinkServiceConnectionState implements JsonSerializable { /* * Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. */ - @JsonProperty(value = "status") private PrivateEndpointServiceConnectionStatus status; /* * The reason for approval/rejection of the connection. */ - @JsonProperty(value = "description") private String description; /* * A message indicating if changes on the service provider require any updates on the consumer. */ - @JsonProperty(value = "actionsRequired") private String actionsRequired; /** @@ -107,4 +108,48 @@ public PrivateLinkServiceConnectionState withActionsRequired(String actionsRequi */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeStringField("actionsRequired", this.actionsRequired); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateLinkServiceConnectionState from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateLinkServiceConnectionState 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 PrivateLinkServiceConnectionState. + */ + public static PrivateLinkServiceConnectionState fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateLinkServiceConnectionState deserializedPrivateLinkServiceConnectionState + = new PrivateLinkServiceConnectionState(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("status".equals(fieldName)) { + deserializedPrivateLinkServiceConnectionState.status + = PrivateEndpointServiceConnectionStatus.fromString(reader.getString()); + } else if ("description".equals(fieldName)) { + deserializedPrivateLinkServiceConnectionState.description = reader.getString(); + } else if ("actionsRequired".equals(fieldName)) { + deserializedPrivateLinkServiceConnectionState.actionsRequired = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateLinkServiceConnectionState; + }); + } } 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 deleted file mode 100644 index 42fc8e3aba599..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/QuotaUsage.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.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 deleted file mode 100644 index b2243c0d47237..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/QuotaUsages.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.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 deleted file mode 100644 index fab5f9ca714b0..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/QuotaUsagesListResult.java +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresqlflexibleserver.models; - -import com.azure.core.annotation.Immutable; -import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.QuotaUsageInner; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** - * Capability for the PostgreSQL server. - */ -@Immutable -public final class QuotaUsagesListResult { - /* - * A list of quota usages. - */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) - private List value; - - /* - * Link to retrieve next page of results. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * Creates an instance of QuotaUsagesListResult class. - */ - public QuotaUsagesListResult() { - } - - /** - * Get the value property: A list of quota usages. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: Link to retrieve next page of results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ReadReplicaPromoteMode.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ReadReplicaPromoteMode.java index ebbbd6a7298b7..dab7f7eff01b8 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ReadReplicaPromoteMode.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ReadReplicaPromoteMode.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.postgresqlflexibleserver.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -37,7 +36,6 @@ public ReadReplicaPromoteMode() { * @param name a name to look for. * @return the corresponding ReadReplicaPromoteMode. */ - @JsonCreator public static ReadReplicaPromoteMode fromString(String name) { return fromString(name, ReadReplicaPromoteMode.class); } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/Replica.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/Replica.java index fc90ec3d46b5b..d0805d9180c53 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/Replica.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/Replica.java @@ -5,41 +5,41 @@ package com.azure.resourcemanager.postgresqlflexibleserver.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Replica properties of a server. */ @Fluent -public final class Replica { +public final class Replica implements JsonSerializable { /* * Used to indicate role of the server in replication set. */ - @JsonProperty(value = "role") private ReplicationRole role; /* * Replicas allowed for a server. */ - @JsonProperty(value = "capacity", access = JsonProperty.Access.WRITE_ONLY) private Integer capacity; /* - * Gets the replication state of a replica server. This property is returned only for replicas api call. Supported values are Active, Catchup, Provisioning, Updating, Broken, Reconfiguring + * Gets the replication state of a replica server. This property is returned only for replicas api call. Supported + * values are Active, Catchup, Provisioning, Updating, Broken, Reconfiguring */ - @JsonProperty(value = "replicationState", access = JsonProperty.Access.WRITE_ONLY) private ReplicationState replicationState; /* * Sets the promote mode for a replica server. This is a write only property. */ - @JsonProperty(value = "promoteMode") private ReadReplicaPromoteMode promoteMode; /* * Sets the promote options for a replica server. This is a write only property. */ - @JsonProperty(value = "promoteOption") private ReplicationPromoteOption promoteOption; /** @@ -134,4 +134,50 @@ public Replica withPromoteOption(ReplicationPromoteOption promoteOption) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("role", this.role == null ? null : this.role.toString()); + jsonWriter.writeStringField("promoteMode", this.promoteMode == null ? null : this.promoteMode.toString()); + jsonWriter.writeStringField("promoteOption", this.promoteOption == null ? null : this.promoteOption.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Replica from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Replica 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 Replica. + */ + public static Replica fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Replica deserializedReplica = new Replica(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("role".equals(fieldName)) { + deserializedReplica.role = ReplicationRole.fromString(reader.getString()); + } else if ("capacity".equals(fieldName)) { + deserializedReplica.capacity = reader.getNullable(JsonReader::getInt); + } else if ("replicationState".equals(fieldName)) { + deserializedReplica.replicationState = ReplicationState.fromString(reader.getString()); + } else if ("promoteMode".equals(fieldName)) { + deserializedReplica.promoteMode = ReadReplicaPromoteMode.fromString(reader.getString()); + } else if ("promoteOption".equals(fieldName)) { + deserializedReplica.promoteOption = ReplicationPromoteOption.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedReplica; + }); + } } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ReplicationPromoteOption.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ReplicationPromoteOption.java index 0b2463d7a0f39..a8937dbd5ed93 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ReplicationPromoteOption.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ReplicationPromoteOption.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.postgresqlflexibleserver.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -37,7 +36,6 @@ public ReplicationPromoteOption() { * @param name a name to look for. * @return the corresponding ReplicationPromoteOption. */ - @JsonCreator public static ReplicationPromoteOption fromString(String name) { return fromString(name, ReplicationPromoteOption.class); } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ReplicationRole.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ReplicationRole.java index 5a2c6f6c3e102..ae7f74ce47178 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ReplicationRole.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ReplicationRole.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.postgresqlflexibleserver.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -47,7 +46,6 @@ public ReplicationRole() { * @param name a name to look for. * @return the corresponding ReplicationRole. */ - @JsonCreator public static ReplicationRole fromString(String name) { return fromString(name, ReplicationRole.class); } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ReplicationState.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ReplicationState.java index f142df0481d35..1b71b1d08b40e 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ReplicationState.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ReplicationState.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.postgresqlflexibleserver.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -58,7 +57,6 @@ public ReplicationState() { * @param name a name to look for. * @return the corresponding ReplicationState. */ - @JsonCreator public static ReplicationState fromString(String name) { return fromString(name, ReplicationState.class); } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/RestartParameter.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/RestartParameter.java index d4bb1051787ab..9a459e14d9217 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/RestartParameter.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/RestartParameter.java @@ -5,23 +5,25 @@ package com.azure.resourcemanager.postgresqlflexibleserver.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Represents server restart parameters. */ @Fluent -public final class RestartParameter { +public final class RestartParameter implements JsonSerializable { /* * Indicates whether to restart the server with failover. */ - @JsonProperty(value = "restartWithFailover") private Boolean restartWithFailover; /* * Failover mode. */ - @JsonProperty(value = "failoverMode") private FailoverMode failoverMode; /** @@ -77,4 +79,43 @@ public RestartParameter withFailoverMode(FailoverMode failoverMode) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("restartWithFailover", this.restartWithFailover); + jsonWriter.writeStringField("failoverMode", this.failoverMode == null ? null : this.failoverMode.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RestartParameter from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RestartParameter 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 RestartParameter. + */ + public static RestartParameter fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RestartParameter deserializedRestartParameter = new RestartParameter(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("restartWithFailover".equals(fieldName)) { + deserializedRestartParameter.restartWithFailover = reader.getNullable(JsonReader::getBoolean); + } else if ("failoverMode".equals(fieldName)) { + deserializedRestartParameter.failoverMode = FailoverMode.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedRestartParameter; + }); + } } 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 39eb8903137b8..7e9d344449f3e 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 @@ -5,7 +5,6 @@ package com.azure.resourcemanager.postgresqlflexibleserver.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -38,7 +37,6 @@ public RestrictedEnum() { * @param name a name to look for. * @return the corresponding RestrictedEnum. */ - @JsonCreator public static RestrictedEnum fromString(String name) { return fromString(name, RestrictedEnum.class); } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/Server.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/Server.java index c88d5edd2b9fe..651c795fa2b88 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 @@ -577,10 +577,11 @@ interface WithCreateMode { * The template for Server update. */ interface Update extends UpdateStages.WithTags, UpdateStages.WithSku, UpdateStages.WithIdentity, - UpdateStages.WithAdministratorLoginPassword, UpdateStages.WithVersion, UpdateStages.WithStorage, - UpdateStages.WithBackup, UpdateStages.WithHighAvailability, UpdateStages.WithMaintenanceWindow, - UpdateStages.WithAuthConfig, UpdateStages.WithDataEncryption, UpdateStages.WithCreateMode, - UpdateStages.WithReplicationRole, UpdateStages.WithReplica, UpdateStages.WithNetwork { + UpdateStages.WithAdministratorLogin, UpdateStages.WithAdministratorLoginPassword, UpdateStages.WithVersion, + UpdateStages.WithStorage, UpdateStages.WithBackup, UpdateStages.WithHighAvailability, + UpdateStages.WithMaintenanceWindow, UpdateStages.WithAuthConfig, UpdateStages.WithDataEncryption, + UpdateStages.WithCreateMode, UpdateStages.WithReplicationRole, UpdateStages.WithReplica, + UpdateStages.WithNetwork { /** * Executes the update request. * @@ -640,6 +641,22 @@ interface WithIdentity { Update withIdentity(UserAssignedIdentity identity); } + /** + * The stage of the Server update allowing to specify administratorLogin. + */ + interface WithAdministratorLogin { + /** + * Specifies the administratorLogin property: The administrator's login name of a server. Can only be + * specified when the server is trying to switch to password authentication and does not have default + * administrator login.. + * + * @param administratorLogin The administrator's login name of a server. Can only be specified when the + * server is trying to switch to password authentication and does not have default administrator login. + * @return the next definition stage. + */ + Update withAdministratorLogin(String administratorLogin); + } + /** * The stage of the Server update allowing to specify administratorLoginPassword. */ diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ServerBackupListResult.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ServerBackupListResult.java index ffbbc9ef146c5..858cae5301901 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ServerBackupListResult.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ServerBackupListResult.java @@ -5,25 +5,27 @@ 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.ServerBackupInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * A list of server backups. */ @Fluent -public final class ServerBackupListResult { +public final class ServerBackupListResult implements JsonSerializable { /* * The list of backups of a server. */ - @JsonProperty(value = "value") private List value; /* * The link used to get the next page of operations. */ - @JsonProperty(value = "nextLink") private String nextLink; /** @@ -82,4 +84,44 @@ public void validate() { 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 ServerBackupListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ServerBackupListResult 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 ServerBackupListResult. + */ + public static ServerBackupListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ServerBackupListResult deserializedServerBackupListResult = new ServerBackupListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> ServerBackupInner.fromJson(reader1)); + deserializedServerBackupListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedServerBackupListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedServerBackupListResult; + }); + } } 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 7f4d4ff2d04ca..a754d623d7b60 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 @@ -5,39 +5,37 @@ 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.ServerPropertiesForUpdate; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.Map; /** * Represents a server to be updated. */ @Fluent -public final class ServerForUpdate { +public final class ServerForUpdate implements JsonSerializable { /* * The SKU (pricing tier) of the server. */ - @JsonProperty(value = "sku") private Sku sku; /* * Describes the identity of the application. */ - @JsonProperty(value = "identity") private UserAssignedIdentity identity; /* * Properties of the server. */ - @JsonProperty(value = "properties") private ServerPropertiesForUpdate innerProperties; /* * Application-specific metadata in the form of key-value pairs. */ - @JsonProperty(value = "tags") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; /** @@ -115,6 +113,31 @@ public ServerForUpdate withTags(Map tags) { return this; } + /** + * Get the administratorLogin property: The administrator's login name of a server. Can only be specified when the + * server is trying to switch to password authentication and does not have default administrator login. + * + * @return the administratorLogin value. + */ + public String administratorLogin() { + return this.innerProperties() == null ? null : this.innerProperties().administratorLogin(); + } + + /** + * Set the administratorLogin property: The administrator's login name of a server. Can only be specified when the + * server is trying to switch to password authentication and does not have default administrator login. + * + * @param administratorLogin the administratorLogin value to set. + * @return the ServerForUpdate object itself. + */ + public ServerForUpdate withAdministratorLogin(String administratorLogin) { + if (this.innerProperties() == null) { + this.innerProperties = new ServerPropertiesForUpdate(); + } + this.innerProperties().withAdministratorLogin(administratorLogin); + return this; + } + /** * Get the administratorLoginPassword property: The password of the administrator login. * @@ -411,4 +434,50 @@ public void validate() { innerProperties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("sku", this.sku); + jsonWriter.writeJsonField("identity", this.identity); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ServerForUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ServerForUpdate 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 ServerForUpdate. + */ + public static ServerForUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ServerForUpdate deserializedServerForUpdate = new ServerForUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("sku".equals(fieldName)) { + deserializedServerForUpdate.sku = Sku.fromJson(reader); + } else if ("identity".equals(fieldName)) { + deserializedServerForUpdate.identity = UserAssignedIdentity.fromJson(reader); + } else if ("properties".equals(fieldName)) { + deserializedServerForUpdate.innerProperties = ServerPropertiesForUpdate.fromJson(reader); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedServerForUpdate.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedServerForUpdate; + }); + } } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ServerHAState.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ServerHAState.java index 3e74fb1ecf7c8..a483089e1881c 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ServerHAState.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ServerHAState.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.postgresqlflexibleserver.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -57,7 +56,6 @@ public ServerHAState() { * @param name a name to look for. * @return the corresponding ServerHAState. */ - @JsonCreator public static ServerHAState fromString(String name) { return fromString(name, ServerHAState.class); } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ServerListResult.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ServerListResult.java index d108ae63a04f8..18be8a706d162 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ServerListResult.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ServerListResult.java @@ -5,25 +5,27 @@ 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.ServerInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * A list of servers. */ @Fluent -public final class ServerListResult { +public final class ServerListResult implements JsonSerializable { /* * The list of flexible servers */ - @JsonProperty(value = "value") private List value; /* * The link used to get the next page of operations. */ - @JsonProperty(value = "nextLink") private String nextLink; /** @@ -82,4 +84,44 @@ public void validate() { 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 ServerListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ServerListResult 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 ServerListResult. + */ + public static ServerListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ServerListResult deserializedServerListResult = new ServerListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> ServerInner.fromJson(reader1)); + deserializedServerListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedServerListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedServerListResult; + }); + } } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ServerPublicNetworkAccessState.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ServerPublicNetworkAccessState.java index 8893967d02532..095df310bd127 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ServerPublicNetworkAccessState.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ServerPublicNetworkAccessState.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.postgresqlflexibleserver.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -37,7 +36,6 @@ public ServerPublicNetworkAccessState() { * @param name a name to look for. * @return the corresponding ServerPublicNetworkAccessState. */ - @JsonCreator public static ServerPublicNetworkAccessState fromString(String name) { return fromString(name, ServerPublicNetworkAccessState.class); } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ServerSku.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ServerSku.java index 022c604a2b40a..63f99216aa9ed 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ServerSku.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ServerSku.java @@ -5,23 +5,25 @@ package com.azure.resourcemanager.postgresqlflexibleserver.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Sku information related properties of a server. */ @Fluent -public final class ServerSku { +public final class ServerSku implements JsonSerializable { /* * The name of the sku, typically, tier + family + cores, e.g. Standard_D4s_v3. */ - @JsonProperty(value = "name") private String name; /* * The tier of the particular SKU, e.g. Burstable. */ - @JsonProperty(value = "tier") private SkuTier tier; /** @@ -77,4 +79,43 @@ public ServerSku withTier(SkuTier tier) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("tier", this.tier == null ? null : this.tier.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ServerSku from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ServerSku 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 ServerSku. + */ + public static ServerSku fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ServerSku deserializedServerSku = new ServerSku(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedServerSku.name = reader.getString(); + } else if ("tier".equals(fieldName)) { + deserializedServerSku.tier = SkuTier.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedServerSku; + }); + } } 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 cee4fe085b4f4..c9523b6952d2a 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 @@ -5,7 +5,10 @@ package com.azure.resourcemanager.postgresqlflexibleserver.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; /** @@ -16,39 +19,43 @@ public final class ServerSkuCapability extends CapabilityBase { /* * Sku name */ - @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) private String name; /* * Supported vCores */ - @JsonProperty(value = "vCores", access = JsonProperty.Access.WRITE_ONLY) private Integer vCores; /* * Supported IOPS */ - @JsonProperty(value = "supportedIops", access = JsonProperty.Access.WRITE_ONLY) private Integer supportedIops; /* * Supported memory per vCore in MB */ - @JsonProperty(value = "supportedMemoryPerVcoreMb", access = JsonProperty.Access.WRITE_ONLY) private Long supportedMemoryPerVcoreMb; /* * List of supported Availability Zones. E.g. "1", "2", "3" */ - @JsonProperty(value = "supportedZones", access = JsonProperty.Access.WRITE_ONLY) private List supportedZones; /* * Supported high availability mode */ - @JsonProperty(value = "supportedHaMode", access = JsonProperty.Access.WRITE_ONLY) private List supportedHaMode; + /* + * The reason for the capability not being available. + */ + private String reason; + + /* + * The status of the capability. + */ + private CapabilityStatus status; + /** * Creates an instance of ServerSkuCapability class. */ @@ -109,6 +116,26 @@ public List supportedHaMode() { return this.supportedHaMode; } + /** + * Get the reason property: The reason for the capability not being available. + * + * @return the reason value. + */ + @Override + public String reason() { + return this.reason; + } + + /** + * Get the status property: The status of the capability. + * + * @return the status value. + */ + @Override + public CapabilityStatus status() { + return this.status; + } + /** * Validates the instance. * @@ -116,6 +143,56 @@ public List supportedHaMode() { */ @Override public void validate() { - super.validate(); + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ServerSkuCapability from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ServerSkuCapability 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 ServerSkuCapability. + */ + public static ServerSkuCapability fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ServerSkuCapability deserializedServerSkuCapability = new ServerSkuCapability(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("status".equals(fieldName)) { + deserializedServerSkuCapability.status = CapabilityStatus.fromString(reader.getString()); + } else if ("reason".equals(fieldName)) { + deserializedServerSkuCapability.reason = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedServerSkuCapability.name = reader.getString(); + } else if ("vCores".equals(fieldName)) { + deserializedServerSkuCapability.vCores = reader.getNullable(JsonReader::getInt); + } else if ("supportedIops".equals(fieldName)) { + deserializedServerSkuCapability.supportedIops = reader.getNullable(JsonReader::getInt); + } else if ("supportedMemoryPerVcoreMb".equals(fieldName)) { + deserializedServerSkuCapability.supportedMemoryPerVcoreMb = reader.getNullable(JsonReader::getLong); + } else if ("supportedZones".equals(fieldName)) { + List supportedZones = reader.readArray(reader1 -> reader1.getString()); + deserializedServerSkuCapability.supportedZones = supportedZones; + } else if ("supportedHaMode".equals(fieldName)) { + List supportedHaMode = reader.readArray(reader1 -> HaMode.fromString(reader1.getString())); + deserializedServerSkuCapability.supportedHaMode = supportedHaMode; + } else { + reader.skipChildren(); + } + } + + return deserializedServerSkuCapability; + }); } } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ServerState.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ServerState.java index a52348063fc5d..a85bf6e086ce2 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ServerState.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ServerState.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.postgresqlflexibleserver.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -62,7 +61,6 @@ public ServerState() { * @param name a name to look for. * @return the corresponding ServerState. */ - @JsonCreator public static ServerState fromString(String name) { return fromString(name, ServerState.class); } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ServerThreatProtectionListResult.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ServerThreatProtectionListResult.java index c74b17508d0a9..cf42365a2e8b6 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ServerThreatProtectionListResult.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ServerThreatProtectionListResult.java @@ -5,25 +5,27 @@ 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.ServerThreatProtectionSettingsModelInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * A list of the server's Advanced Threat Protection settings. */ @Immutable -public final class ServerThreatProtectionListResult { +public final class ServerThreatProtectionListResult implements JsonSerializable { /* * Array of results. */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) private List value; /* * Link to retrieve next page of results. */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; /** @@ -60,4 +62,44 @@ public void validate() { value().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ServerThreatProtectionListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ServerThreatProtectionListResult 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 ServerThreatProtectionListResult. + */ + public static ServerThreatProtectionListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ServerThreatProtectionListResult deserializedServerThreatProtectionListResult + = new ServerThreatProtectionListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> ServerThreatProtectionSettingsModelInner.fromJson(reader1)); + deserializedServerThreatProtectionListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedServerThreatProtectionListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedServerThreatProtectionListResult; + }); + } } 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 595758c9ddc2c..6b152fa9b30aa 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 @@ -5,13 +5,17 @@ package com.azure.resourcemanager.postgresqlflexibleserver.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** * The version of a server. */ public final class ServerVersion extends ExpandableStringEnum { + /** + * Static value 16 for ServerVersion. + */ + public static final ServerVersion ONE_SIX = fromString("16"); + /** * Static value 15 for ServerVersion. */ @@ -37,11 +41,6 @@ public final class ServerVersion extends ExpandableStringEnum { */ public static final ServerVersion ONE_ONE = fromString("11"); - /** - * Static value 16 for ServerVersion. - */ - public static final ServerVersion ONE_SIX = fromString("16"); - /** * Creates a new instance of ServerVersion value. * @@ -57,7 +56,6 @@ public ServerVersion() { * @param name a name to look for. * @return the corresponding ServerVersion. */ - @JsonCreator public static ServerVersion fromString(String name) { return fromString(name, ServerVersion.class); } 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 9b6cf0d7a593c..89a71e12cb413 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 @@ -5,7 +5,10 @@ package com.azure.resourcemanager.postgresqlflexibleserver.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; /** @@ -16,15 +19,23 @@ public final class ServerVersionCapability extends CapabilityBase { /* * Server version */ - @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) private String name; /* * Supported servers versions to upgrade */ - @JsonProperty(value = "supportedVersionsToUpgrade", access = JsonProperty.Access.WRITE_ONLY) private List supportedVersionsToUpgrade; + /* + * The reason for the capability not being available. + */ + private String reason; + + /* + * The status of the capability. + */ + private CapabilityStatus status; + /** * Creates an instance of ServerVersionCapability class. */ @@ -49,6 +60,26 @@ public List supportedVersionsToUpgrade() { return this.supportedVersionsToUpgrade; } + /** + * Get the reason property: The reason for the capability not being available. + * + * @return the reason value. + */ + @Override + public String reason() { + return this.reason; + } + + /** + * Get the status property: The status of the capability. + * + * @return the status value. + */ + @Override + public CapabilityStatus status() { + return this.status; + } + /** * Validates the instance. * @@ -56,6 +87,47 @@ public List supportedVersionsToUpgrade() { */ @Override public void validate() { - super.validate(); + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ServerVersionCapability from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ServerVersionCapability 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 ServerVersionCapability. + */ + public static ServerVersionCapability fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ServerVersionCapability deserializedServerVersionCapability = new ServerVersionCapability(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("status".equals(fieldName)) { + deserializedServerVersionCapability.status = CapabilityStatus.fromString(reader.getString()); + } else if ("reason".equals(fieldName)) { + deserializedServerVersionCapability.reason = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedServerVersionCapability.name = reader.getString(); + } else if ("supportedVersionsToUpgrade".equals(fieldName)) { + List supportedVersionsToUpgrade = reader.readArray(reader1 -> reader1.getString()); + deserializedServerVersionCapability.supportedVersionsToUpgrade = supportedVersionsToUpgrade; + } else { + reader.skipChildren(); + } + } + + return deserializedServerVersionCapability; + }); } } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/Sku.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/Sku.java index f7a0f8e117cc4..f701ebf4ec054 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/Sku.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/Sku.java @@ -6,23 +6,25 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Sku information related properties of a server. */ @Fluent -public final class Sku { +public final class Sku implements JsonSerializable { /* * The name of the sku, typically, tier + family + cores, e.g. Standard_D4s_v3. */ - @JsonProperty(value = "name", required = true) private String name; /* * The tier of the particular SKU, e.g. Burstable. */ - @JsonProperty(value = "tier", required = true) private SkuTier tier; /** @@ -86,4 +88,44 @@ public void validate() { } private static final ClientLogger LOGGER = new ClientLogger(Sku.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("tier", this.tier == null ? null : this.tier.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Sku from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Sku 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 Sku. + */ + public static Sku fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Sku deserializedSku = new Sku(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedSku.name = reader.getString(); + } else if ("tier".equals(fieldName)) { + deserializedSku.tier = SkuTier.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedSku; + }); + } } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/SkuTier.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/SkuTier.java index 5a8f31af249e5..c3b03fcf13404 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/SkuTier.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/SkuTier.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.postgresqlflexibleserver.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -42,7 +41,6 @@ public SkuTier() { * @param name a name to look for. * @return the corresponding SkuTier. */ - @JsonCreator public static SkuTier fromString(String name) { return fromString(name, SkuTier.class); } 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 e864a7eac5016..b983a13f55c13 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 @@ -5,7 +5,6 @@ package com.azure.resourcemanager.postgresqlflexibleserver.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -88,7 +87,6 @@ public SourceType() { * @param name a name to look for. * @return the corresponding SourceType. */ - @JsonCreator public static SourceType fromString(String name) { return fromString(name, SourceType.class); } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/SslMode.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/SslMode.java index 312e98819b00f..87df7d86f9c02 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/SslMode.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/SslMode.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.postgresqlflexibleserver.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -48,7 +47,6 @@ public SslMode() { * @param name a name to look for. * @return the corresponding SslMode. */ - @JsonCreator public static SslMode fromString(String name) { return fromString(name, SslMode.class); } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/StartDataMigrationEnum.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/StartDataMigrationEnum.java index d8189b595fea1..dc18937a429fb 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/StartDataMigrationEnum.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/StartDataMigrationEnum.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.postgresqlflexibleserver.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -37,7 +36,6 @@ public StartDataMigrationEnum() { * @param name a name to look for. * @return the corresponding StartDataMigrationEnum. */ - @JsonCreator public static StartDataMigrationEnum fromString(String name) { return fromString(name, StartDataMigrationEnum.class); } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/Storage.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/Storage.java index 9828fcd5de3cf..f0028e4fa6288 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 @@ -5,47 +5,46 @@ package com.azure.resourcemanager.postgresqlflexibleserver.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Storage properties of a server. */ @Fluent -public final class Storage { +public final class Storage implements JsonSerializable { /* * Max storage allowed for a server. */ - @JsonProperty(value = "storageSizeGB") private Integer storageSizeGB; /* * Flag to enable / disable Storage Auto grow for flexible server. */ - @JsonProperty(value = "autoGrow") private StorageAutoGrow autoGrow; /* * Name of storage tier for IOPS. */ - @JsonProperty(value = "tier") private AzureManagedDiskPerformanceTiers tier; /* * Storage tier IOPS quantity. This property is required to be set for storage Type PremiumV2_LRS */ - @JsonProperty(value = "iops") private Integer iops; /* * Storage throughput for the server. This is required to be set for storage Type PremiumV2_LRS */ - @JsonProperty(value = "throughput") private Integer throughput; /* - * Storage type for the server. Allowed values are Premium_LRS and PremiumV2_LRS, and default is Premium_LRS if not specified + * Storage type for the server. Allowed values are Premium_LRS and PremiumV2_LRS, and default is Premium_LRS if not + * specified */ - @JsonProperty(value = "type") private StorageType type; /** @@ -187,4 +186,55 @@ public Storage withType(StorageType type) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("storageSizeGB", this.storageSizeGB); + jsonWriter.writeStringField("autoGrow", this.autoGrow == null ? null : this.autoGrow.toString()); + jsonWriter.writeStringField("tier", this.tier == null ? null : this.tier.toString()); + jsonWriter.writeNumberField("iops", this.iops); + jsonWriter.writeNumberField("throughput", this.throughput); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Storage from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Storage 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 Storage. + */ + public static Storage fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Storage deserializedStorage = new Storage(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("storageSizeGB".equals(fieldName)) { + deserializedStorage.storageSizeGB = reader.getNullable(JsonReader::getInt); + } else if ("autoGrow".equals(fieldName)) { + deserializedStorage.autoGrow = StorageAutoGrow.fromString(reader.getString()); + } else if ("tier".equals(fieldName)) { + deserializedStorage.tier = AzureManagedDiskPerformanceTiers.fromString(reader.getString()); + } else if ("iops".equals(fieldName)) { + deserializedStorage.iops = reader.getNullable(JsonReader::getInt); + } else if ("throughput".equals(fieldName)) { + deserializedStorage.throughput = reader.getNullable(JsonReader::getInt); + } else if ("type".equals(fieldName)) { + deserializedStorage.type = StorageType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedStorage; + }); + } } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/StorageAutoGrow.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/StorageAutoGrow.java index ea421ae332a7b..c39333f9ff846 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/StorageAutoGrow.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/StorageAutoGrow.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.postgresqlflexibleserver.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -37,7 +36,6 @@ public StorageAutoGrow() { * @param name a name to look for. * @return the corresponding StorageAutoGrow. */ - @JsonCreator public static StorageAutoGrow fromString(String name) { return fromString(name, StorageAutoGrow.class); } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/StorageAutoGrowthSupportedEnum.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/StorageAutoGrowthSupportedEnum.java index 4473e2774fa6e..b92cde1e775af 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 @@ -5,7 +5,6 @@ package com.azure.resourcemanager.postgresqlflexibleserver.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -38,7 +37,6 @@ public StorageAutoGrowthSupportedEnum() { * @param name a name to look for. * @return the corresponding StorageAutoGrowthSupportedEnum. */ - @JsonCreator public static StorageAutoGrowthSupportedEnum fromString(String name) { return fromString(name, StorageAutoGrowthSupportedEnum.class); } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/StorageEditionCapability.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/StorageEditionCapability.java index c64509fed11eb..eb27a7d7bd27b 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/StorageEditionCapability.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/StorageEditionCapability.java @@ -5,7 +5,10 @@ package com.azure.resourcemanager.postgresqlflexibleserver.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; /** @@ -16,21 +19,28 @@ public final class StorageEditionCapability extends CapabilityBase { /* * Storage edition name */ - @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) private String name; /* * Default storage size in MB for storage edition */ - @JsonProperty(value = "defaultStorageSizeMb", access = JsonProperty.Access.WRITE_ONLY) private Long defaultStorageSizeMb; /* * Flexible server supported storage range in MB */ - @JsonProperty(value = "supportedStorageMb", access = JsonProperty.Access.WRITE_ONLY) private List supportedStorageMb; + /* + * The reason for the capability not being available. + */ + private String reason; + + /* + * The status of the capability. + */ + private CapabilityStatus status; + /** * Creates an instance of StorageEditionCapability class. */ @@ -64,6 +74,26 @@ public List supportedStorageMb() { return this.supportedStorageMb; } + /** + * Get the reason property: The reason for the capability not being available. + * + * @return the reason value. + */ + @Override + public String reason() { + return this.reason; + } + + /** + * Get the status property: The status of the capability. + * + * @return the status value. + */ + @Override + public CapabilityStatus status() { + return this.status; + } + /** * Validates the instance. * @@ -71,9 +101,53 @@ public List supportedStorageMb() { */ @Override public void validate() { - super.validate(); if (supportedStorageMb() != null) { supportedStorageMb().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of StorageEditionCapability from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of StorageEditionCapability 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 StorageEditionCapability. + */ + public static StorageEditionCapability fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + StorageEditionCapability deserializedStorageEditionCapability = new StorageEditionCapability(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("status".equals(fieldName)) { + deserializedStorageEditionCapability.status = CapabilityStatus.fromString(reader.getString()); + } else if ("reason".equals(fieldName)) { + deserializedStorageEditionCapability.reason = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedStorageEditionCapability.name = reader.getString(); + } else if ("defaultStorageSizeMb".equals(fieldName)) { + deserializedStorageEditionCapability.defaultStorageSizeMb = reader.getNullable(JsonReader::getLong); + } else if ("supportedStorageMb".equals(fieldName)) { + List supportedStorageMb + = reader.readArray(reader1 -> StorageMbCapability.fromJson(reader1)); + deserializedStorageEditionCapability.supportedStorageMb = supportedStorageMb; + } else { + reader.skipChildren(); + } + } + + return deserializedStorageEditionCapability; + }); + } } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/StorageMbCapability.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/StorageMbCapability.java index e23ffe2aa64c0..dbaeb01a635e6 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/StorageMbCapability.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/StorageMbCapability.java @@ -5,7 +5,10 @@ package com.azure.resourcemanager.postgresqlflexibleserver.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; /** @@ -16,51 +19,53 @@ public final class StorageMbCapability extends CapabilityBase { /* * Supported IOPS */ - @JsonProperty(value = "supportedIops", access = JsonProperty.Access.WRITE_ONLY) private Integer supportedIops; /* * Maximum IOPS supported by this #Vcores or PremiumV2_LRS Storage Size */ - @JsonProperty(value = "supportedMaximumIops", access = JsonProperty.Access.WRITE_ONLY) private Integer supportedMaximumIops; /* * Storage size in MB */ - @JsonProperty(value = "storageSizeMb", access = JsonProperty.Access.WRITE_ONLY) private Long storageSizeMb; /* * Maximum value of Storage size in MB */ - @JsonProperty(value = "maximumStorageSizeMb", access = JsonProperty.Access.WRITE_ONLY) private Long maximumStorageSizeMb; /* * Values of throughput in MB/s */ - @JsonProperty(value = "supportedThroughput", access = JsonProperty.Access.WRITE_ONLY) private Integer supportedThroughput; /* * Maximum values of throughput in MB/s */ - @JsonProperty(value = "supportedMaximumThroughput", access = JsonProperty.Access.WRITE_ONLY) private Integer supportedMaximumThroughput; /* * Default tier for IOPS */ - @JsonProperty(value = "defaultIopsTier", access = JsonProperty.Access.WRITE_ONLY) private String defaultIopsTier; /* * List of available options to upgrade the storage performance */ - @JsonProperty(value = "supportedIopsTiers", access = JsonProperty.Access.WRITE_ONLY) private List supportedIopsTiers; + /* + * The reason for the capability not being available. + */ + private String reason; + + /* + * The status of the capability. + */ + private CapabilityStatus status; + /** * Creates an instance of StorageMbCapability class. */ @@ -139,6 +144,26 @@ public List supportedIopsTiers() { return this.supportedIopsTiers; } + /** + * Get the reason property: The reason for the capability not being available. + * + * @return the reason value. + */ + @Override + public String reason() { + return this.reason; + } + + /** + * Get the status property: The status of the capability. + * + * @return the status value. + */ + @Override + public CapabilityStatus status() { + return this.status; + } + /** * Validates the instance. * @@ -146,9 +171,63 @@ public List supportedIopsTiers() { */ @Override public void validate() { - super.validate(); if (supportedIopsTiers() != null) { supportedIopsTiers().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of StorageMbCapability from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of StorageMbCapability 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 StorageMbCapability. + */ + public static StorageMbCapability fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + StorageMbCapability deserializedStorageMbCapability = new StorageMbCapability(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("status".equals(fieldName)) { + deserializedStorageMbCapability.status = CapabilityStatus.fromString(reader.getString()); + } else if ("reason".equals(fieldName)) { + deserializedStorageMbCapability.reason = reader.getString(); + } else if ("supportedIops".equals(fieldName)) { + deserializedStorageMbCapability.supportedIops = reader.getNullable(JsonReader::getInt); + } else if ("supportedMaximumIops".equals(fieldName)) { + deserializedStorageMbCapability.supportedMaximumIops = reader.getNullable(JsonReader::getInt); + } else if ("storageSizeMb".equals(fieldName)) { + deserializedStorageMbCapability.storageSizeMb = reader.getNullable(JsonReader::getLong); + } else if ("maximumStorageSizeMb".equals(fieldName)) { + deserializedStorageMbCapability.maximumStorageSizeMb = reader.getNullable(JsonReader::getLong); + } else if ("supportedThroughput".equals(fieldName)) { + deserializedStorageMbCapability.supportedThroughput = reader.getNullable(JsonReader::getInt); + } else if ("supportedMaximumThroughput".equals(fieldName)) { + deserializedStorageMbCapability.supportedMaximumThroughput = reader.getNullable(JsonReader::getInt); + } else if ("defaultIopsTier".equals(fieldName)) { + deserializedStorageMbCapability.defaultIopsTier = reader.getString(); + } else if ("supportedIopsTiers".equals(fieldName)) { + List supportedIopsTiers + = reader.readArray(reader1 -> StorageTierCapability.fromJson(reader1)); + deserializedStorageMbCapability.supportedIopsTiers = supportedIopsTiers; + } else { + reader.skipChildren(); + } + } + + return deserializedStorageMbCapability; + }); + } } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/StorageTierCapability.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/StorageTierCapability.java index da4d9a9e07eed..5370254045349 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/StorageTierCapability.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/StorageTierCapability.java @@ -5,7 +5,10 @@ package com.azure.resourcemanager.postgresqlflexibleserver.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Represents capability of a storage tier. @@ -15,15 +18,23 @@ public final class StorageTierCapability extends CapabilityBase { /* * Name to represent Storage tier capability */ - @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) private String name; /* * Supported IOPS for this storage tier */ - @JsonProperty(value = "iops", access = JsonProperty.Access.WRITE_ONLY) private Integer iops; + /* + * The reason for the capability not being available. + */ + private String reason; + + /* + * The status of the capability. + */ + private CapabilityStatus status; + /** * Creates an instance of StorageTierCapability class. */ @@ -48,6 +59,26 @@ public Integer iops() { return this.iops; } + /** + * Get the reason property: The reason for the capability not being available. + * + * @return the reason value. + */ + @Override + public String reason() { + return this.reason; + } + + /** + * Get the status property: The status of the capability. + * + * @return the status value. + */ + @Override + public CapabilityStatus status() { + return this.status; + } + /** * Validates the instance. * @@ -55,6 +86,46 @@ public Integer iops() { */ @Override public void validate() { - super.validate(); + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of StorageTierCapability from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of StorageTierCapability 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 StorageTierCapability. + */ + public static StorageTierCapability fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + StorageTierCapability deserializedStorageTierCapability = new StorageTierCapability(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("status".equals(fieldName)) { + deserializedStorageTierCapability.status = CapabilityStatus.fromString(reader.getString()); + } else if ("reason".equals(fieldName)) { + deserializedStorageTierCapability.reason = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedStorageTierCapability.name = reader.getString(); + } else if ("iops".equals(fieldName)) { + deserializedStorageTierCapability.iops = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedStorageTierCapability; + }); } } 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 06815607d1f21..aee52348ee0fa 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 @@ -5,7 +5,6 @@ package com.azure.resourcemanager.postgresqlflexibleserver.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -38,7 +37,6 @@ public StorageType() { * @param name a name to look for. * @return the corresponding StorageType. */ - @JsonCreator public static StorageType fromString(String name) { return fromString(name, StorageType.class); } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ThreatProtectionName.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ThreatProtectionName.java index b916e61039c02..a07ddd844dd0e 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ThreatProtectionName.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ThreatProtectionName.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.postgresqlflexibleserver.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -32,7 +31,6 @@ public ThreatProtectionName() { * @param name a name to look for. * @return the corresponding ThreatProtectionName. */ - @JsonCreator public static ThreatProtectionName fromString(String name) { return fromString(name, ThreatProtectionName.class); } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ThreatProtectionState.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ThreatProtectionState.java index b79297aae6be1..da405aa4bf57d 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ThreatProtectionState.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ThreatProtectionState.java @@ -4,9 +4,6 @@ package com.azure.resourcemanager.postgresqlflexibleserver.models; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - /** * Specifies the state of the Threat Protection, whether it is enabled or disabled or a state has not been applied yet * on the specific server. @@ -37,7 +34,6 @@ public enum ThreatProtectionState { * @param value the serialized value to parse. * @return the parsed ThreatProtectionState object, or null if unable to parse. */ - @JsonCreator public static ThreatProtectionState fromString(String value) { if (value == null) { return null; @@ -54,7 +50,6 @@ public static ThreatProtectionState fromString(String value) { /** * {@inheritDoc} */ - @JsonValue @Override public String toString() { return this.value; diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/TriggerCutoverEnum.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/TriggerCutoverEnum.java index 18b17a8a8ed08..38fa75b731763 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/TriggerCutoverEnum.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/TriggerCutoverEnum.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.postgresqlflexibleserver.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -37,7 +36,6 @@ public TriggerCutoverEnum() { * @param name a name to look for. * @return the corresponding TriggerCutoverEnum. */ - @JsonCreator public static TriggerCutoverEnum fromString(String name) { return fromString(name, TriggerCutoverEnum.class); } 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 3272c0d994c7b..06a9d485b2d86 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 @@ -6,32 +6,31 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; +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.util.Map; /** * Information describing the identities associated with this application. */ @Fluent -public final class UserAssignedIdentity { +public final class UserAssignedIdentity implements JsonSerializable { /* * represents user assigned identities map. */ - @JsonProperty(value = "userAssignedIdentities") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map userAssignedIdentities; /* * the types of identities associated with this resource; currently restricted to 'None and UserAssigned' */ - @JsonProperty(value = "type", required = true) private IdentityType type; /* * Tenant id of the server. */ - @JsonProperty(value = "tenantId", access = JsonProperty.Access.WRITE_ONLY) private String tenantId; /** @@ -111,4 +110,49 @@ public void validate() { } private static final ClientLogger LOGGER = new ClientLogger(UserAssignedIdentity.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeMapField("userAssignedIdentities", this.userAssignedIdentities, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UserAssignedIdentity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UserAssignedIdentity 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 UserAssignedIdentity. + */ + public static UserAssignedIdentity fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UserAssignedIdentity deserializedUserAssignedIdentity = new UserAssignedIdentity(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedUserAssignedIdentity.type = IdentityType.fromString(reader.getString()); + } else if ("userAssignedIdentities".equals(fieldName)) { + Map userAssignedIdentities + = reader.readMap(reader1 -> UserIdentity.fromJson(reader1)); + deserializedUserAssignedIdentity.userAssignedIdentities = userAssignedIdentities; + } else if ("tenantId".equals(fieldName)) { + deserializedUserAssignedIdentity.tenantId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedUserAssignedIdentity; + }); + } } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/UserIdentity.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/UserIdentity.java index 388b5b5db453f..9f72c7a2e49e7 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/UserIdentity.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/UserIdentity.java @@ -5,23 +5,25 @@ package com.azure.resourcemanager.postgresqlflexibleserver.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Describes a single user-assigned identity associated with the application. */ @Fluent -public final class UserIdentity { +public final class UserIdentity implements JsonSerializable { /* * the object identifier of the Service Principal which this identity represents. */ - @JsonProperty(value = "principalId") private String principalId; /* * the client identifier of the Service Principal which this identity represents. */ - @JsonProperty(value = "clientId") private String clientId; /** @@ -77,4 +79,43 @@ public UserIdentity withClientId(String clientId) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("principalId", this.principalId); + jsonWriter.writeStringField("clientId", this.clientId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UserIdentity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UserIdentity 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 UserIdentity. + */ + public static UserIdentity fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UserIdentity deserializedUserIdentity = new UserIdentity(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("principalId".equals(fieldName)) { + deserializedUserIdentity.principalId = reader.getString(); + } else if ("clientId".equals(fieldName)) { + deserializedUserIdentity.clientId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedUserIdentity; + }); + } } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ValidationDetails.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ValidationDetails.java index 84dca17481edd..a17d3218a63da 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ValidationDetails.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ValidationDetails.java @@ -5,43 +5,44 @@ package com.azure.resourcemanager.postgresqlflexibleserver.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +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; import java.util.List; /** * Details for the validation for migration. */ @Fluent -public final class ValidationDetails { +public final class ValidationDetails implements JsonSerializable { /* * Validation status for migration */ - @JsonProperty(value = "status") private ValidationState status; /* * Validation Start date-time in UTC */ - @JsonProperty(value = "validationStartTimeInUtc") private OffsetDateTime validationStartTimeInUtc; /* * Validation End date-time in UTC */ - @JsonProperty(value = "validationEndTimeInUtc") private OffsetDateTime validationEndTimeInUtc; /* * Details of server level validations */ - @JsonProperty(value = "serverLevelValidationDetails") private List serverLevelValidationDetails; /* * Details of server level validations */ - @JsonProperty(value = "dbLevelValidationDetails") private List dbLevelValidationDetails; /** @@ -164,4 +165,66 @@ public void validate() { dbLevelValidationDetails().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + jsonWriter.writeStringField("validationStartTimeInUtc", + this.validationStartTimeInUtc == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.validationStartTimeInUtc)); + jsonWriter.writeStringField("validationEndTimeInUtc", + this.validationEndTimeInUtc == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.validationEndTimeInUtc)); + jsonWriter.writeArrayField("serverLevelValidationDetails", this.serverLevelValidationDetails, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("dbLevelValidationDetails", this.dbLevelValidationDetails, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ValidationDetails from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ValidationDetails 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 ValidationDetails. + */ + public static ValidationDetails fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ValidationDetails deserializedValidationDetails = new ValidationDetails(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("status".equals(fieldName)) { + deserializedValidationDetails.status = ValidationState.fromString(reader.getString()); + } else if ("validationStartTimeInUtc".equals(fieldName)) { + deserializedValidationDetails.validationStartTimeInUtc = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("validationEndTimeInUtc".equals(fieldName)) { + deserializedValidationDetails.validationEndTimeInUtc = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("serverLevelValidationDetails".equals(fieldName)) { + List serverLevelValidationDetails + = reader.readArray(reader1 -> ValidationSummaryItem.fromJson(reader1)); + deserializedValidationDetails.serverLevelValidationDetails = serverLevelValidationDetails; + } else if ("dbLevelValidationDetails".equals(fieldName)) { + List dbLevelValidationDetails + = reader.readArray(reader1 -> DbLevelValidationStatus.fromJson(reader1)); + deserializedValidationDetails.dbLevelValidationDetails = dbLevelValidationDetails; + } else { + reader.skipChildren(); + } + } + + return deserializedValidationDetails; + }); + } } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ValidationMessage.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ValidationMessage.java index 352e79d2eff21..944cb1940af46 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ValidationMessage.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ValidationMessage.java @@ -5,23 +5,25 @@ package com.azure.resourcemanager.postgresqlflexibleserver.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Validation message object. */ @Fluent -public final class ValidationMessage { +public final class ValidationMessage implements JsonSerializable { /* * Severity of validation message */ - @JsonProperty(value = "state") private ValidationState state; /* * Validation message string */ - @JsonProperty(value = "message") private String message; /** @@ -77,4 +79,43 @@ public ValidationMessage withMessage(String message) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("state", this.state == null ? null : this.state.toString()); + jsonWriter.writeStringField("message", this.message); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ValidationMessage from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ValidationMessage 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 ValidationMessage. + */ + public static ValidationMessage fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ValidationMessage deserializedValidationMessage = new ValidationMessage(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("state".equals(fieldName)) { + deserializedValidationMessage.state = ValidationState.fromString(reader.getString()); + } else if ("message".equals(fieldName)) { + deserializedValidationMessage.message = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedValidationMessage; + }); + } } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ValidationState.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ValidationState.java index 1b118e21101f9..2eede5f7f43f1 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ValidationState.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ValidationState.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.postgresqlflexibleserver.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -42,7 +41,6 @@ public ValidationState() { * @param name a name to look for. * @return the corresponding ValidationState. */ - @JsonCreator public static ValidationState fromString(String name) { return fromString(name, ValidationState.class); } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ValidationSummaryItem.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ValidationSummaryItem.java index b438e0a298f83..4345153db6aa5 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ValidationSummaryItem.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ValidationSummaryItem.java @@ -5,30 +5,31 @@ package com.azure.resourcemanager.postgresqlflexibleserver.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +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.util.List; /** * Validation summary object. */ @Fluent -public final class ValidationSummaryItem { +public final class ValidationSummaryItem implements JsonSerializable { /* * Validation type */ - @JsonProperty(value = "type") private String type; /* * Validation status for migration */ - @JsonProperty(value = "state") private ValidationState state; /* * Validation messages */ - @JsonProperty(value = "messages") private List messages; /** @@ -107,4 +108,47 @@ public void validate() { messages().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type); + jsonWriter.writeStringField("state", this.state == null ? null : this.state.toString()); + jsonWriter.writeArrayField("messages", this.messages, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ValidationSummaryItem from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ValidationSummaryItem 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 ValidationSummaryItem. + */ + public static ValidationSummaryItem fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ValidationSummaryItem deserializedValidationSummaryItem = new ValidationSummaryItem(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedValidationSummaryItem.type = reader.getString(); + } else if ("state".equals(fieldName)) { + deserializedValidationSummaryItem.state = ValidationState.fromString(reader.getString()); + } else if ("messages".equals(fieldName)) { + List messages = reader.readArray(reader1 -> ValidationMessage.fromJson(reader1)); + deserializedValidationSummaryItem.messages = messages; + } else { + reader.skipChildren(); + } + } + + return deserializedValidationSummaryItem; + }); + } } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/VirtualEndpointResourceForPatch.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/VirtualEndpointResourceForPatch.java index d781da4155903..979ecb992ddb9 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/VirtualEndpointResourceForPatch.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/VirtualEndpointResourceForPatch.java @@ -5,19 +5,22 @@ 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.VirtualEndpointResourceProperties; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * Represents a virtual endpoint for a server. */ @Fluent -public class VirtualEndpointResourceForPatch { +public class VirtualEndpointResourceForPatch implements JsonSerializable { /* * Properties of the virtual endpoint resource. */ - @JsonProperty(value = "properties") private VirtualEndpointResourceProperties innerProperties; /** @@ -35,6 +38,17 @@ private VirtualEndpointResourceProperties innerProperties() { return this.innerProperties; } + /** + * Set the innerProperties property: Properties of the virtual endpoint resource. + * + * @param innerProperties the innerProperties value to set. + * @return the VirtualEndpointResourceForPatch object itself. + */ + VirtualEndpointResourceForPatch withInnerProperties(VirtualEndpointResourceProperties innerProperties) { + this.innerProperties = innerProperties; + return this; + } + /** * Get the endpointType property: The endpoint type for the virtual endpoint. * @@ -100,4 +114,42 @@ public void validate() { 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 VirtualEndpointResourceForPatch from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VirtualEndpointResourceForPatch 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 VirtualEndpointResourceForPatch. + */ + public static VirtualEndpointResourceForPatch fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VirtualEndpointResourceForPatch deserializedVirtualEndpointResourceForPatch + = new VirtualEndpointResourceForPatch(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("properties".equals(fieldName)) { + deserializedVirtualEndpointResourceForPatch.innerProperties + = VirtualEndpointResourceProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedVirtualEndpointResourceForPatch; + }); + } } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/VirtualEndpointType.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/VirtualEndpointType.java index c8b4fe2612721..4dc3ffcb3e75b 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/VirtualEndpointType.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/VirtualEndpointType.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.postgresqlflexibleserver.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -32,7 +31,6 @@ public VirtualEndpointType() { * @param name a name to look for. * @return the corresponding VirtualEndpointType. */ - @JsonCreator public static VirtualEndpointType fromString(String name) { return fromString(name, VirtualEndpointType.class); } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/VirtualEndpointsListResult.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/VirtualEndpointsListResult.java index a4293c86f52bc..6ab12b6208821 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/VirtualEndpointsListResult.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/VirtualEndpointsListResult.java @@ -5,25 +5,27 @@ 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.VirtualEndpointResourceInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * A list of virtual endpoints. */ @Fluent -public final class VirtualEndpointsListResult { +public final class VirtualEndpointsListResult implements JsonSerializable { /* * The list of virtual endpoints */ - @JsonProperty(value = "value") private List value; /* * The link used to get the next page of operations. */ - @JsonProperty(value = "nextLink") private String nextLink; /** @@ -82,4 +84,45 @@ public void validate() { 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 VirtualEndpointsListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VirtualEndpointsListResult 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 VirtualEndpointsListResult. + */ + public static VirtualEndpointsListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VirtualEndpointsListResult deserializedVirtualEndpointsListResult = new VirtualEndpointsListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> VirtualEndpointResourceInner.fromJson(reader1)); + deserializedVirtualEndpointsListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedVirtualEndpointsListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedVirtualEndpointsListResult; + }); + } } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/VirtualNetworkSubnetUsageParameter.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/VirtualNetworkSubnetUsageParameter.java index dcad4477a2c3d..e4d9bc5b96b8b 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/VirtualNetworkSubnetUsageParameter.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/VirtualNetworkSubnetUsageParameter.java @@ -5,17 +5,20 @@ package com.azure.resourcemanager.postgresqlflexibleserver.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Virtual network subnet usage parameter. */ @Fluent -public final class VirtualNetworkSubnetUsageParameter { +public final class VirtualNetworkSubnetUsageParameter implements JsonSerializable { /* * Virtual network resource id. */ - @JsonProperty(value = "virtualNetworkArmResourceId") private String virtualNetworkArmResourceId; /** @@ -51,4 +54,41 @@ public VirtualNetworkSubnetUsageParameter withVirtualNetworkArmResourceId(String */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("virtualNetworkArmResourceId", this.virtualNetworkArmResourceId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VirtualNetworkSubnetUsageParameter from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VirtualNetworkSubnetUsageParameter 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 VirtualNetworkSubnetUsageParameter. + */ + public static VirtualNetworkSubnetUsageParameter fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VirtualNetworkSubnetUsageParameter deserializedVirtualNetworkSubnetUsageParameter + = new VirtualNetworkSubnetUsageParameter(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("virtualNetworkArmResourceId".equals(fieldName)) { + deserializedVirtualNetworkSubnetUsageParameter.virtualNetworkArmResourceId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedVirtualNetworkSubnetUsageParameter; + }); + } } 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 09e65dc0f5990..0e1d9e706f8a3 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 @@ -5,7 +5,6 @@ package com.azure.resourcemanager.postgresqlflexibleserver.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -39,7 +38,6 @@ public ZoneRedundantHaAndGeoBackupSupportedEnum() { * @param name a name to look for. * @return the corresponding ZoneRedundantHaAndGeoBackupSupportedEnum. */ - @JsonCreator public static ZoneRedundantHaAndGeoBackupSupportedEnum fromString(String name) { return fromString(name, ZoneRedundantHaAndGeoBackupSupportedEnum.class); } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ZoneRedundantHaSupportedEnum.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ZoneRedundantHaSupportedEnum.java index 8a1d4fdca58cc..b321c4fc8b4c0 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 @@ -5,7 +5,6 @@ package com.azure.resourcemanager.postgresqlflexibleserver.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -38,7 +37,6 @@ public ZoneRedundantHaSupportedEnum() { * @param name a name to look for. * @return the corresponding ZoneRedundantHaSupportedEnum. */ - @JsonCreator public static ZoneRedundantHaSupportedEnum fromString(String name) { return fromString(name, ZoneRedundantHaSupportedEnum.class); } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/package-info.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/package-info.java index 0a81bec78ff1e..8ff25adfb77da 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/package-info.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/package-info.java @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. /** - * Package containing the data models for PostgreSqlManagementClient. + * Package containing the data models for PostgreSqlServerManagementClient. * 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. diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/package-info.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/package-info.java index fa3c7eaa8d7c5..8c43542e760aa 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/package-info.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/package-info.java @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. /** - * Package containing the classes for PostgreSqlManagementClient. + * Package containing the classes for PostgreSqlServerManagementClient. * 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. diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/module-info.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/module-info.java index 6392eb745ba2c..35508fc86cc05 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/module-info.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/module-info.java @@ -8,6 +8,6 @@ exports com.azure.resourcemanager.postgresqlflexibleserver.fluent; exports com.azure.resourcemanager.postgresqlflexibleserver.fluent.models; exports com.azure.resourcemanager.postgresqlflexibleserver.models; - opens com.azure.resourcemanager.postgresqlflexibleserver.fluent.models to com.azure.core, com.fasterxml.jackson.databind; - opens com.azure.resourcemanager.postgresqlflexibleserver.models to com.azure.core, com.fasterxml.jackson.databind; + opens com.azure.resourcemanager.postgresqlflexibleserver.fluent.models to com.azure.core; + opens com.azure.resourcemanager.postgresqlflexibleserver.models to com.azure.core; } \ No newline at end of file diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-postgresqlflexibleserver/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 f0320af0048ef..15d392fdd4a28 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.LocationBasedCapabilitiesClientImpl$LocationBasedCapabilitiesService" ], [ "com.azure.resourcemanager.postgresqlflexibleserver.implementation.ServerCapabilitiesClientImpl$ServerCapabilitiesService" ], [ "com.azure.resourcemanager.postgresqlflexibleserver.implementation.CheckNameAvailabilitiesClientImpl$CheckNameAvailabilitiesService" ], [ "com.azure.resourcemanager.postgresqlflexibleserver.implementation.CheckNameAvailabilityWithLocationsClientImpl$CheckNameAvailabilityWithLocationsService" ], [ "com.azure.resourcemanager.postgresqlflexibleserver.implementation.ConfigurationsClientImpl$ConfigurationsService" ], [ "com.azure.resourcemanager.postgresqlflexibleserver.implementation.DatabasesClientImpl$DatabasesService" ], [ "com.azure.resourcemanager.postgresqlflexibleserver.implementation.FirewallRulesClientImpl$FirewallRulesService" ], [ "com.azure.resourcemanager.postgresqlflexibleserver.implementation.ServersClientImpl$ServersService" ], [ "com.azure.resourcemanager.postgresqlflexibleserver.implementation.FlexibleServersClientImpl$FlexibleServersService" ], [ "com.azure.resourcemanager.postgresqlflexibleserver.implementation.LtrBackupOperationsClientImpl$LtrBackupOperationsService" ], [ "com.azure.resourcemanager.postgresqlflexibleserver.implementation.MigrationsClientImpl$MigrationsService" ], [ "com.azure.resourcemanager.postgresqlflexibleserver.implementation.ResourceProvidersClientImpl$ResourceProvidersService" ], [ "com.azure.resourcemanager.postgresqlflexibleserver.implementation.OperationsClientImpl$OperationsService" ], [ "com.azure.resourcemanager.postgresqlflexibleserver.implementation.GetPrivateDnsZoneSuffixesClientImpl$GetPrivateDnsZoneSuffixesService" ], [ "com.azure.resourcemanager.postgresqlflexibleserver.implementation.PrivateEndpointConnectionsClientImpl$PrivateEndpointConnectionsService" ], [ "com.azure.resourcemanager.postgresqlflexibleserver.implementation.PrivateEndpointConnectionOperationsClientImpl$PrivateEndpointConnectionOperationsService" ], [ "com.azure.resourcemanager.postgresqlflexibleserver.implementation.PrivateLinkResourcesClientImpl$PrivateLinkResourcesService" ], [ "com.azure.resourcemanager.postgresqlflexibleserver.implementation.QuotaUsagesClientImpl$QuotaUsagesService" ], [ "com.azure.resourcemanager.postgresqlflexibleserver.implementation.ReplicasClientImpl$ReplicasService" ], [ "com.azure.resourcemanager.postgresqlflexibleserver.implementation.LogFilesClientImpl$LogFilesService" ], [ "com.azure.resourcemanager.postgresqlflexibleserver.implementation.ServerThreatProtectionSettingsClientImpl$ServerThreatProtectionSettingsService" ], [ "com.azure.resourcemanager.postgresqlflexibleserver.implementation.VirtualEndpointsClientImpl$VirtualEndpointsService" ], [ "com.azure.resourcemanager.postgresqlflexibleserver.implementation.VirtualNetworkSubnetUsagesClientImpl$VirtualNetworkSubnetUsagesService" ] ] \ No newline at end of file +[["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 diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-postgresqlflexibleserver/reflect-config.json b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-postgresqlflexibleserver/reflect-config.json index 3476fa9b6e344..0637a088a01e8 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-postgresqlflexibleserver/reflect-config.json +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-postgresqlflexibleserver/reflect-config.json @@ -1,811 +1 @@ -[ { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.ActiveDirectoryAdministratorAdd", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.AdministratorPropertiesForAdd", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.ActiveDirectoryAdministratorInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.AdministratorProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.AdministratorListResult", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.ServerBackupInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.ServerBackupProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.ServerBackupListResult", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.CapabilitiesListResult", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.FlexibleServerCapabilityInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.FlexibleServerEditionCapability", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.StorageEditionCapability", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.StorageMbCapability", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.StorageTierCapability", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.CapabilityBase", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.ServerSkuCapability", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.ServerVersionCapability", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.FastProvisioningEditionCapability", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.CheckNameAvailabilityRequest", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.NameAvailabilityInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.CheckNameAvailabilityResponse", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.ConfigurationListResult", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.ConfigurationInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.ConfigurationProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.ConfigurationForUpdate", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.DatabaseInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.DatabaseProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.DatabaseListResult", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.FirewallRuleInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.FirewallRuleProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.FirewallRuleListResult", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.ServerInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.Sku", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.UserAssignedIdentity", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.UserIdentity", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.ServerProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.Storage", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.AuthConfig", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.DataEncryption", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.Backup", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.Network", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.HighAvailability", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.MaintenanceWindow", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.Replica", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.PrivateEndpointConnectionInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.PrivateEndpointConnectionProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.PrivateEndpoint", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.PrivateLinkServiceConnectionState", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.ServerForUpdate", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.ServerPropertiesForUpdate", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.ServerListResult", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.LtrPreBackupRequest", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.BackupRequestBase", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.BackupSettings", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.LtrPreBackupResponseInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.LtrPreBackupResponseProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.LtrBackupRequest", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.BackupStoreDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.LtrBackupResponseInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.LtrBackupOperationResponseProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.LtrServerBackupOperationInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.LtrServerBackupOperationList", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.MigrationResourceInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.MigrationResourceProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.MigrationStatus", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.MigrationSubStateDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.DbMigrationStatus", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.ValidationDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.ValidationSummaryItem", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.ValidationMessage", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.DbLevelValidationStatus", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.DbServerMetadata", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.ServerSku", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.MigrationSecretParameters", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.AdminCredentials", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.MigrationResourceForPatch", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.MigrationResourcePropertiesForPatch", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.MigrationResourceListResult", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.MigrationNameAvailabilityResourceInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.OperationListResultInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.Operation", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.OperationDisplay", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.PrivateEndpointConnectionListResult", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.PrivateLinkResourceListResult", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.PrivateLinkResourceInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.PrivateLinkResourceProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.QuotaUsagesListResult", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.QuotaUsageInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.NameProperty", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.LogFileListResult", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.LogFileInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.LogFileProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.RestartParameter", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.ServerThreatProtectionListResult", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.ServerThreatProtectionSettingsModelInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.ServerThreatProtectionProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.VirtualEndpointResourceInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.VirtualEndpointResourceForPatch", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.VirtualEndpointResourceProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.VirtualEndpointsListResult", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.VirtualNetworkSubnetUsageParameter", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.VirtualNetworkSubnetUsageResultInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.DelegatedSubnetUsage", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.FlexibleServersTriggerLtrPreBackupHeaders", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.PrincipalType", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.Origin", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.HaMode", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.FastProvisioningSupportedEnum", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.GeoBackupSupportedEnum", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.ZoneRedundantHaSupportedEnum", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.ZoneRedundantHaAndGeoBackupSupportedEnum", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.StorageAutoGrowthSupportedEnum", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.OnlineResizeSupportedEnum", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.RestrictedEnum", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.CheckNameAvailabilityReason", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.ConfigurationDataType", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.SkuTier", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.IdentityType", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.ServerVersion", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.ServerState", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.StorageAutoGrow", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.AzureManagedDiskPerformanceTiers", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.StorageType", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.ActiveDirectoryAuthEnum", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.PasswordAuthEnum", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.ArmServerKeyType", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.KeyStatusEnum", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.GeoRedundantBackupEnum", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.ServerPublicNetworkAccessState", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.HighAvailabilityMode", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.ServerHAState", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.ReplicationRole", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.ReplicationState", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.ReadReplicaPromoteMode", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.ReplicationPromoteOption", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.CreateMode", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.PrivateEndpointServiceConnectionStatus", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.PrivateEndpointConnectionProvisioningState", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.CreateModeForUpdate", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.ExecutionStatus", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.MigrationState", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.MigrationSubState", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.MigrationDbState", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.ValidationState", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.MigrationMode", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.MigrationOption", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.SourceType", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.SslMode", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.LogicalReplicationOnSourceDbEnum", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.OverwriteDbsInTargetEnum", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.MigrateRolesEnum", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.StartDataMigrationEnum", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.TriggerCutoverEnum", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.CancelEnum", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.MigrationListFilter", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.MigrationNameAvailabilityReason", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.OperationOrigin", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.FailoverMode", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.ThreatProtectionName", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.VirtualEndpointType", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.CapabilityStatus", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.ThreatProtectionState", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -} ] \ No newline at end of file +[] \ 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 827447d68f87a..a035c49051644 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 @@ -11,15 +11,17 @@ */ public final class AdministratorsCreateSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/AdministratorAdd.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/AdministratorAdd. + * json */ /** * Sample code: Adds an Active DIrectory Administrator for the server. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ public static void addsAnActiveDIrectoryAdministratorForTheServer( - com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.administrators() .define("oooooooo-oooo-oooo-oooo-oooooooooooo") .withExistingFlexibleServer("testrg", "testserver") 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 076dfcd9caabe..27ce22ffb3680 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 @@ -9,15 +9,17 @@ */ public final class AdministratorsDeleteSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/AdministratorDelete.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * AdministratorDelete.json */ /** * Sample code: AdministratorDelete. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ public static void - administratorDelete(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + administratorDelete(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.administrators() .delete("testrg", "testserver", "oooooooo-oooo-oooo-oooo-oooooooooooo", com.azure.core.util.Context.NONE); } 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 57538b0ef01ec..935e5d38c8eb1 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 @@ -9,14 +9,16 @@ */ public final class AdministratorsGetSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/AdministratorGet.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/AdministratorGet. + * json */ /** * Sample code: ServerGet. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ - public static void serverGet(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + public static void serverGet(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.administrators() .getWithResponse("testrg", "pgtestsvc1", "oooooooo-oooo-oooo-oooo-oooooooooooo", com.azure.core.util.Context.NONE); 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 aa7b26821300f..74084d6b03858 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 @@ -9,15 +9,17 @@ */ public final class AdministratorsListByServerSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/AdministratorsListByServer.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * AdministratorsListByServer.json */ /** * Sample code: AdministratorsListByServer. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ public static void - administratorsListByServer(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + administratorsListByServer(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.administrators().listByServer("testrg", "pgtestsvc1", com.azure.core.util.Context.NONE); } } 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 new file mode 100644 index 0000000000000..538fbc151ae76 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/BackupsCreateSamples.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 Backups Create. + */ +public final class BackupsCreateSamples { + /* + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/BackupCreate.json + */ + /** + * Sample code: Create a new Backup for a flexible server. + * + * @param manager Entry point to PostgreSqlServerManager. + */ + public static void createANewBackupForAFlexibleServer( + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { + manager.backups() + .create("TestGroup", "postgresqltestserver", "backup_20210615T160516", com.azure.core.util.Context.NONE); + } +} 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 new file mode 100644 index 0000000000000..382ece895d668 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/BackupsDeleteSamples.java @@ -0,0 +1,24 @@ +// Copyright (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 Backups Delete. + */ +public final class BackupsDeleteSamples { + /* + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/BackupDelete.json + */ + /** + * Sample code: Delete a specific backup. + * + * @param manager Entry point to PostgreSqlServerManager. + */ + public static void + deleteASpecificBackup(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { + manager.backups().delete("TestGroup", "testserver", "backup_20210615T160516", com.azure.core.util.Context.NONE); + } +} 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 7cb61749f50db..6921404c2f58e 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 @@ -9,15 +9,16 @@ */ public final class BackupsGetSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/BackupGet.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/BackupGet.json */ /** * Sample code: Get a backup for a server. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ public static void - getABackupForAServer(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + getABackupForAServer(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.backups() .getWithResponse("TestGroup", "postgresqltestserver", "daily_20210615T160516", com.azure.core.util.Context.NONE); 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 a0ff96efd231d..35b2b5c676de9 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 @@ -9,15 +9,17 @@ */ public final class BackupsListByServerSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/BackupListByServer.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/BackupListByServer + * .json */ /** * Sample code: List backups for a server. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ public static void - listBackupsForAServer(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + listBackupsForAServer(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.backups().listByServer("TestGroup", "postgresqltestserver", com.azure.core.util.Context.NONE); } } 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 ab0c8ecaf9835..21c0e0b55f9ce 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 @@ -11,14 +11,17 @@ */ public final class CheckNameAvailabilityExecuteSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/CheckNameAvailability.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * CheckNameAvailability.json */ /** * Sample code: NameAvailability. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ - public static void nameAvailability(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + public static void + nameAvailability(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.checkNameAvailabilities() .executeWithResponse(new CheckNameAvailabilityRequest().withName("name1") .withType("Microsoft.DBforPostgreSQL/flexibleServers"), com.azure.core.util.Context.NONE); 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 6afe0605cb9f6..06174a2d34098 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 @@ -11,14 +11,17 @@ */ public final class CheckNameAvailabilityWithLocationExecuteSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/CheckNameAvailabilityLocationBased.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * CheckNameAvailabilityLocationBased.json */ /** * Sample code: NameAvailability. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ - public static void nameAvailability(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + public static void + nameAvailability(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.checkNameAvailabilityWithLocations() .executeWithResponse("westus", new CheckNameAvailabilityRequest().withName("name1") .withType("Microsoft.DBforPostgreSQL/flexibleServers"), com.azure.core.util.Context.NONE); 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 2b866f57d98b7..04d0a50465809 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 @@ -9,14 +9,17 @@ */ public final class ConfigurationsGetSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/ConfigurationGet.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ConfigurationGet. + * json */ /** * Sample code: ConfigurationGet. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ - public static void configurationGet(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + public static void + configurationGet(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.configurations() .getWithResponse("testrg", "testserver", "array_nulls", com.azure.core.util.Context.NONE); } 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 b152999915a26..3547235ef0c31 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 @@ -9,14 +9,17 @@ */ public final class ConfigurationsListByServerSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/ConfigurationListByServer.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * ConfigurationListByServer.json */ /** * Sample code: ConfigurationList. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ - public static void configurationList(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + public static void + configurationList(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.configurations().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/ConfigurationsPutSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ConfigurationsPutSamples.java index 6da779e1ff47a..e9e3dfe2663b0 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 @@ -9,15 +9,17 @@ */ public final class ConfigurationsPutSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/ConfigurationUpdate.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * ConfigurationUpdate.json */ /** * Sample code: Update a user configuration. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ public static void - updateAUserConfiguration(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + updateAUserConfiguration(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.configurations() .define("event_scheduler") .withExistingFlexibleServer("testrg", "testserver") 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 228d37aab6ef4..7252879ecf4b7 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 @@ -11,15 +11,17 @@ */ public final class ConfigurationsUpdateSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/ConfigurationUpdate.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * ConfigurationUpdate.json */ /** * Sample code: Update a user configuration. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ public static void - updateAUserConfiguration(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + updateAUserConfiguration(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { Configuration resource = manager.configurations() .getWithResponse("testrg", "testserver", "event_scheduler", com.azure.core.util.Context.NONE) .getValue(); 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 32c18906de806..3d7921f16b3ed 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 @@ -9,14 +9,17 @@ */ public final class DatabasesCreateSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/DatabaseCreate.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/DatabaseCreate. + * json */ /** * Sample code: Create a database. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ - public static void createADatabase(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + public static void + createADatabase(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.databases() .define("db1") .withExistingFlexibleServer("TestGroup", "testserver") 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 87e654cbca6ee..85e2110b0a5cc 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 @@ -9,14 +9,17 @@ */ public final class DatabasesDeleteSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/DatabaseDelete.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/DatabaseDelete. + * json */ /** * Sample code: Delete a database. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ - public static void deleteADatabase(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + public static void + deleteADatabase(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.databases().delete("TestGroup", "testserver", "db1", com.azure.core.util.Context.NONE); } } 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 148d75b1c960c..8ebc2b9cd1b22 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 @@ -9,14 +9,16 @@ */ public final class DatabasesGetSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/DatabaseGet.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/DatabaseGet.json */ /** * Sample code: Get a database. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ - public static void getADatabase(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + public static void + getADatabase(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.databases().getWithResponse("TestGroup", "testserver", "db1", com.azure.core.util.Context.NONE); } } 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 3c7c794572205..edea26b4a73ae 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 @@ -9,15 +9,17 @@ */ public final class DatabasesListByServerSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/DatabasesListByServer.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * DatabasesListByServer.json */ /** * Sample code: List databases in a server. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ public static void - listDatabasesInAServer(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + listDatabasesInAServer(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.databases().listByServer("TestGroup", "testserver", com.azure.core.util.Context.NONE); } } 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 d1afec7619361..a32df8f1a7d47 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 @@ -9,15 +9,17 @@ */ public final class FirewallRulesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/FirewallRuleCreate.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/FirewallRuleCreate + * .json */ /** * Sample code: FirewallRuleCreate. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ public static void - firewallRuleCreate(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + firewallRuleCreate(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.firewallRules() .define("rule1") .withExistingFlexibleServer("testrg", "testserver") 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 cab4270578085..a8e68a4098222 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 @@ -9,15 +9,17 @@ */ public final class FirewallRulesDeleteSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/FirewallRuleDelete.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/FirewallRuleDelete + * .json */ /** * Sample code: FirewallRuleDelete. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ public static void - firewallRuleDelete(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + firewallRuleDelete(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.firewallRules().delete("testrg", "testserver", "rule1", com.azure.core.util.Context.NONE); } } 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 6627663ee2b4a..c6a446015a7e9 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 @@ -9,14 +9,17 @@ */ public final class FirewallRulesGetSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/FirewallRuleGet.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/FirewallRuleGet. + * json */ /** * Sample code: FirewallRuleList. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ - public static void firewallRuleList(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + public static void + firewallRuleList(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.firewallRules().getWithResponse("testrg", "testserver", "rule1", com.azure.core.util.Context.NONE); } } 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 4b476d9590678..a59cd55ffe322 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 @@ -9,14 +9,17 @@ */ public final class FirewallRulesListByServerSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/FirewallRuleListByServer.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * FirewallRuleListByServer.json */ /** * Sample code: FirewallRuleList. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ - public static void firewallRuleList(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + public static void + firewallRuleList(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.firewallRules().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/FlexibleServerStartLtrBackupSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/FlexibleServerStartLtrBackupSamples.java index ef8c96d534d27..fbf674830a3b9 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 @@ -14,15 +14,17 @@ */ public final class FlexibleServerStartLtrBackupSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/LongTermRetentionBackup.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * LongTermRetentionBackup.json */ /** * Sample code: Sample_ExecuteBackup. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ public static void - sampleExecuteBackup(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + sampleExecuteBackup(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.flexibleServers() .startLtrBackup("rgLongTermRetention", "pgsqlltrtestserver", new LtrBackupRequest().withBackupSettings(new BackupSettings().withBackupName("backup1")) 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 adf50157bc3e0..0b45d1903cea0 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 @@ -12,14 +12,17 @@ */ public final class FlexibleServerTriggerLtrPreBackupSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/LongTermRetentionPreBackup.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * LongTermRetentionPreBackup.json */ /** * Sample code: Sample_Prebackup. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ - public static void samplePrebackup(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + public static void + samplePrebackup(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.flexibleServers() .triggerLtrPreBackupWithResponse("rgLongTermRetention", "pgsqlltrtestserver", new LtrPreBackupRequest().withBackupSettings(new BackupSettings().withBackupName("backup1")), 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 25001d2767016..f883aa94da192 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 @@ -9,15 +9,17 @@ */ public final class GetPrivateDnsZoneSuffixExecuteSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/GetPrivateDnsZoneSuffix.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * GetPrivateDnsZoneSuffix.json */ /** * Sample code: GetPrivateDnsZoneSuffix. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ public static void - getPrivateDnsZoneSuffix(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + getPrivateDnsZoneSuffix(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.getPrivateDnsZoneSuffixes().executeWithResponse(com.azure.core.util.Context.NONE); } } 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 c3cf98d85e37a..b665f4658142f 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 @@ -9,14 +9,17 @@ */ public final class LocationBasedCapabilitiesExecuteSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/CapabilitiesByLocation.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * CapabilitiesByLocation.json */ /** * Sample code: CapabilitiesList. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ - public static void capabilitiesList(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { - manager.locationBasedCapabilities().execute("westus", com.azure.core.util.Context.NONE); + public static void + capabilitiesList(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { + manager.locationBasedCapabilities().execute("eastus", com.azure.core.util.Context.NONE); } } 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 3623f9870132c..4a8f1f868e683 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 @@ -9,15 +9,17 @@ */ public final class LogFilesListByServerSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/LogFilesListByServer.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * LogFilesListByServer.json */ /** * Sample code: List all server log files for a server. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ - public static void - listAllServerLogFilesForAServer(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + public static void listAllServerLogFilesForAServer( + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.logFiles().listByServer("testrg", "postgresqltestsvc1", com.azure.core.util.Context.NONE); } } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/LtrBackupOperationsGetSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/LtrBackupOperationsGetSamples.java index a8f20a78db93b..c77a2fd6934ca 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 @@ -9,14 +9,16 @@ */ public final class LtrBackupOperationsGetSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/LongTermRetentionOperationGet.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * LongTermRetentionOperationGet.json */ /** * Sample code: Sample. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ - public static void sample(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + public static void sample(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.ltrBackupOperations() .getWithResponse("rgLongTermRetention", "pgsqlltrtestserver", "backup1", com.azure.core.util.Context.NONE); } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/LtrBackupOperationsListByServerSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/LtrBackupOperationsListByServerSamples.java index 87c4e796affc8..923f871b42124 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 @@ -9,15 +9,17 @@ */ public final class LtrBackupOperationsListByServerSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/LongTermRetentionOperationListByServer.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * LongTermRetentionOperationListByServer.json */ /** * Sample code: Sample List of Long Tern Retention Operations by Flexible Server. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ public static void sampleListOfLongTernRetentionOperationsByFlexibleServer( - com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.ltrBackupOperations() .listByServer("rgLongTermRetention", "pgsqlltrtestserver", com.azure.core.util.Context.NONE); } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/MigrationsCreateSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/MigrationsCreateSamples.java index 1ab2f721bc837..89fef0c13f5a8 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 @@ -19,15 +19,17 @@ */ public final class MigrationsCreateSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/Migrations_Create_With_PrivateEndpoint_Servers.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * Migrations_Create_With_PrivateEndpoint_Servers.json */ /** * Sample code: Migrations Create with private endpoint. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ public static void migrationsCreateWithPrivateEndpoint( - com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.migrations() .define("testmigration") .withRegion("westus") @@ -46,15 +48,17 @@ public static void migrationsCreateWithPrivateEndpoint( } /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/Migrations_Create_With_Roles.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * Migrations_Create_With_Roles.json */ /** * Sample code: Migrations Create with roles. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ public static void - migrationsCreateWithRoles(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + migrationsCreateWithRoles(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.migrations() .define("testmigration") .withRegion("westus") @@ -72,15 +76,17 @@ public static void migrationsCreateWithPrivateEndpoint( } /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/Migrations_Create_Validate_Only.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * Migrations_Create_Validate_Only.json */ /** * Sample code: Create Pre-migration Validation. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ - public static void - createPreMigrationValidation(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + public static void createPreMigrationValidation( + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.migrations() .define("testmigration") .withRegion("westus") @@ -98,15 +104,17 @@ public static void migrationsCreateWithPrivateEndpoint( } /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/Migrations_Create_With_Other_Users.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * Migrations_Create_With_Other_Users.json */ /** * Sample code: Migrations Create by passing user names. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ public static void migrationsCreateByPassingUserNames( - com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.migrations() .define("testmigration") .withRegion("westus") @@ -124,14 +132,17 @@ public static void migrationsCreateByPassingUserNames( } /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/Migrations_Create.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/Migrations_Create. + * json */ /** * Sample code: Migrations_Create. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ - public static void migrationsCreate(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + public static void + migrationsCreate(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.migrations() .define("testmigration") .withRegion("westus") @@ -150,15 +161,17 @@ public static void migrationsCreate(com.azure.resourcemanager.postgresqlflexible } /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/Migrations_Create_Other_SourceTypes_Validate_Migrate.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * Migrations_Create_Other_SourceTypes_Validate_Migrate.json */ /** * Sample code: Create Migration with other source types for Validate and Migrate. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ public static void createMigrationWithOtherSourceTypesForValidateAndMigrate( - com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.migrations() .define("testmigration") .withRegion("westus") 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 e9c8fd2587d05..a362707fd830d 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 @@ -9,14 +9,17 @@ */ public final class MigrationsDeleteSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/Migrations_Delete.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/Migrations_Delete. + * json */ /** * Sample code: Migrations_Delete. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ - public static void migrationsDelete(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + public static void + migrationsDelete(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.migrations() .deleteWithResponse("ffffffff-ffff-ffff-ffff-ffffffffffff", "testrg", "testtarget", "testmigration", com.azure.core.util.Context.NONE); diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/MigrationsGetSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/MigrationsGetSamples.java index 2af025101a05f..eeb22ed66d699 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 @@ -9,74 +9,85 @@ */ public final class MigrationsGetSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/Migrations_GetMigrationWithSuccessfulValidationOnly.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * Migrations_GetMigrationWithSuccessfulValidationOnly.json */ /** * Sample code: Migrations_GetMigrationWithSuccessfulValidationOnly. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ public static void migrationsGetMigrationWithSuccessfulValidationOnly( - com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.migrations() .getWithResponse("ffffffff-ffff-ffff-ffff-ffffffffffff", "testrg", "testtarget", "testmigrationwithsuccessfulvalidationonly", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/Migrations_Get.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/Migrations_Get. + * json */ /** * Sample code: Migrations_Get. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ - public static void migrationsGet(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + public static void + migrationsGet(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.migrations() .getWithResponse("ffffffff-ffff-ffff-ffff-ffffffffffff", "testrg", "testtarget", "testmigration", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/Migrations_GetMigrationWithSuccessfulValidationButMigrationFailure.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * Migrations_GetMigrationWithSuccessfulValidationButMigrationFailure.json */ /** * Sample code: Migrations_GetMigrationWithSuccessfulValidationButMigrationFailure. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ public static void migrationsGetMigrationWithSuccessfulValidationButMigrationFailure( - com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.migrations() .getWithResponse("ffffffff-ffff-ffff-ffff-ffffffffffff", "testrg", "testtarget", "testmigrationwithsuccessfulvalidationbutmigrationfailure", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/Migrations_GetMigrationWithSuccessfulValidationAndMigration.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * Migrations_GetMigrationWithSuccessfulValidationAndMigration.json */ /** * Sample code: Migrations_GetMigrationWithSuccessfulValidationAndMigration. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ public static void migrationsGetMigrationWithSuccessfulValidationAndMigration( - com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.migrations() .getWithResponse("ffffffff-ffff-ffff-ffff-ffffffffffff", "testrg", "testtarget", "testmigrationwithsuccessfulvalidationandmigration", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/Migrations_GetMigrationWithValidationFailures.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * Migrations_GetMigrationWithValidationFailures.json */ /** * Sample code: Migrations_GetMigrationWithValidationFailures. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ public static void migrationsGetMigrationWithValidationFailures( - com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.migrations() .getWithResponse("ffffffff-ffff-ffff-ffff-ffffffffffff", "testrg", "testtarget", "testmigrationwithvalidationfailure", com.azure.core.util.Context.NONE); diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/MigrationsListByTargetServerSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/MigrationsListByTargetServerSamples.java index a7ab322e4f233..3ca63fb7819a3 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 @@ -11,15 +11,17 @@ */ public final class MigrationsListByTargetServerSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/Migrations_ListByTargetServer.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * Migrations_ListByTargetServer.json */ /** * Sample code: Migrations_ListByTargetServer. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ - public static void - migrationsListByTargetServer(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + public static void migrationsListByTargetServer( + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.migrations() .listByTargetServer("ffffffff-ffff-ffff-ffff-ffffffffffff", "testrg", "testtarget", MigrationListFilter.ALL, com.azure.core.util.Context.NONE); diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/MigrationsUpdateSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/MigrationsUpdateSamples.java index 62f603d59d105..45cc7bbb155db 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 @@ -13,14 +13,17 @@ */ public final class MigrationsUpdateSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/Migrations_Cancel.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/Migrations_Cancel. + * json */ /** * Sample code: Cancel migration. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ - public static void cancelMigration(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + public static void + cancelMigration(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { MigrationResource resource = manager.migrations() .getWithResponse("ffffffff-ffff-ffff-ffff-ffffffffffff", "testrg", "testtarget", "testmigration", com.azure.core.util.Context.NONE) @@ -29,14 +32,17 @@ public static void cancelMigration(com.azure.resourcemanager.postgresqlflexibles } /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/Migrations_Update.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/Migrations_Update. + * json */ /** * Sample code: Migrations_Update. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ - public static void migrationsUpdate(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + public static void + migrationsUpdate(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { MigrationResource resource = manager.migrations() .getWithResponse("ffffffff-ffff-ffff-ffff-ffffffffffff", "testrg", "testtarget", "testmigration", com.azure.core.util.Context.NONE) diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/OperationsListSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/OperationsListSamples.java index 41b4afec01fbc..5e41d28f7cea0 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 @@ -9,14 +9,16 @@ */ public final class OperationsListSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/OperationList.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/OperationList.json */ /** * Sample code: OperationList. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ - public static void operationList(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + public static void + operationList(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.operations().listWithResponse(com.azure.core.util.Context.NONE); } } 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 4818b46b481cc..38f076d114a00 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 @@ -9,15 +9,17 @@ */ public final class PrivateEndpointConnectionOperationDeleteSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/PrivateEndpointConnectionDelete.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * PrivateEndpointConnectionDelete.json */ /** * Sample code: Deletes a private endpoint connection with a given name. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ public static void deletesAPrivateEndpointConnectionWithAGivenName( - com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.privateEndpointConnectionOperations() .delete("Default", "test-svr", "private-endpoint-connection-name.1fa229cd-bf3f-47f0-8c49-afb36723997e", com.azure.core.util.Context.NONE); diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/PrivateEndpointConnectionOperationUpdateSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/PrivateEndpointConnectionOperationUpdateSamples.java index 2458fa0c67c12..bad7e73cf06f1 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 @@ -13,15 +13,17 @@ */ public final class PrivateEndpointConnectionOperationUpdateSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/PrivateEndpointConnectionUpdate.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * PrivateEndpointConnectionUpdate.json */ /** * Sample code: Approve or reject a private endpoint connection with a given name. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ public static void approveOrRejectAPrivateEndpointConnectionWithAGivenName( - com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.privateEndpointConnectionOperations() .update("Default", "test-svr", "private-endpoint-connection-name.1fa229cd-bf3f-47f0-8c49-afb36723997e", new PrivateEndpointConnectionInner().withPrivateLinkServiceConnectionState( 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 7661d26ddf711..1a7491a384143 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 @@ -9,15 +9,17 @@ */ public final class PrivateEndpointConnectionsGetSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/PrivateEndpointConnectionGet.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * PrivateEndpointConnectionGet.json */ /** * Sample code: Gets private endpoint connection. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ - public static void - getsPrivateEndpointConnection(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + public static void getsPrivateEndpointConnection( + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.privateEndpointConnections() .getWithResponse("Default", "test-svr", "private-endpoint-connection-name.1fa229cd-bf3f-47f0-8c49-afb36723997e", 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 0069c3fe9c5dc..74c62e77dedad 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 @@ -9,15 +9,17 @@ */ public final class PrivateEndpointConnectionsListByServerSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/PrivateEndpointConnectionList.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * PrivateEndpointConnectionList.json */ /** * Sample code: Gets list of private endpoint connections on a server. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ public static void getsListOfPrivateEndpointConnectionsOnAServer( - com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.privateEndpointConnections().listByServer("Default", "test-svr", com.azure.core.util.Context.NONE); } } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/PrivateLinkResourcesGetSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/PrivateLinkResourcesGetSamples.java index bbbbd1eb2a6c5..b94aa727c80e3 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 @@ -9,15 +9,17 @@ */ public final class PrivateLinkResourcesGetSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/PrivateLinkResourcesGet.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * PrivateLinkResourcesGet.json */ /** * Sample code: Gets a private link resource for PostgreSQL. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ public static void getsAPrivateLinkResourceForPostgreSQL( - com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.privateLinkResources().getWithResponse("Default", "test-svr", "plr", com.azure.core.util.Context.NONE); } } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/PrivateLinkResourcesListByServerSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/PrivateLinkResourcesListByServerSamples.java index c41f22e7fceaf..bb566662c76c1 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 @@ -9,15 +9,17 @@ */ public final class PrivateLinkResourcesListByServerSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/PrivateLinkResourcesList.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * PrivateLinkResourcesList.json */ /** * Sample code: Gets private link resources for PostgreSQL. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ public static void getsPrivateLinkResourcesForPostgreSQL( - com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.privateLinkResources().listByServer("Default", "test-svr", com.azure.core.util.Context.NONE); } } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/QuotaUsagesListSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/QuotaUsagesListSamples.java deleted file mode 100644 index 53b3b63a254f7..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/QuotaUsagesListSamples.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; - -/** - * Samples for QuotaUsages List. - */ -public final class QuotaUsagesListSamples { - /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-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 ecb4792be1833..bde133b7c42b8 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 @@ -9,15 +9,17 @@ */ public final class ReplicasListByServerSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/ReplicasListByServer.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * ReplicasListByServer.json */ /** * Sample code: ReplicasListByServer. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ public static void - replicasListByServer(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + replicasListByServer(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.replicas().listByServer("testrg", "sourcepgservername", com.azure.core.util.Context.NONE); } } 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 ecf34bf6f710e..75d5a02f3a796 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 @@ -11,15 +11,17 @@ */ public final class ResourceProviderCheckMigrationNameAvailabilitySamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/CheckMigrationNameAvailability.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * CheckMigrationNameAvailability.json */ /** * Sample code: CheckMigrationNameAvailability. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ - public static void - checkMigrationNameAvailability(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + public static void checkMigrationNameAvailability( + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.resourceProviders() .checkMigrationNameAvailabilityWithResponse("ffffffff-ffff-ffff-ffff-ffffffffffff", "testrg", "testtarget", new MigrationNameAvailabilityResourceInner().withName("name1") 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 bc700b1ab758b..c8fcbbddf1394 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 @@ -9,15 +9,17 @@ */ public final class ServerCapabilitiesListSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/ServerCapabilities.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ServerCapabilities + * .json */ /** * Sample code: ServerCapabilitiesList. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ public static void - serverCapabilitiesList(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + serverCapabilitiesList(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.serverCapabilities().list("testrg", "pgtestsvc4", com.azure.core.util.Context.NONE); } } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServerThreatProtectionSettingsCreateOrUpdateSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServerThreatProtectionSettingsCreateOrUpdateSamples.java index 94614fdd117e0..ffc09b5507d95 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 @@ -13,15 +13,17 @@ */ public final class ServerThreatProtectionSettingsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/ServerThreatProtectionSettingsCreateOrUpdate.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * ServerThreatProtectionSettingsCreateOrUpdate.json */ /** * Sample code: Update a server's Threat Protection settings. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ public static void updateAServerSThreatProtectionSettings( - com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { ServerThreatProtectionSettingsModel resource = manager.serverThreatProtectionSettings() .getWithResponse("threatprotection-4799", "threatprotection-6440", ThreatProtectionName.DEFAULT, com.azure.core.util.Context.NONE) 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 492d78dd1ce2f..77de378feaadf 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 @@ -11,15 +11,17 @@ */ public final class ServerThreatProtectionSettingsGetSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/ServerThreatProtectionSettingsGet.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * ServerThreatProtectionSettingsGet.json */ /** * Sample code: Get a server's Threat Protection settings. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ public static void getAServerSThreatProtectionSettings( - com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.serverThreatProtectionSettings() .getWithResponse("threatprotection-6852", "threatprotection-2080", ThreatProtectionName.DEFAULT, com.azure.core.util.Context.NONE); diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServerThreatProtectionSettingsListByServerSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServerThreatProtectionSettingsListByServerSamples.java index fbd46aed20b19..999579d0c84a5 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 @@ -9,15 +9,17 @@ */ public final class ServerThreatProtectionSettingsListByServerSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/ServerThreatProtectionSettingsListByServer.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * ServerThreatProtectionSettingsListByServer.json */ /** * Sample code: Get a server's Advanced Threat Protection settings. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ public static void getAServerSAdvancedThreatProtectionSettings( - com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.serverThreatProtectionSettings() .listByServer("threatprotection-6852", "threatprotection-2080", com.azure.core.util.Context.NONE); } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServersCreateSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServersCreateSamples.java index 1cee75977c800..52195af8c9956 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 @@ -33,15 +33,17 @@ */ public final class ServersCreateSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/ServerCreateWithDataEncryptionEnabled.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * ServerCreateWithDataEncryptionEnabled.json */ /** * Sample code: ServerCreateWithDataEncryptionEnabled. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ public static void serverCreateWithDataEncryptionEnabled( - com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.servers() .define("pgtestsvc4") .withRegion("westus") @@ -73,15 +75,17 @@ public static void serverCreateWithDataEncryptionEnabled( } /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/ServerCreateReviveDropped.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * ServerCreateReviveDropped.json */ /** * Sample code: ServerCreateReviveDropped. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ public static void - serverCreateReviveDropped(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + serverCreateReviveDropped(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.servers() .define("pgtestsvc5-rev") .withRegion("westus") @@ -94,15 +98,17 @@ public static void serverCreateWithDataEncryptionEnabled( } /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/ServerCreateGeoRestoreWithDataEncryptionEnabled.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * ServerCreateGeoRestoreWithDataEncryptionEnabled.json */ /** * Sample code: Create a database as a geo-restore in geo-paired location. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ public static void createADatabaseAsAGeoRestoreInGeoPairedLocation( - com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.servers() .define("pgtestsvc5geo") .withRegion("eastus") @@ -127,14 +133,16 @@ public static void createADatabaseAsAGeoRestoreInGeoPairedLocation( } /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/ServerCreate.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ServerCreate.json */ /** * Sample code: Create a new server. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ - public static void createANewServer(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + public static void + createANewServer(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.servers() .define("pgtestsvc4") .withRegion("westus") @@ -159,15 +167,17 @@ public static void createANewServer(com.azure.resourcemanager.postgresqlflexible } /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/ServerCreateWithAadAuthEnabled.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * ServerCreateWithAadAuthEnabled.json */ /** * Sample code: Create a new server with active directory authentication enabled. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ public static void createANewServerWithActiveDirectoryAuthenticationEnabled( - com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.servers() .define("pgtestsvc4") .withRegion("westus") @@ -196,15 +206,17 @@ public static void createANewServerWithActiveDirectoryAuthenticationEnabled( } /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/ServerCreateReplica.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * ServerCreateReplica.json */ /** * Sample code: ServerCreateReplica. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ public static void - serverCreateReplica(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + serverCreateReplica(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.servers() .define("pgtestsvc5rep") .withRegion("westus") @@ -226,15 +238,17 @@ public static void createANewServerWithActiveDirectoryAuthenticationEnabled( } /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/ServerCreatePointInTimeRestore.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * ServerCreatePointInTimeRestore.json */ /** * Sample code: Create a database as a point in time restore. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ public static void createADatabaseAsAPointInTimeRestore( - com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.servers() .define("pgtestsvc5") .withRegion("westus") 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 9a21108d32894..de46276e33497 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 @@ -9,14 +9,16 @@ */ public final class ServersDeleteSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/ServerDelete.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ServerDelete.json */ /** * Sample code: ServerDelete. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ - public static void serverDelete(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + public static void + serverDelete(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.servers().delete("testrg", "testserver", com.azure.core.util.Context.NONE); } } 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 ce2d1abbbe7ae..680e023934507 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 @@ -9,39 +9,45 @@ */ public final class ServersGetByResourceGroupSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/ServerGetWithPrivateEndpoints.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * ServerGetWithPrivateEndpoints.json */ /** * Sample code: ServerGetWithPrivateEndpoints. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ - public static void - serverGetWithPrivateEndpoints(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + public static void serverGetWithPrivateEndpoints( + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.servers().getByResourceGroupWithResponse("testrg", "pgtestsvc2", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/ServerGet.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ServerGet.json */ /** * Sample code: ServerGet. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ - public static void serverGet(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + public static void serverGet(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.servers().getByResourceGroupWithResponse("testrg", "pgtestsvc1", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/ServerGetWithVnet.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ServerGetWithVnet. + * json */ /** * Sample code: ServerGetWithVnet. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ - public static void serverGetWithVnet(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + public static void + serverGetWithVnet(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.servers().getByResourceGroupWithResponse("testrg", "pgtestsvc4", com.azure.core.util.Context.NONE); } } 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 14715fd27c1dc..94f1aefcff62d 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 @@ -9,15 +9,17 @@ */ public final class ServersListByResourceGroupSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/ServerListByResourceGroup.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * ServerListByResourceGroup.json */ /** * Sample code: ServerListByResourceGroup. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ public static void - serverListByResourceGroup(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + serverListByResourceGroup(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.servers().listByResourceGroup("testrg", com.azure.core.util.Context.NONE); } } 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 728bbcb2059d7..72874e1abeab3 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 @@ -9,14 +9,15 @@ */ public final class ServersListSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/ServerList.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ServerList.json */ /** * Sample code: ServerList. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ - public static void serverList(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + public static void serverList(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.servers().list(com.azure.core.util.Context.NONE); } } 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 ec569f34108b1..3e3d67ff484a4 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 @@ -12,27 +12,31 @@ */ public final class ServersRestartSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/ServerRestart.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ServerRestart.json */ /** * Sample code: ServerRestart. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ - public static void serverRestart(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + public static void + serverRestart(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.servers().restart("testrg", "testserver", null, com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/ServerRestartWithFailover.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * ServerRestartWithFailover.json */ /** * Sample code: ServerRestartWithFailover. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ public static void - serverRestartWithFailover(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + serverRestartWithFailover(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.servers() .restart("testrg", "testserver", new RestartParameter().withRestartWithFailover(true).withFailoverMode(FailoverMode.FORCED_FAILOVER), 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 bb358b08f93a3..7f174e58e641b 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 @@ -9,14 +9,15 @@ */ public final class ServersStartSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/ServerStart.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ServerStart.json */ /** * Sample code: ServerStart. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ - public static void serverStart(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + public static void serverStart(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.servers().start("testrg", "testserver", com.azure.core.util.Context.NONE); } } 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 702610a7db2a7..36dad9413a82e 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 @@ -9,14 +9,15 @@ */ public final class ServersStopSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/ServerStop.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ServerStop.json */ /** * Sample code: ServerStop. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ - public static void serverStop(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + public static void serverStop(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.servers().stop("testrg", "testserver", com.azure.core.util.Context.NONE); } } 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 bd97b2402ce32..3b9f085b39ca5 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 @@ -33,15 +33,17 @@ */ public final class ServersUpdateSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/ServerUpdateWithAadAuthEnabled.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * ServerUpdateWithAadAuthEnabled.json */ /** * Sample code: ServerUpdateWithAadAuthEnabled. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ - public static void - serverUpdateWithAadAuthEnabled(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + public static void serverUpdateWithAadAuthEnabled( + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { Server resource = manager.servers() .getByResourceGroupWithResponse("TestGroup", "pgtestsvc4", com.azure.core.util.Context.NONE) .getValue(); @@ -60,15 +62,17 @@ public final class ServersUpdateSamples { } /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/ServerUpdateWithDataEncryptionEnabled.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * ServerUpdateWithDataEncryptionEnabled.json */ /** * Sample code: ServerUpdateWithDataEncryptionEnabled. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ public static void serverUpdateWithDataEncryptionEnabled( - com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { Server resource = manager.servers() .getByResourceGroupWithResponse("TestGroup", "pgtestsvc4", com.azure.core.util.Context.NONE) .getValue(); @@ -93,17 +97,19 @@ public static void serverUpdateWithDataEncryptionEnabled( } /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/PromoteReplicaAsPlannedSwitchover.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * PromoteReplicaAsPlannedSwitchover.json */ /** * Sample code: SwitchOver a replica server as planned, i.e. it will wait for replication to complete before * promoting replica as Primary and original primary as replica. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ public static void switchOverAReplicaServerAsPlannedIEItWillWaitForReplicationToCompleteBeforePromotingReplicaAsPrimaryAndOriginalPrimaryAsReplica( - com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { Server resource = manager.servers() .getByResourceGroupWithResponse("testResourceGroup", "pgtestsvc4-replica", com.azure.core.util.Context.NONE) .getValue(); @@ -114,17 +120,19 @@ public static void serverUpdateWithDataEncryptionEnabled( } /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/PromoteReplicaAsForcedSwitchover.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * PromoteReplicaAsForcedSwitchover.json */ /** * Sample code: SwitchOver a replica server as forced, i.e. it will replica as Primary and original primary as * replica immediately without waiting for primary and replica to be in sync. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ public static void switchOverAReplicaServerAsForcedIEItWillReplicaAsPrimaryAndOriginalPrimaryAsReplicaImmediatelyWithoutWaitingForPrimaryAndReplicaToBeInSync( - com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { Server resource = manager.servers() .getByResourceGroupWithResponse("testResourceGroup", "pgtestsvc4-replica", com.azure.core.util.Context.NONE) .getValue(); @@ -135,14 +143,16 @@ public static void serverUpdateWithDataEncryptionEnabled( } /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/ServerUpdate.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ServerUpdate.json */ /** * Sample code: ServerUpdate. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ - public static void serverUpdate(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + public static void + serverUpdate(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { Server resource = manager.servers() .getByResourceGroupWithResponse("TestGroup", "pgtestsvc4", com.azure.core.util.Context.NONE) .getValue(); @@ -158,15 +168,17 @@ public static void serverUpdate(com.azure.resourcemanager.postgresqlflexibleserv } /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/ServerUpdateWithMajorVersionUpgrade.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * ServerUpdateWithMajorVersionUpgrade.json */ /** * Sample code: ServerUpdateWithMajorVersionUpgrade. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ public static void serverUpdateWithMajorVersionUpgrade( - com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { Server resource = manager.servers() .getByResourceGroupWithResponse("testrg", "pgtestsvc4", com.azure.core.util.Context.NONE) .getValue(); @@ -174,15 +186,17 @@ public static void serverUpdateWithMajorVersionUpgrade( } /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/ServerUpdateWithCustomerMaintenanceWindow.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * ServerUpdateWithCustomerMaintenanceWindow.json */ /** * Sample code: ServerUpdateWithCustomerMaintenanceWindow. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ public static void serverUpdateWithCustomerMaintenanceWindow( - com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { Server resource = manager.servers() .getByResourceGroupWithResponse("testrg", "pgtestsvc4", com.azure.core.util.Context.NONE) .getValue(); @@ -196,17 +210,19 @@ public static void serverUpdateWithCustomerMaintenanceWindow( } /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/PromoteReplicaAsForcedStandaloneServer.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * PromoteReplicaAsForcedStandaloneServer.json */ /** * Sample code: Promote a replica server as a Standalone server as forced, i.e. it will promote a replica server * immediately without waiting for primary and replica to be in sync. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ public static void promoteAReplicaServerAsAStandaloneServerAsForcedIEItWillPromoteAReplicaServerImmediatelyWithoutWaitingForPrimaryAndReplicaToBeInSync( - com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { Server resource = manager.servers() .getByResourceGroupWithResponse("testResourceGroup", "pgtestsvc4-replica", com.azure.core.util.Context.NONE) .getValue(); @@ -217,16 +233,18 @@ public static void serverUpdateWithCustomerMaintenanceWindow( } /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/PromoteReplicaAsPlannedStandaloneServer.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * PromoteReplicaAsPlannedStandaloneServer.json */ /** * Sample code: Promote a replica server as a Standalone server as planned, i.e. it will wait for replication to * complete. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ public static void promoteAReplicaServerAsAStandaloneServerAsPlannedIEItWillWaitForReplicationToComplete( - com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { Server resource = manager.servers() .getByResourceGroupWithResponse("testResourceGroup", "pgtestsvc4-replica", com.azure.core.util.Context.NONE) .getValue(); 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 88bb22223ed05..cf1cb4f1727c5 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 @@ -12,15 +12,17 @@ */ public final class VirtualEndpointsCreateSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/VirtualEndpointCreate.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * VirtualEndpointCreate.json */ /** * Sample code: Create a new virtual endpoint for a flexible server. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ public static void createANewVirtualEndpointForAFlexibleServer( - com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.virtualEndpoints() .define("pgVirtualEndpoint1") .withExistingFlexibleServer("testrg", "pgtestsvc4") 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 5a1ecddcb0dcb..ba84986cbd86a 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 @@ -9,15 +9,17 @@ */ public final class VirtualEndpointsDeleteSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/VirtualEndpointDelete.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * VirtualEndpointDelete.json */ /** * Sample code: Delete a virtual endpoint. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ public static void - deleteAVirtualEndpoint(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + deleteAVirtualEndpoint(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.virtualEndpoints() .delete("testrg", "pgtestsvc4", "pgVirtualEndpoint1", com.azure.core.util.Context.NONE); } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/VirtualEndpointsGetSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/VirtualEndpointsGetSamples.java index 2a72a48614619..82b4300c8b944 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 @@ -9,15 +9,17 @@ */ public final class VirtualEndpointsGetSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/VirtualEndpointsGet.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * VirtualEndpointsGet.json */ /** * Sample code: Get a virtual endpoint. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ public static void - getAVirtualEndpoint(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + getAVirtualEndpoint(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.virtualEndpoints() .getWithResponse("testrg", "pgtestsvc4", "pgVirtualEndpoint1", com.azure.core.util.Context.NONE); } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/VirtualEndpointsListByServerSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/VirtualEndpointsListByServerSamples.java index 2e8064fdb6e90..097caabdbeead 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 @@ -9,15 +9,17 @@ */ public final class VirtualEndpointsListByServerSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/VirtualEndpointsListByServer.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * VirtualEndpointsListByServer.json */ /** * Sample code: VirtualEndpointListByServer. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ - public static void - virtualEndpointListByServer(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + public static void virtualEndpointListByServer( + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.virtualEndpoints().listByServer("testrg", "pgtestsvc4", com.azure.core.util.Context.NONE); } } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/VirtualEndpointsUpdateSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/VirtualEndpointsUpdateSamples.java index 67a0678172cc8..9a411f8570c09 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 @@ -13,15 +13,17 @@ */ public final class VirtualEndpointsUpdateSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/VirtualEndpointUpdate.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * VirtualEndpointUpdate.json */ /** * Sample code: Update a virtual endpoint for a server to update the. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ public static void updateAVirtualEndpointForAServerToUpdateThe( - com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { VirtualEndpointResource resource = manager.virtualEndpoints() .getWithResponse("testrg", "pgtestsvc4", "pgVirtualEndpoint1", com.azure.core.util.Context.NONE) .getValue(); 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 ef3db500b617d..ffe0f32ffc389 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 @@ -11,15 +11,17 @@ */ public final class VirtualNetworkSubnetUsageExecuteSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/VirtualNetworkSubnetUsage.json + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * VirtualNetworkSubnetUsage.json */ /** * Sample code: VirtualNetworkSubnetUsageList. * - * @param manager Entry point to PostgreSqlManager. + * @param manager Entry point to PostgreSqlServerManager. */ - public static void - virtualNetworkSubnetUsageList(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + public static void virtualNetworkSubnetUsageList( + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlServerManager manager) { manager.virtualNetworkSubnetUsages() .executeWithResponse("westus", new VirtualNetworkSubnetUsageParameter().withVirtualNetworkArmResourceId( "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/testvnet"), 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 0c8fd44887951..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\":\"User\",\"principalName\":\"ywdxsmic\",\"objectId\":\"rwfscjfnynszquj\",\"tenantId\":\"dvoqyt\"},\"id\":\"yo\",\"name\":\"bblgyavut\",\"type\":\"thjoxoism\"}"; - - 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("cubiipuipw") - .withExistingFlexibleServer("euzaof", "chvcyyysfgdo") - .withPrincipalType(PrincipalType.USER) - .withPrincipalName("acjekni") - .withTenantId("hqvcimpevfgmblr") - .create(); - - Assertions.assertEquals(PrincipalType.USER, response.principalType()); - Assertions.assertEquals("ywdxsmic", response.principalName()); - Assertions.assertEquals("rwfscjfnynszquj", response.objectId()); - Assertions.assertEquals("dvoqyt", 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 1326394bd3a80..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("ufactk", "hzovaj", "ziuxxpshnee", 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 f3328a28d443f..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\":\"Unknown\",\"principalName\":\"mduvw\",\"objectId\":\"lvxwmyg\",\"tenantId\":\"pgpqchiszepnnb\"},\"id\":\"rxgibbd\",\"name\":\"xconfozauors\",\"type\":\"kokwbqplhlvnu\"}"; - - 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("ulfgslqu", "kwdlenrdsutujba", "pjuohminyfl", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(PrincipalType.UNKNOWN, response.principalType()); - Assertions.assertEquals("mduvw", response.principalName()); - Assertions.assertEquals("lvxwmyg", response.objectId()); - Assertions.assertEquals("pgpqchiszepnnb", 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 f0e3c0b3ef69c..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\":\"User\",\"principalName\":\"nrwrbiork\",\"objectId\":\"lywjhh\",\"tenantId\":\"nhxmsi\"},\"id\":\"omi\",\"name\":\"ox\",\"type\":\"gdufiqnd\"}]}"; - - 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("epzl", "phwzsoldweyuqdu", com.azure.core.util.Context.NONE); - - Assertions.assertEquals(PrincipalType.USER, response.iterator().next().principalType()); - Assertions.assertEquals("nrwrbiork", response.iterator().next().principalName()); - Assertions.assertEquals("lywjhh", response.iterator().next().objectId()); - Assertions.assertEquals("nhxmsi", 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 4f8bba3553de1..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\":\"gktrmgucnapkte\"}}") - .toObject(BackupRequestBase.class); - Assertions.assertEquals("gktrmgucnapkte", model.backupSettings().backupName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - BackupRequestBase model - = new BackupRequestBase().withBackupSettings(new BackupSettings().withBackupName("gktrmgucnapkte")); - model = BinaryData.fromObject(model).toObject(BackupRequestBase.class); - Assertions.assertEquals("gktrmgucnapkte", 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 cc6ebf276393c..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\":\"ellwptfdy\"}").toObject(BackupSettings.class); - Assertions.assertEquals("ellwptfdy", model.backupName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - BackupSettings model = new BackupSettings().withBackupName("ellwptfdy"); - model = BinaryData.fromObject(model).toObject(BackupSettings.class); - Assertions.assertEquals("ellwptfdy", 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 515aa2557a30f..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/BackupStoreDetailsTests.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.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\":[\"qxolzdahzx\"]}").toObject(BackupStoreDetails.class); - Assertions.assertEquals("qxolzdahzx", model.sasUriList().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - BackupStoreDetails model = new BackupStoreDetails().withSasUriList(Arrays.asList("qxolzdahzx")); - model = BinaryData.fromObject(model).toObject(BackupStoreDetails.class); - Assertions.assertEquals("qxolzdahzx", 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/BackupsGetWithResponseMockTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/BackupsGetWithResponseMockTests.java deleted file mode 100644 index ea557f68a2cc8..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\":\"Full\",\"completedTime\":\"2021-04-12T21:20:45Z\",\"source\":\"lyoupfgfbkju\"},\"id\":\"yhgk\",\"name\":\"minsgowzf\",\"type\":\"tsttktlahbq\"}"; - - 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("ksbpimlqoljx", "cgxxlxs", "fgcviz", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(Origin.FULL, response.backupType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-12T21:20:45Z"), response.completedTime()); - Assertions.assertEquals("lyoupfgfbkju", 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 44cd2f30b78a8..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\":\"Full\",\"completedTime\":\"2021-11-27T09:39:12Z\",\"source\":\"uisavokq\"},\"id\":\"fvazivjlfrqttba\",\"name\":\"lkatnwxyiopidkqq\",\"type\":\"kuvscxkdm\"}]}"; - - 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("ctxtgzukxi", "mmqtgqqqxhr", com.azure.core.util.Context.NONE); - - Assertions.assertEquals(Origin.FULL, response.iterator().next().backupType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-27T09:39:12Z"), - response.iterator().next().completedTime()); - Assertions.assertEquals("uisavokq", 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 5e437e6427abf..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\":\"ulcdisdosf\",\"type\":\"jsvg\",\"nameAvailable\":true,\"reason\":\"Invalid\",\"message\":\"vyc\"}"; - - 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("okqgukkjq").withType("broyla"), - com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(true, response.nameAvailable()); - Assertions.assertEquals(CheckNameAvailabilityReason.INVALID, response.reason()); - Assertions.assertEquals("vyc", 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 1b8861e637ffb..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\":\"edxihchrphkmcrj\",\"type\":\"nsdfzpbgtgky\",\"nameAvailable\":false,\"reason\":\"AlreadyExists\",\"message\":\"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)); - - NameAvailability response = manager.checkNameAvailabilityWithLocations() - .executeWithResponse("t", - new CheckNameAvailabilityRequest().withName("lxgccknfnwmbtm").withType("dvjdhttza"), - com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(false, response.nameAvailable()); - Assertions.assertEquals(CheckNameAvailabilityReason.ALREADY_EXISTS, response.reason()); - Assertions.assertEquals("jeuut", 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 fa795a3294b2a..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\":\"meisls\",\"description\":\"asylwx\",\"defaultValue\":\"aumweoohguufu\",\"dataType\":\"Integer\",\"allowedValues\":\"jathwtzo\",\"source\":\"a\",\"isDynamicConfig\":false,\"isReadOnly\":false,\"isConfigPendingRestart\":true,\"unit\":\"bwjscjpahlxveab\",\"documentationLink\":\"xnmwmqtibxyijddt\"},\"id\":\"cttadi\",\"name\":\"aeukm\",\"type\":\"sieekpndzaapm\"}"; - - 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("ankjpdnjzh", "joylh", "lmuoyxprimrsopte", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("meisls", response.value()); - Assertions.assertEquals("a", 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 e7670c7dbefea..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\":\"gppipifh\",\"description\":\"e\",\"defaultValue\":\"jvgcxtx\",\"dataType\":\"Numeric\",\"allowedValues\":\"eafidltugsresm\",\"source\":\"sjhoiftxfkfwegpr\",\"isDynamicConfig\":true,\"isReadOnly\":false,\"isConfigPendingRestart\":false,\"unit\":\"biqtgdq\",\"documentationLink\":\"mcwsldrizetpwb\"},\"id\":\"lllibph\",\"name\":\"qzmiza\",\"type\":\"a\"}]}"; - - 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("wxezwzhok", "bwnhhtql", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("gppipifh", response.iterator().next().value()); - Assertions.assertEquals("sjhoiftxfkfwegpr", 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 cdee52eef3211..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\":\"reljeamur\",\"description\":\"mlovuanashcxl\",\"defaultValue\":\"jerbdkelvidizozs\",\"dataType\":\"Numeric\",\"allowedValues\":\"xjmonf\",\"source\":\"nwncypuuw\",\"isDynamicConfig\":true,\"isReadOnly\":false,\"isConfigPendingRestart\":true,\"unit\":\"tzenk\",\"documentationLink\":\"fzzhmkdasv\"},\"id\":\"yhbxcudchxgs\",\"name\":\"boldforobwj\",\"type\":\"vizbfhfo\"}"; - - 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("ybpmzznrtffyaq") - .withExistingFlexibleServer("dqmeqwigpibudq", "yxeb") - .withValue("hheioqaqhvseuf") - .withSource("rnxzh") - .create(); - - Assertions.assertEquals("reljeamur", response.value()); - Assertions.assertEquals("nwncypuuw", 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 a2367d6612171..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\":\"ctfnmdxotng\",\"collation\":\"gugey\"},\"id\":\"hgrky\",\"name\":\"i\",\"type\":\"absnmfpp\"}"; - - 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("xfuojrn") - .withExistingFlexibleServer("ihrraiouaub", "jtlo") - .withCharset("l") - .withCollation("pasccbi") - .create(); - - Assertions.assertEquals("ctfnmdxotng", response.charset()); - Assertions.assertEquals("gugey", 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 4518a83d0de23..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("vacqpbtuodxesz", "bbelawumuaslzk", "rrwoycqucwyhahn", 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 f291e1eb25fc7..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\":\"pgepqtybbwwpgda\",\"collation\":\"hzyvlixqnrkcx\"},\"id\":\"ibn\",\"name\":\"mysu\",\"type\":\"swqrntvlwijp\"}"; - - 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("mdr", "ywuhpsvfuur", "tlwexxwlalniexz", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("pgepqtybbwwpgda", response.charset()); - Assertions.assertEquals("hzyvlixqnrkcx", 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 e53f695a3e8f6..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\":\"pkcdqzhlct\",\"collation\":\"unqndyfpchrqb\"},\"id\":\"jrcg\",\"name\":\"gydcw\",\"type\":\"oxjumvqqo\"}]}"; - - 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("ttexoqqpwcyyufmh", "uncuw", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("pkcdqzhlct", response.iterator().next().charset()); - Assertions.assertEquals("unqndyfpchrqb", 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 398156e0597b1..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/DelegatedSubnetUsageTests.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.DelegatedSubnetUsage; - -public final class DelegatedSubnetUsageTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DelegatedSubnetUsage model - = BinaryData.fromString("{\"subnetName\":\"wzcjznmwcpmgua\",\"usage\":6174770568857951171}") - .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 c4f80915e6ed3..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\":\"sdtmcdzs\",\"endIpAddress\":\"fcohdxbzlmcmu\"},\"id\":\"cvhd\",\"name\":\"evwqqxeyskonq\",\"type\":\"inkfkbgbz\"}"; - - 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("mftpmdtz") - .withExistingFlexibleServer("jkavl", "or") - .withStartIpAddress("jltfvnzcyjtotpv") - .withEndIpAddress("pvpbdbzqgqqiheds") - .create(); - - Assertions.assertEquals("sdtmcdzs", response.startIpAddress()); - Assertions.assertEquals("fcohdxbzlmcmu", 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 f4c2fe3739ec7..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("ojeevy", "yhsgz", "czbgomfgbeg", 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 4e2be90c3ebb4..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\":\"qqxlajr\",\"endIpAddress\":\"wxacevehj\"},\"id\":\"yxoaf\",\"name\":\"aoqltfaey\",\"type\":\"inmfgvxirp\"}"; - - 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("qgleohibetnluank", "rfxeeebtij", "acvbmqz", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("qqxlajr", response.startIpAddress()); - Assertions.assertEquals("wxacevehj", 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 babf4cf05f0eb..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\":\"nuciqdsmexiit\",\"endIpAddress\":\"fuxtyasiibmiybnn\"},\"id\":\"tgnljhnmgixhcmav\",\"name\":\"qfoudorhcgyy\",\"type\":\"rotwypundmbxhugc\"}]}"; - - 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("hriypoqeyhlqhy", "prlpy", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("nuciqdsmexiit", response.iterator().next().startIpAddress()); - Assertions.assertEquals("fuxtyasiibmiybnn", 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 f5febaf082b06..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\":1111352078}}"; - - 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("tzxpuamwabzxrv", "cush", - new LtrPreBackupRequest().withBackupSettings(new BackupSettings().withBackupName("phai")), - com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(1111352078, 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 6bfbffa6a4df6..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 = "\"phdu\""; - - 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("phdu", 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 01804ec6376fc..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\":\"xk\",\"supportedServerEditions\":[{\"name\":\"azur\",\"defaultSkuName\":\"cbgoor\",\"supportedStorageEditions\":[{\"name\":\"ybfhjxa\",\"defaultStorageSizeMb\":5656556959711721318,\"supportedStorageMb\":[{},{},{}],\"status\":\"Disabled\",\"reason\":\"dilmyww\"},{\"name\":\"gkxnyedabg\",\"defaultStorageSizeMb\":475774977196617352,\"supportedStorageMb\":[{},{},{},{}],\"status\":\"Default\",\"reason\":\"bcihxuuwhc\"},{\"name\":\"xccybvpa\",\"defaultStorageSizeMb\":6238077672035548376,\"supportedStorageMb\":[{},{},{}],\"status\":\"Visible\",\"reason\":\"gwjplmag\"},{\"name\":\"cyohpfkyrkdbd\",\"defaultStorageSizeMb\":3710008921485897476,\"supportedStorageMb\":[{},{}],\"status\":\"Available\",\"reason\":\"wqjnob\"}],\"supportedServerSkus\":[{\"name\":\"ddviacegfnmntfpm\",\"vCores\":1245666604,\"supportedIops\":999073348,\"supportedMemoryPerVcoreMb\":5936316598559171392,\"supportedZones\":[\"vvbalx\"],\"supportedHaMode\":[\"SameZone\",\"SameZone\",\"ZoneRedundant\",\"ZoneRedundant\"],\"status\":\"Available\",\"reason\":\"evwrdnhfuk\"},{\"name\":\"sjcswsmystuluqyp\",\"vCores\":1783589840,\"supportedIops\":291266426,\"supportedMemoryPerVcoreMb\":2710586854780001980,\"supportedZones\":[\"bm\",\"pjbabwidfc\",\"sspuunnoxyhkx\",\"qddrihpfhoqcaae\"],\"supportedHaMode\":[\"ZoneRedundant\",\"SameZone\",\"SameZone\"],\"status\":\"Visible\",\"reason\":\"pjxxkzb\"}],\"status\":\"Available\",\"reason\":\"eivsiykzkdnc\"},{\"name\":\"xonbzoggculapz\",\"defaultSkuName\":\"rpgogtqxep\",\"supportedStorageEditions\":[{\"name\":\"fuajly\",\"defaultStorageSizeMb\":8707082855119375763,\"supportedStorageMb\":[{},{}],\"status\":\"Disabled\",\"reason\":\"vfcibyfmowux\"}],\"supportedServerSkus\":[{\"name\":\"vdwxfzwi\",\"vCores\":1157352083,\"supportedIops\":1754263967,\"supportedMemoryPerVcoreMb\":3348863459715855066,\"supportedZones\":[\"xjrk\",\"mbtrnegvmnvu\"],\"supportedHaMode\":[\"SameZone\",\"SameZone\",\"ZoneRedundant\",\"ZoneRedundant\"],\"status\":\"Disabled\",\"reason\":\"tjb\"}],\"status\":\"Available\",\"reason\":\"flvestmjlxrrilo\"},{\"name\":\"peewchpxlkt\",\"defaultSkuName\":\"uziycsl\",\"supportedStorageEditions\":[{\"name\":\"uztcktyhjtqed\",\"defaultStorageSizeMb\":5572638261267969935,\"supportedStorageMb\":[{},{}],\"status\":\"Default\",\"reason\":\"qzz\"},{\"name\":\"jvpglydzgk\",\"defaultStorageSizeMb\":4622170098850979496,\"supportedStorageMb\":[{},{},{}],\"status\":\"Available\",\"reason\":\"pryu\"},{\"name\":\"wytpzdmovz\",\"defaultStorageSizeMb\":1753829479410952479,\"supportedStorageMb\":[{}],\"status\":\"Visible\",\"reason\":\"dflgzuri\"},{\"name\":\"aecxndtic\",\"defaultStorageSizeMb\":2952144912587821446,\"supportedStorageMb\":[{},{},{}],\"status\":\"Available\",\"reason\":\"mldgxobfirc\"}],\"supportedServerSkus\":[{\"name\":\"ciayzriykhya\",\"vCores\":47458099,\"supportedIops\":235772258,\"supportedMemoryPerVcoreMb\":8892395873525165573,\"supportedZones\":[\"kjlmx\",\"omdynhdwdigum\",\"nraauzz\"],\"supportedHaMode\":[\"SameZone\",\"SameZone\",\"SameZone\",\"SameZone\"],\"status\":\"Default\",\"reason\":\"ezwwv\"}],\"status\":\"Default\",\"reason\":\"uvvfonkp\"},{\"name\":\"qyikvy\",\"defaultSkuName\":\"uyav\",\"supportedStorageEditions\":[{\"name\":\"ncstt\",\"defaultStorageSizeMb\":9105800928046481710,\"supportedStorageMb\":[{}],\"status\":\"Visible\",\"reason\":\"krsgsgb\"}],\"supportedServerSkus\":[{\"name\":\"qgnjdgkynscli\",\"vCores\":1543388563,\"supportedIops\":252891746,\"supportedMemoryPerVcoreMb\":2288883432059892927,\"supportedZones\":[\"tkubotppn\"],\"supportedHaMode\":[\"SameZone\"],\"status\":\"Disabled\",\"reason\":\"hfrbbc\"},{\"name\":\"qagt\",\"vCores\":1362620391,\"supportedIops\":2099072626,\"supportedMemoryPerVcoreMb\":2322539021539304077,\"supportedZones\":[\"py\",\"vgtrdcnifmzzs\",\"ymbrnysuxmpraf\",\"g\"],\"supportedHaMode\":[\"ZoneRedundant\",\"ZoneRedundant\",\"SameZone\",\"SameZone\"],\"status\":\"Disabled\",\"reason\":\"fwafqrouda\"},{\"name\":\"avehhrvkbunzo\",\"vCores\":35410717,\"supportedIops\":1288828831,\"supportedMemoryPerVcoreMb\":9008191829096348596,\"supportedZones\":[\"yxcdyuibhmfdnbzy\",\"vfvfcj\",\"aeoisrvh\"],\"supportedHaMode\":[\"SameZone\",\"ZoneRedundant\",\"ZoneRedundant\"],\"status\":\"Default\",\"reason\":\"scvwmzhwplef\"},{\"name\":\"vxilcbt\",\"vCores\":896173123,\"supportedIops\":2012963266,\"supportedMemoryPerVcoreMb\":1792451256873457712,\"supportedZones\":[\"jjfzqlqhycavo\"],\"supportedHaMode\":[\"ZoneRedundant\",\"SameZone\",\"ZoneRedundant\"],\"status\":\"Visible\",\"reason\":\"mieknlraria\"}],\"status\":\"Disabled\",\"reason\":\"agy\"}],\"supportedServerVersions\":[{\"name\":\"bylyrfgia\",\"supportedVersionsToUpgrade\":[\"ojocqwogf\",\"zjvusfzldmo\",\"uxylfsbtkadpy\",\"own\"],\"status\":\"Default\",\"reason\":\"bugrj\"}],\"fastProvisioningSupported\":\"Enabled\",\"supportedFastProvisioningEditions\":[{\"supportedTier\":\"mi\",\"supportedSku\":\"fieypefojyqdhcup\",\"supportedStorageGb\":1670240889,\"supportedServerVersions\":\"cwkhihi\",\"serverCount\":1457958163,\"status\":\"Disabled\",\"reason\":\"qtz\"}],\"geoBackupSupported\":\"Disabled\",\"zoneRedundantHaSupported\":\"Enabled\",\"zoneRedundantHaAndGeoBackupSupported\":\"Enabled\",\"storageAutoGrowthSupported\":\"Enabled\",\"onlineResizeSupported\":\"Disabled\",\"restricted\":\"Enabled\",\"status\":\"Available\",\"reason\":\"actxmwoteyowc\"}]}"; - - 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("igovi", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("xk", 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 2e1e9ba918ffd..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-12-07T02:03:19Z\",\"lastModifiedTime\":\"2021-06-16T15:34:06Z\",\"sizeInKb\":4507882308438079300,\"type\":\"g\",\"url\":\"ujb\"},\"id\":\"omvzzbtd\",\"name\":\"qvpn\",\"type\":\"yujviylwdshfssn\"}") - .toObject(LogFileInner.class); - Assertions.assertEquals(OffsetDateTime.parse("2021-12-07T02:03:19Z"), model.createdTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-16T15:34:06Z"), model.lastModifiedTime()); - Assertions.assertEquals(4507882308438079300L, model.sizeInKb()); - Assertions.assertEquals("g", model.typePropertiesType()); - Assertions.assertEquals("ujb", model.url()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - LogFileInner model = new LogFileInner().withCreatedTime(OffsetDateTime.parse("2021-12-07T02:03:19Z")) - .withLastModifiedTime(OffsetDateTime.parse("2021-06-16T15:34:06Z")) - .withSizeInKb(4507882308438079300L) - .withTypePropertiesType("g") - .withUrl("ujb"); - model = BinaryData.fromObject(model).toObject(LogFileInner.class); - Assertions.assertEquals(OffsetDateTime.parse("2021-12-07T02:03:19Z"), model.createdTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-16T15:34:06Z"), model.lastModifiedTime()); - Assertions.assertEquals(4507882308438079300L, model.sizeInKb()); - Assertions.assertEquals("g", model.typePropertiesType()); - Assertions.assertEquals("ujb", 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 6504244feb42d..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/LogFileListResultTests.java +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.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-01-09T04:08:29Z\",\"lastModifiedTime\":\"2021-01-15T08:24:44Z\",\"sizeInKb\":8766240575961475236,\"type\":\"fiufx\",\"url\":\"npirgnepttw\"},\"id\":\"sniffc\",\"name\":\"mqnrojlpijnkr\",\"type\":\"frddhcrati\"},{\"properties\":{\"createdTime\":\"2021-06-27T16:40:41Z\",\"lastModifiedTime\":\"2021-05-12T01:29:29Z\",\"sizeInKb\":1499717509379744462,\"type\":\"tozqyzhftwesgo\",\"url\":\"zhonnxkrlgnyhmo\"},\"id\":\"xkk\",\"name\":\"thrrgh\",\"type\":\"jbdhqxvc\"},{\"properties\":{\"createdTime\":\"2021-08-03T04:18:25Z\",\"lastModifiedTime\":\"2021-06-30T13:21:57Z\",\"sizeInKb\":6288014935815935700,\"type\":\"shrnsvbuswdvz\",\"url\":\"bycnunvjsrtkf\"},\"id\":\"nopqgikyzirtx\",\"name\":\"yuxzejntpsewgi\",\"type\":\"ilqu\"},{\"properties\":{\"createdTime\":\"2021-01-27T19:33:50Z\",\"lastModifiedTime\":\"2021-05-20T16:44:09Z\",\"sizeInKb\":2574413464596771769,\"type\":\"ox\",\"url\":\"ggufhyaomtb\"},\"id\":\"havgrvk\",\"name\":\"fo\",\"type\":\"jzhpjbibgjmfx\"}],\"nextLink\":\"vfcluyovwxnbkfe\"}") - .toObject(LogFileListResult.class); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-09T04:08:29Z"), model.value().get(0).createdTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-15T08:24:44Z"), model.value().get(0).lastModifiedTime()); - Assertions.assertEquals(8766240575961475236L, model.value().get(0).sizeInKb()); - Assertions.assertEquals("fiufx", model.value().get(0).typePropertiesType()); - Assertions.assertEquals("npirgnepttw", model.value().get(0).url()); - Assertions.assertEquals("vfcluyovwxnbkfe", 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-01-09T04:08:29Z")) - .withLastModifiedTime(OffsetDateTime.parse("2021-01-15T08:24:44Z")) - .withSizeInKb(8766240575961475236L) - .withTypePropertiesType("fiufx") - .withUrl("npirgnepttw"), - new LogFileInner().withCreatedTime(OffsetDateTime.parse("2021-06-27T16:40:41Z")) - .withLastModifiedTime(OffsetDateTime.parse("2021-05-12T01:29:29Z")) - .withSizeInKb(1499717509379744462L) - .withTypePropertiesType("tozqyzhftwesgo") - .withUrl("zhonnxkrlgnyhmo"), - new LogFileInner().withCreatedTime(OffsetDateTime.parse("2021-08-03T04:18:25Z")) - .withLastModifiedTime(OffsetDateTime.parse("2021-06-30T13:21:57Z")) - .withSizeInKb(6288014935815935700L) - .withTypePropertiesType("shrnsvbuswdvz") - .withUrl("bycnunvjsrtkf"), - new LogFileInner().withCreatedTime(OffsetDateTime.parse("2021-01-27T19:33:50Z")) - .withLastModifiedTime(OffsetDateTime.parse("2021-05-20T16:44:09Z")) - .withSizeInKb(2574413464596771769L) - .withTypePropertiesType("ox") - .withUrl("ggufhyaomtb"))) - .withNextLink("vfcluyovwxnbkfe"); - model = BinaryData.fromObject(model).toObject(LogFileListResult.class); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-09T04:08:29Z"), model.value().get(0).createdTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-15T08:24:44Z"), model.value().get(0).lastModifiedTime()); - Assertions.assertEquals(8766240575961475236L, model.value().get(0).sizeInKb()); - Assertions.assertEquals("fiufx", model.value().get(0).typePropertiesType()); - Assertions.assertEquals("npirgnepttw", model.value().get(0).url()); - Assertions.assertEquals("vfcluyovwxnbkfe", 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 f02ba77054073..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-10-15T12:19:25Z\",\"lastModifiedTime\":\"2021-08-09T21:16:26Z\",\"sizeInKb\":2974540016936368802,\"type\":\"sgaojfmwncot\",\"url\":\"fhir\"}") - .toObject(LogFileProperties.class); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-15T12:19:25Z"), model.createdTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-09T21:16:26Z"), model.lastModifiedTime()); - Assertions.assertEquals(2974540016936368802L, model.sizeInKb()); - Assertions.assertEquals("sgaojfmwncot", model.type()); - Assertions.assertEquals("fhir", model.url()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - LogFileProperties model = new LogFileProperties().withCreatedTime(OffsetDateTime.parse("2021-10-15T12:19:25Z")) - .withLastModifiedTime(OffsetDateTime.parse("2021-08-09T21:16:26Z")) - .withSizeInKb(2974540016936368802L) - .withType("sgaojfmwncot") - .withUrl("fhir"); - model = BinaryData.fromObject(model).toObject(LogFileProperties.class); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-15T12:19:25Z"), model.createdTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-09T21:16:26Z"), model.lastModifiedTime()); - Assertions.assertEquals(2974540016936368802L, model.sizeInKb()); - Assertions.assertEquals("sgaojfmwncot", model.type()); - Assertions.assertEquals("fhir", 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 8d0c94aff8354..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-07-27T13:55:01Z\",\"lastModifiedTime\":\"2021-06-04T03:09:29Z\",\"sizeInKb\":5363354368308403251,\"type\":\"anarfdlpukhpyrne\",\"url\":\"jcpeogkhnmg\"},\"id\":\"ouxddbhfhpfpazj\",\"name\":\"oywjxhpdulont\",\"type\":\"cnpqwteht\"}]}"; - - 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("h", "jnhgwydyyn", com.azure.core.util.Context.NONE); - - Assertions.assertEquals(OffsetDateTime.parse("2021-07-27T13:55:01Z"), response.iterator().next().createdTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-04T03:09:29Z"), - response.iterator().next().lastModifiedTime()); - Assertions.assertEquals(5363354368308403251L, response.iterator().next().sizeInKb()); - Assertions.assertEquals("anarfdlpukhpyrne", response.iterator().next().typePropertiesType()); - Assertions.assertEquals("jcpeogkhnmg", 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 6841510e9ec18..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/LtrBackupRequestTests.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.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\":[\"b\",\"ac\",\"op\"]},\"backupSettings\":{\"backupName\":\"fqrhhuaopppc\"}}") - .toObject(LtrBackupRequest.class); - Assertions.assertEquals("fqrhhuaopppc", model.backupSettings().backupName()); - Assertions.assertEquals("b", model.targetDetails().sasUriList().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - LtrBackupRequest model - = new LtrBackupRequest().withBackupSettings(new BackupSettings().withBackupName("fqrhhuaopppc")) - .withTargetDetails(new BackupStoreDetails().withSasUriList(Arrays.asList("b", "ac", "op"))); - model = BinaryData.fromObject(model).toObject(LtrBackupRequest.class); - Assertions.assertEquals("fqrhhuaopppc", model.backupSettings().backupName()); - Assertions.assertEquals("b", 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 185eaf3a83650..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\":\"lynqwwncwzzh\"}}") - .toObject(LtrPreBackupRequest.class); - Assertions.assertEquals("lynqwwncwzzh", model.backupSettings().backupName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - LtrPreBackupRequest model - = new LtrPreBackupRequest().withBackupSettings(new BackupSettings().withBackupName("lynqwwncwzzh")); - model = BinaryData.fromObject(model).toObject(LtrPreBackupRequest.class); - Assertions.assertEquals("lynqwwncwzzh", 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 a5ed0ad710513..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\":1046571541}}") - .toObject(LtrPreBackupResponseInner.class); - Assertions.assertEquals(1046571541, model.numberOfContainers()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - LtrPreBackupResponseInner model = new LtrPreBackupResponseInner().withNumberOfContainers(1046571541); - model = BinaryData.fromObject(model).toObject(LtrPreBackupResponseInner.class); - Assertions.assertEquals(1046571541, 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 a79551f8d9512..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\":622690283}") - .toObject(LtrPreBackupResponseProperties.class); - Assertions.assertEquals(622690283, model.numberOfContainers()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - LtrPreBackupResponseProperties model = new LtrPreBackupResponseProperties().withNumberOfContainers(622690283); - model = BinaryData.fromObject(model).toObject(LtrPreBackupResponseProperties.class); - Assertions.assertEquals(622690283, 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 b009146a971e5..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/MigrationsDeleteWithResponseMockTests.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.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("inwjizcilngh", "shejjtbxqm", "luxlxqzvnersby", "ucrwnami", - 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/NamePropertyTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/NamePropertyTests.java deleted file mode 100644 index 53ee3bbf2a3c7..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/NamePropertyTests.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.NameProperty; -import org.junit.jupiter.api.Assertions; - -public final class NamePropertyTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NameProperty model = BinaryData.fromString("{\"value\":\"ond\",\"localizedValue\":\"luudfdlwggytsb\"}") - .toObject(NameProperty.class); - Assertions.assertEquals("ond", model.value()); - Assertions.assertEquals("luudfdlwggytsb", model.localizedValue()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NameProperty model = new NameProperty().withValue("ond").withLocalizedValue("luudfdlwggytsb"); - model = BinaryData.fromObject(model).toObject(NameProperty.class); - Assertions.assertEquals("ond", model.value()); - Assertions.assertEquals("luudfdlwggytsb", model.localizedValue()); - } -} 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 4d95c0758d812..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\":\"ajquhuxylrjvmtyg\",\"display\":{\"provider\":\"zyos\",\"resource\":\"p\",\"operation\":\"c\",\"description\":\"kyjpmspbps\"},\"isDataAction\":true,\"origin\":\"system\",\"properties\":{\"eyujtvczkcnyxrx\":\"datagt\",\"glnkvxlxpagl\":\"dataunjdx\",\"hpzvuqdflvoniyp\":\"dataivbgkcv\",\"idibgqjxgpn\":\"datapubcpzgpxtivhjk\"}},{\"name\":\"govfgpikqmhhaow\",\"display\":{\"provider\":\"zvuporqzdfuydz\",\"resource\":\"fvxcnqmxqpswo\",\"operation\":\"vkhlggdhbemz\",\"description\":\"zszuwiwtglxx\"},\"isDataAction\":true,\"origin\":\"system\",\"properties\":{\"gmqgjs\":\"dataicrmnzh\",\"rmbodt\":\"datavpqcb\",\"qgvriibakcla\":\"datas\",\"gmwohqfzizvu\":\"datajfrnxousxauzlwv\"}},{\"name\":\"mk\",\"display\":{\"provider\":\"thnwpzte\",\"resource\":\"vmribiat\",\"operation\":\"plucfotangcfhnyk\",\"description\":\"ugswvx\"},\"isDataAction\":true,\"origin\":\"system\",\"properties\":{\"cvclxynpdk\":\"datavtxnjmxmcuqud\"}}],\"nextLink\":\"fabuiyjibu\"}"; - - 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("fabuiyjibu", 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 464cc0268467f..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\":[\"xrdcqtj\",\"idttgepus\",\"vyjtcvu\"],\"privateEndpoint\":{\"id\":\"s\"},\"privateLinkServiceConnectionState\":{\"status\":\"Approved\",\"description\":\"sfuughtuqfecjx\",\"actionsRequired\":\"gtuhxuicbu\"},\"provisioningState\":\"Succeeded\"},\"id\":\"s\",\"name\":\"njlx\",\"type\":\"zrhwp\"}"; - - 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("epdfgkmtdherng", "tcjuahokqto", "kauxof", - new PrivateEndpointConnectionInner().withPrivateEndpoint(new PrivateEndpoint()) - .withPrivateLinkServiceConnectionState(new PrivateLinkServiceConnectionState() - .withStatus(PrivateEndpointServiceConnectionStatus.REJECTED) - .withDescription("bauiropi") - .withActionsRequired("szonwpngajinn")), - com.azure.core.util.Context.NONE); - - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.APPROVED, - response.privateLinkServiceConnectionState().status()); - Assertions.assertEquals("sfuughtuqfecjx", response.privateLinkServiceConnectionState().description()); - Assertions.assertEquals("gtuhxuicbu", 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 cd884a67b2e06..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\":[\"r\",\"x\",\"ewpktvqy\"],\"privateEndpoint\":{\"id\":\"qpzoyhlfbcgwgcl\"},\"privateLinkServiceConnectionState\":{\"status\":\"Pending\",\"description\":\"bqinjipnwjfu\",\"actionsRequired\":\"lafcbahh\"},\"provisioningState\":\"Creating\"},\"id\":\"foiyjwpfilk\",\"name\":\"kkholvdndvia\",\"type\":\"ogphuartvtiu\"}"; - - 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("neiknpg", "xgjiuqh", "btozipqwje", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.PENDING, - response.privateLinkServiceConnectionState().status()); - Assertions.assertEquals("bqinjipnwjfu", response.privateLinkServiceConnectionState().description()); - Assertions.assertEquals("lafcbahh", 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 c66b502ec2337..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/PrivateEndpointConnectionsListByServerMockTests.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.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\":[\"oxffif\"],\"privateEndpoint\":{\"id\":\"rsnewmozqvbubqma\"},\"privateLinkServiceConnectionState\":{\"status\":\"Approved\",\"description\":\"cx\",\"actionsRequired\":\"zgaz\"},\"provisioningState\":\"Succeeded\"},\"id\":\"o\",\"name\":\"dvmfqhppub\",\"type\":\"w\"}]}"; - - 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("yefchnm", "ahmnxhkxjqirw", com.azure.core.util.Context.NONE); - - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.APPROVED, - response.iterator().next().privateLinkServiceConnectionState().status()); - Assertions.assertEquals("cx", response.iterator().next().privateLinkServiceConnectionState().description()); - Assertions.assertEquals("zgaz", - 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 e6ae20dbb0c22..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\":\"bnfxofvc\",\"requiredMembers\":[\"dirazf\",\"xejw\"],\"requiredZoneNames\":[\"dujtmvcope\",\"c\",\"jurbuhhlkyqltqsr\",\"gtuwkff\"]},\"id\":\"ktsysidfvclglxn\",\"name\":\"uijtkbu\",\"type\":\"qogsfikayian\"}"; - - 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("ueio", "kjbsah", "tdtpdelqacslmo", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("dujtmvcope", 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 592bf684deae4..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\":\"jqatucoigebxn\",\"requiredMembers\":[\"fepbnwgfmxjgc\",\"bjb\",\"dlfgtdysnaq\"],\"requiredZoneNames\":[\"qbctqha\",\"zjrwdkqze\",\"yjleziunjx\",\"fza\"]},\"id\":\"kwcegyamlbn\",\"name\":\"eqacjjvpilguooq\",\"type\":\"agmdit\"}]}"; - - 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("sxjb", "qehgpd", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("qbctqha", 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/QuotaUsageInnerTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/QuotaUsageInnerTests.java deleted file mode 100644 index 153051e3d23ea..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/QuotaUsageInnerTests.java +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.QuotaUsageInner; -import com.azure.resourcemanager.postgresqlflexibleserver.models.NameProperty; -import org.junit.jupiter.api.Assertions; - -public final class QuotaUsageInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - QuotaUsageInner model = BinaryData.fromString( - "{\"name\":{\"value\":\"tylbfpncurdoiw\",\"localizedValue\":\"thtywub\"},\"limit\":3048231352847216987,\"unit\":\"wqknfdn\",\"currentValue\":4775969019661520867,\"id\":\"rdgoihxumw\"}") - .toObject(QuotaUsageInner.class); - Assertions.assertEquals("tylbfpncurdoiw", model.name().value()); - Assertions.assertEquals("thtywub", model.name().localizedValue()); - Assertions.assertEquals(3048231352847216987L, model.limit()); - Assertions.assertEquals("wqknfdn", model.unit()); - Assertions.assertEquals(4775969019661520867L, model.currentValue()); - Assertions.assertEquals("rdgoihxumw", model.id()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - QuotaUsageInner model = new QuotaUsageInner() - .withName(new NameProperty().withValue("tylbfpncurdoiw").withLocalizedValue("thtywub")) - .withLimit(3048231352847216987L) - .withUnit("wqknfdn") - .withCurrentValue(4775969019661520867L) - .withId("rdgoihxumw"); - model = BinaryData.fromObject(model).toObject(QuotaUsageInner.class); - Assertions.assertEquals("tylbfpncurdoiw", model.name().value()); - Assertions.assertEquals("thtywub", model.name().localizedValue()); - Assertions.assertEquals(3048231352847216987L, model.limit()); - Assertions.assertEquals("wqknfdn", model.unit()); - Assertions.assertEquals(4775969019661520867L, model.currentValue()); - Assertions.assertEquals("rdgoihxumw", model.id()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/QuotaUsagesListMockTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/QuotaUsagesListMockTests.java deleted file mode 100644 index ae4ff9a4e17de..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/QuotaUsagesListMockTests.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.QuotaUsage; -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 QuotaUsagesListMockTests { - @Test - public void testList() throws Exception { - String responseStr - = "{\"value\":[{\"name\":{\"value\":\"iqxf\",\"localizedValue\":\"j\"},\"limit\":3974939603346143154,\"unit\":\"kpqhjpenuygbq\",\"currentValue\":3439448263345992300,\"id\":\"ewvnqvcdlgu\"}]}"; - - 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.quotaUsages().list("haru", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("iqxf", response.iterator().next().name().value()); - Assertions.assertEquals("j", response.iterator().next().name().localizedValue()); - Assertions.assertEquals(3974939603346143154L, response.iterator().next().limit()); - Assertions.assertEquals("kpqhjpenuygbq", response.iterator().next().unit()); - Assertions.assertEquals(3439448263345992300L, response.iterator().next().currentValue()); - Assertions.assertEquals("ewvnqvcdlgu", response.iterator().next().id()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/QuotaUsagesListResultTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/QuotaUsagesListResultTests.java deleted file mode 100644 index 82b5906c244d3..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/QuotaUsagesListResultTests.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.QuotaUsagesListResult; - -public final class QuotaUsagesListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - QuotaUsagesListResult model = BinaryData.fromString( - "{\"value\":[{\"name\":{\"value\":\"akpjpqqmtedlt\",\"localizedValue\":\"jihy\"},\"limit\":4159702080316838891,\"unit\":\"vwau\",\"currentValue\":4404884666059686122,\"id\":\"gupkvipmdscwxq\"},{\"name\":{\"value\":\"vzhfstotxhoj\",\"localizedValue\":\"bypel\"},\"limit\":3920435085963862976,\"unit\":\"ixbjx\",\"currentValue\":55141822425765508,\"id\":\"lrcoolsttpki\"}],\"nextLink\":\"kbnujr\"}") - .toObject(QuotaUsagesListResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - QuotaUsagesListResult model = new QuotaUsagesListResult(); - model = BinaryData.fromObject(model).toObject(QuotaUsagesListResult.class); - } -} 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/RestartParameterTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/RestartParameterTests.java deleted file mode 100644 index 3c4f8c1f6aa82..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\":\"ForcedSwitchover\"}") - .toObject(RestartParameter.class); - Assertions.assertEquals(true, model.restartWithFailover()); - Assertions.assertEquals(FailoverMode.FORCED_SWITCHOVER, model.failoverMode()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - RestartParameter model - = new RestartParameter().withRestartWithFailover(true).withFailoverMode(FailoverMode.FORCED_SWITCHOVER); - model = BinaryData.fromObject(model).toObject(RestartParameter.class); - Assertions.assertEquals(true, model.restartWithFailover()); - Assertions.assertEquals(FailoverMode.FORCED_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 cebb10bbbd470..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\":\"Full\",\"completedTime\":\"2021-02-10T03:30:23Z\",\"source\":\"x\"},\"id\":\"ivyqniwbybrkxvd\",\"name\":\"mjgr\",\"type\":\"fwvuk\"}") - .toObject(ServerBackupInner.class); - Assertions.assertEquals(Origin.FULL, model.backupType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-10T03:30:23Z"), model.completedTime()); - Assertions.assertEquals("x", model.source()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ServerBackupInner model = new ServerBackupInner().withBackupType(Origin.FULL) - .withCompletedTime(OffsetDateTime.parse("2021-02-10T03:30:23Z")) - .withSource("x"); - model = BinaryData.fromObject(model).toObject(ServerBackupInner.class); - Assertions.assertEquals(Origin.FULL, model.backupType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-10T03:30:23Z"), model.completedTime()); - Assertions.assertEquals("x", model.source()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServerBackupListResultTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServerBackupListResultTests.java deleted file mode 100644 index ffdbdb4f6b378..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServerBackupListResultTests.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.ServerBackupInner; -import com.azure.resourcemanager.postgresqlflexibleserver.models.Origin; -import com.azure.resourcemanager.postgresqlflexibleserver.models.ServerBackupListResult; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ServerBackupListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ServerBackupListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"backupType\":\"Full\",\"completedTime\":\"2021-08-18T11:52:54Z\",\"source\":\"hkryhtn\"},\"id\":\"czwlokjyem\",\"name\":\"kvnipjoxz\",\"type\":\"nchgej\"}],\"nextLink\":\"odmailzyd\"}") - .toObject(ServerBackupListResult.class); - Assertions.assertEquals(Origin.FULL, model.value().get(0).backupType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-18T11:52:54Z"), model.value().get(0).completedTime()); - Assertions.assertEquals("hkryhtn", model.value().get(0).source()); - Assertions.assertEquals("odmailzyd", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ServerBackupListResult model - = new ServerBackupListResult().withValue(Arrays.asList(new ServerBackupInner().withBackupType(Origin.FULL) - .withCompletedTime(OffsetDateTime.parse("2021-08-18T11:52:54Z")) - .withSource("hkryhtn"))).withNextLink("odmailzyd"); - model = BinaryData.fromObject(model).toObject(ServerBackupListResult.class); - Assertions.assertEquals(Origin.FULL, model.value().get(0).backupType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-18T11:52:54Z"), model.value().get(0).completedTime()); - Assertions.assertEquals("hkryhtn", model.value().get(0).source()); - Assertions.assertEquals("odmailzyd", model.nextLink()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServerBackupPropertiesTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServerBackupPropertiesTests.java deleted file mode 100644 index 09db89cf8affd..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServerBackupPropertiesTests.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.ServerBackupProperties; -import com.azure.resourcemanager.postgresqlflexibleserver.models.Origin; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; - -public final class ServerBackupPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ServerBackupProperties model = BinaryData - .fromString("{\"backupType\":\"Full\",\"completedTime\":\"2021-02-24T15:23:22Z\",\"source\":\"cs\"}") - .toObject(ServerBackupProperties.class); - Assertions.assertEquals(Origin.FULL, model.backupType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-24T15:23:22Z"), model.completedTime()); - Assertions.assertEquals("cs", model.source()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ServerBackupProperties model = new ServerBackupProperties().withBackupType(Origin.FULL) - .withCompletedTime(OffsetDateTime.parse("2021-02-24T15:23:22Z")) - .withSource("cs"); - model = BinaryData.fromObject(model).toObject(ServerBackupProperties.class); - Assertions.assertEquals(Origin.FULL, model.backupType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-24T15:23:22Z"), model.completedTime()); - Assertions.assertEquals("cs", model.source()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServerCapabilitiesListMockTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServerCapabilitiesListMockTests.java deleted file mode 100644 index d59a9bfb6097a..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\":\"vqikfxcvhrfsphu\",\"supportedServerEditions\":[{\"name\":\"tikteusqczkvykl\",\"defaultSkuName\":\"byjaffmmf\",\"supportedStorageEditions\":[{\"name\":\"cuubgq\",\"defaultStorageSizeMb\":6925699685066088287,\"supportedStorageMb\":[{},{},{},{}],\"status\":\"Disabled\",\"reason\":\"ttwgdsl\"}],\"supportedServerSkus\":[{\"name\":\"hrmooi\",\"vCores\":1309261520,\"supportedIops\":418488184,\"supportedMemoryPerVcoreMb\":6854004636755290327,\"supportedZones\":[\"cxa\",\"zhyrpeto\",\"e\",\"joxslhvnhla\"],\"supportedHaMode\":[\"SameZone\"],\"status\":\"Default\",\"reason\":\"jcjbt\"},{\"name\":\"aehvvibrxjjstoq\",\"vCores\":449265761,\"supportedIops\":774286462,\"supportedMemoryPerVcoreMb\":4666346090573112474,\"supportedZones\":[\"oobklftidgfcwq\"],\"supportedHaMode\":[\"ZoneRedundant\"],\"status\":\"Available\",\"reason\":\"zhe\"}],\"status\":\"Disabled\",\"reason\":\"ohu\"},{\"name\":\"wtwko\",\"defaultSkuName\":\"wculkbaw\",\"supportedStorageEditions\":[{\"name\":\"njwltlwtjjgu\",\"defaultStorageSizeMb\":8518213803289262805,\"supportedStorageMb\":[{}],\"status\":\"Available\",\"reason\":\"cdmxzrpoaiml\"},{\"name\":\"iaaomylweazul\",\"defaultStorageSizeMb\":4118122894986571340,\"supportedStorageMb\":[{},{}],\"status\":\"Disabled\",\"reason\":\"jhlfzswpchwahf\"},{\"name\":\"usnfepgfewet\",\"defaultStorageSizeMb\":7432084644277094724,\"supportedStorageMb\":[{},{},{},{}],\"status\":\"Available\",\"reason\":\"kxhdjhlimmbcx\"}],\"supportedServerSkus\":[{\"name\":\"po\",\"vCores\":2026678131,\"supportedIops\":1548715838,\"supportedMemoryPerVcoreMb\":7495334357568508911,\"supportedZones\":[\"zxfpxtgqsc\",\"avft\"],\"supportedHaMode\":[\"ZoneRedundant\",\"SameZone\",\"ZoneRedundant\",\"ZoneRedundant\"],\"status\":\"Available\",\"reason\":\"gg\"},{\"name\":\"pijrajcivmmghf\",\"vCores\":1851539206,\"supportedIops\":1456716709,\"supportedMemoryPerVcoreMb\":3356451442054441941,\"supportedZones\":[\"uvyinzqodfvpgs\",\"oxgsgbpfgzdjtx\",\"zflbqvg\",\"qvlgafcqusrdvetn\"],\"supportedHaMode\":[\"ZoneRedundant\",\"SameZone\",\"ZoneRedundant\"],\"status\":\"Available\",\"reason\":\"duy\"},{\"name\":\"uzhyrmewipmvekdx\",\"vCores\":1124949924,\"supportedIops\":894303936,\"supportedMemoryPerVcoreMb\":1648370479769908154,\"supportedZones\":[\"n\",\"xgketwz\",\"hzjhf\"],\"supportedHaMode\":[\"SameZone\",\"SameZone\",\"SameZone\"],\"status\":\"Available\",\"reason\":\"pmuneqsx\"},{\"name\":\"hfbuzjyihsasbhud\",\"vCores\":1053625203,\"supportedIops\":719606175,\"supportedMemoryPerVcoreMb\":2798000155301001189,\"supportedZones\":[\"ynsqyrpfoobr\",\"ttymsjny\",\"qdnfwqzdz\"],\"supportedHaMode\":[\"SameZone\",\"SameZone\"],\"status\":\"Disabled\",\"reason\":\"fhqlyvi\"}],\"status\":\"Available\",\"reason\":\"iv\"},{\"name\":\"oyzunbixxr\",\"defaultSkuName\":\"kvcpwpgclr\",\"supportedStorageEditions\":[{\"name\":\"soxfrken\",\"defaultStorageSizeMb\":116533809200901624,\"supportedStorageMb\":[{}],\"status\":\"Default\",\"reason\":\"mpdnqqskawa\"},{\"name\":\"vmm\",\"defaultStorageSizeMb\":118268358895074671,\"supportedStorageMb\":[{}],\"status\":\"Available\",\"reason\":\"kzmegnitgvkxlz\"}],\"supportedServerSkus\":[{\"name\":\"fegcea\",\"vCores\":608530050,\"supportedIops\":1274510165,\"supportedMemoryPerVcoreMb\":4874125909627032017,\"supportedZones\":[\"moy\"],\"supportedHaMode\":[\"SameZone\",\"ZoneRedundant\",\"ZoneRedundant\"],\"status\":\"Default\",\"reason\":\"bkbxgomfa\"}],\"status\":\"Default\",\"reason\":\"sqvdaeyygux\"}],\"supportedServerVersions\":[{\"name\":\"qzhzbezkgimsi\",\"supportedVersionsToUpgrade\":[\"sicddyvv\"],\"status\":\"Default\",\"reason\":\"fmocwahpq\"},{\"name\":\"tjeaahhvjhh\",\"supportedVersionsToUpgrade\":[\"zybbj\"],\"status\":\"Visible\",\"reason\":\"ksyxkyxvxevblbje\"},{\"name\":\"ljlageuaulxu\",\"supportedVersionsToUpgrade\":[\"jbnkpp\",\"ynenlsvxeizz\"],\"status\":\"Default\",\"reason\":\"nsrmffeycx\"}],\"fastProvisioningSupported\":\"Disabled\",\"supportedFastProvisioningEditions\":[{\"supportedTier\":\"merteeammxqiek\",\"supportedSku\":\"zddrt\",\"supportedStorageGb\":550978856,\"supportedServerVersions\":\"jbmxvavre\",\"serverCount\":1844509739,\"status\":\"Default\",\"reason\":\"ecuijpxtxs\"},{\"supportedTier\":\"prtujwsawdd\",\"supportedSku\":\"babxvitit\",\"supportedStorageGb\":1297733750,\"supportedServerVersions\":\"exavoxt\",\"serverCount\":165499088,\"status\":\"Visible\",\"reason\":\"m\"},{\"supportedTier\":\"bwpypqtgsfjacb\",\"supportedSku\":\"hhxud\",\"supportedStorageGb\":1368673691,\"supportedServerVersions\":\"d\",\"serverCount\":1282129926,\"status\":\"Available\",\"reason\":\"ud\"},{\"supportedTier\":\"m\",\"supportedSku\":\"sckdlp\",\"supportedStorageGb\":2009658341,\"supportedServerVersions\":\"cxfailcfxwmdboxd\",\"serverCount\":1260487269,\"status\":\"Disabled\",\"reason\":\"fqob\"}],\"geoBackupSupported\":\"Enabled\",\"zoneRedundantHaSupported\":\"Disabled\",\"zoneRedundantHaAndGeoBackupSupported\":\"Disabled\",\"storageAutoGrowthSupported\":\"Disabled\",\"onlineResizeSupported\":\"Enabled\",\"restricted\":\"Disabled\",\"status\":\"Available\",\"reason\":\"zvytnrzvuljraaer\"}]}"; - - 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("uqovekqvgqouwif", "mpjw", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("vqikfxcvhrfsphu", 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 204f018b89a34..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-05-10T08:06:55Z\"},\"id\":\"iwyczuh\",\"name\":\"a\",\"type\":\"pqjlihhyusps\"},{\"properties\":{\"state\":\"Disabled\",\"creationTime\":\"2021-06-21T01:18:29Z\"},\"id\":\"mfwdgzxu\",\"name\":\"ucvpamrs\",\"type\":\"euzvx\"},{\"properties\":{\"state\":\"Enabled\",\"creationTime\":\"2021-08-12T14:06:46Z\"},\"id\":\"hn\",\"name\":\"txifqj\",\"type\":\"gxmrhublwp\"}],\"nextLink\":\"sutrgjup\"}") - .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 96a27cd3e8097..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\":\"Disabled\",\"creationTime\":\"2021-03-21T20:16:43Z\"}") - .toObject(ServerThreatProtectionProperties.class); - Assertions.assertEquals(ThreatProtectionState.DISABLED, model.state()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ServerThreatProtectionProperties model - = new ServerThreatProtectionProperties().withState(ThreatProtectionState.DISABLED); - model = BinaryData.fromObject(model).toObject(ServerThreatProtectionProperties.class); - Assertions.assertEquals(ThreatProtectionState.DISABLED, 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 10f0a7fc99f25..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-11-12T13:22:26Z\"},\"id\":\"rrrouuxvnsa\",\"name\":\"bcrymodizrx\",\"type\":\"lobdxna\"}"; - - 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("ninvudbchaqdt", "qecrqctmxx") - .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 5252385122c9b..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\":\"Disabled\",\"creationTime\":\"2021-01-05T04:41:43Z\"},\"id\":\"okkhminq\",\"name\":\"ymc\",\"type\":\"ngnbdxxew\"}"; - - 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("nafvvkyfedev", "bo", ThreatProtectionName.DEFAULT, com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(ThreatProtectionState.DISABLED, 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 b725f225e522d..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-08-18T08:22:43Z\"},\"id\":\"gwbsreurf\",\"name\":\"kfuarenlv\",\"type\":\"htkln\"}]}"; - - 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("evrh", "ljyoogwx", 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 e123c7a0d8761..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-05-19T21:38:43Z\"},\"id\":\"oqh\",\"name\":\"hej\",\"type\":\"g\"}") - .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 69d7c00031a18..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("owxeqocljmy", "vkzqk", 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 eb51a846bf37b..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("lkvn", "jlrigjkskyrioovz", - new RestartParameter().withRestartWithFailover(false).withFailoverMode(FailoverMode.FORCED_SWITCHOVER), - com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServersStartMockTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServersStartMockTests.java deleted file mode 100644 index a5a287a899c9c..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("aabzmif", "ygznmmaxrizk", 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 ed5f5b9cad3e9..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("obgop", "lhslnelxieixyn", 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 d84a3f64ca240..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\":\"UserAssigned\",\"tenantId\":\"dhmdua\"}") - .toObject(UserAssignedIdentity.class); - Assertions.assertEquals("kv", model.userAssignedIdentities().get("hahvljuahaq").principalId()); - Assertions.assertEquals("elmqk", model.userAssignedIdentities().get("hahvljuahaq").clientId()); - Assertions.assertEquals(IdentityType.USER_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.USER_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.USER_ASSIGNED, model.type()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/UserIdentityTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/UserIdentityTests.java deleted file mode 100644 index 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 a15aad46af18b..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\":[\"dvk\"],\"virtualEndpoints\":[\"jdz\"]}}") - .toObject(VirtualEndpointResourceForPatch.class); - Assertions.assertEquals(VirtualEndpointType.READ_WRITE, model.endpointType()); - Assertions.assertEquals("dvk", 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("dvk")); - model = BinaryData.fromObject(model).toObject(VirtualEndpointResourceForPatch.class); - Assertions.assertEquals(VirtualEndpointType.READ_WRITE, model.endpointType()); - Assertions.assertEquals("dvk", 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 470e9c187fd47..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\":\"qntcypsxjvfoimwk\",\"name\":\"ircizjxvy\",\"type\":\"ceacvlhvygdy\",\"properties\":{\"endpointType\":\"ReadWrite\",\"members\":[\"nawjslbiwkojgcy\",\"tsf\",\"z\"],\"virtualEndpoints\":[\"eqphchqnrnr\",\"x\",\"huwrykqgaifm\"]}}") - .toObject(VirtualEndpointResourceInner.class); - Assertions.assertEquals(VirtualEndpointType.READ_WRITE, model.endpointType()); - Assertions.assertEquals("nawjslbiwkojgcy", 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("nawjslbiwkojgcy", "tsf", "z")); - model = BinaryData.fromObject(model).toObject(VirtualEndpointResourceInner.class); - Assertions.assertEquals(VirtualEndpointType.READ_WRITE, model.endpointType()); - Assertions.assertEquals("nawjslbiwkojgcy", 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 8cdf7bfbd1743..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\":[\"srhnjivo\",\"v\"],\"virtualEndpoints\":[\"v\",\"fzg\"]}") - .toObject(VirtualEndpointResourceProperties.class); - Assertions.assertEquals(VirtualEndpointType.READ_WRITE, model.endpointType()); - Assertions.assertEquals("srhnjivo", 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("srhnjivo", "v")); - model = BinaryData.fromObject(model).toObject(VirtualEndpointResourceProperties.class); - Assertions.assertEquals(VirtualEndpointType.READ_WRITE, model.endpointType()); - Assertions.assertEquals("srhnjivo", 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 eb1ebf8de0c45..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\":\"phvtrrmhwrb\",\"name\":\"pyf\",\"type\":\"bhvjglr\",\"properties\":{\"endpointType\":\"ReadWrite\",\"members\":[\"hhmemhooclutnp\",\"memczjkmmyk\",\"ujxsglhsr\"],\"virtualEndpoints\":[\"ejylmbkzu\",\"nigrfihotjewl\",\"xuzzjgnrefq\",\"hqo\"]}}"; - - 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("tmhqykiz") - .withExistingFlexibleServer("owlkjxnqpv", "gf") - .withEndpointType(VirtualEndpointType.READ_WRITE) - .withMembers(Arrays.asList("cbvopwndyqleallk")) - .create(); - - Assertions.assertEquals(VirtualEndpointType.READ_WRITE, response.endpointType()); - Assertions.assertEquals("hhmemhooclutnp", 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 ed1f36a9dfd09..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\":\"rdddtfgxqbawpcb\",\"name\":\"zqcyknap\",\"type\":\"fyuicdh\",\"properties\":{\"endpointType\":\"ReadWrite\",\"members\":[\"gbdvibidmhmwff\",\"lfmu\",\"apckccrrvw\",\"yoxoy\"],\"virtualEndpoints\":[\"phaimmoi\"]}}"; - - 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("pmkmlmvevfx", "op", "hbzxli", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(VirtualEndpointType.READ_WRITE, response.endpointType()); - Assertions.assertEquals("gbdvibidmhmwff", 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 a30c4ca5a6b5e..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\":\"avbopfp\",\"name\":\"bwnupgahxkumas\",\"type\":\"aacfdmmc\",\"properties\":{\"endpointType\":\"ReadWrite\",\"members\":[\"epvufhbzehew\",\"oqhnlb\",\"nbldxeaclgschori\"],\"virtualEndpoints\":[\"srrm\",\"ucsofldpuviyf\",\"aabeolhbhlvbmxuq\",\"bsxtkcudfbsfarfs\"]}}]}"; - - 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("oqboshbragapyyr", "fsv", com.azure.core.util.Context.NONE); - - Assertions.assertEquals(VirtualEndpointType.READ_WRITE, response.iterator().next().endpointType()); - Assertions.assertEquals("epvufhbzehew", 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 dedf4d50cfd9d..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/VirtualEndpointsListResultTests.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.VirtualEndpointResourceInner; -import com.azure.resourcemanager.postgresqlflexibleserver.models.VirtualEndpointsListResult; -import com.azure.resourcemanager.postgresqlflexibleserver.models.VirtualEndpointType; -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\":\"ftul\",\"name\":\"tduceamt\",\"type\":\"zuo\",\"properties\":{\"endpointType\":\"ReadWrite\",\"members\":[\"qioknssxmojm\",\"vpkjpr\"],\"virtualEndpoints\":[\"cfzq\",\"jyxgtczh\",\"ydbsd\"]}},{\"id\":\"m\",\"name\":\"maehvbbxurip\",\"type\":\"fnhtbaxkgxyw\",\"properties\":{\"endpointType\":\"ReadWrite\",\"members\":[\"yhpluodpvruudlgz\",\"bth\",\"stgktst\",\"dxeclzedqbcvh\"],\"virtualEndpoints\":[\"plodqkdlwwqfbu\"]}},{\"id\":\"kxtrq\",\"name\":\"smlmbtxhwgfwsrta\",\"type\":\"oezbrhubsk\",\"properties\":{\"endpointType\":\"ReadWrite\",\"members\":[\"okkqfqjbvleo\"],\"virtualEndpoints\":[\"luiqtqzfavyvnqq\"]}}],\"nextLink\":\"aryeu\"}") - .toObject(VirtualEndpointsListResult.class); - Assertions.assertEquals(VirtualEndpointType.READ_WRITE, model.value().get(0).endpointType()); - Assertions.assertEquals("qioknssxmojm", model.value().get(0).members().get(0)); - Assertions.assertEquals("aryeu", 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("qioknssxmojm", "vpkjpr")), - new VirtualEndpointResourceInner().withEndpointType(VirtualEndpointType.READ_WRITE) - .withMembers(Arrays.asList("yhpluodpvruudlgz", "bth", "stgktst", "dxeclzedqbcvh")), - new VirtualEndpointResourceInner().withEndpointType(VirtualEndpointType.READ_WRITE) - .withMembers(Arrays.asList("okkqfqjbvleo")))) - .withNextLink("aryeu"); - model = BinaryData.fromObject(model).toObject(VirtualEndpointsListResult.class); - Assertions.assertEquals(VirtualEndpointType.READ_WRITE, model.value().get(0).endpointType()); - Assertions.assertEquals("qioknssxmojm", model.value().get(0).members().get(0)); - Assertions.assertEquals("aryeu", 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 184e0c06d4645..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\":\"jkqa\"}") - .toObject(VirtualNetworkSubnetUsageParameter.class); - Assertions.assertEquals("jkqa", model.virtualNetworkArmResourceId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - VirtualNetworkSubnetUsageParameter model - = new VirtualNetworkSubnetUsageParameter().withVirtualNetworkArmResourceId("jkqa"); - model = BinaryData.fromObject(model).toObject(VirtualNetworkSubnetUsageParameter.class); - Assertions.assertEquals("jkqa", 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 da179f8cadd06..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\":\"slesjcbhernnt\",\"usage\":721518754958009281},{\"subnetName\":\"cv\",\"usage\":3139399735496716073},{\"subnetName\":\"behwagohb\",\"usage\":4128252170970600631},{\"subnetName\":\"rqemvvhmxt\",\"usage\":2260254657949075974}],\"location\":\"tac\",\"subscriptionId\":\"bj\"}") - .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 e51fc336fbb18..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\":\"qaxsipietgbebjf\",\"usage\":7305176553437357835},{\"subnetName\":\"ichdlpn\",\"usage\":7943096772032502565}],\"location\":\"tnbatzvi\",\"subscriptionId\":\"owsaaelcattcjuh\"}"; - - 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("oihiqak", - new VirtualNetworkSubnetUsageParameter().withVirtualNetworkArmResourceId("iwfbrkwpzdqtvhcs"), - com.azure.core.util.Context.NONE) - .getValue(); - - } -}