From 74205f124f7203941049491cdde826b5aa6ea2f3 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Tue, 6 May 2025 22:08:47 +0000 Subject: [PATCH] CodeGen from PR 34479 in Azure/azure-rest-api-specs Merge be55c42de7c54d3e1fd057dd61866cdd9f936c4e into 1755004c92eefdc7a66b4cd90df27d0af4cb0456 --- .../CHANGELOG.md | 139 +- .../README.md | 8 +- .../SAMPLE.md | 2546 ++++++++++------- .../pom.xml | 3 +- .../PostgreSqlManager.java | 73 +- .../fluent/AdministratorsClient.java | 48 +- .../fluent/OperationsClient.java | 35 +- .../fluent/PostgreSqlManagementClient.java | 28 + .../fluent/QuotaUsagesClient.java | 56 + .../fluent/TuningConfigurationsClient.java | 540 ++++ .../fluent/TuningIndexesClient.java | 82 + .../fluent/TuningOptionsClient.java | 124 + .../ActiveDirectoryAdministratorInner.java | 22 +- .../models/AdministratorProperties.java | 26 +- .../models/AdministratorPropertiesForAdd.java | 20 +- .../models/FlexibleServerCapabilityInner.java | 56 +- .../fluent/models/MigrationResourceInner.java | 10 +- .../models/MigrationResourceProperties.java | 14 +- .../ObjectRecommendationResourceInner.java | 368 +++ ...bjectRecommendationResourceProperties.java | 365 +++ .../fluent/models/OperationInner.java | 164 ++ .../fluent/models/QuotaUsageInner.java | 209 ++ .../fluent/models/ServerInner.java | 24 + .../fluent/models/ServerProperties.java | 32 + .../models/ServerPropertiesForUpdate.java | 38 +- .../models/SessionDetailsResourceInner.java | 233 ++ .../fluent/models/SessionResourceInner.java | 261 ++ .../models/TuningOptionsResourceInner.java | 134 + .../AdministratorsClientImpl.java | 76 +- .../FlexibleServerCapabilityImpl.java | 10 + .../ObjectRecommendationResourceImpl.java | 103 + .../implementation/OperationImpl.java | 57 + .../implementation/OperationsClientImpl.java | 121 +- .../implementation/OperationsImpl.java | 28 +- .../PostgreSqlManagementClientImpl.java | 66 +- ...istResultImpl.java => QuotaUsageImpl.java} | 41 +- .../implementation/QuotaUsagesClientImpl.java | 259 ++ .../implementation/QuotaUsagesImpl.java | 45 + .../implementation/ServerImpl.java | 15 + .../SessionDetailsResourceImpl.java | 52 + .../implementation/SessionResourceImpl.java | 56 + .../TuningConfigurationsClientImpl.java | 1510 ++++++++++ .../TuningConfigurationsImpl.java | 102 + .../TuningIndexesClientImpl.java | 333 +++ .../implementation/TuningIndexesImpl.java | 53 + .../TuningOptionsClientImpl.java | 425 +++ .../implementation/TuningOptionsImpl.java | 72 + .../TuningOptionsResourceImpl.java | 45 + .../models/ActiveDirectoryAdministrator.java | 20 +- .../ActiveDirectoryAdministratorAdd.java | 18 +- .../models/ActiveDirectoryAuthEnum.java | 2 +- .../models/AdministratorListResult.java | 14 +- .../models/Administrators.java | 12 +- .../models/AuthConfig.java | 6 +- .../models/Cluster.java | 93 + .../models/ConfigTuningRequestParameter.java | 179 ++ .../models/FastProvisioningSupportedEnum.java | 3 +- .../models/FlexibleServerCapability.java | 23 +- .../models/GeoBackupSupportedEnum.java | 2 +- .../models/IdentityType.java | 7 +- .../models/ImpactRecord.java | 179 ++ .../models/MigrationResource.java | 15 +- .../models/NameProperty.java | 121 + .../models/ObjectRecommendationDetails.java | 265 ++ .../ObjectRecommendationListResult.java | 132 + .../models/ObjectRecommendationResource.java | 122 + ...ionResourcePropertiesAnalyzedWorkload.java | 160 ++ ...sourcePropertiesImplementationDetails.java | 125 + .../models/OnlineResizeSupportedEnum.java | 3 +- .../models/Operation.java | 139 +- .../models/OperationListResult.java | 115 +- .../models/Operations.java | 14 +- .../models/PrincipalType.java | 2 +- .../models/QuotaUsage.java | 54 + .../models/QuotaUsages.java | 38 + .../models/QuotaUsagesListResult.java | 103 + .../models/RecommendationType.java | 56 + .../models/RecommendationTypeEnum.java | 61 + .../models/RestrictedEnum.java | 2 +- .../models/Server.java | 41 +- .../models/ServerForUpdate.java | 27 +- .../models/ServerSkuCapability.java | 37 + .../models/ServerState.java | 15 + .../models/ServerVersion.java | 5 + .../models/ServerVersionCapability.java | 21 + .../SessionDetailsListResult.java} | 49 +- .../models/SessionDetailsResource.java | 62 + .../models/SessionResource.java | 68 + .../models/SessionsListResult.java | 131 + .../models/SourceType.java | 64 +- .../models/Storage.java | 28 +- .../StorageAutoGrowthSupportedEnum.java | 3 +- .../models/StorageType.java | 9 +- .../models/SupportedFeature.java | 97 + .../models/SupportedFeatureStatusEnum.java | 51 + .../models/TuningConfigurations.java | 177 ++ .../models/TuningIndexes.java | 43 + .../models/TuningOptionEnum.java | 56 + .../models/TuningOptions.java | 68 + .../models/TuningOptionsListResult.java | 131 + .../models/TuningOptionsResource.java | 49 + .../models/UserAssignedIdentity.java | 36 +- ...eRedundantHaAndGeoBackupSupportedEnum.java | 1 + .../models/ZoneRedundantHaSupportedEnum.java | 3 +- .../proxy-config.json | 2 +- ...anager-postgresqlflexibleserver.properties | 1 + .../AdministratorsCreateSamples.java | 8 +- .../AdministratorsDeleteSamples.java | 2 +- .../generated/AdministratorsGetSamples.java | 4 +- .../AdministratorsListByServerSamples.java | 2 +- .../generated/BackupsCreateSamples.java | 5 +- .../generated/BackupsDeleteSamples.java | 5 +- .../generated/BackupsGetSamples.java | 5 +- .../generated/BackupsListByServerSamples.java | 4 +- .../CheckNameAvailabilityExecuteSamples.java | 2 +- ...vailabilityWithLocationExecuteSamples.java | 2 +- .../generated/ConfigurationsGetSamples.java | 4 +- .../ConfigurationsListByServerSamples.java | 2 +- .../generated/ConfigurationsPutSamples.java | 4 +- .../ConfigurationsUpdateSamples.java | 4 +- .../generated/DatabasesCreateSamples.java | 4 +- .../generated/DatabasesDeleteSamples.java | 4 +- .../generated/DatabasesGetSamples.java | 3 +- .../DatabasesListByServerSamples.java | 2 +- .../FirewallRulesCreateOrUpdateSamples.java | 4 +- .../generated/FirewallRulesDeleteSamples.java | 4 +- .../generated/FirewallRulesGetSamples.java | 4 +- .../FirewallRulesListByServerSamples.java | 2 +- .../FlexibleServerStartLtrBackupSamples.java | 2 +- ...xibleServerTriggerLtrPreBackupSamples.java | 2 +- ...GetPrivateDnsZoneSuffixExecuteSamples.java | 2 +- ...cationBasedCapabilitiesExecuteSamples.java | 2 +- .../LogFilesListByServerSamples.java | 2 +- .../LtrBackupOperationsGetSamples.java | 2 +- ...trBackupOperationsListByServerSamples.java | 2 +- .../generated/MigrationsCreateSamples.java | 45 +- .../generated/MigrationsDeleteSamples.java | 4 +- .../generated/MigrationsGetSamples.java | 12 +- .../MigrationsListByTargetServerSamples.java | 2 +- .../generated/MigrationsUpdateSamples.java | 8 +- .../generated/OperationsListSamples.java | 5 +- ...pointConnectionOperationDeleteSamples.java | 2 +- ...pointConnectionOperationUpdateSamples.java | 2 +- .../PrivateEndpointConnectionsGetSamples.java | 2 +- ...ndpointConnectionsListByServerSamples.java | 2 +- .../PrivateLinkResourcesGetSamples.java | 2 +- ...ivateLinkResourcesListByServerSamples.java | 2 +- .../generated/QuotaUsagesListSamples.java | 25 + .../ReplicasListByServerSamples.java | 2 +- ...CheckMigrationNameAvailabilitySamples.java | 2 +- .../ServerCapabilitiesListSamples.java | 4 +- ...otectionSettingsCreateOrUpdateSamples.java | 2 +- ...verThreatProtectionSettingsGetSamples.java | 2 +- ...ProtectionSettingsListByServerSamples.java | 2 +- .../generated/ServersCreateSamples.java | 94 +- .../generated/ServersDeleteSamples.java | 3 +- .../ServersGetByResourceGroupSamples.java | 13 +- .../ServersListByResourceGroupSamples.java | 4 +- .../generated/ServersListSamples.java | 3 +- .../generated/ServersRestartSamples.java | 5 +- .../generated/ServersStartSamples.java | 3 +- .../generated/ServersStopSamples.java | 3 +- .../generated/ServersUpdateSamples.java | 77 +- .../TuningConfigurationDisableSamples.java | 28 + .../TuningConfigurationEnableSamples.java | 28 + ...onfigurationListSessionDetailsSamples.java | 29 + ...uningConfigurationListSessionsSamples.java | 28 + ...uningConfigurationStartSessionSamples.java | 32 + ...TuningConfigurationStopSessionSamples.java | 28 + ...TuningIndexListRecommendationsSamples.java | 81 + .../generated/TuningOptionsGetSamples.java | 27 + .../TuningOptionsListByServerSamples.java | 25 + .../VirtualEndpointsCreateSamples.java | 2 +- .../VirtualEndpointsDeleteSamples.java | 2 +- .../generated/VirtualEndpointsGetSamples.java | 2 +- .../VirtualEndpointsListByServerSamples.java | 2 +- .../VirtualEndpointsUpdateSamples.java | 2 +- ...rtualNetworkSubnetUsageExecuteSamples.java | 2 +- .../ActiveDirectoryAdministratorAddTests.java | 35 - ...ctiveDirectoryAdministratorInnerTests.java | 37 - .../AdministratorListResultTests.java | 54 - .../AdministratorPropertiesForAddTests.java | 35 - .../AdministratorPropertiesTests.java | 36 - .../AdministratorsCreateMockTests.java | 47 - .../AdministratorsDeleteMockTests.java | 33 - ...dministratorsGetWithResponseMockTests.java | 43 - .../AdministratorsListByServerMockTests.java | 43 - .../generated/BackupRequestBaseTests.java | 27 - .../generated/BackupSettingsTests.java | 24 - .../generated/BackupStoreDetailsTests.java | 28 - .../generated/BackupTests.java | 30 - .../generated/BackupsCreateMockTests.java | 41 - .../BackupsGetWithResponseMockTests.java | 42 - .../BackupsListByServerMockTests.java | 43 - .../CapabilitiesListResultTests.java | 23 - .../generated/CapabilityBaseTests.java | 22 - ...abilitiesExecuteWithResponseMockTests.java | 44 - .../CheckNameAvailabilityRequestTests.java | 27 - .../CheckNameAvailabilityResponseTests.java | 33 - ...LocationsExecuteWithResponseMockTests.java | 45 - .../ConfigurationForUpdateTests.java | 28 - .../generated/ConfigurationInnerTests.java | 28 - .../ConfigurationListResultTests.java | 37 - .../ConfigurationPropertiesTests.java | 29 - ...onfigurationsGetWithResponseMockTests.java | 40 - .../ConfigurationsListByServerMockTests.java | 40 - .../generated/ConfigurationsPutMockTests.java | 43 - .../generated/DatabaseInnerTests.java | 28 - .../generated/DatabaseListResultTests.java | 38 - .../generated/DatabasePropertiesTests.java | 27 - .../generated/DatabasesCreateMockTests.java | 43 - .../generated/DatabasesDeleteMockTests.java | 34 - .../DatabasesGetWithResponseMockTests.java | 40 - .../DatabasesListByServerMockTests.java | 40 - .../DbLevelValidationStatusTests.java | 59 - .../generated/DbMigrationStatusTests.java | 73 - .../generated/DbServerMetadataTests.java | 36 - .../generated/DelegatedSubnetUsageTests.java | 22 - ...astProvisioningEditionCapabilityTests.java | 23 - .../generated/FirewallRuleInnerTests.java | 29 - .../FirewallRuleListResultTests.java | 36 - .../FirewallRulePropertiesTests.java | 29 - .../FirewallRulesCreateOrUpdateMockTests.java | 43 - .../FirewallRulesDeleteMockTests.java | 33 - ...FirewallRulesGetWithResponseMockTests.java | 40 - .../FirewallRulesListByServerMockTests.java | 40 - .../FlexibleServerCapabilityInnerTests.java | 26 - .../FlexibleServerEditionCapabilityTests.java | 23 - ...ggerLtrPreBackupWithResponseMockTests.java | 42 - ...eSuffixesExecuteWithResponseMockTests.java | 36 - .../generated/HighAvailabilityTests.java | 30 - ...tionBasedCapabilitiesExecuteMockTests.java | 39 - .../generated/LogFileInnerTests.java | 39 - .../generated/LogFileListResultTests.java | 50 - .../generated/LogFilePropertiesTests.java | 39 - .../LogFilesListByServerMockTests.java | 44 - .../generated/LtrBackupRequestTests.java | 34 - .../generated/LtrPreBackupRequestTests.java | 27 - .../LtrPreBackupResponseInnerTests.java | 25 - .../LtrPreBackupResponsePropertiesTests.java | 25 - .../generated/MaintenanceWindowTests.java | 35 - ...ionNameAvailabilityResourceInnerTests.java | 29 - .../generated/MigrationStatusTests.java | 23 - .../MigrationSubStateDetailsTests.java | 189 -- ...MigrationsDeleteWithResponseMockTests.java | 33 - .../generated/NameAvailabilityInnerTests.java | 33 - .../generated/NetworkTests.java | 33 - .../generated/OperationDisplayTests.java | 24 - .../OperationListResultInnerTests.java | 33 - .../generated/OperationTests.java | 26 - .../OperationsListWithResponseMockTests.java | 39 - .../PrivateEndpointConnectionInnerTests.java | 40 - ...vateEndpointConnectionListResultTests.java | 23 - ...ntConnectionOperationsUpdateMockTests.java | 51 - ...vateEndpointConnectionPropertiesTests.java | 40 - ...ntConnectionsGetWithResponseMockTests.java | 43 - ...pointConnectionsListByServerMockTests.java | 45 - .../generated/PrivateEndpointTests.java | 21 - .../PrivateLinkResourceInnerTests.java | 28 - .../PrivateLinkResourceListResultTests.java | 23 - .../PrivateLinkResourcePropertiesTests.java | 28 - ...LinkResourcesGetWithResponseMockTests.java | 39 - ...ateLinkResourcesListByServerMockTests.java | 39 - ...rivateLinkServiceConnectionStateTests.java | 35 - .../generated/ReplicaTests.java | 35 - ...grationNameAvailabilityWithRMockTests.java | 43 - .../generated/RestartParameterTests.java | 30 - .../generated/ServerBackupInnerTests.java | 34 - .../ServerBackupListResultTests.java | 40 - .../ServerBackupPropertiesTests.java | 35 - .../ServerCapabilitiesListMockTests.java | 39 - .../generated/ServerSkuCapabilityTests.java | 23 - .../generated/ServerSkuTests.java | 28 - ...ServerThreatProtectionListResultTests.java | 23 - ...ServerThreatProtectionPropertiesTests.java | 28 - ...ectionSettingsCreateOrUpdateMockTests.java | 43 - ...ctionSettingsGetWithResponseMockTests.java | 41 - ...otectionSettingsListByServerMockTests.java | 40 - ...reatProtectionSettingsModelInnerTests.java | 28 - .../ServerVersionCapabilityTests.java | 23 - .../generated/ServersDeleteMockTests.java | 33 - .../generated/ServersRestartMockTests.java | 38 - .../generated/ServersStartMockTests.java | 33 - .../generated/ServersStopMockTests.java | 33 - .../generated/SkuTests.java | 27 - .../StorageEditionCapabilityTests.java | 23 - .../generated/StorageMbCapabilityTests.java | 23 - .../generated/StorageTests.java | 44 - .../generated/StorageTierCapabilityTests.java | 24 - .../generated/UserAssignedIdentityTests.java | 49 - .../generated/UserIdentityTests.java | 27 - .../generated/ValidationDetailsTests.java | 105 - .../generated/ValidationMessageTests.java | 28 - .../generated/ValidationSummaryItemTests.java | 40 - .../VirtualEndpointResourceForPatchTests.java | 32 - .../VirtualEndpointResourceInnerTests.java | 32 - ...irtualEndpointResourcePropertiesTests.java | 32 - .../VirtualEndpointsCreateMockTests.java | 45 - ...tualEndpointsGetWithResponseMockTests.java | 41 - ...VirtualEndpointsListByServerMockTests.java | 41 - .../VirtualEndpointsListResultTests.java | 38 - ...rtualNetworkSubnetUsageParameterTests.java | 26 - ...ualNetworkSubnetUsageResultInnerTests.java | 23 - ...netUsagesExecuteWithResponseMockTests.java | 40 - 304 files changed, 11544 insertions(+), 6278 deletions(-) create mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/QuotaUsagesClient.java create mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/TuningConfigurationsClient.java create mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/TuningIndexesClient.java create mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/TuningOptionsClient.java create mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/ObjectRecommendationResourceInner.java create mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/ObjectRecommendationResourceProperties.java create mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/OperationInner.java create mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/QuotaUsageInner.java create mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/SessionDetailsResourceInner.java create mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/SessionResourceInner.java create mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/TuningOptionsResourceInner.java create mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/ObjectRecommendationResourceImpl.java create mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/OperationImpl.java rename sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/{OperationListResultImpl.java => QuotaUsageImpl.java} (56%) create mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/QuotaUsagesClientImpl.java create mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/QuotaUsagesImpl.java create mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/SessionDetailsResourceImpl.java create mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/SessionResourceImpl.java create mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/TuningConfigurationsClientImpl.java create mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/TuningConfigurationsImpl.java create mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/TuningIndexesClientImpl.java create mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/TuningIndexesImpl.java create mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/TuningOptionsClientImpl.java create mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/TuningOptionsImpl.java create mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/TuningOptionsResourceImpl.java create mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/Cluster.java create mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ConfigTuningRequestParameter.java create mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ImpactRecord.java create mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/NameProperty.java create mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ObjectRecommendationDetails.java create mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ObjectRecommendationListResult.java create mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ObjectRecommendationResource.java create mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ObjectRecommendationResourcePropertiesAnalyzedWorkload.java create mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ObjectRecommendationResourcePropertiesImplementationDetails.java create mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/QuotaUsage.java create mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/QuotaUsages.java create mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/QuotaUsagesListResult.java create mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/RecommendationType.java create mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/RecommendationTypeEnum.java rename sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/{fluent/models/OperationListResultInner.java => models/SessionDetailsListResult.java} (63%) create mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/SessionDetailsResource.java create mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/SessionResource.java create mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/SessionsListResult.java create mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/SupportedFeature.java create mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/SupportedFeatureStatusEnum.java create mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/TuningConfigurations.java create mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/TuningIndexes.java create mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/TuningOptionEnum.java create mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/TuningOptions.java create mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/TuningOptionsListResult.java create mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/TuningOptionsResource.java create mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/resources/azure-resourcemanager-postgresqlflexibleserver.properties create mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/QuotaUsagesListSamples.java create mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/TuningConfigurationDisableSamples.java create mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/TuningConfigurationEnableSamples.java create mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/TuningConfigurationListSessionDetailsSamples.java create mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/TuningConfigurationListSessionsSamples.java create mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/TuningConfigurationStartSessionSamples.java create mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/TuningConfigurationStopSessionSamples.java create mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/TuningIndexListRecommendationsSamples.java create mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/TuningOptionsGetSamples.java create mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/TuningOptionsListByServerSamples.java delete mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ActiveDirectoryAdministratorAddTests.java delete mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ActiveDirectoryAdministratorInnerTests.java delete mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/AdministratorListResultTests.java delete mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/AdministratorPropertiesForAddTests.java delete mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/AdministratorPropertiesTests.java delete mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/AdministratorsCreateMockTests.java delete mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/AdministratorsDeleteMockTests.java delete mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/AdministratorsGetWithResponseMockTests.java delete mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/AdministratorsListByServerMockTests.java delete mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/BackupRequestBaseTests.java delete mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/BackupSettingsTests.java delete mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/BackupStoreDetailsTests.java delete mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/BackupTests.java delete mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/BackupsCreateMockTests.java delete mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/BackupsGetWithResponseMockTests.java delete mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/BackupsListByServerMockTests.java delete mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/CapabilitiesListResultTests.java delete mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/CapabilityBaseTests.java delete mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/CheckNameAvailabilitiesExecuteWithResponseMockTests.java delete mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/CheckNameAvailabilityRequestTests.java delete mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/CheckNameAvailabilityResponseTests.java delete mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/CheckNameAvailabilityWithLocationsExecuteWithResponseMockTests.java delete mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ConfigurationForUpdateTests.java delete mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ConfigurationInnerTests.java delete mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ConfigurationListResultTests.java delete mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ConfigurationPropertiesTests.java delete mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ConfigurationsGetWithResponseMockTests.java delete mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ConfigurationsListByServerMockTests.java delete mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ConfigurationsPutMockTests.java delete mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/DatabaseInnerTests.java delete mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/DatabaseListResultTests.java delete mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/DatabasePropertiesTests.java delete mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/DatabasesCreateMockTests.java delete mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/DatabasesDeleteMockTests.java delete mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/DatabasesGetWithResponseMockTests.java delete mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/DatabasesListByServerMockTests.java delete mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/DbLevelValidationStatusTests.java delete mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/DbMigrationStatusTests.java delete mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/DbServerMetadataTests.java delete mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/DelegatedSubnetUsageTests.java delete mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/FastProvisioningEditionCapabilityTests.java delete mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/FirewallRuleInnerTests.java delete mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/FirewallRuleListResultTests.java delete mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/FirewallRulePropertiesTests.java delete mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/FirewallRulesCreateOrUpdateMockTests.java delete mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/FirewallRulesDeleteMockTests.java delete mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/FirewallRulesGetWithResponseMockTests.java delete mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/FirewallRulesListByServerMockTests.java delete mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/FlexibleServerCapabilityInnerTests.java delete mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/FlexibleServerEditionCapabilityTests.java delete mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/FlexibleServersTriggerLtrPreBackupWithResponseMockTests.java delete mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/GetPrivateDnsZoneSuffixesExecuteWithResponseMockTests.java delete mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/HighAvailabilityTests.java delete mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/LocationBasedCapabilitiesExecuteMockTests.java delete mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/LogFileInnerTests.java delete mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/LogFileListResultTests.java delete mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/LogFilePropertiesTests.java delete mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/LogFilesListByServerMockTests.java delete mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/LtrBackupRequestTests.java delete mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/LtrPreBackupRequestTests.java delete mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/LtrPreBackupResponseInnerTests.java delete mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/LtrPreBackupResponsePropertiesTests.java delete mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/MaintenanceWindowTests.java delete mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/MigrationNameAvailabilityResourceInnerTests.java delete mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/MigrationStatusTests.java delete mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/MigrationSubStateDetailsTests.java delete mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/MigrationsDeleteWithResponseMockTests.java delete mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/NameAvailabilityInnerTests.java delete mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/NetworkTests.java delete mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/OperationDisplayTests.java delete mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/OperationListResultInnerTests.java delete mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/OperationTests.java delete mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/OperationsListWithResponseMockTests.java delete mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/PrivateEndpointConnectionInnerTests.java delete mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/PrivateEndpointConnectionListResultTests.java delete mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/PrivateEndpointConnectionOperationsUpdateMockTests.java delete mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/PrivateEndpointConnectionPropertiesTests.java delete mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/PrivateEndpointConnectionsGetWithResponseMockTests.java delete mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/PrivateEndpointConnectionsListByServerMockTests.java delete mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/PrivateEndpointTests.java delete mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/PrivateLinkResourceInnerTests.java delete mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/PrivateLinkResourceListResultTests.java delete mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/PrivateLinkResourcePropertiesTests.java delete mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/PrivateLinkResourcesGetWithResponseMockTests.java delete mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/PrivateLinkResourcesListByServerMockTests.java delete mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/PrivateLinkServiceConnectionStateTests.java delete mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ReplicaTests.java delete mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ResourceProvidersCheckMigrationNameAvailabilityWithRMockTests.java delete mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/RestartParameterTests.java delete mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServerBackupInnerTests.java delete mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServerBackupListResultTests.java delete mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServerBackupPropertiesTests.java delete mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServerCapabilitiesListMockTests.java delete mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServerSkuCapabilityTests.java delete mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServerSkuTests.java delete mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServerThreatProtectionListResultTests.java delete mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServerThreatProtectionPropertiesTests.java delete mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServerThreatProtectionSettingsCreateOrUpdateMockTests.java delete mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServerThreatProtectionSettingsGetWithResponseMockTests.java delete mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServerThreatProtectionSettingsListByServerMockTests.java delete mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServerThreatProtectionSettingsModelInnerTests.java delete mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServerVersionCapabilityTests.java delete mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServersDeleteMockTests.java delete mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServersRestartMockTests.java delete mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServersStartMockTests.java delete mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServersStopMockTests.java delete mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/SkuTests.java delete mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/StorageEditionCapabilityTests.java delete mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/StorageMbCapabilityTests.java delete mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/StorageTests.java delete mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/StorageTierCapabilityTests.java delete mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/UserAssignedIdentityTests.java delete mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/UserIdentityTests.java delete mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ValidationDetailsTests.java delete mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ValidationMessageTests.java delete mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ValidationSummaryItemTests.java delete mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/VirtualEndpointResourceForPatchTests.java delete mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/VirtualEndpointResourceInnerTests.java delete mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/VirtualEndpointResourcePropertiesTests.java delete mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/VirtualEndpointsCreateMockTests.java delete mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/VirtualEndpointsGetWithResponseMockTests.java delete mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/VirtualEndpointsListByServerMockTests.java delete mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/VirtualEndpointsListResultTests.java delete mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/VirtualNetworkSubnetUsageParameterTests.java delete mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/VirtualNetworkSubnetUsageResultInnerTests.java delete mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/VirtualNetworkSubnetUsagesExecuteWithResponseMockTests.java diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/CHANGELOG.md b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/CHANGELOG.md index df6924915b70..0fd784baa489 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/CHANGELOG.md +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/CHANGELOG.md @@ -1,14 +1,145 @@ # Release History -## 1.2.0-beta.1 (Unreleased) +## 1.0.0-beta.1 (2025-05-06) -### Features Added +- Azure Resource Manager PostgreSql client library for Java. This package contains Microsoft Azure SDK for PostgreSql Management SDK. The Microsoft Azure management API provides create, read, update, and delete functionality for Azure PostgreSQL resources including servers, databases, firewall rules, VNET rules, security alert policies, log files and configurations with new business model. Package tag package-flexibleserver-2025-01-01-preview. 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.OperationListResult` was modified + +* `innerModel()` was removed +* `java.lang.String nextLink()` -> `java.lang.String nextLink()` +* `java.util.List value()` -> `java.util.List value()` + +#### `models.Operation` was modified + +* `models.OperationDisplay display()` -> `models.OperationDisplay display()` +* `withIsDataAction(java.lang.Boolean)` was removed +* `java.lang.Boolean isDataAction()` -> `java.lang.Boolean isDataAction()` +* `fromJson(com.azure.json.JsonReader)` was removed +* `validate()` was removed +* `models.OperationOrigin origin()` -> `models.OperationOrigin origin()` +* `java.util.Map properties()` -> `java.util.Map properties()` +* `java.lang.String name()` -> `java.lang.String name()` +* `toJson(com.azure.json.JsonWriter)` was removed + +#### `models.Operations` was modified + +* `models.OperationListResult list()` -> `com.azure.core.http.rest.PagedIterable list()` +* `listWithResponse(com.azure.core.util.Context)` was removed + +### Features Added + +* `models.SupportedFeatureStatusEnum` was added + +* `models.QuotaUsages` was added + +* `models.ConfigTuningRequestParameter` was added + +* `models.TuningOptionsListResult` was added + +* `models.ObjectRecommendationResource` was added + +* `models.SessionResource` was added + +* `models.QuotaUsage` was added + +* `models.ImpactRecord` was added + +* `models.SessionDetailsListResult` was added + +* `models.ObjectRecommendationDetails` was added + +* `models.QuotaUsagesListResult` was added + +* `models.NameProperty` was added + +* `models.TuningOptions` was added + +* `models.ObjectRecommendationListResult` was added + +* `models.ObjectRecommendationResourcePropertiesAnalyzedWorkload` was added + +* `models.RecommendationTypeEnum` was added + +* `models.SupportedFeature` was added + +* `models.SessionsListResult` was added + +* `models.RecommendationType` was added + +* `models.ObjectRecommendationResourcePropertiesImplementationDetails` was added + +* `models.TuningOptionEnum` was added + +* `models.TuningConfigurations` was added + +* `models.Cluster` was added + +* `models.TuningIndexes` was added -### Other Changes +* `models.TuningOptionsResource` was added + +* `models.SessionDetailsResource` was added + +#### `models.OperationListResult` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `validate()` was added +* `withValue(java.util.List)` was added +* `withNextLink(java.lang.String)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.UserAssignedIdentity` was modified + +* `withPrincipalId(java.lang.String)` was added +* `principalId()` was added + +#### `models.ServerForUpdate` was modified + +* `cluster()` was added +* `withCluster(models.Cluster)` was added + +#### `models.FlexibleServerCapability` was modified + +* `supportedFeatures()` was added + +#### `models.ServerVersionCapability` was modified + +* `supportedFeatures()` was added + +#### `models.ServerSkuCapability` was modified + +* `supportedFeatures()` was added +* `securityProfile()` was added + +#### `models.Operation` was modified + +* `innerModel()` was added + +#### `models.Operations` was modified + +* `list(com.azure.core.util.Context)` was added + +#### `models.Server$Update` was modified + +* `withCluster(models.Cluster)` was added + +#### `models.Server` was modified + +* `cluster()` was added + +#### `models.Server$Definition` was modified + +* `withCluster(models.Cluster)` was added + +#### `PostgreSqlManager` was modified + +* `tuningConfigurations()` was added +* `tuningIndexes()` was added +* `quotaUsages()` was added +* `tuningOptions()` was added ## 1.1.0 (2025-01-06) diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/README.md b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/README.md index 88cbc56c538a..71ee8f12e634 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/README.md +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/README.md @@ -2,7 +2,7 @@ Azure Resource Manager PostgreSql client library for Java. -This package contains Microsoft Azure SDK for PostgreSql Management SDK. The Microsoft Azure management API provides create, read, update, and delete functionality for Azure PostgreSQL resources including servers, databases, firewall rules, VNET rules, security alert policies, log files and configurations with new business model. Package tag package-flexibleserver-2024-08-01. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). +This package contains Microsoft Azure SDK for PostgreSql Management SDK. The Microsoft Azure management API provides create, read, update, and delete functionality for Azure PostgreSQL resources including servers, databases, firewall rules, VNET rules, security alert policies, log files and configurations with new business model. Package tag package-flexibleserver-2025-01-01-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ## We'd love to hear your feedback @@ -52,7 +52,7 @@ Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment Assuming the use of the `DefaultAzureCredential` credential class, the client can be authenticated using the following code: ```java -AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); +AzureProfile profile = new AzureProfile(AzureCloud.AZURE_PUBLIC_CLOUD); TokenCredential credential = new DefaultAzureCredentialBuilder() .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) .build(); @@ -60,7 +60,7 @@ PostgreSqlManager manager = PostgreSqlManager .authenticate(credential, profile); ``` -The sample code assumes global Azure. Please change `AzureEnvironment.AZURE` variable if otherwise. +The sample code assumes global Azure. Please change the `AzureCloud.AZURE_PUBLIC_CLOUD` variable if otherwise. See [Authentication][authenticate] for more options. @@ -121,5 +121,3 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m [cg]: https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md [coc]: https://opensource.microsoft.com/codeofconduct/ [coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ - - diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/SAMPLE.md b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/SAMPLE.md index a36791cecb43..e0f61d40dafd 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/SAMPLE.md +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/SAMPLE.md @@ -93,6 +93,10 @@ - [Get](#privatelinkresources_get) - [ListByServer](#privatelinkresources_listbyserver) +## QuotaUsages + +- [List](#quotausages_list) + ## Replicas - [ListByServer](#replicas_listbyserver) @@ -123,6 +127,24 @@ - [Stop](#servers_stop) - [Update](#servers_update) +## TuningConfiguration + +- [Disable](#tuningconfiguration_disable) +- [Enable](#tuningconfiguration_enable) +- [ListSessionDetails](#tuningconfiguration_listsessiondetails) +- [ListSessions](#tuningconfiguration_listsessions) +- [StartSession](#tuningconfiguration_startsession) +- [StopSession](#tuningconfiguration_stopsession) + +## TuningIndex + +- [ListRecommendations](#tuningindex_listrecommendations) + +## TuningOptions + +- [Get](#tuningoptions_get) +- [ListByServer](#tuningoptions_listbyserver) + ## VirtualEndpoints - [Create](#virtualendpoints_create) @@ -137,31 +159,30 @@ ### Administrators_Create ```java -import com.azure.resourcemanager.postgresqlflexibleserver.models.PrincipalType; +import com.azure.resourcemanager.postgresqlflexibleserver.models.ConfigTuningRequestParameter; +import com.azure.resourcemanager.postgresqlflexibleserver.models.TuningOptionEnum; /** - * Samples for Administrators Create. + * Samples for TuningConfiguration StartSession. */ -public final class AdministratorsCreateSamples { +public final class TuningConfigurationStartSessionSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/AdministratorAdd. - * json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ + * TuningConfiguration_StartSession.json */ /** - * Sample code: Adds an Active DIrectory Administrator for the server. + * Sample code: TuningConfiguration_StartSession. * * @param manager Entry point to PostgreSqlManager. */ - public static void addsAnActiveDIrectoryAdministratorForTheServer( - com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { - manager.administrators() - .define("oooooooo-oooo-oooo-oooo-oooooooooooo") - .withExistingFlexibleServer("testrg", "testserver") - .withPrincipalType(PrincipalType.USER) - .withPrincipalName("testuser1@microsoft.com") - .withTenantId("tttttttt-tttt-tttt-tttt-tttttttttttt") - .create(); + public static void + tuningConfigurationStartSession(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager.tuningConfigurations() + .startSession("testrg", "testserver", TuningOptionEnum.CONFIGURATION, + new ConfigTuningRequestParameter().withAllowServerRestarts(false) + .withTargetImprovementMetric("targetImprovementMetric"), + com.azure.core.util.Context.NONE); } } ``` @@ -170,23 +191,23 @@ public final class AdministratorsCreateSamples { ```java /** - * Samples for Administrators Delete. + * Samples for LtrBackupOperations ListByServer. */ -public final class AdministratorsDeleteSamples { +public final class LtrBackupOperationsListByServerSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ - * AdministratorDelete.json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ + * LongTermRetentionOperationListByServer.json */ /** - * Sample code: AdministratorDelete. + * Sample code: Sample List of Long Tern Retention Operations by Flexible Server. * * @param manager Entry point to PostgreSqlManager. */ - public static void - administratorDelete(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { - manager.administrators() - .delete("testrg", "testserver", "oooooooo-oooo-oooo-oooo-oooooooooooo", com.azure.core.util.Context.NONE); + public static void sampleListOfLongTernRetentionOperationsByFlexibleServer( + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager.ltrBackupOperations() + .listByServer("rgLongTermRetention", "pgsqlltrtestserver", com.azure.core.util.Context.NONE); } } ``` @@ -194,23 +215,27 @@ public final class AdministratorsDeleteSamples { ### Administrators_Get ```java +import com.azure.resourcemanager.postgresqlflexibleserver.models.BackupSettings; +import com.azure.resourcemanager.postgresqlflexibleserver.models.LtrPreBackupRequest; + /** - * Samples for Administrators Get. + * Samples for FlexibleServer TriggerLtrPreBackup. */ -public final class AdministratorsGetSamples { +public final class FlexibleServerTriggerLtrPreBackupSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/AdministratorGet. - * json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ + * LongTermRetentionPreBackup.json */ /** - * Sample code: ServerGet. + * Sample code: Sample_Prebackup. * * @param manager Entry point to PostgreSqlManager. */ - public static void serverGet(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { - manager.administrators() - .getWithResponse("testrg", "pgtestsvc1", "oooooooo-oooo-oooo-oooo-oooooooooooo", + public static void samplePrebackup(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager.flexibleServers() + .triggerLtrPreBackupWithResponse("rgLongTermRetention", "pgsqlltrtestserver", + new LtrPreBackupRequest().withBackupSettings(new BackupSettings().withBackupName("backup1")), com.azure.core.util.Context.NONE); } } @@ -220,22 +245,21 @@ public final class AdministratorsGetSamples { ```java /** - * Samples for Administrators ListByServer. + * Samples for Servers Delete. */ -public final class AdministratorsListByServerSamples { +public final class ServersDeleteSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ - * AdministratorsListByServer.json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ + * ServerDelete.json */ /** - * Sample code: AdministratorsListByServer. + * Sample code: ServerDelete. * * @param manager Entry point to PostgreSqlManager. */ - public static void - administratorsListByServer(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { - manager.administrators().listByServer("testrg", "pgtestsvc1", com.azure.core.util.Context.NONE); + public static void serverDelete(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager.servers().delete("testrg", "testserver", com.azure.core.util.Context.NONE); } } ``` @@ -243,23 +267,43 @@ public final class AdministratorsListByServerSamples { ### Backups_Create ```java +import com.azure.resourcemanager.postgresqlflexibleserver.models.FailoverMode; +import com.azure.resourcemanager.postgresqlflexibleserver.models.RestartParameter; + /** - * Samples for Backups Create. + * Samples for Servers Restart. */ -public final class BackupsCreateSamples { +public final class ServersRestartSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/BackupCreate.json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ + * ServerRestart.json */ /** - * Sample code: Create a new Backup for a flexible server. + * Sample code: ServerRestart. * * @param manager Entry point to PostgreSqlManager. */ - public static void createANewBackupForAFlexibleServer( - com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { - manager.backups() - .create("TestGroup", "postgresqltestserver", "backup_20210615T160516", com.azure.core.util.Context.NONE); + public static void serverRestart(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager.servers().restart("testrg", "testserver", null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ + * ServerRestartWithFailover.json + */ + /** + * Sample code: ServerRestartWithFailover. + * + * @param manager Entry point to PostgreSqlManager. + */ + public static void + serverRestartWithFailover(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager.servers() + .restart("testrg", "testserver", + new RestartParameter().withRestartWithFailover(true).withFailoverMode(FailoverMode.FORCED_FAILOVER), + com.azure.core.util.Context.NONE); } } ``` @@ -267,22 +311,26 @@ public final class BackupsCreateSamples { ### Backups_Delete ```java +import com.azure.resourcemanager.postgresqlflexibleserver.models.CheckNameAvailabilityRequest; + /** - * Samples for Backups Delete. + * Samples for CheckNameAvailabilityWithLocation Execute. */ -public final class BackupsDeleteSamples { +public final class CheckNameAvailabilityWithLocationExecuteSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/BackupDelete.json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ + * CheckNameAvailabilityLocationBased.json */ /** - * Sample code: Delete a specific backup. + * Sample code: NameAvailability. * * @param manager Entry point to PostgreSqlManager. */ - public static void - deleteASpecificBackup(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { - manager.backups().delete("TestGroup", "testserver", "backup_20210615T160516", com.azure.core.util.Context.NONE); + public static void nameAvailability(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager.checkNameAvailabilityWithLocations() + .executeWithResponse("westus", new CheckNameAvailabilityRequest().withName("name1") + .withType("Microsoft.DBforPostgreSQL/flexibleServers"), com.azure.core.util.Context.NONE); } } ``` @@ -291,23 +339,21 @@ public final class BackupsDeleteSamples { ```java /** - * Samples for Backups Get. + * Samples for LocationBasedCapabilities Execute. */ -public final class BackupsGetSamples { +public final class LocationBasedCapabilitiesExecuteSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/BackupGet.json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ + * CapabilitiesByLocation.json */ /** - * Sample code: Get a backup for a server. + * Sample code: CapabilitiesList. * * @param manager Entry point to PostgreSqlManager. */ - public static void - getABackupForAServer(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { - manager.backups() - .getWithResponse("TestGroup", "postgresqltestserver", "daily_20210615T160516", - com.azure.core.util.Context.NONE); + public static void capabilitiesList(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager.locationBasedCapabilities().execute("eastus", com.azure.core.util.Context.NONE); } } ``` @@ -316,22 +362,23 @@ public final class BackupsGetSamples { ```java /** - * Samples for Backups ListByServer. + * Samples for VirtualEndpoints Delete. */ -public final class BackupsListByServerSamples { +public final class VirtualEndpointsDeleteSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/BackupListByServer - * .json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ + * VirtualEndpointDelete.json */ /** - * Sample code: List backups for a server. + * Sample code: Delete a virtual endpoint. * * @param manager Entry point to PostgreSqlManager. */ public static void - listBackupsForAServer(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { - manager.backups().listByServer("TestGroup", "postgresqltestserver", com.azure.core.util.Context.NONE); + deleteAVirtualEndpoint(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager.virtualEndpoints() + .delete("testrg", "pgtestsvc4", "pgVirtualEndpoint1", com.azure.core.util.Context.NONE); } } ``` @@ -339,26 +386,24 @@ public final class BackupsListByServerSamples { ### CheckNameAvailability_Execute ```java -import com.azure.resourcemanager.postgresqlflexibleserver.models.CheckNameAvailabilityRequest; - /** - * Samples for CheckNameAvailability Execute. + * Samples for Backups Create. */ -public final class CheckNameAvailabilityExecuteSamples { +public final class BackupsCreateSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ - * CheckNameAvailability.json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ + * BackupCreate.json */ /** - * Sample code: NameAvailability. + * Sample code: Create a new Backup for a flexible server. * * @param manager Entry point to PostgreSqlManager. */ - public static void nameAvailability(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { - manager.checkNameAvailabilities() - .executeWithResponse(new CheckNameAvailabilityRequest().withName("name1") - .withType("Microsoft.DBforPostgreSQL/flexibleServers"), com.azure.core.util.Context.NONE); + public static void createANewBackupForAFlexibleServer( + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager.backups() + .create("TestGroup", "postgresqltestserver", "backup_20250303T160516", com.azure.core.util.Context.NONE); } } ``` @@ -366,26 +411,23 @@ public final class CheckNameAvailabilityExecuteSamples { ### CheckNameAvailabilityWithLocation_Execute ```java -import com.azure.resourcemanager.postgresqlflexibleserver.models.CheckNameAvailabilityRequest; - /** - * Samples for CheckNameAvailabilityWithLocation Execute. + * Samples for Administrators ListByServer. */ -public final class CheckNameAvailabilityWithLocationExecuteSamples { +public final class AdministratorsListByServerSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ - * CheckNameAvailabilityLocationBased.json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ + * AdministratorsListByServer.json */ /** - * Sample code: NameAvailability. + * Sample code: AdministratorsListByServer. * * @param manager Entry point to PostgreSqlManager. */ - public static void nameAvailability(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { - manager.checkNameAvailabilityWithLocations() - .executeWithResponse("westus", new CheckNameAvailabilityRequest().withName("name1") - .withType("Microsoft.DBforPostgreSQL/flexibleServers"), com.azure.core.util.Context.NONE); + public static void + administratorsListByServer(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager.administrators().listByServer("testrg", "pgtestsvc1", com.azure.core.util.Context.NONE); } } ``` @@ -394,22 +436,22 @@ public final class CheckNameAvailabilityWithLocationExecuteSamples { ```java /** - * Samples for Configurations Get. + * Samples for VirtualEndpoints ListByServer. */ -public final class ConfigurationsGetSamples { +public final class VirtualEndpointsListByServerSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ConfigurationGet. - * json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ + * VirtualEndpointsListByServer.json */ /** - * Sample code: ConfigurationGet. + * Sample code: VirtualEndpointListByServer. * * @param manager Entry point to PostgreSqlManager. */ - public static void configurationGet(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { - manager.configurations() - .getWithResponse("testrg", "testserver", "array_nulls", com.azure.core.util.Context.NONE); + public static void + virtualEndpointListByServer(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager.virtualEndpoints().listByServer("testrg", "pgtestsvc4", com.azure.core.util.Context.NONE); } } ``` @@ -418,21 +460,22 @@ public final class ConfigurationsGetSamples { ```java /** - * Samples for Configurations ListByServer. + * Samples for LtrBackupOperations Get. */ -public final class ConfigurationsListByServerSamples { +public final class LtrBackupOperationsGetSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ - * ConfigurationListByServer.json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ + * LongTermRetentionOperationGet.json */ /** - * Sample code: ConfigurationList. + * Sample code: Sample. * * @param manager Entry point to PostgreSqlManager. */ - public static void configurationList(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { - manager.configurations().listByServer("testrg", "testserver", com.azure.core.util.Context.NONE); + public static void sample(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager.ltrBackupOperations() + .getWithResponse("rgLongTermRetention", "pgsqlltrtestserver", "backup1", com.azure.core.util.Context.NONE); } } ``` @@ -441,27 +484,22 @@ public final class ConfigurationsListByServerSamples { ```java /** - * Samples for Configurations Put. + * Samples for LogFiles ListByServer. */ -public final class ConfigurationsPutSamples { +public final class LogFilesListByServerSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ - * ConfigurationUpdate.json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ + * LogFilesListByServer.json */ /** - * Sample code: Update a user configuration. + * Sample code: List all server log files for a server. * * @param manager Entry point to PostgreSqlManager. */ public static void - updateAUserConfiguration(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { - manager.configurations() - .define("event_scheduler") - .withExistingFlexibleServer("testrg", "testserver") - .withValue("on") - .withSource("user-override") - .create(); + listAllServerLogFilesForAServer(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager.logFiles().listByServer("testrg", "postgresqltestsvc1", com.azure.core.util.Context.NONE); } } ``` @@ -469,28 +507,23 @@ public final class ConfigurationsPutSamples { ### Configurations_Update ```java -import com.azure.resourcemanager.postgresqlflexibleserver.models.Configuration; - /** - * Samples for Configurations Update. + * Samples for Servers ListByResourceGroup. */ -public final class ConfigurationsUpdateSamples { +public final class ServersListByResourceGroupSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ - * ConfigurationUpdate.json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ + * ServerListByResourceGroup.json */ /** - * Sample code: Update a user configuration. + * Sample code: ServerListByResourceGroup. * * @param manager Entry point to PostgreSqlManager. */ public static void - updateAUserConfiguration(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { - Configuration resource = manager.configurations() - .getWithResponse("testrg", "testserver", "event_scheduler", com.azure.core.util.Context.NONE) - .getValue(); - resource.update().withValue("on").withSource("user-override").apply(); + serverListByResourceGroup(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager.servers().listByResourceGroup("testrgn", com.azure.core.util.Context.NONE); } } ``` @@ -499,26 +532,22 @@ public final class ConfigurationsUpdateSamples { ```java /** - * Samples for Databases Create. + * Samples for Backups ListByServer. */ -public final class DatabasesCreateSamples { +public final class BackupsListByServerSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/DatabaseCreate. - * json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ + * BackupListByServer.json */ /** - * Sample code: Create a database. + * Sample code: List backups for a server. * * @param manager Entry point to PostgreSqlManager. */ - public static void createADatabase(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { - manager.databases() - .define("db1") - .withExistingFlexibleServer("TestGroup", "testserver") - .withCharset("utf8") - .withCollation("en_US.utf8") - .create(); + public static void + listBackupsForAServer(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager.backups().listByServer("TestGroup", "postgresqltestserver", com.azure.core.util.Context.NONE); } } ``` @@ -526,23 +555,29 @@ public final class DatabasesCreateSamples { ### Databases_Delete ```java +import com.azure.resourcemanager.postgresqlflexibleserver.models.Configuration; + /** - * Samples for Databases Delete. + * Samples for Configurations Update. */ -public final class DatabasesDeleteSamples { +public final class ConfigurationsUpdateSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/DatabaseDelete. - * json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ + * ConfigurationUpdate.json */ /** - * Sample code: Delete a database. + * Sample code: Update a user configuration. * * @param manager Entry point to PostgreSqlManager. */ - public static void deleteADatabase(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { - manager.databases().delete("TestGroup", "testserver", "db1", com.azure.core.util.Context.NONE); - } + public static void + updateAUserConfiguration(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + Configuration resource = manager.configurations() + .getWithResponse("testrg", "testserver", "constraint_exclusion", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withValue("on").withSource("user-override").apply(); + } } ``` @@ -550,20 +585,22 @@ public final class DatabasesDeleteSamples { ```java /** - * Samples for Databases Get. + * Samples for PrivateLinkResources ListByServer. */ -public final class DatabasesGetSamples { +public final class PrivateLinkResourcesListByServerSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/DatabaseGet.json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ + * PrivateLinkResourcesList.json */ /** - * Sample code: Get a database. + * Sample code: Gets private link resources for PostgreSQL. * * @param manager Entry point to PostgreSqlManager. */ - public static void getADatabase(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { - manager.databases().getWithResponse("TestGroup", "testserver", "db1", com.azure.core.util.Context.NONE); + public static void getsPrivateLinkResourcesForPostgreSQL( + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager.privateLinkResources().listByServer("Default", "test-svr", com.azure.core.util.Context.NONE); } } ``` @@ -571,23 +608,79 @@ public final class DatabasesGetSamples { ### Databases_ListByServer ```java +import com.azure.resourcemanager.postgresqlflexibleserver.models.RecommendationType; +import com.azure.resourcemanager.postgresqlflexibleserver.models.TuningOptionEnum; + /** - * Samples for Databases ListByServer. + * Samples for TuningIndex ListRecommendations. */ -public final class DatabasesListByServerSamples { +public final class TuningIndexListRecommendationsSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ - * DatabasesListByServer.json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ + * TuningIndex_GetFilteredTableRecommendations.json */ /** - * Sample code: List databases in a server. + * Sample code: TuningIndex_ListFilteredTableRecommendations. + * + * @param manager Entry point to PostgreSqlManager. + */ + public static void tuningIndexListFilteredTableRecommendations( + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager.tuningIndexes() + .listRecommendations("s0403mllorentpimmy", "arm3", TuningOptionEnum.TABLE, RecommendationType.ANALYZE_TABLE, + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ + * TuningIndex_GetFilteredRecommendations.json + */ + /** + * Sample code: TuningIndex_ListFilteredRecommendations. + * + * @param manager Entry point to PostgreSqlManager. + */ + public static void tuningIndexListFilteredRecommendations( + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager.tuningIndexes() + .listRecommendations("testrg", "pgtestrecs", TuningOptionEnum.INDEX, RecommendationType.CREATE_INDEX, + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ + * TuningIndex_GetRecommendations.json + */ + /** + * Sample code: TuningIndex_ListRecommendations. * * @param manager Entry point to PostgreSqlManager. */ public static void - listDatabasesInAServer(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { - manager.databases().listByServer("TestGroup", "testserver", com.azure.core.util.Context.NONE); + tuningIndexListRecommendations(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager.tuningIndexes() + .listRecommendations("testrg", "pgtestsvc4", TuningOptionEnum.INDEX, null, + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ + * TuningIndex_GetTableRecommendations.json + */ + /** + * Sample code: TuningIndex_ListTableRecommendations. + * + * @param manager Entry point to PostgreSqlManager. + */ + public static void tuningIndexListTableRecommendations( + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager.tuningIndexes() + .listRecommendations("testrg", "pgtestsvc4", TuningOptionEnum.TABLE, null, + com.azure.core.util.Context.NONE); } } ``` @@ -595,28 +688,26 @@ public final class DatabasesListByServerSamples { ### FirewallRules_CreateOrUpdate ```java +import com.azure.resourcemanager.postgresqlflexibleserver.models.TuningOptionEnum; + /** - * Samples for FirewallRules CreateOrUpdate. + * Samples for TuningConfiguration Disable. */ -public final class FirewallRulesCreateOrUpdateSamples { +public final class TuningConfigurationDisableSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/FirewallRuleCreate - * .json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ + * TuningConfiguration_Disable.json */ /** - * Sample code: FirewallRuleCreate. + * Sample code: TuningConfiguration_Disable. * * @param manager Entry point to PostgreSqlManager. */ public static void - firewallRuleCreate(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { - manager.firewallRules() - .define("rule1") - .withExistingFlexibleServer("testrg", "testserver") - .withStartIpAddress("0.0.0.0") - .withEndIpAddress("255.255.255.255") - .create(); + tuningConfigurationDisable(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager.tuningConfigurations() + .disable("testrg", "testserver", TuningOptionEnum.CONFIGURATION, com.azure.core.util.Context.NONE); } } ``` @@ -624,23 +715,28 @@ public final class FirewallRulesCreateOrUpdateSamples { ### FirewallRules_Delete ```java +import com.azure.resourcemanager.postgresqlflexibleserver.models.VirtualNetworkSubnetUsageParameter; + /** - * Samples for FirewallRules Delete. + * Samples for VirtualNetworkSubnetUsage Execute. */ -public final class FirewallRulesDeleteSamples { +public final class VirtualNetworkSubnetUsageExecuteSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/FirewallRuleDelete - * .json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ + * VirtualNetworkSubnetUsage.json */ /** - * Sample code: FirewallRuleDelete. + * Sample code: VirtualNetworkSubnetUsageList. * * @param manager Entry point to PostgreSqlManager. */ public static void - firewallRuleDelete(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { - manager.firewallRules().delete("testrg", "testserver", "rule1", com.azure.core.util.Context.NONE); + virtualNetworkSubnetUsageList(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager.virtualNetworkSubnetUsages() + .executeWithResponse("westus", new VirtualNetworkSubnetUsageParameter().withVirtualNetworkArmResourceId( + "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/testvnet"), + com.azure.core.util.Context.NONE); } } ``` @@ -648,22 +744,27 @@ public final class FirewallRulesDeleteSamples { ### FirewallRules_Get ```java +import com.azure.resourcemanager.postgresqlflexibleserver.models.TuningOptionEnum; + /** - * Samples for FirewallRules Get. + * Samples for TuningConfiguration ListSessionDetails. */ -public final class FirewallRulesGetSamples { +public final class TuningConfigurationListSessionDetailsSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/FirewallRuleGet. - * json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ + * TuningConfiguration_ListSessionDetails.json */ /** - * Sample code: FirewallRuleList. + * Sample code: TuningConfiguration_ListSessionDetails. * * @param manager Entry point to PostgreSqlManager. */ - public static void firewallRuleList(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { - manager.firewallRules().getWithResponse("testrg", "testserver", "rule1", com.azure.core.util.Context.NONE); + public static void tuningConfigurationListSessionDetails( + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager.tuningConfigurations() + .listSessionDetails("testrg", "testserver", TuningOptionEnum.CONFIGURATION, + "oooooooo-oooo-oooo-oooo-oooooooooooo", com.azure.core.util.Context.NONE); } } ``` @@ -671,22 +772,26 @@ public final class FirewallRulesGetSamples { ### FirewallRules_ListByServer ```java +import com.azure.resourcemanager.postgresqlflexibleserver.models.TuningOptionEnum; + /** - * Samples for FirewallRules ListByServer. + * Samples for TuningConfiguration StopSession. */ -public final class FirewallRulesListByServerSamples { +public final class TuningConfigurationStopSessionSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ - * FirewallRuleListByServer.json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ + * TuningConfiguration_StopSession.json */ /** - * Sample code: FirewallRuleList. + * Sample code: TuningConfiguration_StopSession. * * @param manager Entry point to PostgreSqlManager. */ - public static void firewallRuleList(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { - manager.firewallRules().listByServer("testrg", "testserver", com.azure.core.util.Context.NONE); + public static void + tuningConfigurationStopSession(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager.tuningConfigurations() + .stopSession("testrg", "testserver", TuningOptionEnum.CONFIGURATION, com.azure.core.util.Context.NONE); } } ``` @@ -694,31 +799,26 @@ public final class FirewallRulesListByServerSamples { ### FlexibleServer_StartLtrBackup ```java -import com.azure.resourcemanager.postgresqlflexibleserver.models.BackupSettings; -import com.azure.resourcemanager.postgresqlflexibleserver.models.BackupStoreDetails; -import com.azure.resourcemanager.postgresqlflexibleserver.models.LtrBackupRequest; -import java.util.Arrays; +import com.azure.resourcemanager.postgresqlflexibleserver.models.ThreatProtectionName; /** - * Samples for FlexibleServer StartLtrBackup. + * Samples for ServerThreatProtectionSettings Get. */ -public final class FlexibleServerStartLtrBackupSamples { +public final class ServerThreatProtectionSettingsGetSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ - * LongTermRetentionBackup.json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ + * ServerThreatProtectionSettingsGet.json */ /** - * Sample code: Sample_ExecuteBackup. + * Sample code: Get a server's Threat Protection settings. * * @param manager Entry point to PostgreSqlManager. */ - public static void - sampleExecuteBackup(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { - manager.flexibleServers() - .startLtrBackup("rgLongTermRetention", "pgsqlltrtestserver", - new LtrBackupRequest().withBackupSettings(new BackupSettings().withBackupName("backup1")) - .withTargetDetails(new BackupStoreDetails().withSasUriList(Arrays.asList("sasuri"))), + public static void getAServerSThreatProtectionSettings( + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager.serverThreatProtectionSettings() + .getWithResponse("threatprotection-6852", "threatprotection-2080", ThreatProtectionName.DEFAULT, com.azure.core.util.Context.NONE); } } @@ -727,28 +827,22 @@ public final class FlexibleServerStartLtrBackupSamples { ### FlexibleServer_TriggerLtrPreBackup ```java -import com.azure.resourcemanager.postgresqlflexibleserver.models.BackupSettings; -import com.azure.resourcemanager.postgresqlflexibleserver.models.LtrPreBackupRequest; - /** - * Samples for FlexibleServer TriggerLtrPreBackup. + * Samples for Databases Delete. */ -public final class FlexibleServerTriggerLtrPreBackupSamples { +public final class DatabasesDeleteSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ - * LongTermRetentionPreBackup.json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ + * DatabaseDelete.json */ /** - * Sample code: Sample_Prebackup. + * Sample code: Delete a database. * * @param manager Entry point to PostgreSqlManager. */ - public static void samplePrebackup(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { - manager.flexibleServers() - .triggerLtrPreBackupWithResponse("rgLongTermRetention", "pgsqlltrtestserver", - new LtrPreBackupRequest().withBackupSettings(new BackupSettings().withBackupName("backup1")), - com.azure.core.util.Context.NONE); + public static void deleteADatabase(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager.databases().delete("TestGroup", "testserver", "db1", com.azure.core.util.Context.NONE); } } ``` @@ -756,23 +850,26 @@ public final class FlexibleServerTriggerLtrPreBackupSamples { ### GetPrivateDnsZoneSuffix_Execute ```java +import com.azure.resourcemanager.postgresqlflexibleserver.models.TuningOptionEnum; + /** - * Samples for GetPrivateDnsZoneSuffix Execute. + * Samples for TuningConfiguration Enable. */ -public final class GetPrivateDnsZoneSuffixExecuteSamples { +public final class TuningConfigurationEnableSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ - * GetPrivateDnsZoneSuffix.json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ + * TuningConfiguration_Enable.json */ /** - * Sample code: GetPrivateDnsZoneSuffix. + * Sample code: TuningConfiguration_Enable. * * @param manager Entry point to PostgreSqlManager. */ public static void - getPrivateDnsZoneSuffix(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { - manager.getPrivateDnsZoneSuffixes().executeWithResponse(com.azure.core.util.Context.NONE); + tuningConfigurationEnable(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager.tuningConfigurations() + .enable("testrg", "testserver", TuningOptionEnum.CONFIGURATION, com.azure.core.util.Context.NONE); } } ``` @@ -780,22 +877,26 @@ public final class GetPrivateDnsZoneSuffixExecuteSamples { ### LocationBasedCapabilities_Execute ```java +import com.azure.resourcemanager.postgresqlflexibleserver.models.TuningOptionEnum; + /** - * Samples for LocationBasedCapabilities Execute. + * Samples for TuningConfiguration ListSessions. */ -public final class LocationBasedCapabilitiesExecuteSamples { +public final class TuningConfigurationListSessionsSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ - * CapabilitiesByLocation.json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ + * TuningConfiguration_ListSessions.json */ /** - * Sample code: CapabilitiesList. + * Sample code: TuningConfiguration_ListSessions. * * @param manager Entry point to PostgreSqlManager. */ - public static void capabilitiesList(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { - manager.locationBasedCapabilities().execute("eastus", com.azure.core.util.Context.NONE); + public static void + tuningConfigurationListSessions(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager.tuningConfigurations() + .listSessions("testrg", "testserver", TuningOptionEnum.CONFIGURATION, com.azure.core.util.Context.NONE); } } ``` @@ -804,22 +905,22 @@ public final class LocationBasedCapabilitiesExecuteSamples { ```java /** - * Samples for LogFiles ListByServer. + * Samples for QuotaUsages List. */ -public final class LogFilesListByServerSamples { +public final class QuotaUsagesListSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ - * LogFilesListByServer.json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ + * QuotaUsagesForFlexibleServers.json */ /** - * Sample code: List all server log files for a server. + * Sample code: List of quota usages for flexible servers. * * @param manager Entry point to PostgreSqlManager. */ - public static void - listAllServerLogFilesForAServer(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { - manager.logFiles().listByServer("testrg", "postgresqltestsvc1", com.azure.core.util.Context.NONE); + public static void listOfQuotaUsagesForFlexibleServers( + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager.quotaUsages().list("westus", com.azure.core.util.Context.NONE); } } ``` @@ -828,22 +929,24 @@ public final class LogFilesListByServerSamples { ```java /** - * Samples for LtrBackupOperations Get. + * Samples for Backups Get. */ -public final class LtrBackupOperationsGetSamples { +public final class BackupsGetSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ - * LongTermRetentionOperationGet.json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/BackupGet + * .json */ /** - * Sample code: Sample. + * Sample code: Get a backup for a server. * * @param manager Entry point to PostgreSqlManager. */ - public static void sample(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { - manager.ltrBackupOperations() - .getWithResponse("rgLongTermRetention", "pgsqlltrtestserver", "backup1", com.azure.core.util.Context.NONE); + public static void + getABackupForAServer(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager.backups() + .getWithResponse("TestGroup", "postgresqltestserver", "daily_20250303T160516", + com.azure.core.util.Context.NONE); } } ``` @@ -852,23 +955,21 @@ public final class LtrBackupOperationsGetSamples { ```java /** - * Samples for LtrBackupOperations ListByServer. + * Samples for Operations List. */ -public final class LtrBackupOperationsListByServerSamples { +public final class OperationsListSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ - * LongTermRetentionOperationListByServer.json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ + * OperationList.json */ /** - * Sample code: Sample List of Long Tern Retention Operations by Flexible Server. + * Sample code: OperationList. * * @param manager Entry point to PostgreSqlManager. */ - public static void sampleListOfLongTernRetentionOperationsByFlexibleServer( - com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { - manager.ltrBackupOperations() - .listByServer("rgLongTermRetention", "pgsqlltrtestserver", com.azure.core.util.Context.NONE); + public static void operationList(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager.operations().list(com.azure.core.util.Context.NONE); } } ``` @@ -876,436 +977,436 @@ public final class LtrBackupOperationsListByServerSamples { ### Migrations_Create ```java -import com.azure.resourcemanager.postgresqlflexibleserver.models.AdminCredentials; -import com.azure.resourcemanager.postgresqlflexibleserver.models.MigrateRolesEnum; -import com.azure.resourcemanager.postgresqlflexibleserver.models.MigrationMode; -import com.azure.resourcemanager.postgresqlflexibleserver.models.MigrationOption; -import com.azure.resourcemanager.postgresqlflexibleserver.models.MigrationSecretParameters; -import com.azure.resourcemanager.postgresqlflexibleserver.models.OverwriteDbsInTargetEnum; -import com.azure.resourcemanager.postgresqlflexibleserver.models.SourceType; -import com.azure.resourcemanager.postgresqlflexibleserver.models.SslMode; -import java.util.Arrays; - /** - * Samples for Migrations Create. + * Samples for PrivateEndpointConnectionOperation Delete. */ -public final class MigrationsCreateSamples { +public final class PrivateEndpointConnectionOperationDeleteSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ - * Migrations_Create_With_PrivateEndpoint_Servers.json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ + * PrivateEndpointConnectionDelete.json */ /** - * Sample code: Migrations Create with private endpoint. + * Sample code: Deletes a private endpoint connection with a given name. * * @param manager Entry point to PostgreSqlManager. */ - public static void migrationsCreateWithPrivateEndpoint( + public static void deletesAPrivateEndpointConnectionWithAGivenName( com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { - manager.migrations() - .define("testmigration") - .withRegion("westus") - .withExistingFlexibleServer("ffffffff-ffff-ffff-ffff-ffffffffffff", "testrg", "testtarget") - .withMigrationInstanceResourceId( - "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/flexibleServers/testsourcemigration") - .withMigrationMode(MigrationMode.OFFLINE) - .withSourceDbServerResourceId( - "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/servers/testsource") - .withSecretParameters(new MigrationSecretParameters() - .withAdminCredentials(new AdminCredentials().withSourceServerPassword("fakeTokenPlaceholder") - .withTargetServerPassword("fakeTokenPlaceholder"))) - .withDbsToMigrate(Arrays.asList("db1", "db2", "db3", "db4")) - .withOverwriteDbsInTarget(OverwriteDbsInTargetEnum.TRUE) - .create(); + manager.privateEndpointConnectionOperations() + .delete("Default", "test-svr", "private-endpoint-connection-name.1fa229cd-bf3f-47f0-8c49-afb36723997e", + com.azure.core.util.Context.NONE); } +} +``` + +### Migrations_Delete + +```java +import com.azure.resourcemanager.postgresqlflexibleserver.models.BackupSettings; +import com.azure.resourcemanager.postgresqlflexibleserver.models.BackupStoreDetails; +import com.azure.resourcemanager.postgresqlflexibleserver.models.LtrBackupRequest; +import java.util.Arrays; +/** + * Samples for FlexibleServer StartLtrBackup. + */ +public final class FlexibleServerStartLtrBackupSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ - * Migrations_Create_With_Roles.json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ + * LongTermRetentionBackup.json */ /** - * Sample code: Migrations Create with roles. + * Sample code: Sample_ExecuteBackup. * * @param manager Entry point to PostgreSqlManager. */ public static void - migrationsCreateWithRoles(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { - manager.migrations() - .define("testmigration") - .withRegion("westus") - .withExistingFlexibleServer("ffffffff-ffff-ffff-ffff-ffffffffffff", "testrg", "testtarget") - .withMigrationMode(MigrationMode.OFFLINE) - .withSourceDbServerResourceId( - "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/servers/testsource") - .withSecretParameters(new MigrationSecretParameters() - .withAdminCredentials(new AdminCredentials().withSourceServerPassword("fakeTokenPlaceholder") - .withTargetServerPassword("fakeTokenPlaceholder"))) - .withDbsToMigrate(Arrays.asList("db1", "db2", "db3", "db4")) - .withOverwriteDbsInTarget(OverwriteDbsInTargetEnum.TRUE) - .withMigrateRoles(MigrateRolesEnum.TRUE) - .create(); + sampleExecuteBackup(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager.flexibleServers() + .startLtrBackup("rgLongTermRetention", "pgsqlltrtestserver", + new LtrBackupRequest().withBackupSettings(new BackupSettings().withBackupName("backup1")) + .withTargetDetails(new BackupStoreDetails().withSasUriList(Arrays.asList("sasuri"))), + com.azure.core.util.Context.NONE); } +} +``` - /* - * 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. - */ - public static void - createPreMigrationValidation(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { - manager.migrations() - .define("testmigration") - .withRegion("westus") - .withExistingFlexibleServer("ffffffff-ffff-ffff-ffff-ffffffffffff", "testrg", "testtarget") - .withMigrationMode(MigrationMode.OFFLINE) - .withMigrationOption(MigrationOption.VALIDATE) - .withSourceDbServerResourceId( - "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/servers/testsource") - .withSecretParameters(new MigrationSecretParameters() - .withAdminCredentials(new AdminCredentials().withSourceServerPassword("fakeTokenPlaceholder") - .withTargetServerPassword("fakeTokenPlaceholder"))) - .withDbsToMigrate(Arrays.asList("db1", "db2", "db3", "db4")) - .withOverwriteDbsInTarget(OverwriteDbsInTargetEnum.TRUE) - .create(); - } +### Migrations_Get + +```java +import com.azure.resourcemanager.postgresqlflexibleserver.models.ServerThreatProtectionSettingsModel; +import com.azure.resourcemanager.postgresqlflexibleserver.models.ThreatProtectionName; +import com.azure.resourcemanager.postgresqlflexibleserver.models.ThreatProtectionState; +/** + * Samples for ServerThreatProtectionSettings CreateOrUpdate. + */ +public final class ServerThreatProtectionSettingsCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ - * Migrations_Create_With_Other_Users.json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ + * ServerThreatProtectionSettingsCreateOrUpdate.json */ /** - * Sample code: Migrations Create by passing user names. + * Sample code: Update a server's Threat Protection settings. * * @param manager Entry point to PostgreSqlManager. */ - public static void migrationsCreateByPassingUserNames( + public static void updateAServerSThreatProtectionSettings( com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { - manager.migrations() - .define("testmigration") - .withRegion("westus") - .withExistingFlexibleServer("ffffffff-ffff-ffff-ffff-ffffffffffff", "testrg", "testtarget") - .withMigrationMode(MigrationMode.OFFLINE) - .withSourceDbServerResourceId( - "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/servers/testsource") - .withSecretParameters(new MigrationSecretParameters() - .withAdminCredentials(new AdminCredentials().withSourceServerPassword("fakeTokenPlaceholder") - .withTargetServerPassword("fakeTokenPlaceholder")) - .withSourceServerUsername("newadmin@testsource") - .withTargetServerUsername("targetadmin")) - .withDbsToMigrate(Arrays.asList("db1", "db2", "db3", "db4")) - .create(); + ServerThreatProtectionSettingsModel resource = manager.serverThreatProtectionSettings() + .getWithResponse("threatprotection-4799", "threatprotection-6440", ThreatProtectionName.DEFAULT, + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withState(ThreatProtectionState.ENABLED).apply(); } +} +``` + +### Migrations_ListByTargetServer +```java +/** + * Samples for FirewallRules Get. + */ +public final class FirewallRulesGetSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/Migrations_Create. - * json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ + * FirewallRuleGet.json */ /** - * Sample code: Migrations_Create. + * Sample code: FirewallRuleList. * * @param manager Entry point to PostgreSqlManager. */ - public static void migrationsCreate(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { - manager.migrations() - .define("testmigration") - .withRegion("westus") - .withExistingFlexibleServer("ffffffff-ffff-ffff-ffff-ffffffffffff", "testrg", "testtarget") - .withMigrationInstanceResourceId( - "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/flexibleServers/testsourcemigration") - .withMigrationMode(MigrationMode.OFFLINE) - .withSourceDbServerResourceId( - "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/servers/testsource") - .withSecretParameters(new MigrationSecretParameters() - .withAdminCredentials(new AdminCredentials().withSourceServerPassword("fakeTokenPlaceholder") - .withTargetServerPassword("fakeTokenPlaceholder"))) - .withDbsToMigrate(Arrays.asList("db1", "db2", "db3", "db4")) - .withOverwriteDbsInTarget(OverwriteDbsInTargetEnum.TRUE) - .create(); + public static void firewallRuleList(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager.firewallRules().getWithResponse("testrg", "testserver", "rule1", com.azure.core.util.Context.NONE); } +} +``` +### Migrations_Update + +```java +/** + * Samples for Administrators Delete. + */ +public final class AdministratorsDeleteSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ - * Migrations_Create_Other_SourceTypes_Validate_Migrate.json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ + * AdministratorDelete.json */ /** - * Sample code: Create Migration with other source types for Validate and Migrate. + * Sample code: AdministratorDelete. * * @param manager Entry point to PostgreSqlManager. */ - public static void createMigrationWithOtherSourceTypesForValidateAndMigrate( - com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { - manager.migrations() - .define("testmigration") - .withRegion("westus") - .withExistingFlexibleServer("ffffffff-ffff-ffff-ffff-ffffffffffff", "testrg", "testtarget") - .withMigrationMode(MigrationMode.OFFLINE) - .withMigrationOption(MigrationOption.VALIDATE_AND_MIGRATE) - .withSourceType(SourceType.ON_PREMISES) - .withSslMode(SslMode.PREFER) - .withSourceDbServerResourceId("testsource:5432@pguser") - .withSecretParameters(new MigrationSecretParameters() - .withAdminCredentials(new AdminCredentials().withSourceServerPassword("fakeTokenPlaceholder") - .withTargetServerPassword("fakeTokenPlaceholder"))) - .withDbsToMigrate(Arrays.asList("db1", "db2", "db3", "db4")) - .withOverwriteDbsInTarget(OverwriteDbsInTargetEnum.TRUE) - .create(); + public static void + administratorDelete(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager.administrators() + .delete("testrg", "testserver", "oooooooo-oooo-oooo-oooo-oooooooooooo", com.azure.core.util.Context.NONE); } } ``` -### Migrations_Delete +### Operations_List ```java /** - * Samples for Migrations Delete. + * Samples for Databases Get. */ -public final class MigrationsDeleteSamples { +public final class DatabasesGetSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/Migrations_Delete. - * json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ + * DatabaseGet.json */ /** - * Sample code: Migrations_Delete. + * Sample code: Get a database. * * @param manager Entry point to PostgreSqlManager. */ - public static void migrationsDelete(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { - manager.migrations() - .deleteWithResponse("ffffffff-ffff-ffff-ffff-ffffffffffff", "testrg", "testtarget", "testmigration", - com.azure.core.util.Context.NONE); + public static void getADatabase(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager.databases().getWithResponse("TestGroup", "testserver", "db1", com.azure.core.util.Context.NONE); } } ``` -### Migrations_Get +### PrivateEndpointConnectionOperation_Delete ```java /** - * Samples for Migrations Get. + * Samples for Configurations ListByServer. */ -public final class MigrationsGetSamples { +public final class ConfigurationsListByServerSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ - * Migrations_GetMigrationWithSuccessfulValidationOnly.json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ + * ConfigurationListByServer.json */ /** - * Sample code: Migrations_GetMigrationWithSuccessfulValidationOnly. + * Sample code: ConfigurationList. * * @param manager Entry point to PostgreSqlManager. */ - public static void migrationsGetMigrationWithSuccessfulValidationOnly( - com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { - manager.migrations() - .getWithResponse("ffffffff-ffff-ffff-ffff-ffffffffffff", "testrg", "testtarget", - "testmigrationwithsuccessfulvalidationonly", com.azure.core.util.Context.NONE); + public static void configurationList(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager.configurations().listByServer("testrg", "testserver", com.azure.core.util.Context.NONE); } +} +``` + +### PrivateEndpointConnectionOperation_Update +```java +/** + * Samples for Databases Create. + */ +public final class DatabasesCreateSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/Migrations_Get. - * json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ + * DatabaseCreate.json */ /** - * Sample code: Migrations_Get. + * Sample code: Create a database. * * @param manager Entry point to PostgreSqlManager. */ - public static void migrationsGet(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { - manager.migrations() - .getWithResponse("ffffffff-ffff-ffff-ffff-ffffffffffff", "testrg", "testtarget", "testmigration", - com.azure.core.util.Context.NONE); + public static void createADatabase(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager.databases() + .define("db1") + .withExistingFlexibleServer("TestGroup", "testserver") + .withCharset("utf8") + .withCollation("en_US.utf8") + .create(); } +} +``` + +### PrivateEndpointConnections_Get +```java +/** + * Samples for TuningOptions ListByServer. + */ +public final class TuningOptionsListByServerSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ - * Migrations_GetMigrationWithSuccessfulValidationButMigrationFailure.json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ + * Tuning_ListTuningOptions.json */ /** - * Sample code: Migrations_GetMigrationWithSuccessfulValidationButMigrationFailure. + * Sample code: TuningOptions_ListByServer. * * @param manager Entry point to PostgreSqlManager. */ - public static void migrationsGetMigrationWithSuccessfulValidationButMigrationFailure( - com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { - manager.migrations() - .getWithResponse("ffffffff-ffff-ffff-ffff-ffffffffffff", "testrg", "testtarget", - "testmigrationwithsuccessfulvalidationbutmigrationfailure", com.azure.core.util.Context.NONE); + public static void + tuningOptionsListByServer(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager.tuningOptions().listByServer("s0403mllorentpimmy", "arm3", com.azure.core.util.Context.NONE); } +} +``` + +### PrivateEndpointConnections_ListByServer + +```java +import com.azure.resourcemanager.postgresqlflexibleserver.models.VirtualEndpointResource; +import com.azure.resourcemanager.postgresqlflexibleserver.models.VirtualEndpointType; +import java.util.Arrays; +/** + * Samples for VirtualEndpoints Update. + */ +public final class VirtualEndpointsUpdateSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ - * Migrations_GetMigrationWithSuccessfulValidationAndMigration.json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ + * VirtualEndpointUpdate.json */ /** - * Sample code: Migrations_GetMigrationWithSuccessfulValidationAndMigration. + * Sample code: Update a virtual endpoint for a server to update the. * * @param manager Entry point to PostgreSqlManager. */ - public static void migrationsGetMigrationWithSuccessfulValidationAndMigration( + public static void updateAVirtualEndpointForAServerToUpdateThe( com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { - manager.migrations() - .getWithResponse("ffffffff-ffff-ffff-ffff-ffffffffffff", "testrg", "testtarget", - "testmigrationwithsuccessfulvalidationandmigration", com.azure.core.util.Context.NONE); + VirtualEndpointResource resource = manager.virtualEndpoints() + .getWithResponse("testrg", "pgtestsvc4", "pgVirtualEndpoint1", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withEndpointType(VirtualEndpointType.READ_WRITE) + .withMembers(Arrays.asList("testReplica1")) + .apply(); } +} +``` + +### PrivateLinkResources_Get + +```java +import com.azure.resourcemanager.postgresqlflexibleserver.models.PrincipalType; +/** + * Samples for Administrators Create. + */ +public final class AdministratorsCreateSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ - * Migrations_GetMigrationWithValidationFailures.json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ + * AdministratorAdd.json */ /** - * Sample code: Migrations_GetMigrationWithValidationFailures. + * Sample code: Adds an Microsoft Entra Administrator for the server. * * @param manager Entry point to PostgreSqlManager. */ - public static void migrationsGetMigrationWithValidationFailures( + public static void addsAnMicrosoftEntraAdministratorForTheServer( com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { - manager.migrations() - .getWithResponse("ffffffff-ffff-ffff-ffff-ffffffffffff", "testrg", "testtarget", - "testmigrationwithvalidationfailure", com.azure.core.util.Context.NONE); - } -} + manager.administrators() + .define("oooooooo-oooo-oooo-oooo-oooooooooooo") + .withExistingFlexibleServer("testrg", "testserver") + .withPrincipalType(PrincipalType.USER) + .withPrincipalName("testuser1@microsoft.com") + .withTenantId("tttttttt-tttt-tttt-tttt-tttttttttttt") + .create(); + } +} ``` -### Migrations_ListByTargetServer +### PrivateLinkResources_ListByServer ```java -import com.azure.resourcemanager.postgresqlflexibleserver.models.MigrationListFilter; - /** - * Samples for Migrations ListByTargetServer. + * Samples for Servers Start. */ -public final class MigrationsListByTargetServerSamples { +public final class ServersStartSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ - * Migrations_ListByTargetServer.json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ + * ServerStart.json */ /** - * Sample code: Migrations_ListByTargetServer. + * Sample code: ServerStart. * * @param manager Entry point to PostgreSqlManager. */ - public static void - migrationsListByTargetServer(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { - manager.migrations() - .listByTargetServer("ffffffff-ffff-ffff-ffff-ffffffffffff", "testrg", "testtarget", MigrationListFilter.ALL, - com.azure.core.util.Context.NONE); + public static void serverStart(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager.servers().start("testrg", "testserver", com.azure.core.util.Context.NONE); } } ``` -### Migrations_Update +### QuotaUsages_List ```java -import com.azure.resourcemanager.postgresqlflexibleserver.models.CancelEnum; -import com.azure.resourcemanager.postgresqlflexibleserver.models.LogicalReplicationOnSourceDbEnum; -import com.azure.resourcemanager.postgresqlflexibleserver.models.MigrationResource; - /** - * Samples for Migrations Update. + * Samples for VirtualEndpoints Get. */ -public final class MigrationsUpdateSamples { +public final class VirtualEndpointsGetSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/Migrations_Cancel. - * json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ + * VirtualEndpointsGet.json */ /** - * Sample code: Cancel migration. + * Sample code: Get a virtual endpoint. * * @param manager Entry point to PostgreSqlManager. */ - public static void cancelMigration(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { - MigrationResource resource = manager.migrations() - .getWithResponse("ffffffff-ffff-ffff-ffff-ffffffffffff", "testrg", "testtarget", "testmigration", - com.azure.core.util.Context.NONE) - .getValue(); - resource.update().withCancel(CancelEnum.TRUE).apply(); + public static void + getAVirtualEndpoint(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager.virtualEndpoints() + .getWithResponse("testrg", "pgtestsvc4", "pgVirtualEndpoint1", com.azure.core.util.Context.NONE); } +} +``` + +### Replicas_ListByServer + +```java +import com.azure.resourcemanager.postgresqlflexibleserver.models.VirtualEndpointType; +import java.util.Arrays; +/** + * Samples for VirtualEndpoints Create. + */ +public final class VirtualEndpointsCreateSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/Migrations_Update. - * json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ + * VirtualEndpointCreate.json */ /** - * Sample code: Migrations_Update. + * Sample code: Create a new virtual endpoint for a flexible server. * * @param manager Entry point to PostgreSqlManager. */ - public static void migrationsUpdate(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { - MigrationResource resource = manager.migrations() - .getWithResponse("ffffffff-ffff-ffff-ffff-ffffffffffff", "testrg", "testtarget", "testmigration", - com.azure.core.util.Context.NONE) - .getValue(); - resource.update().withSetupLogicalReplicationOnSourceDbIfNeeded(LogicalReplicationOnSourceDbEnum.TRUE).apply(); + public static void createANewVirtualEndpointForAFlexibleServer( + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager.virtualEndpoints() + .define("pgVirtualEndpoint1") + .withExistingFlexibleServer("testrg", "pgtestsvc4") + .withEndpointType(VirtualEndpointType.READ_WRITE) + .withMembers(Arrays.asList("testPrimary1")) + .create(); } } ``` -### Operations_List +### ResourceProvider_CheckMigrationNameAvailability ```java +import com.azure.resourcemanager.postgresqlflexibleserver.models.CancelEnum; +import com.azure.resourcemanager.postgresqlflexibleserver.models.LogicalReplicationOnSourceDbEnum; +import com.azure.resourcemanager.postgresqlflexibleserver.models.MigrationResource; + /** - * Samples for Operations List. + * Samples for Migrations Update. */ -public final class OperationsListSamples { +public final class MigrationsUpdateSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/OperationList.json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ + * Migrations_Cancel.json */ /** - * Sample code: OperationList. + * Sample code: Cancel migration. * * @param manager Entry point to PostgreSqlManager. */ - public static void operationList(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { - manager.operations().listWithResponse(com.azure.core.util.Context.NONE); + public static void cancelMigration(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + MigrationResource resource = manager.migrations() + .getWithResponse("ffffffff-ffff-ffff-ffff-ffffffffffff", "testrg", "testtarget", "testmigration", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withCancel(CancelEnum.TRUE).apply(); } -} -``` - -### PrivateEndpointConnectionOperation_Delete -```java -/** - * Samples for PrivateEndpointConnectionOperation Delete. - */ -public final class PrivateEndpointConnectionOperationDeleteSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ - * PrivateEndpointConnectionDelete.json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ + * Migrations_Update.json */ /** - * Sample code: Deletes a private endpoint connection with a given name. + * Sample code: Migrations_Update. * * @param manager Entry point to PostgreSqlManager. */ - public static void deletesAPrivateEndpointConnectionWithAGivenName( - com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { - manager.privateEndpointConnectionOperations() - .delete("Default", "test-svr", "private-endpoint-connection-name.1fa229cd-bf3f-47f0-8c49-afb36723997e", - com.azure.core.util.Context.NONE); + public static void migrationsUpdate(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + MigrationResource resource = manager.migrations() + .getWithResponse("ffffffff-ffff-ffff-ffff-ffffffffffff", "testrg", "testtarget", "testmigration", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withSetupLogicalReplicationOnSourceDbIfNeeded(LogicalReplicationOnSourceDbEnum.TRUE).apply(); } } ``` -### PrivateEndpointConnectionOperation_Update +### ServerCapabilities_List ```java import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.PrivateEndpointConnectionInner; @@ -1318,7 +1419,7 @@ import com.azure.resourcemanager.postgresqlflexibleserver.models.PrivateLinkServ public final class PrivateEndpointConnectionOperationUpdateSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ * PrivateEndpointConnectionUpdate.json */ /** @@ -1338,211 +1439,308 @@ public final class PrivateEndpointConnectionOperationUpdateSamples { } ``` -### PrivateEndpointConnections_Get +### ServerThreatProtectionSettings_CreateOrUpdate ```java -/** - * Samples for PrivateEndpointConnections Get. - */ -public final class PrivateEndpointConnectionsGetSamples { - /* - * 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. - */ - public static void - getsPrivateEndpointConnection(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { - manager.privateEndpointConnections() - .getWithResponse("Default", "test-svr", - "private-endpoint-connection-name.1fa229cd-bf3f-47f0-8c49-afb36723997e", - com.azure.core.util.Context.NONE); - } -} -``` - -### PrivateEndpointConnections_ListByServer +import com.azure.resourcemanager.postgresqlflexibleserver.models.ActiveDirectoryAuthEnum; +import com.azure.resourcemanager.postgresqlflexibleserver.models.ArmServerKeyType; +import com.azure.resourcemanager.postgresqlflexibleserver.models.AuthConfig; +import com.azure.resourcemanager.postgresqlflexibleserver.models.AzureManagedDiskPerformanceTiers; +import com.azure.resourcemanager.postgresqlflexibleserver.models.Backup; +import com.azure.resourcemanager.postgresqlflexibleserver.models.Cluster; +import com.azure.resourcemanager.postgresqlflexibleserver.models.CreateMode; +import com.azure.resourcemanager.postgresqlflexibleserver.models.DataEncryption; +import com.azure.resourcemanager.postgresqlflexibleserver.models.GeoRedundantBackupEnum; +import com.azure.resourcemanager.postgresqlflexibleserver.models.HighAvailability; +import com.azure.resourcemanager.postgresqlflexibleserver.models.HighAvailabilityMode; +import com.azure.resourcemanager.postgresqlflexibleserver.models.IdentityType; +import com.azure.resourcemanager.postgresqlflexibleserver.models.Network; +import com.azure.resourcemanager.postgresqlflexibleserver.models.PasswordAuthEnum; +import com.azure.resourcemanager.postgresqlflexibleserver.models.ServerPublicNetworkAccessState; +import com.azure.resourcemanager.postgresqlflexibleserver.models.ServerVersion; +import com.azure.resourcemanager.postgresqlflexibleserver.models.Sku; +import com.azure.resourcemanager.postgresqlflexibleserver.models.SkuTier; +import com.azure.resourcemanager.postgresqlflexibleserver.models.Storage; +import com.azure.resourcemanager.postgresqlflexibleserver.models.StorageAutoGrow; +import com.azure.resourcemanager.postgresqlflexibleserver.models.UserAssignedIdentity; +import com.azure.resourcemanager.postgresqlflexibleserver.models.UserIdentity; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; -```java /** - * Samples for PrivateEndpointConnections ListByServer. + * Samples for Servers Create. */ -public final class PrivateEndpointConnectionsListByServerSamples { +public final class ServersCreateSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ - * PrivateEndpointConnectionList.json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ + * ServerCreateWithDataEncryptionEnabled.json */ /** - * Sample code: Gets list of private endpoint connections on a server. + * Sample code: ServerCreateWithDataEncryptionEnabled. * * @param manager Entry point to PostgreSqlManager. */ - public static void getsListOfPrivateEndpointConnectionsOnAServer( + public static void serverCreateWithDataEncryptionEnabled( com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { - manager.privateEndpointConnections().listByServer("Default", "test-svr", com.azure.core.util.Context.NONE); + manager.servers() + .define("pgtestsvc4") + .withRegion("westus") + .withExistingResourceGroup("testrg") + .withSku(new Sku().withName("Standard_D4ds_v5").withTier(SkuTier.GENERAL_PURPOSE)) + .withIdentity(new UserAssignedIdentity().withUserAssignedIdentities(mapOf( + "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-usermanagedidentity", + new UserIdentity())).withType(IdentityType.USER_ASSIGNED)) + .withAdministratorLogin("login") + .withAdministratorLoginPassword("Password1") + .withVersion(ServerVersion.ONE_SIX) + .withStorage(new Storage().withStorageSizeGB(512) + .withAutoGrow(StorageAutoGrow.DISABLED) + .withTier(AzureManagedDiskPerformanceTiers.P20)) + .withDataEncryption(new DataEncryption().withPrimaryKeyUri("fakeTokenPlaceholder") + .withPrimaryUserAssignedIdentityId( + "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-usermanagedidentity") + .withGeoBackupKeyUri("fakeTokenPlaceholder") + .withGeoBackupUserAssignedIdentityId("") + .withType(ArmServerKeyType.AZURE_KEY_VAULT)) + .withBackup(new Backup().withBackupRetentionDays(7).withGeoRedundantBackup(GeoRedundantBackupEnum.DISABLED)) + .withNetwork(new Network().withDelegatedSubnetResourceId( + "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/test-vnet-subnet") + .withPrivateDnsZoneArmResourceId( + "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourcegroups/testrg/providers/Microsoft.Network/privateDnsZones/test-private-dns-zone.postgres.database.azure.com")) + .withHighAvailability(new HighAvailability().withMode(HighAvailabilityMode.ZONE_REDUNDANT)) + .withAvailabilityZone("1") + .withCreateMode(CreateMode.CREATE) + .create(); } -} -``` - -### PrivateLinkResources_Get -```java -/** - * Samples for PrivateLinkResources Get. - */ -public final class PrivateLinkResourcesGetSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ - * PrivateLinkResourcesGet.json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ + * ServerCreateReviveDropped.json */ /** - * Sample code: Gets a private link resource for PostgreSQL. + * Sample code: ServerCreateReviveDropped. * * @param manager Entry point to PostgreSqlManager. */ - public static void getsAPrivateLinkResourceForPostgreSQL( - com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { - manager.privateLinkResources().getWithResponse("Default", "test-svr", "plr", com.azure.core.util.Context.NONE); + public static void + serverCreateReviveDropped(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager.servers() + .define("pgtestsvc5-rev") + .withRegion("westus") + .withExistingResourceGroup("testrg") + .withSourceServerResourceId( + "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/pgtestsvc5") + .withPointInTimeUtc(OffsetDateTime.parse("2023-04-27T00:04:59.4078005+00:00")) + .withCreateMode(CreateMode.REVIVE_DROPPED) + .create(); } -} -``` - -### PrivateLinkResources_ListByServer -```java -/** - * Samples for PrivateLinkResources ListByServer. - */ -public final class PrivateLinkResourcesListByServerSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ - * PrivateLinkResourcesList.json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ + * ServerCreateGeoRestoreWithDataEncryptionEnabled.json */ /** - * Sample code: Gets private link resources for PostgreSQL. + * Sample code: Create a database as a geo-restore in geo-paired location. * * @param manager Entry point to PostgreSqlManager. */ - public static void getsPrivateLinkResourcesForPostgreSQL( + public static void createADatabaseAsAGeoRestoreInGeoPairedLocation( com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { - manager.privateLinkResources().listByServer("Default", "test-svr", com.azure.core.util.Context.NONE); - } -} -``` - -### Replicas_ListByServer + manager.servers() + .define("pgtestsvc5geo") + .withRegion("eastus") + .withExistingResourceGroup("testrg") + .withIdentity(new UserAssignedIdentity().withUserAssignedIdentities(mapOf( + "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-geo-usermanagedidentity", + new UserIdentity(), + "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-usermanagedidentity", + new UserIdentity())).withType(IdentityType.USER_ASSIGNED)) + .withDataEncryption(new DataEncryption().withPrimaryKeyUri("fakeTokenPlaceholder") + .withPrimaryUserAssignedIdentityId( + "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-usermanagedidentity") + .withGeoBackupKeyUri("fakeTokenPlaceholder") + .withGeoBackupUserAssignedIdentityId( + "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-geo-usermanagedidentity") + .withType(ArmServerKeyType.AZURE_KEY_VAULT)) + .withSourceServerResourceId( + "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/sourcepgservername") + .withPointInTimeUtc(OffsetDateTime.parse("2021-06-27T00:04:59.4078005+00:00")) + .withCreateMode(CreateMode.GEO_RESTORE) + .create(); + } -```java -/** - * Samples for Replicas ListByServer. - */ -public final class ReplicasListByServerSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ - * ReplicasListByServer.json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ + * ServerCreate.json */ /** - * Sample code: ReplicasListByServer. + * Sample code: Create a new server. * * @param manager Entry point to PostgreSqlManager. */ - public static void - replicasListByServer(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { - manager.replicas().listByServer("testrg", "sourcepgservername", com.azure.core.util.Context.NONE); + public static void createANewServer(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager.servers() + .define("testpgflex") + .withRegion("eastus") + .withExistingResourceGroup("testrg") + .withTags(mapOf("VNetServer", "1")) + .withSku(new Sku().withName("Standard_D4ds_v5").withTier(SkuTier.GENERAL_PURPOSE)) + .withAdministratorLogin("login") + .withAdministratorLoginPassword("Password1") + .withVersion(ServerVersion.ONE_SIX) + .withStorage(new Storage().withStorageSizeGB(512) + .withAutoGrow(StorageAutoGrow.DISABLED) + .withTier(AzureManagedDiskPerformanceTiers.P20)) + .withBackup(new Backup().withBackupRetentionDays(7).withGeoRedundantBackup(GeoRedundantBackupEnum.ENABLED)) + .withNetwork(new Network().withDelegatedSubnetResourceId( + "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/test-subnet") + .withPrivateDnsZoneArmResourceId( + "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/privateDnsZones/testpgflex.private.postgres.database")) + .withHighAvailability(new HighAvailability().withMode(HighAvailabilityMode.ZONE_REDUNDANT)) + .withAvailabilityZone("1") + .withCreateMode(CreateMode.CREATE) + .create(); } -} -``` -### ResourceProvider_CheckMigrationNameAvailability - -```java -import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.MigrationNameAvailabilityResourceInner; - -/** - * Samples for ResourceProvider CheckMigrationNameAvailability. - */ -public final class ResourceProviderCheckMigrationNameAvailabilitySamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ - * CheckMigrationNameAvailability.json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ + * ServerCreateWithMicrosoftEntraEnabled.json */ /** - * Sample code: CheckMigrationNameAvailability. + * Sample code: Create a new server with Microsoft Entra authentication enabled. * * @param manager Entry point to PostgreSqlManager. */ - public static void - checkMigrationNameAvailability(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { - manager.resourceProviders() - .checkMigrationNameAvailabilityWithResponse("ffffffff-ffff-ffff-ffff-ffffffffffff", "testrg", "testtarget", - new MigrationNameAvailabilityResourceInner().withName("name1") - .withType("Microsoft.DBforPostgreSQL/flexibleServers/migrations"), - com.azure.core.util.Context.NONE); + public static void createANewServerWithMicrosoftEntraAuthenticationEnabled( + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager.servers() + .define("pgtestsvc4") + .withRegion("westus") + .withExistingResourceGroup("testrg") + .withTags(mapOf("ElasticServer", "1")) + .withSku(new Sku().withName("Standard_D4ds_v5").withTier(SkuTier.GENERAL_PURPOSE)) + .withAdministratorLogin("login") + .withAdministratorLoginPassword("Password1") + .withVersion(ServerVersion.ONE_SIX) + .withStorage(new Storage().withStorageSizeGB(512) + .withAutoGrow(StorageAutoGrow.DISABLED) + .withTier(AzureManagedDiskPerformanceTiers.P20)) + .withAuthConfig(new AuthConfig().withActiveDirectoryAuth(ActiveDirectoryAuthEnum.ENABLED) + .withPasswordAuth(PasswordAuthEnum.ENABLED) + .withTenantId("tttttt-tttt-tttt-tttt-tttttttttttt")) + .withDataEncryption(new DataEncryption().withType(ArmServerKeyType.SYSTEM_MANAGED)) + .withBackup(new Backup().withBackupRetentionDays(7).withGeoRedundantBackup(GeoRedundantBackupEnum.DISABLED)) + .withNetwork(new Network().withDelegatedSubnetResourceId( + "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/test-vnet-subnet") + .withPrivateDnsZoneArmResourceId( + "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourcegroups/testrg/providers/Microsoft.Network/privateDnsZones/test-private-dns-zone.postgres.database.azure.com")) + .withHighAvailability(new HighAvailability().withMode(HighAvailabilityMode.ZONE_REDUNDANT)) + .withAvailabilityZone("1") + .withCreateMode(CreateMode.CREATE) + .create(); } -} -``` - -### ServerCapabilities_List -```java -/** - * Samples for ServerCapabilities List. - */ -public final class ServerCapabilitiesListSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ServerCapabilities - * .json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ + * ServerCreateReplica.json */ /** - * Sample code: ServerCapabilitiesList. + * Sample code: ServerCreateReplica. * * @param manager Entry point to PostgreSqlManager. */ public static void - serverCapabilitiesList(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { - manager.serverCapabilities().list("testrg", "pgtestsvc4", com.azure.core.util.Context.NONE); + serverCreateReplica(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager.servers() + .define("pgtestsvc5rep") + .withRegion("westus") + .withExistingResourceGroup("testrg") + .withIdentity(new UserAssignedIdentity().withUserAssignedIdentities(mapOf( + "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-usermanagedidentity", + new UserIdentity())).withType(IdentityType.USER_ASSIGNED)) + .withDataEncryption(new DataEncryption().withPrimaryKeyUri("fakeTokenPlaceholder") + .withPrimaryUserAssignedIdentityId( + "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-usermanagedidentity") + .withGeoBackupKeyUri("fakeTokenPlaceholder") + .withGeoBackupUserAssignedIdentityId("") + .withType(ArmServerKeyType.AZURE_KEY_VAULT)) + .withSourceServerResourceId( + "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/sourcepgservername") + .withPointInTimeUtc(OffsetDateTime.parse("2021-06-27T00:04:59.4078005+00:00")) + .withCreateMode(CreateMode.REPLICA) + .create(); } -} -``` -### ServerThreatProtectionSettings_CreateOrUpdate - -```java -import com.azure.resourcemanager.postgresqlflexibleserver.models.ServerThreatProtectionSettingsModel; -import com.azure.resourcemanager.postgresqlflexibleserver.models.ThreatProtectionName; -import com.azure.resourcemanager.postgresqlflexibleserver.models.ThreatProtectionState; + /* + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ + * ClusterCreate.json + */ + /** + * Sample code: ClusterCreate. + * + * @param manager Entry point to PostgreSqlManager. + */ + public static void clusterCreate(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager.servers() + .define("pgtestcluster") + .withRegion("westus") + .withExistingResourceGroup("testrg") + .withSku(new Sku().withName("Standard_D4ds_v5").withTier(SkuTier.GENERAL_PURPOSE)) + .withAdministratorLogin("login") + .withAdministratorLoginPassword("Password1") + .withVersion(ServerVersion.ONE_SIX) + .withStorage(new Storage().withStorageSizeGB(256) + .withAutoGrow(StorageAutoGrow.DISABLED) + .withTier(AzureManagedDiskPerformanceTiers.P15)) + .withBackup(new Backup().withBackupRetentionDays(7).withGeoRedundantBackup(GeoRedundantBackupEnum.DISABLED)) + .withNetwork(new Network().withPublicNetworkAccess(ServerPublicNetworkAccessState.DISABLED)) + .withHighAvailability(new HighAvailability().withMode(HighAvailabilityMode.DISABLED)) + .withCreateMode(CreateMode.CREATE) + .withCluster(new Cluster().withClusterSize(2)) + .create(); + } -/** - * Samples for ServerThreatProtectionSettings CreateOrUpdate. - */ -public final class ServerThreatProtectionSettingsCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ - * ServerThreatProtectionSettingsCreateOrUpdate.json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ + * ServerCreatePointInTimeRestore.json */ /** - * Sample code: Update a server's Threat Protection settings. + * Sample code: Create a database as a point in time restore. * * @param manager Entry point to PostgreSqlManager. */ - public static void updateAServerSThreatProtectionSettings( + public static void createADatabaseAsAPointInTimeRestore( com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { - ServerThreatProtectionSettingsModel resource = manager.serverThreatProtectionSettings() - .getWithResponse("threatprotection-4799", "threatprotection-6440", ThreatProtectionName.DEFAULT, - com.azure.core.util.Context.NONE) - .getValue(); - resource.update().withState(ThreatProtectionState.ENABLED).apply(); + manager.servers() + .define("pgtestsvc5") + .withRegion("westus") + .withExistingResourceGroup("testrg") + .withSourceServerResourceId( + "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/sourcepgservername") + .withPointInTimeUtc(OffsetDateTime.parse("2021-06-27T00:04:59.4078005+00:00")) + .withCreateMode(CreateMode.POINT_IN_TIME_RESTORE) + .create(); + } + + // 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; } } ``` @@ -1550,27 +1748,23 @@ public final class ServerThreatProtectionSettingsCreateOrUpdateSamples { ### ServerThreatProtectionSettings_Get ```java -import com.azure.resourcemanager.postgresqlflexibleserver.models.ThreatProtectionName; - /** - * Samples for ServerThreatProtectionSettings Get. + * Samples for PrivateLinkResources Get. */ -public final class ServerThreatProtectionSettingsGetSamples { +public final class PrivateLinkResourcesGetSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ - * ServerThreatProtectionSettingsGet.json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ + * PrivateLinkResourcesGet.json */ /** - * Sample code: Get a server's Threat Protection settings. + * Sample code: Gets a private link resource for PostgreSQL. * * @param manager Entry point to PostgreSqlManager. */ - public static void getAServerSThreatProtectionSettings( + public static void getsAPrivateLinkResourceForPostgreSQL( com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { - manager.serverThreatProtectionSettings() - .getWithResponse("threatprotection-6852", "threatprotection-2080", ThreatProtectionName.DEFAULT, - com.azure.core.util.Context.NONE); + manager.privateLinkResources().getWithResponse("Default", "test-svr", "plr", com.azure.core.util.Context.NONE); } } ``` @@ -1579,23 +1773,21 @@ public final class ServerThreatProtectionSettingsGetSamples { ```java /** - * Samples for ServerThreatProtectionSettings ListByServer. + * Samples for Servers List. */ -public final class ServerThreatProtectionSettingsListByServerSamples { +public final class ServersListSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ - * ServerThreatProtectionSettingsListByServer.json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ + * ServerList.json */ /** - * Sample code: Get a server's Advanced Threat Protection settings. + * Sample code: ServerList. * * @param manager Entry point to PostgreSqlManager. */ - public static void getAServerSAdvancedThreatProtectionSettings( - com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { - manager.serverThreatProtectionSettings() - .listByServer("threatprotection-6852", "threatprotection-2080", com.azure.core.util.Context.NONE); + public static void serverList(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager.servers().list(com.azure.core.util.Context.NONE); } } ``` @@ -1603,482 +1795,570 @@ public final class ServerThreatProtectionSettingsListByServerSamples { ### Servers_Create ```java -import com.azure.resourcemanager.postgresqlflexibleserver.models.ActiveDirectoryAuthEnum; -import com.azure.resourcemanager.postgresqlflexibleserver.models.ArmServerKeyType; -import com.azure.resourcemanager.postgresqlflexibleserver.models.AuthConfig; -import com.azure.resourcemanager.postgresqlflexibleserver.models.AzureManagedDiskPerformanceTiers; -import com.azure.resourcemanager.postgresqlflexibleserver.models.Backup; -import com.azure.resourcemanager.postgresqlflexibleserver.models.CreateMode; -import com.azure.resourcemanager.postgresqlflexibleserver.models.DataEncryption; -import com.azure.resourcemanager.postgresqlflexibleserver.models.GeoRedundantBackupEnum; -import com.azure.resourcemanager.postgresqlflexibleserver.models.HighAvailability; -import com.azure.resourcemanager.postgresqlflexibleserver.models.HighAvailabilityMode; -import com.azure.resourcemanager.postgresqlflexibleserver.models.IdentityType; -import com.azure.resourcemanager.postgresqlflexibleserver.models.Network; -import com.azure.resourcemanager.postgresqlflexibleserver.models.PasswordAuthEnum; -import com.azure.resourcemanager.postgresqlflexibleserver.models.ServerVersion; -import com.azure.resourcemanager.postgresqlflexibleserver.models.Sku; -import com.azure.resourcemanager.postgresqlflexibleserver.models.SkuTier; -import com.azure.resourcemanager.postgresqlflexibleserver.models.Storage; -import com.azure.resourcemanager.postgresqlflexibleserver.models.StorageAutoGrow; -import com.azure.resourcemanager.postgresqlflexibleserver.models.UserAssignedIdentity; -import com.azure.resourcemanager.postgresqlflexibleserver.models.UserIdentity; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; - /** - * Samples for Servers Create. + * Samples for Servers GetByResourceGroup. */ -public final class ServersCreateSamples { +public final class ServersGetByResourceGroupSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ - * ServerCreateWithDataEncryptionEnabled.json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ + * ServerGetWithPrivateEndpoints.json */ /** - * Sample code: ServerCreateWithDataEncryptionEnabled. + * Sample code: ServerGetWithPrivateEndpoints. * * @param manager Entry point to PostgreSqlManager. */ - public static void serverCreateWithDataEncryptionEnabled( - com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { - manager.servers() - .define("pgtestsvc4") - .withRegion("westus") - .withExistingResourceGroup("testrg") - .withTags(mapOf("ElasticServer", "1")) - .withSku(new Sku().withName("Standard_D4s_v3").withTier(SkuTier.GENERAL_PURPOSE)) - .withIdentity(new UserAssignedIdentity().withUserAssignedIdentities(mapOf( - "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-usermanagedidentity", - new UserIdentity())).withType(IdentityType.USER_ASSIGNED)) - .withAdministratorLogin("cloudsa") - .withAdministratorLoginPassword("password") - .withVersion(ServerVersion.ONE_TWO) - .withStorage(new Storage().withStorageSizeGB(512).withAutoGrow(StorageAutoGrow.DISABLED)) - .withDataEncryption(new DataEncryption().withPrimaryKeyUri("fakeTokenPlaceholder") - .withPrimaryUserAssignedIdentityId( - "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-usermanagedidentity") - .withGeoBackupKeyUri("fakeTokenPlaceholder") - .withGeoBackupUserAssignedIdentityId("") - .withType(ArmServerKeyType.AZURE_KEY_VAULT)) - .withBackup(new Backup().withBackupRetentionDays(7).withGeoRedundantBackup(GeoRedundantBackupEnum.DISABLED)) - .withNetwork(new Network().withDelegatedSubnetResourceId( - "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/test-vnet-subnet") - .withPrivateDnsZoneArmResourceId( - "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourcegroups/testrg/providers/Microsoft.Network/privateDnsZones/test-private-dns-zone.postgres.database.azure.com")) - .withHighAvailability(new HighAvailability().withMode(HighAvailabilityMode.ZONE_REDUNDANT)) - .withAvailabilityZone("1") - .withCreateMode(CreateMode.CREATE) - .create(); + public static void + serverGetWithPrivateEndpoints(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager.servers().getByResourceGroupWithResponse("testrg", "pgtestsvc2", com.azure.core.util.Context.NONE); } /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ - * ServerCreateReviveDropped.json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ServerGet + * .json */ /** - * Sample code: ServerCreateReviveDropped. + * Sample code: ServerGet. * * @param manager Entry point to PostgreSqlManager. */ - public static void - serverCreateReviveDropped(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { - manager.servers() - .define("pgtestsvc5-rev") - .withRegion("westus") - .withExistingResourceGroup("testrg") - .withSourceServerResourceId( - "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/pgtestsvc5") - .withPointInTimeUtc(OffsetDateTime.parse("2023-04-27T00:04:59.4078005+00:00")) - .withCreateMode(CreateMode.REVIVE_DROPPED) - .create(); + public static void serverGet(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager.servers().getByResourceGroupWithResponse("testrg", "testpgflex", com.azure.core.util.Context.NONE); } /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ - * ServerCreateGeoRestoreWithDataEncryptionEnabled.json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ + * ServerGetWithVnet.json */ /** - * Sample code: Create a database as a geo-restore in geo-paired location. + * Sample code: ServerGetWithVnet. * * @param manager Entry point to PostgreSqlManager. */ - public static void createADatabaseAsAGeoRestoreInGeoPairedLocation( - com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { - manager.servers() - .define("pgtestsvc5geo") - .withRegion("eastus") - .withExistingResourceGroup("testrg") - .withIdentity(new UserAssignedIdentity().withUserAssignedIdentities(mapOf( - "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-geo-usermanagedidentity", - new UserIdentity(), - "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-usermanagedidentity", - new UserIdentity())).withType(IdentityType.USER_ASSIGNED)) - .withDataEncryption(new DataEncryption().withPrimaryKeyUri("fakeTokenPlaceholder") - .withPrimaryUserAssignedIdentityId( - "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-usermanagedidentity") - .withGeoBackupKeyUri("fakeTokenPlaceholder") - .withGeoBackupUserAssignedIdentityId( - "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-geo-usermanagedidentity") - .withType(ArmServerKeyType.AZURE_KEY_VAULT)) - .withSourceServerResourceId( - "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/sourcepgservername") - .withPointInTimeUtc(OffsetDateTime.parse("2021-06-27T00:04:59.4078005+00:00")) - .withCreateMode(CreateMode.GEO_RESTORE) - .create(); + public static void serverGetWithVnet(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager.servers().getByResourceGroupWithResponse("testrg", "testpgflex", com.azure.core.util.Context.NONE); } +} +``` +### Servers_Delete + +```java +import com.azure.resourcemanager.postgresqlflexibleserver.models.TuningOptionEnum; + +/** + * Samples for TuningOptions Get. + */ +public final class TuningOptionsGetSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ServerCreate.json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ + * Tuning_GetTuningOption.json */ /** - * Sample code: Create a new server. + * Sample code: TuningOptions_Get. * * @param manager Entry point to PostgreSqlManager. */ - public static void createANewServer(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { - manager.servers() - .define("pgtestsvc4") - .withRegion("westus") - .withExistingResourceGroup("testrg") - .withTags(mapOf("ElasticServer", "1")) - .withSku(new Sku().withName("Standard_D4s_v3").withTier(SkuTier.GENERAL_PURPOSE)) - .withAdministratorLogin("cloudsa") - .withAdministratorLoginPassword("password") - .withVersion(ServerVersion.ONE_TWO) - .withStorage(new Storage().withStorageSizeGB(512) - .withAutoGrow(StorageAutoGrow.DISABLED) - .withTier(AzureManagedDiskPerformanceTiers.P20)) - .withBackup(new Backup().withBackupRetentionDays(7).withGeoRedundantBackup(GeoRedundantBackupEnum.DISABLED)) - .withNetwork(new Network().withDelegatedSubnetResourceId( - "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/test-vnet-subnet") - .withPrivateDnsZoneArmResourceId( - "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourcegroups/testrg/providers/Microsoft.Network/privateDnsZones/test-private-dns-zone.postgres.database.azure.com")) - .withHighAvailability(new HighAvailability().withMode(HighAvailabilityMode.ZONE_REDUNDANT)) - .withAvailabilityZone("1") - .withCreateMode(CreateMode.CREATE) - .create(); + public static void tuningOptionsGet(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager.tuningOptions() + .getWithResponse("testrg", "testserver", TuningOptionEnum.INDEX, com.azure.core.util.Context.NONE); } +} +``` + +### Servers_GetByResourceGroup + +```java +import com.azure.resourcemanager.postgresqlflexibleserver.models.CheckNameAvailabilityRequest; +/** + * Samples for CheckNameAvailability Execute. + */ +public final class CheckNameAvailabilityExecuteSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ - * ServerCreateWithAadAuthEnabled.json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ + * CheckNameAvailability.json */ /** - * Sample code: Create a new server with active directory authentication enabled. + * Sample code: NameAvailability. * * @param manager Entry point to PostgreSqlManager. */ - public static void createANewServerWithActiveDirectoryAuthenticationEnabled( - com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { - manager.servers() - .define("pgtestsvc4") - .withRegion("westus") - .withExistingResourceGroup("testrg") - .withTags(mapOf("ElasticServer", "1")) - .withSku(new Sku().withName("Standard_D4s_v3").withTier(SkuTier.GENERAL_PURPOSE)) - .withAdministratorLogin("cloudsa") - .withAdministratorLoginPassword("password") - .withVersion(ServerVersion.ONE_TWO) - .withStorage(new Storage().withStorageSizeGB(512) - .withAutoGrow(StorageAutoGrow.DISABLED) - .withTier(AzureManagedDiskPerformanceTiers.P20)) - .withAuthConfig(new AuthConfig().withActiveDirectoryAuth(ActiveDirectoryAuthEnum.ENABLED) - .withPasswordAuth(PasswordAuthEnum.ENABLED) - .withTenantId("tttttt-tttt-tttt-tttt-tttttttttttt")) - .withDataEncryption(new DataEncryption().withType(ArmServerKeyType.SYSTEM_MANAGED)) - .withBackup(new Backup().withBackupRetentionDays(7).withGeoRedundantBackup(GeoRedundantBackupEnum.DISABLED)) - .withNetwork(new Network().withDelegatedSubnetResourceId( - "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/test-vnet-subnet") - .withPrivateDnsZoneArmResourceId( - "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourcegroups/testrg/providers/Microsoft.Network/privateDnsZones/test-private-dns-zone.postgres.database.azure.com")) - .withHighAvailability(new HighAvailability().withMode(HighAvailabilityMode.ZONE_REDUNDANT)) - .withAvailabilityZone("1") - .withCreateMode(CreateMode.CREATE) - .create(); + public static void nameAvailability(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager.checkNameAvailabilities() + .executeWithResponse(new CheckNameAvailabilityRequest().withName("name1") + .withType("Microsoft.DBforPostgreSQL/flexibleServers"), com.azure.core.util.Context.NONE); } +} +``` + +### Servers_List +```java +/** + * Samples for Servers Stop. + */ +public final class ServersStopSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ - * ServerCreateReplica.json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ + * ServerStop.json */ /** - * Sample code: ServerCreateReplica. + * Sample code: ServerStop. + * + * @param manager Entry point to PostgreSqlManager. + */ + public static void serverStop(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager.servers().stop("testrg", "testserver", com.azure.core.util.Context.NONE); + } +} +``` + +### Servers_ListByResourceGroup + +```java +/** + * Samples for Databases ListByServer. + */ +public final class DatabasesListByServerSamples { + /* + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ + * DatabasesListByServer.json + */ + /** + * Sample code: List databases in a server. * * @param manager Entry point to PostgreSqlManager. */ public static void - serverCreateReplica(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { - manager.servers() - .define("pgtestsvc5rep") - .withRegion("westus") - .withExistingResourceGroup("testrg") - .withIdentity(new UserAssignedIdentity().withUserAssignedIdentities(mapOf( - "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-usermanagedidentity", - new UserIdentity())).withType(IdentityType.USER_ASSIGNED)) - .withDataEncryption(new DataEncryption().withPrimaryKeyUri("fakeTokenPlaceholder") - .withPrimaryUserAssignedIdentityId( - "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-usermanagedidentity") - .withGeoBackupKeyUri("fakeTokenPlaceholder") - .withGeoBackupUserAssignedIdentityId("") - .withType(ArmServerKeyType.AZURE_KEY_VAULT)) - .withSourceServerResourceId( - "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/sourcepgservername") - .withPointInTimeUtc(OffsetDateTime.parse("2021-06-27T00:04:59.4078005+00:00")) - .withCreateMode(CreateMode.REPLICA) - .create(); + listDatabasesInAServer(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager.databases().listByServer("TestGroup", "testserver", com.azure.core.util.Context.NONE); } +} +``` +### Servers_Restart + +```java +/** + * Samples for Administrators Get. + */ +public final class AdministratorsGetSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ - * ServerCreatePointInTimeRestore.json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ + * AdministratorGet.json */ /** - * Sample code: Create a database as a point in time restore. + * Sample code: ServerGet. * * @param manager Entry point to PostgreSqlManager. */ - public static void createADatabaseAsAPointInTimeRestore( + public static void serverGet(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager.administrators() + .getWithResponse("testrg", "pgtestsvc1", "oooooooo-oooo-oooo-oooo-oooooooooooo", + com.azure.core.util.Context.NONE); + } +} +``` + +### Servers_Start + +```java +/** + * Samples for Configurations Get. + */ +public final class ConfigurationsGetSamples { + /* + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ + * ConfigurationGet.json + */ + /** + * Sample code: ConfigurationGet. + * + * @param manager Entry point to PostgreSqlManager. + */ + public static void configurationGet(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager.configurations() + .getWithResponse("testrg", "testserver", "array_nulls", com.azure.core.util.Context.NONE); + } +} +``` + +### Servers_Stop + +```java +/** + * Samples for ServerThreatProtectionSettings ListByServer. + */ +public final class ServerThreatProtectionSettingsListByServerSamples { + /* + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ + * ServerThreatProtectionSettingsListByServer.json + */ + /** + * Sample code: Get a server's Advanced Threat Protection settings. + * + * @param manager Entry point to PostgreSqlManager. + */ + public static void getAServerSAdvancedThreatProtectionSettings( com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { - manager.servers() - .define("pgtestsvc5") - .withRegion("westus") - .withExistingResourceGroup("testrg") - .withSourceServerResourceId( - "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/sourcepgservername") - .withPointInTimeUtc(OffsetDateTime.parse("2021-06-27T00:04:59.4078005+00:00")) - .withCreateMode(CreateMode.POINT_IN_TIME_RESTORE) - .create(); + manager.serverThreatProtectionSettings() + .listByServer("threatprotection-6852", "threatprotection-2080", com.azure.core.util.Context.NONE); } +} +``` - // 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; +### Servers_Update + +```java +/** + * Samples for ServerCapabilities List. + */ +public final class ServerCapabilitiesListSamples { + /* + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ + * ServerCapabilities.json + */ + /** + * Sample code: ServerCapabilitiesList. + * + * @param manager Entry point to PostgreSqlManager. + */ + public static void + serverCapabilitiesList(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager.serverCapabilities().list("testrg", "pgtestsvc4", com.azure.core.util.Context.NONE); } } ``` -### Servers_Delete +### TuningConfiguration_Disable ```java /** - * Samples for Servers Delete. + * Samples for Backups Delete. */ -public final class ServersDeleteSamples { +public final class BackupsDeleteSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ServerDelete.json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ + * BackupDelete.json */ /** - * Sample code: ServerDelete. + * Sample code: Delete a specific backup. * * @param manager Entry point to PostgreSqlManager. */ - public static void serverDelete(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { - manager.servers().delete("testrg", "testserver", com.azure.core.util.Context.NONE); + public static void + deleteASpecificBackup(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager.backups().delete("TestGroup", "testserver", "backup_20250303T160516", com.azure.core.util.Context.NONE); + } +} +``` + +### TuningConfiguration_Enable + +```java +/** + * Samples for FirewallRules CreateOrUpdate. + */ +public final class FirewallRulesCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ + * FirewallRuleCreate.json + */ + /** + * Sample code: FirewallRuleCreate. + * + * @param manager Entry point to PostgreSqlManager. + */ + public static void + firewallRuleCreate(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager.firewallRules() + .define("rule1") + .withExistingFlexibleServer("testrg", "testserver") + .withStartIpAddress("0.0.0.0") + .withEndIpAddress("255.255.255.255") + .create(); } } ``` -### Servers_GetByResourceGroup +### TuningConfiguration_ListSessionDetails ```java +import com.azure.resourcemanager.postgresqlflexibleserver.models.AdminCredentials; +import com.azure.resourcemanager.postgresqlflexibleserver.models.MigrateRolesEnum; +import com.azure.resourcemanager.postgresqlflexibleserver.models.MigrationMode; +import com.azure.resourcemanager.postgresqlflexibleserver.models.MigrationOption; +import com.azure.resourcemanager.postgresqlflexibleserver.models.MigrationSecretParameters; +import com.azure.resourcemanager.postgresqlflexibleserver.models.OverwriteDbsInTargetEnum; +import com.azure.resourcemanager.postgresqlflexibleserver.models.SourceType; +import com.azure.resourcemanager.postgresqlflexibleserver.models.SslMode; +import java.util.Arrays; + /** - * Samples for Servers GetByResourceGroup. + * Samples for Migrations Create. */ -public final class ServersGetByResourceGroupSamples { +public final class MigrationsCreateSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ - * ServerGetWithPrivateEndpoints.json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ + * Migrations_Create_With_PrivateEndpoint_Servers.json */ /** - * Sample code: ServerGetWithPrivateEndpoints. + * Sample code: Migrations Create with private endpoint. * * @param manager Entry point to PostgreSqlManager. */ - public static void - serverGetWithPrivateEndpoints(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { - manager.servers().getByResourceGroupWithResponse("testrg", "pgtestsvc2", com.azure.core.util.Context.NONE); + public static void migrationsCreateWithPrivateEndpoint( + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager.migrations() + .define("testmigration") + .withRegion("westus") + .withExistingFlexibleServer("ffffffff-ffff-ffff-ffff-ffffffffffff", "testrg", "testtarget") + .withMigrationInstanceResourceId( + "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/flexibleServers/testsourcemigration") + .withMigrationMode(MigrationMode.OFFLINE) + .withSourceDbServerResourceId( + "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/servers/testsource") + .withSecretParameters(new MigrationSecretParameters() + .withAdminCredentials(new AdminCredentials().withSourceServerPassword("fakeTokenPlaceholder") + .withTargetServerPassword("fakeTokenPlaceholder"))) + .withDbsToMigrate(Arrays.asList("db1", "db2", "db3", "db4")) + .withOverwriteDbsInTarget(OverwriteDbsInTargetEnum.TRUE) + .create(); } /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ServerGet.json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ + * Migrations_Create_With_Roles.json */ /** - * Sample code: ServerGet. + * Sample code: Migrations Create with roles. * * @param manager Entry point to PostgreSqlManager. */ - public static void serverGet(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { - manager.servers().getByResourceGroupWithResponse("testrg", "pgtestsvc1", com.azure.core.util.Context.NONE); + public static void + migrationsCreateWithRoles(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager.migrations() + .define("testmigration") + .withRegion("westus") + .withExistingFlexibleServer("ffffffff-ffff-ffff-ffff-ffffffffffff", "testrg", "testtarget") + .withMigrationMode(MigrationMode.OFFLINE) + .withSourceDbServerResourceId( + "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/servers/testsource") + .withSecretParameters(new MigrationSecretParameters() + .withAdminCredentials(new AdminCredentials().withSourceServerPassword("fakeTokenPlaceholder") + .withTargetServerPassword("fakeTokenPlaceholder"))) + .withDbsToMigrate(Arrays.asList("db1", "db2", "db3", "db4")) + .withOverwriteDbsInTarget(OverwriteDbsInTargetEnum.TRUE) + .withMigrateRoles(MigrateRolesEnum.TRUE) + .create(); } /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ServerGetWithVnet. - * json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ + * Migrations_Create_With_FullyQualifiedDomainName.json */ /** - * Sample code: ServerGetWithVnet. + * Sample code: Migrations Create with fully qualified domain name. * * @param manager Entry point to PostgreSqlManager. */ - public static void serverGetWithVnet(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { - manager.servers().getByResourceGroupWithResponse("testrg", "pgtestsvc4", com.azure.core.util.Context.NONE); + public static void migrationsCreateWithFullyQualifiedDomainName( + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager.migrations() + .define("testmigration") + .withRegion("westus") + .withExistingFlexibleServer("ffffffff-ffff-ffff-ffff-ffffffffffff", "testrg", "testtarget") + .withMigrationMode(MigrationMode.OFFLINE) + .withSourceDbServerResourceId( + "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/servers/testsource") + .withSourceDbServerFullyQualifiedDomainName("testsourcefqdn.example.com") + .withTargetDbServerFullyQualifiedDomainName("test-target-fqdn.example.com") + .withSecretParameters(new MigrationSecretParameters() + .withAdminCredentials(new AdminCredentials().withSourceServerPassword("fakeTokenPlaceholder") + .withTargetServerPassword("fakeTokenPlaceholder"))) + .withDbsToMigrate(Arrays.asList("db1", "db2", "db3", "db4")) + .withOverwriteDbsInTarget(OverwriteDbsInTargetEnum.TRUE) + .create(); } -} -``` - -### Servers_List -```java -/** - * Samples for Servers List. - */ -public final class ServersListSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ServerList.json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ + * Migrations_Create_Validate_Only.json */ /** - * Sample code: ServerList. + * Sample code: Create Pre-migration Validation. * * @param manager Entry point to PostgreSqlManager. */ - public static void serverList(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { - manager.servers().list(com.azure.core.util.Context.NONE); + public static void + createPreMigrationValidation(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager.migrations() + .define("testmigration") + .withRegion("westus") + .withExistingFlexibleServer("ffffffff-ffff-ffff-ffff-ffffffffffff", "testrg", "testtarget") + .withMigrationMode(MigrationMode.OFFLINE) + .withMigrationOption(MigrationOption.VALIDATE) + .withSourceDbServerResourceId( + "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/servers/testsource") + .withSecretParameters(new MigrationSecretParameters() + .withAdminCredentials(new AdminCredentials().withSourceServerPassword("fakeTokenPlaceholder") + .withTargetServerPassword("fakeTokenPlaceholder"))) + .withDbsToMigrate(Arrays.asList("db1", "db2", "db3", "db4")) + .withOverwriteDbsInTarget(OverwriteDbsInTargetEnum.TRUE) + .create(); } -} -``` - -### Servers_ListByResourceGroup -```java -/** - * Samples for Servers ListByResourceGroup. - */ -public final class ServersListByResourceGroupSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ - * ServerListByResourceGroup.json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ + * Migrations_Create_With_Other_Users.json */ /** - * Sample code: ServerListByResourceGroup. + * Sample code: Migrations Create by passing user names. * * @param manager Entry point to PostgreSqlManager. */ - public static void - serverListByResourceGroup(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { - manager.servers().listByResourceGroup("testrg", com.azure.core.util.Context.NONE); + public static void migrationsCreateByPassingUserNames( + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager.migrations() + .define("testmigration") + .withRegion("westus") + .withExistingFlexibleServer("ffffffff-ffff-ffff-ffff-ffffffffffff", "testrg", "testtarget") + .withMigrationMode(MigrationMode.OFFLINE) + .withSourceDbServerResourceId( + "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/servers/testsource") + .withSecretParameters(new MigrationSecretParameters() + .withAdminCredentials(new AdminCredentials().withSourceServerPassword("fakeTokenPlaceholder") + .withTargetServerPassword("fakeTokenPlaceholder")) + .withSourceServerUsername("newadmin@testsource") + .withTargetServerUsername("targetadmin")) + .withDbsToMigrate(Arrays.asList("db1", "db2", "db3", "db4")) + .create(); } -} -``` - -### Servers_Restart - -```java -import com.azure.resourcemanager.postgresqlflexibleserver.models.FailoverMode; -import com.azure.resourcemanager.postgresqlflexibleserver.models.RestartParameter; -/** - * Samples for Servers Restart. - */ -public final class ServersRestartSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ServerRestart.json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ + * Migrations_Create.json */ /** - * Sample code: ServerRestart. + * Sample code: Migrations_Create. * * @param manager Entry point to PostgreSqlManager. */ - public static void serverRestart(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { - manager.servers().restart("testrg", "testserver", null, com.azure.core.util.Context.NONE); + public static void migrationsCreate(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager.migrations() + .define("testmigration") + .withRegion("westus") + .withExistingFlexibleServer("ffffffff-ffff-ffff-ffff-ffffffffffff", "testrg", "testtarget") + .withMigrationMode(MigrationMode.OFFLINE) + .withSourceDbServerResourceId( + "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/servers/testsource") + .withSecretParameters(new MigrationSecretParameters() + .withAdminCredentials(new AdminCredentials().withSourceServerPassword("fakeTokenPlaceholder") + .withTargetServerPassword("fakeTokenPlaceholder"))) + .withDbsToMigrate(Arrays.asList("db1", "db2", "db3", "db4")) + .withOverwriteDbsInTarget(OverwriteDbsInTargetEnum.TRUE) + .create(); } /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ - * ServerRestartWithFailover.json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ + * Migrations_Create_Other_SourceTypes_Validate_Migrate.json */ /** - * Sample code: ServerRestartWithFailover. + * Sample code: Create Migration with other source types for Validate and Migrate. * * @param manager Entry point to PostgreSqlManager. */ - public static void - serverRestartWithFailover(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { - manager.servers() - .restart("testrg", "testserver", - new RestartParameter().withRestartWithFailover(true).withFailoverMode(FailoverMode.FORCED_FAILOVER), - com.azure.core.util.Context.NONE); + public static void createMigrationWithOtherSourceTypesForValidateAndMigrate( + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager.migrations() + .define("testmigration") + .withRegion("westus") + .withExistingFlexibleServer("ffffffff-ffff-ffff-ffff-ffffffffffff", "testrg", "testtarget") + .withMigrationMode(MigrationMode.OFFLINE) + .withMigrationOption(MigrationOption.VALIDATE_AND_MIGRATE) + .withSourceType(SourceType.ON_PREMISES) + .withSslMode(SslMode.PREFER) + .withSourceDbServerResourceId("testsource:5432@pguser") + .withSecretParameters(new MigrationSecretParameters() + .withAdminCredentials(new AdminCredentials().withSourceServerPassword("fakeTokenPlaceholder") + .withTargetServerPassword("fakeTokenPlaceholder"))) + .withDbsToMigrate(Arrays.asList("db1", "db2", "db3", "db4")) + .withOverwriteDbsInTarget(OverwriteDbsInTargetEnum.TRUE) + .create(); } } ``` -### Servers_Start +### TuningConfiguration_ListSessions ```java /** - * Samples for Servers Start. + * Samples for FirewallRules Delete. */ -public final class ServersStartSamples { +public final class FirewallRulesDeleteSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ServerStart.json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ + * FirewallRuleDelete.json */ /** - * Sample code: ServerStart. + * Sample code: FirewallRuleDelete. * * @param manager Entry point to PostgreSqlManager. */ - public static void serverStart(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { - manager.servers().start("testrg", "testserver", com.azure.core.util.Context.NONE); + public static void + firewallRuleDelete(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager.firewallRules().delete("testrg", "testserver", "rule1", com.azure.core.util.Context.NONE); } } ``` -### Servers_Stop +### TuningConfiguration_StartSession ```java /** - * Samples for Servers Stop. + * Samples for FirewallRules ListByServer. */ -public final class ServersStopSamples { +public final class FirewallRulesListByServerSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ServerStop.json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ + * FirewallRuleListByServer.json */ /** - * Sample code: ServerStop. + * Sample code: FirewallRuleList. * * @param manager Entry point to PostgreSqlManager. */ - public static void serverStop(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { - manager.servers().stop("testrg", "testserver", com.azure.core.util.Context.NONE); + public static void firewallRuleList(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager.firewallRules().listByServer("testrg", "testserver", com.azure.core.util.Context.NONE); } } ``` -### Servers_Update +### TuningConfiguration_StopSession ```java import com.azure.resourcemanager.postgresqlflexibleserver.models.ActiveDirectoryAuthEnum; @@ -2111,36 +2391,7 @@ import java.util.Map; public final class ServersUpdateSamples { /* * 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. - */ - public static void - serverUpdateWithAadAuthEnabled(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { - Server resource = manager.servers() - .getByResourceGroupWithResponse("TestGroup", "pgtestsvc4", com.azure.core.util.Context.NONE) - .getValue(); - resource.update() - .withSku(new Sku().withName("Standard_D8s_v3").withTier(SkuTier.GENERAL_PURPOSE)) - .withAdministratorLoginPassword("newpassword") - .withStorage(new Storage().withStorageSizeGB(1024) - .withAutoGrow(StorageAutoGrow.DISABLED) - .withTier(AzureManagedDiskPerformanceTiers.P30)) - .withBackup(new Backup().withBackupRetentionDays(20)) - .withAuthConfig(new AuthConfig().withActiveDirectoryAuth(ActiveDirectoryAuthEnum.ENABLED) - .withPasswordAuth(PasswordAuthEnum.ENABLED) - .withTenantId("tttttt-tttt-tttt-tttt-tttttttttttt")) - .withCreateMode(CreateModeForUpdate.UPDATE) - .apply(); - } - - /* - * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ * ServerUpdateWithDataEncryptionEnabled.json */ /** @@ -2175,7 +2426,7 @@ public final class ServersUpdateSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ * PromoteReplicaAsPlannedSwitchover.json */ /** @@ -2198,7 +2449,7 @@ public final class ServersUpdateSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ * PromoteReplicaAsForcedSwitchover.json */ /** @@ -2221,7 +2472,8 @@ public final class ServersUpdateSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ServerUpdate.json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ + * ServerUpdate.json */ /** * Sample code: ServerUpdate. @@ -2245,7 +2497,7 @@ public final class ServersUpdateSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ * ServerUpdateWithMajorVersionUpgrade.json */ /** @@ -2258,12 +2510,12 @@ public final class ServersUpdateSamples { Server resource = manager.servers() .getByResourceGroupWithResponse("testrg", "pgtestsvc4", com.azure.core.util.Context.NONE) .getValue(); - resource.update().withVersion(ServerVersion.ONE_FOUR).withCreateMode(CreateModeForUpdate.UPDATE).apply(); + resource.update().withVersion(ServerVersion.ONE_SIX).withCreateMode(CreateModeForUpdate.UPDATE).apply(); } /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ * ServerUpdateWithCustomerMaintenanceWindow.json */ /** @@ -2287,7 +2539,36 @@ public final class ServersUpdateSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ + * ServerUpdateWithMicrosoftEntraEnabled.json + */ + /** + * Sample code: ServerUpdateWithMicrosoftEntraEnabled. + * + * @param manager Entry point to PostgreSqlManager. + */ + public static void serverUpdateWithMicrosoftEntraEnabled( + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + Server resource = manager.servers() + .getByResourceGroupWithResponse("TestGroup", "pgtestsvc4", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withSku(new Sku().withName("Standard_D8s_v3").withTier(SkuTier.GENERAL_PURPOSE)) + .withAdministratorLoginPassword("newpassword") + .withStorage(new Storage().withStorageSizeGB(1024) + .withAutoGrow(StorageAutoGrow.DISABLED) + .withTier(AzureManagedDiskPerformanceTiers.P30)) + .withBackup(new Backup().withBackupRetentionDays(20)) + .withAuthConfig(new AuthConfig().withActiveDirectoryAuth(ActiveDirectoryAuthEnum.ENABLED) + .withPasswordAuth(PasswordAuthEnum.ENABLED) + .withTenantId("tttttt-tttt-tttt-tttt-tttttttttttt")) + .withCreateMode(CreateModeForUpdate.UPDATE) + .apply(); + } + + /* + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ * PromoteReplicaAsForcedStandaloneServer.json */ /** @@ -2310,7 +2591,7 @@ public final class ServersUpdateSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ * PromoteReplicaAsPlannedStandaloneServer.json */ /** @@ -2344,59 +2625,134 @@ public final class ServersUpdateSamples { } ``` -### VirtualEndpoints_Create +### TuningIndex_ListRecommendations ```java -import com.azure.resourcemanager.postgresqlflexibleserver.models.VirtualEndpointType; -import java.util.Arrays; +/** + * Samples for Migrations Delete. + */ +public final class MigrationsDeleteSamples { + /* + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ + * Migrations_Delete.json + */ + /** + * Sample code: Migrations_Delete. + * + * @param manager Entry point to PostgreSqlManager. + */ + public static void migrationsDelete(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager.migrations() + .deleteWithResponse("ffffffff-ffff-ffff-ffff-ffffffffffff", "testrg", "testtarget", "testmigration", + com.azure.core.util.Context.NONE); + } +} +``` +### TuningOptions_Get + +```java /** - * Samples for VirtualEndpoints Create. + * Samples for Configurations Put. */ -public final class VirtualEndpointsCreateSamples { +public final class ConfigurationsPutSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ - * VirtualEndpointCreate.json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ + * ConfigurationUpdate.json */ /** - * Sample code: Create a new virtual endpoint for a flexible server. + * Sample code: Update a user configuration. * * @param manager Entry point to PostgreSqlManager. */ - public static void createANewVirtualEndpointForAFlexibleServer( - com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { - manager.virtualEndpoints() - .define("pgVirtualEndpoint1") - .withExistingFlexibleServer("testrg", "pgtestsvc4") - .withEndpointType(VirtualEndpointType.READ_WRITE) - .withMembers(Arrays.asList("testPrimary1")) + public static void + updateAUserConfiguration(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager.configurations() + .define("constraint_exclusion") + .withExistingFlexibleServer("testrg", "testserver") + .withValue("on") + .withSource("user-override") .create(); } } ``` +### TuningOptions_ListByServer + +```java +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.MigrationNameAvailabilityResourceInner; + +/** + * Samples for ResourceProvider CheckMigrationNameAvailability. + */ +public final class ResourceProviderCheckMigrationNameAvailabilitySamples { + /* + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ + * CheckMigrationNameAvailability.json + */ + /** + * Sample code: CheckMigrationNameAvailability. + * + * @param manager Entry point to PostgreSqlManager. + */ + public static void + checkMigrationNameAvailability(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager.resourceProviders() + .checkMigrationNameAvailabilityWithResponse("ffffffff-ffff-ffff-ffff-ffffffffffff", "testrg", "testtarget", + new MigrationNameAvailabilityResourceInner().withName("name1") + .withType("Microsoft.DBforPostgreSQL/flexibleServers/migrations"), + com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualEndpoints_Create + +```java +/** + * Samples for GetPrivateDnsZoneSuffix Execute. + */ +public final class GetPrivateDnsZoneSuffixExecuteSamples { + /* + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ + * GetPrivateDnsZoneSuffix.json + */ + /** + * Sample code: GetPrivateDnsZoneSuffix. + * + * @param manager Entry point to PostgreSqlManager. + */ + public static void + getPrivateDnsZoneSuffix(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager.getPrivateDnsZoneSuffixes().executeWithResponse(com.azure.core.util.Context.NONE); + } +} +``` + ### VirtualEndpoints_Delete ```java /** - * Samples for VirtualEndpoints Delete. + * Samples for Replicas ListByServer. */ -public final class VirtualEndpointsDeleteSamples { +public final class ReplicasListByServerSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ - * VirtualEndpointDelete.json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ + * ReplicasListByServer.json */ /** - * Sample code: Delete a virtual endpoint. + * Sample code: ReplicasListByServer. * * @param manager Entry point to PostgreSqlManager. */ public static void - deleteAVirtualEndpoint(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { - manager.virtualEndpoints() - .delete("testrg", "pgtestsvc4", "pgVirtualEndpoint1", com.azure.core.util.Context.NONE); + replicasListByServer(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager.replicas().listByServer("testrg", "sourcepgservername", com.azure.core.util.Context.NONE); } } ``` @@ -2405,23 +2761,22 @@ public final class VirtualEndpointsDeleteSamples { ```java /** - * Samples for VirtualEndpoints Get. + * Samples for PrivateEndpointConnections ListByServer. */ -public final class VirtualEndpointsGetSamples { +public final class PrivateEndpointConnectionsListByServerSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ - * VirtualEndpointsGet.json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ + * PrivateEndpointConnectionList.json */ /** - * Sample code: Get a virtual endpoint. + * Sample code: Gets list of private endpoint connections on a server. * * @param manager Entry point to PostgreSqlManager. */ - public static void - getAVirtualEndpoint(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { - manager.virtualEndpoints() - .getWithResponse("testrg", "pgtestsvc4", "pgVirtualEndpoint1", com.azure.core.util.Context.NONE); + public static void getsListOfPrivateEndpointConnectionsOnAServer( + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager.privateEndpointConnections().listByServer("Default", "test-svr", com.azure.core.util.Context.NONE); } } ``` @@ -2429,23 +2784,27 @@ public final class VirtualEndpointsGetSamples { ### VirtualEndpoints_ListByServer ```java +import com.azure.resourcemanager.postgresqlflexibleserver.models.MigrationListFilter; + /** - * Samples for VirtualEndpoints ListByServer. + * Samples for Migrations ListByTargetServer. */ -public final class VirtualEndpointsListByServerSamples { +public final class MigrationsListByTargetServerSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ - * VirtualEndpointsListByServer.json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ + * Migrations_ListByTargetServer.json */ /** - * Sample code: VirtualEndpointListByServer. + * Sample code: Migrations_ListByTargetServer. * * @param manager Entry point to PostgreSqlManager. */ public static void - virtualEndpointListByServer(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { - manager.virtualEndpoints().listByServer("testrg", "pgtestsvc4", com.azure.core.util.Context.NONE); + migrationsListByTargetServer(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager.migrations() + .listByTargetServer("ffffffff-ffff-ffff-ffff-ffffffffffff", "testrg", "testtarget", MigrationListFilter.ALL, + com.azure.core.util.Context.NONE); } } ``` @@ -2453,33 +2812,92 @@ public final class VirtualEndpointsListByServerSamples { ### VirtualEndpoints_Update ```java -import com.azure.resourcemanager.postgresqlflexibleserver.models.VirtualEndpointResource; -import com.azure.resourcemanager.postgresqlflexibleserver.models.VirtualEndpointType; -import java.util.Arrays; - /** - * Samples for VirtualEndpoints Update. + * Samples for Migrations Get. */ -public final class VirtualEndpointsUpdateSamples { +public final class MigrationsGetSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ - * VirtualEndpointUpdate.json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ + * Migrations_GetMigrationWithSuccessfulValidationOnly.json */ /** - * Sample code: Update a virtual endpoint for a server to update the. + * Sample code: Migrations_GetMigrationWithSuccessfulValidationOnly. * * @param manager Entry point to PostgreSqlManager. */ - public static void updateAVirtualEndpointForAServerToUpdateThe( + public static void migrationsGetMigrationWithSuccessfulValidationOnly( com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { - VirtualEndpointResource resource = manager.virtualEndpoints() - .getWithResponse("testrg", "pgtestsvc4", "pgVirtualEndpoint1", com.azure.core.util.Context.NONE) - .getValue(); - resource.update() - .withEndpointType(VirtualEndpointType.READ_WRITE) - .withMembers(Arrays.asList("testReplica1")) - .apply(); + 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/2025-01-01-preview/examples/ + * Migrations_Get.json + */ + /** + * Sample code: Migrations_Get. + * + * @param manager Entry point to PostgreSqlManager. + */ + public static void migrationsGet(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager.migrations() + .getWithResponse("ffffffff-ffff-ffff-ffff-ffffffffffff", "testrg", "testtarget", "testmigration", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ + * Migrations_GetMigrationWithSuccessfulValidationButMigrationFailure.json + */ + /** + * Sample code: Migrations_GetMigrationWithSuccessfulValidationButMigrationFailure. + * + * @param manager Entry point to PostgreSqlManager. + */ + public static void migrationsGetMigrationWithSuccessfulValidationButMigrationFailure( + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager.migrations() + .getWithResponse("ffffffff-ffff-ffff-ffff-ffffffffffff", "testrg", "testtarget", + "testmigrationwithsuccessfulvalidationbutmigrationfailure", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ + * Migrations_GetMigrationWithSuccessfulValidationAndMigration.json + */ + /** + * Sample code: Migrations_GetMigrationWithSuccessfulValidationAndMigration. + * + * @param manager Entry point to PostgreSqlManager. + */ + public static void migrationsGetMigrationWithSuccessfulValidationAndMigration( + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager.migrations() + .getWithResponse("ffffffff-ffff-ffff-ffff-ffffffffffff", "testrg", "testtarget", + "testmigrationwithsuccessfulvalidationandmigration", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ + * Migrations_GetMigrationWithValidationFailures.json + */ + /** + * Sample code: Migrations_GetMigrationWithValidationFailures. + * + * @param manager Entry point to PostgreSqlManager. + */ + public static void migrationsGetMigrationWithValidationFailures( + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager.migrations() + .getWithResponse("ffffffff-ffff-ffff-ffff-ffffffffffff", "testrg", "testtarget", + "testmigrationwithvalidationfailure", com.azure.core.util.Context.NONE); } } ``` @@ -2487,27 +2905,25 @@ public final class VirtualEndpointsUpdateSamples { ### VirtualNetworkSubnetUsage_Execute ```java -import com.azure.resourcemanager.postgresqlflexibleserver.models.VirtualNetworkSubnetUsageParameter; - /** - * Samples for VirtualNetworkSubnetUsage Execute. + * Samples for PrivateEndpointConnections Get. */ -public final class VirtualNetworkSubnetUsageExecuteSamples { +public final class PrivateEndpointConnectionsGetSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ - * VirtualNetworkSubnetUsage.json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ + * PrivateEndpointConnectionGet.json */ /** - * Sample code: VirtualNetworkSubnetUsageList. + * Sample code: Gets private endpoint connection. * * @param manager Entry point to PostgreSqlManager. */ public static void - virtualNetworkSubnetUsageList(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { - manager.virtualNetworkSubnetUsages() - .executeWithResponse("westus", new VirtualNetworkSubnetUsageParameter().withVirtualNetworkArmResourceId( - "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/testvnet"), + getsPrivateEndpointConnection(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager.privateEndpointConnections() + .getWithResponse("Default", "test-svr", + "private-endpoint-connection-name.1fa229cd-bf3f-47f0-8c49-afb36723997e", com.azure.core.util.Context.NONE); } } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/pom.xml b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/pom.xml index 25aaea5f9682..07c7bb407561 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/pom.xml +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/pom.xml @@ -18,7 +18,7 @@ jar Microsoft Azure SDK for PostgreSql Management - This package contains Microsoft Azure SDK for PostgreSql Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. The Microsoft Azure management API provides create, read, update, and delete functionality for Azure PostgreSQL resources including servers, databases, firewall rules, VNET rules, security alert policies, log files and configurations with new business model. Package tag package-flexibleserver-2024-08-01. + This package contains Microsoft Azure SDK for PostgreSql Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. The Microsoft Azure management API provides create, read, update, and delete functionality for Azure PostgreSQL resources including servers, databases, firewall rules, VNET rules, security alert policies, log files and configurations with new business model. Package tag package-flexibleserver-2025-01-01-preview. https://github.com/Azure/azure-sdk-for-java @@ -46,7 +46,6 @@ 0 0 true - false diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/PostgreSqlManager.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/PostgreSqlManager.java index 1b81948c4979..36a70ec07269 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/PostgreSqlManager.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/PostgreSqlManager.java @@ -22,6 +22,7 @@ import com.azure.core.http.policy.UserAgentPolicy; import com.azure.core.management.profile.AzureProfile; import com.azure.core.util.Configuration; +import com.azure.core.util.CoreUtils; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.postgresqlflexibleserver.fluent.PostgreSqlManagementClient; import com.azure.resourcemanager.postgresqlflexibleserver.implementation.AdministratorsImpl; @@ -42,11 +43,15 @@ import com.azure.resourcemanager.postgresqlflexibleserver.implementation.PrivateEndpointConnectionOperationsImpl; import com.azure.resourcemanager.postgresqlflexibleserver.implementation.PrivateEndpointConnectionsImpl; import com.azure.resourcemanager.postgresqlflexibleserver.implementation.PrivateLinkResourcesImpl; +import com.azure.resourcemanager.postgresqlflexibleserver.implementation.QuotaUsagesImpl; import com.azure.resourcemanager.postgresqlflexibleserver.implementation.ReplicasImpl; import com.azure.resourcemanager.postgresqlflexibleserver.implementation.ResourceProvidersImpl; import com.azure.resourcemanager.postgresqlflexibleserver.implementation.ServerCapabilitiesImpl; import com.azure.resourcemanager.postgresqlflexibleserver.implementation.ServerThreatProtectionSettingsImpl; import com.azure.resourcemanager.postgresqlflexibleserver.implementation.ServersImpl; +import com.azure.resourcemanager.postgresqlflexibleserver.implementation.TuningConfigurationsImpl; +import com.azure.resourcemanager.postgresqlflexibleserver.implementation.TuningIndexesImpl; +import com.azure.resourcemanager.postgresqlflexibleserver.implementation.TuningOptionsImpl; import com.azure.resourcemanager.postgresqlflexibleserver.implementation.VirtualEndpointsImpl; import com.azure.resourcemanager.postgresqlflexibleserver.implementation.VirtualNetworkSubnetUsagesImpl; import com.azure.resourcemanager.postgresqlflexibleserver.models.Administrators; @@ -66,17 +71,22 @@ import com.azure.resourcemanager.postgresqlflexibleserver.models.PrivateEndpointConnectionOperations; import com.azure.resourcemanager.postgresqlflexibleserver.models.PrivateEndpointConnections; import com.azure.resourcemanager.postgresqlflexibleserver.models.PrivateLinkResources; +import com.azure.resourcemanager.postgresqlflexibleserver.models.QuotaUsages; import com.azure.resourcemanager.postgresqlflexibleserver.models.Replicas; import com.azure.resourcemanager.postgresqlflexibleserver.models.ResourceProviders; import com.azure.resourcemanager.postgresqlflexibleserver.models.ServerCapabilities; import com.azure.resourcemanager.postgresqlflexibleserver.models.ServerThreatProtectionSettings; import com.azure.resourcemanager.postgresqlflexibleserver.models.Servers; +import com.azure.resourcemanager.postgresqlflexibleserver.models.TuningConfigurations; +import com.azure.resourcemanager.postgresqlflexibleserver.models.TuningIndexes; +import com.azure.resourcemanager.postgresqlflexibleserver.models.TuningOptions; import com.azure.resourcemanager.postgresqlflexibleserver.models.VirtualEndpoints; import com.azure.resourcemanager.postgresqlflexibleserver.models.VirtualNetworkSubnetUsages; import java.time.Duration; import java.time.temporal.ChronoUnit; import java.util.ArrayList; import java.util.List; +import java.util.Map; import java.util.Objects; import java.util.stream.Collectors; @@ -125,12 +135,20 @@ public final class PostgreSqlManager { private PrivateLinkResources privateLinkResources; + private QuotaUsages quotaUsages; + private Replicas replicas; private LogFiles logFiles; private ServerThreatProtectionSettings serverThreatProtectionSettings; + private TuningOptions tuningOptions; + + private TuningIndexes tuningIndexes; + + private TuningConfigurations tuningConfigurations; + private VirtualEndpoints virtualEndpoints; private VirtualNetworkSubnetUsages virtualNetworkSubnetUsages; @@ -187,6 +205,9 @@ public static Configurable configure() { */ public static final class Configurable { private static final ClientLogger LOGGER = new ClientLogger(Configurable.class); + private static final String SDK_VERSION = "version"; + private static final Map PROPERTIES + = CoreUtils.getProperties("azure-resourcemanager-postgresqlflexibleserver.properties"); private HttpClient httpClient; private HttpLogOptions httpLogOptions; @@ -294,12 +315,14 @@ public PostgreSqlManager authenticate(TokenCredential credential, AzureProfile p Objects.requireNonNull(credential, "'credential' cannot be null."); Objects.requireNonNull(profile, "'profile' cannot be null."); + String clientVersion = PROPERTIES.getOrDefault(SDK_VERSION, "UnknownVersion"); + StringBuilder userAgentBuilder = new StringBuilder(); userAgentBuilder.append("azsdk-java") .append("-") .append("com.azure.resourcemanager.postgresqlflexibleserver") .append("/") - .append("1.1.0"); + .append(clientVersion); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { userAgentBuilder.append(" (") .append(Configuration.getGlobalConfiguration().get("java.version")) @@ -579,6 +602,18 @@ public PrivateLinkResources privateLinkResources() { return privateLinkResources; } + /** + * Gets the resource collection API of QuotaUsages. + * + * @return Resource collection API of QuotaUsages. + */ + public QuotaUsages quotaUsages() { + if (this.quotaUsages == null) { + this.quotaUsages = new QuotaUsagesImpl(clientObject.getQuotaUsages(), this); + } + return quotaUsages; + } + /** * Gets the resource collection API of Replicas. * @@ -617,6 +652,42 @@ public ServerThreatProtectionSettings serverThreatProtectionSettings() { return serverThreatProtectionSettings; } + /** + * Gets the resource collection API of TuningOptions. + * + * @return Resource collection API of TuningOptions. + */ + public TuningOptions tuningOptions() { + if (this.tuningOptions == null) { + this.tuningOptions = new TuningOptionsImpl(clientObject.getTuningOptions(), this); + } + return tuningOptions; + } + + /** + * Gets the resource collection API of TuningIndexes. + * + * @return Resource collection API of TuningIndexes. + */ + public TuningIndexes tuningIndexes() { + if (this.tuningIndexes == null) { + this.tuningIndexes = new TuningIndexesImpl(clientObject.getTuningIndexes(), this); + } + return tuningIndexes; + } + + /** + * Gets the resource collection API of TuningConfigurations. + * + * @return Resource collection API of TuningConfigurations. + */ + public TuningConfigurations tuningConfigurations() { + if (this.tuningConfigurations == null) { + this.tuningConfigurations = new TuningConfigurationsImpl(clientObject.getTuningConfigurations(), this); + } + return tuningConfigurations; + } + /** * Gets the resource collection API of VirtualEndpoints. It manages VirtualEndpointResource. * diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/AdministratorsClient.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/AdministratorsClient.java index bc8ab4a4f717..e9f77c17fff3 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/AdministratorsClient.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/AdministratorsClient.java @@ -29,11 +29,11 @@ public interface AdministratorsClient { * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @param objectId Guid of the objectId for the administrator. - * @param parameters The required parameters for adding an active directory administrator for a server. + * @param parameters The required parameters for adding an Microsoft Entra Administrator for a server. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents an Active Directory administrator along with {@link Response} on successful completion of + * @return represents an Microsoft Entra Administrator along with {@link Response} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -46,11 +46,11 @@ Mono>> createWithResponseAsync(String resourceGroupNam * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @param objectId Guid of the objectId for the administrator. - * @param parameters The required parameters for adding an active directory administrator for a server. + * @param parameters The required parameters for adding an Microsoft Entra Administrator for a server. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of represents an Active Directory administrator. + * @return the {@link PollerFlux} for polling of represents an Microsoft Entra Administrator. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) PollerFlux, ActiveDirectoryAdministratorInner> beginCreateAsync( @@ -62,11 +62,11 @@ PollerFlux, ActiveDirectoryAdminis * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @param objectId Guid of the objectId for the administrator. - * @param parameters The required parameters for adding an active directory administrator for a server. + * @param parameters The required parameters for adding an Microsoft Entra Administrator for a server. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of represents an Active Directory administrator. + * @return the {@link SyncPoller} for polling of represents an Microsoft Entra Administrator. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, ActiveDirectoryAdministratorInner> beginCreate( @@ -78,12 +78,12 @@ SyncPoller, ActiveDirectoryAdminis * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @param objectId Guid of the objectId for the administrator. - * @param parameters The required parameters for adding an active directory administrator for a server. + * @param parameters The required parameters for adding an Microsoft Entra Administrator for a server. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of represents an Active Directory administrator. + * @return the {@link SyncPoller} for polling of represents an Microsoft Entra Administrator. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, ActiveDirectoryAdministratorInner> beginCreate( @@ -96,11 +96,11 @@ SyncPoller, ActiveDirectoryAdminis * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @param objectId Guid of the objectId for the administrator. - * @param parameters The required parameters for adding an active directory administrator for a server. + * @param parameters The required parameters for adding an Microsoft Entra Administrator for a server. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents an Active Directory administrator on successful completion of {@link Mono}. + * @return represents an Microsoft Entra Administrator on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) Mono createAsync(String resourceGroupName, String serverName, String objectId, @@ -112,11 +112,11 @@ Mono createAsync(String resourceGroupName, St * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @param objectId Guid of the objectId for the administrator. - * @param parameters The required parameters for adding an active directory administrator for a server. + * @param parameters The required parameters for adding an Microsoft Entra Administrator for a server. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents an Active Directory administrator. + * @return represents an Microsoft Entra Administrator. */ @ServiceMethod(returns = ReturnType.SINGLE) ActiveDirectoryAdministratorInner create(String resourceGroupName, String serverName, String objectId, @@ -128,19 +128,19 @@ ActiveDirectoryAdministratorInner create(String resourceGroupName, String server * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @param objectId Guid of the objectId for the administrator. - * @param parameters The required parameters for adding an active directory administrator for a server. + * @param parameters The required parameters for adding an Microsoft Entra Administrator for a server. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents an Active Directory administrator. + * @return represents an Microsoft Entra Administrator. */ @ServiceMethod(returns = ReturnType.SINGLE) ActiveDirectoryAdministratorInner create(String resourceGroupName, String serverName, String objectId, ActiveDirectoryAdministratorAdd parameters, Context context); /** - * Deletes an Active Directory Administrator associated with the server. + * Deletes an Microsoft Entra Administrator associated with the server. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. @@ -155,7 +155,7 @@ Mono>> deleteWithResponseAsync(String resourceGroupNam String objectId); /** - * Deletes an Active Directory Administrator associated with the server. + * Deletes an Microsoft Entra Administrator associated with the server. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. @@ -169,7 +169,7 @@ Mono>> deleteWithResponseAsync(String resourceGroupNam PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String serverName, String objectId); /** - * Deletes an Active Directory Administrator associated with the server. + * Deletes an Microsoft Entra Administrator associated with the server. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. @@ -183,7 +183,7 @@ Mono>> deleteWithResponseAsync(String resourceGroupNam SyncPoller, Void> beginDelete(String resourceGroupName, String serverName, String objectId); /** - * Deletes an Active Directory Administrator associated with the server. + * Deletes an Microsoft Entra Administrator associated with the server. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. @@ -199,7 +199,7 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String Context context); /** - * Deletes an Active Directory Administrator associated with the server. + * Deletes an Microsoft Entra Administrator associated with the server. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. @@ -213,7 +213,7 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String Mono deleteAsync(String resourceGroupName, String serverName, String objectId); /** - * Deletes an Active Directory Administrator associated with the server. + * Deletes an Microsoft Entra Administrator associated with the server. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. @@ -226,7 +226,7 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String void delete(String resourceGroupName, String serverName, String objectId); /** - * Deletes an Active Directory Administrator associated with the server. + * Deletes an Microsoft Entra Administrator associated with the server. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. @@ -306,7 +306,7 @@ Response getWithResponse(String resourceGroup * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of active directory administrators as paginated response with {@link PagedFlux}. + * @return a list of Microsoft Entra Administrators as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedFlux listByServerAsync(String resourceGroupName, String serverName); @@ -319,7 +319,7 @@ Response getWithResponse(String resourceGroup * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of active directory administrators as paginated response with {@link PagedIterable}. + * @return a list of Microsoft Entra Administrators as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByServer(String resourceGroupName, String serverName); @@ -333,7 +333,7 @@ Response getWithResponse(String resourceGroup * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of active directory administrators as paginated response with {@link PagedIterable}. + * @return a list of Microsoft Entra Administrators as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByServer(String resourceGroupName, String serverName, diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/OperationsClient.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/OperationsClient.java index e614d5ad9577..f62bdb5712d8 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/OperationsClient.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/OperationsClient.java @@ -6,10 +6,10 @@ import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.Response; +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.OperationListResultInner; -import reactor.core.publisher.Mono; +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.OperationInner; /** * An instance of this class provides access to all the operations defined in OperationsClient. @@ -20,21 +20,20 @@ public interface OperationsClient { * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of resource provider operations along with {@link Response} on successful completion of - * {@link Mono}. + * @return a list of resource provider operations as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> listWithResponseAsync(); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listAsync(); /** * Lists all of the available REST API operations. * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of resource provider operations on successful completion of {@link Mono}. + * @return a list of resource provider operations as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono listAsync(); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); /** * Lists all of the available REST API operations. @@ -43,18 +42,8 @@ public interface OperationsClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of resource provider operations along with {@link Response}. + * @return a list of resource provider operations as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listWithResponse(Context context); - - /** - * Lists all of the available REST API operations. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of resource provider operations. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - OperationListResultInner list(); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/PostgreSqlManagementClient.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/PostgreSqlManagementClient.java index 3cc78d0a298f..f1a88fe31099 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/PostgreSqlManagementClient.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/PostgreSqlManagementClient.java @@ -179,6 +179,13 @@ public interface PostgreSqlManagementClient { */ PrivateLinkResourcesClient getPrivateLinkResources(); + /** + * Gets the QuotaUsagesClient object to access its operations. + * + * @return the QuotaUsagesClient object. + */ + QuotaUsagesClient getQuotaUsages(); + /** * Gets the ReplicasClient object to access its operations. * @@ -200,6 +207,27 @@ public interface PostgreSqlManagementClient { */ ServerThreatProtectionSettingsClient getServerThreatProtectionSettings(); + /** + * Gets the TuningOptionsClient object to access its operations. + * + * @return the TuningOptionsClient object. + */ + TuningOptionsClient getTuningOptions(); + + /** + * Gets the TuningIndexesClient object to access its operations. + * + * @return the TuningIndexesClient object. + */ + TuningIndexesClient getTuningIndexes(); + + /** + * Gets the TuningConfigurationsClient object to access its operations. + * + * @return the TuningConfigurationsClient object. + */ + TuningConfigurationsClient getTuningConfigurations(); + /** * Gets the VirtualEndpointsClient object to access its operations. * diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/QuotaUsagesClient.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/QuotaUsagesClient.java new file mode 100644 index 000000000000..59ed9de674a3 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/QuotaUsagesClient.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.QuotaUsageInner; + +/** + * An instance of this class provides access to all the operations defined in QuotaUsagesClient. + */ +public interface QuotaUsagesClient { + /** + * Get quota usages at specified location in a given subscription. + * + * @param locationName The name of the location. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return quota usages at specified location in a given subscription as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listAsync(String locationName); + + /** + * Get quota usages at specified location in a given subscription. + * + * @param locationName The name of the location. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return quota usages at specified location in a given subscription as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String locationName); + + /** + * Get quota usages at specified location in a given subscription. + * + * @param locationName The name of the location. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return quota usages at specified location in a given subscription as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String locationName, Context context); +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/TuningConfigurationsClient.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/TuningConfigurationsClient.java new file mode 100644 index 000000000000..04b33e408c1a --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/TuningConfigurationsClient.java @@ -0,0 +1,540 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.SessionDetailsResourceInner; +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.SessionResourceInner; +import com.azure.resourcemanager.postgresqlflexibleserver.models.ConfigTuningRequestParameter; +import com.azure.resourcemanager.postgresqlflexibleserver.models.TuningOptionEnum; +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 TuningConfigurationsClient. + */ +public interface TuningConfigurationsClient { + /** + * Enables the config tuning. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono>> enableWithResponseAsync(String resourceGroupName, String serverName, + TuningOptionEnum tuningOption); + + /** + * Enables the config tuning. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + PollerFlux, Void> beginEnableAsync(String resourceGroupName, String serverName, + TuningOptionEnum tuningOption); + + /** + * Enables the config tuning. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginEnable(String resourceGroupName, String serverName, + TuningOptionEnum tuningOption); + + /** + * Enables the config tuning. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginEnable(String resourceGroupName, String serverName, + TuningOptionEnum tuningOption, Context context); + + /** + * Enables the config tuning. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono enableAsync(String resourceGroupName, String serverName, TuningOptionEnum tuningOption); + + /** + * Enables the config tuning. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void enable(String resourceGroupName, String serverName, TuningOptionEnum tuningOption); + + /** + * Enables the config tuning. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void enable(String resourceGroupName, String serverName, TuningOptionEnum tuningOption, Context context); + + /** + * Disables the config tuning. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono>> disableWithResponseAsync(String resourceGroupName, String serverName, + TuningOptionEnum tuningOption); + + /** + * Disables the config tuning. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + PollerFlux, Void> beginDisableAsync(String resourceGroupName, String serverName, + TuningOptionEnum tuningOption); + + /** + * Disables the config tuning. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDisable(String resourceGroupName, String serverName, + TuningOptionEnum tuningOption); + + /** + * Disables the config tuning. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDisable(String resourceGroupName, String serverName, + TuningOptionEnum tuningOption, Context context); + + /** + * Disables the config tuning. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono disableAsync(String resourceGroupName, String serverName, TuningOptionEnum tuningOption); + + /** + * Disables the config tuning. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void disable(String resourceGroupName, String serverName, TuningOptionEnum tuningOption); + + /** + * Disables the config tuning. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void disable(String resourceGroupName, String serverName, TuningOptionEnum tuningOption, Context context); + + /** + * Starts up the config tuning session. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @param configTuningRequest The parameters for tuning request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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>> startSessionWithResponseAsync(String resourceGroupName, String serverName, + TuningOptionEnum tuningOption, ConfigTuningRequestParameter configTuningRequest); + + /** + * Starts up the config tuning session. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @param configTuningRequest The parameters for tuning request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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> beginStartSessionAsync(String resourceGroupName, String serverName, + TuningOptionEnum tuningOption, ConfigTuningRequestParameter configTuningRequest); + + /** + * Starts up the config tuning session. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @param configTuningRequest The parameters for tuning request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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> beginStartSession(String resourceGroupName, String serverName, + TuningOptionEnum tuningOption, ConfigTuningRequestParameter configTuningRequest); + + /** + * Starts up the config tuning session. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @param configTuningRequest The parameters for tuning request. + * @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> beginStartSession(String resourceGroupName, String serverName, + TuningOptionEnum tuningOption, ConfigTuningRequestParameter configTuningRequest, Context context); + + /** + * Starts up the config tuning session. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @param configTuningRequest The parameters for tuning request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 startSessionAsync(String resourceGroupName, String serverName, TuningOptionEnum tuningOption, + ConfigTuningRequestParameter configTuningRequest); + + /** + * Starts up the config tuning session. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @param configTuningRequest The parameters for tuning request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 startSession(String resourceGroupName, String serverName, TuningOptionEnum tuningOption, + ConfigTuningRequestParameter configTuningRequest); + + /** + * Starts up the config tuning session. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @param configTuningRequest The parameters for tuning request. + * @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 startSession(String resourceGroupName, String serverName, TuningOptionEnum tuningOption, + ConfigTuningRequestParameter configTuningRequest, Context context); + + /** + * Stops the config tuning session. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono>> stopSessionWithResponseAsync(String resourceGroupName, String serverName, + TuningOptionEnum tuningOption); + + /** + * Stops the config tuning session. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + PollerFlux, Void> beginStopSessionAsync(String resourceGroupName, String serverName, + TuningOptionEnum tuningOption); + + /** + * Stops the config tuning session. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginStopSession(String resourceGroupName, String serverName, + TuningOptionEnum tuningOption); + + /** + * Stops the config tuning session. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginStopSession(String resourceGroupName, String serverName, + TuningOptionEnum tuningOption, Context context); + + /** + * Stops the config tuning session. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono stopSessionAsync(String resourceGroupName, String serverName, TuningOptionEnum tuningOption); + + /** + * Stops the config tuning session. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void stopSession(String resourceGroupName, String serverName, TuningOptionEnum tuningOption); + + /** + * Stops the config tuning session. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void stopSession(String resourceGroupName, String serverName, TuningOptionEnum tuningOption, Context context); + + /** + * Gets up the config tuning session status. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return up the config tuning session status as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listSessionsAsync(String resourceGroupName, String serverName, + TuningOptionEnum tuningOption); + + /** + * Gets up the config tuning session status. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return up the config tuning session status as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listSessions(String resourceGroupName, String serverName, + TuningOptionEnum tuningOption); + + /** + * Gets up the config tuning session status. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return up the config tuning session status as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listSessions(String resourceGroupName, String serverName, + TuningOptionEnum tuningOption, Context context); + + /** + * Gets the session details of a config tuning session. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @param sessionId Guid of the objectId for the session. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 session details of a config tuning session as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listSessionDetailsAsync(String resourceGroupName, String serverName, + TuningOptionEnum tuningOption, String sessionId); + + /** + * Gets the session details of a config tuning session. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @param sessionId Guid of the objectId for the session. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 session details of a config tuning session as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listSessionDetails(String resourceGroupName, String serverName, + TuningOptionEnum tuningOption, String sessionId); + + /** + * Gets the session details of a config tuning session. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @param sessionId Guid of the objectId for the session. + * @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 session details of a config tuning session as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listSessionDetails(String resourceGroupName, String serverName, + TuningOptionEnum tuningOption, String sessionId, Context context); +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/TuningIndexesClient.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/TuningIndexesClient.java new file mode 100644 index 000000000000..46a6b7b55eda --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/TuningIndexesClient.java @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.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.ObjectRecommendationResourceInner; +import com.azure.resourcemanager.postgresqlflexibleserver.models.RecommendationType; +import com.azure.resourcemanager.postgresqlflexibleserver.models.TuningOptionEnum; + +/** + * An instance of this class provides access to all the operations defined in TuningIndexesClient. + */ +public interface TuningIndexesClient { + /** + * Retrieve the list of available tuning recommendations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @param recommendationType Recommendations list filter. Retrieves recommendations based on type. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of available recommendations as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listRecommendationsAsync(String resourceGroupName, String serverName, + TuningOptionEnum tuningOption, RecommendationType recommendationType); + + /** + * Retrieve the list of available tuning recommendations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of available recommendations as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listRecommendationsAsync(String resourceGroupName, String serverName, + TuningOptionEnum tuningOption); + + /** + * Retrieve the list of available tuning recommendations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of available recommendations as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listRecommendations(String resourceGroupName, String serverName, + TuningOptionEnum tuningOption); + + /** + * Retrieve the list of available tuning recommendations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @param recommendationType Recommendations list filter. Retrieves recommendations based on type. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of available recommendations as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listRecommendations(String resourceGroupName, String serverName, + TuningOptionEnum tuningOption, RecommendationType recommendationType, Context context); +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/TuningOptionsClient.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/TuningOptionsClient.java new file mode 100644 index 000000000000..8b665b9074b4 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/TuningOptionsClient.java @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.TuningOptionsResourceInner; +import com.azure.resourcemanager.postgresqlflexibleserver.models.TuningOptionEnum; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in TuningOptionsClient. + */ +public interface TuningOptionsClient { + /** + * Retrieve the tuning option on a server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return stores property that features impact on some metric if this recommended action is applied along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> getWithResponseAsync(String resourceGroupName, String serverName, + TuningOptionEnum tuningOption); + + /** + * Retrieve the tuning option on a server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return stores property that features impact on some metric if this recommended action is applied on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono getAsync(String resourceGroupName, String serverName, + TuningOptionEnum tuningOption); + + /** + * Retrieve the tuning option on a server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return stores property that features impact on some metric if this recommended action is applied along with + * {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String serverName, + TuningOptionEnum tuningOption, Context context); + + /** + * Retrieve the tuning option on a server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return stores property that features impact on some metric if this recommended action is applied. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + TuningOptionsResourceInner get(String resourceGroupName, String serverName, TuningOptionEnum tuningOption); + + /** + * Retrieve the list of available tuning options. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of server tuning options as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listByServerAsync(String resourceGroupName, String serverName); + + /** + * Retrieve the list of available tuning options. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of server tuning options as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByServer(String resourceGroupName, String serverName); + + /** + * Retrieve the list of available tuning options. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of server tuning options as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByServer(String resourceGroupName, String serverName, + Context context); +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/ActiveDirectoryAdministratorInner.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/ActiveDirectoryAdministratorInner.java index 472a9c5f8366..fcece1847892 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 @@ -15,12 +15,12 @@ import java.io.IOException; /** - * Represents an Active Directory administrator. + * Represents an Microsoft Entra Administrator. */ @Fluent public final class ActiveDirectoryAdministratorInner extends ProxyResource { /* - * Properties of the active directory administrator. + * Properties of the Microsoft Entra Administrator. */ private AdministratorProperties innerProperties = new AdministratorProperties(); @@ -51,7 +51,7 @@ public ActiveDirectoryAdministratorInner() { } /** - * Get the innerProperties property: Properties of the active directory administrator. + * Get the innerProperties property: Properties of the Microsoft Entra Administrator. * * @return the innerProperties value. */ @@ -99,7 +99,7 @@ public String id() { } /** - * Get the principalType property: The principal type used to represent the type of Active Directory Administrator. + * Get the principalType property: The principal type used to represent the type of Microsoft Entra Administrator. * * @return the principalType value. */ @@ -108,7 +108,7 @@ public PrincipalType principalType() { } /** - * Set the principalType property: The principal type used to represent the type of Active Directory Administrator. + * Set the principalType property: The principal type used to represent the type of Microsoft Entra Administrator. * * @param principalType the principalType value to set. * @return the ActiveDirectoryAdministratorInner object itself. @@ -122,7 +122,7 @@ public ActiveDirectoryAdministratorInner withPrincipalType(PrincipalType princip } /** - * Get the principalName property: Active Directory administrator principal name. + * Get the principalName property: Microsoft Entra Administrator principal name. * * @return the principalName value. */ @@ -131,7 +131,7 @@ public String principalName() { } /** - * Set the principalName property: Active Directory administrator principal name. + * Set the principalName property: Microsoft Entra Administrator principal name. * * @param principalName the principalName value to set. * @return the ActiveDirectoryAdministratorInner object itself. @@ -145,7 +145,7 @@ public ActiveDirectoryAdministratorInner withPrincipalName(String principalName) } /** - * Get the objectId property: The objectId of the Active Directory administrator. + * Get the objectId property: The objectId of the Microsoft Entra Administrator. * * @return the objectId value. */ @@ -154,7 +154,7 @@ public String objectId() { } /** - * Set the objectId property: The objectId of the Active Directory administrator. + * Set the objectId property: The objectId of the Microsoft Entra Administrator. * * @param objectId the objectId value to set. * @return the ActiveDirectoryAdministratorInner object itself. @@ -168,7 +168,7 @@ public ActiveDirectoryAdministratorInner withObjectId(String objectId) { } /** - * Get the tenantId property: The tenantId of the Active Directory administrator. + * Get the tenantId property: The tenantId of the Microsoft Entra Administrator. * * @return the tenantId value. */ @@ -177,7 +177,7 @@ public String tenantId() { } /** - * Set the tenantId property: The tenantId of the Active Directory administrator. + * Set the tenantId property: The tenantId of the Microsoft Entra Administrator. * * @param tenantId the tenantId value to set. * @return the ActiveDirectoryAdministratorInner object itself. 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 4b5870a0954e..18c36c31a1d9 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 @@ -13,27 +13,27 @@ import java.io.IOException; /** - * The properties of an Active Directory administrator. + * The properties of an Microsoft Entra Administrator. */ @Fluent public final class AdministratorProperties implements JsonSerializable { /* - * The principal type used to represent the type of Active Directory Administrator. + * The principal type used to represent the type of Microsoft Entra Administrator. */ private PrincipalType principalType; /* - * Active Directory administrator principal name. + * Microsoft Entra Administrator principal name. */ private String principalName; /* - * The objectId of the Active Directory administrator. + * The objectId of the Microsoft Entra Administrator. */ private String objectId; /* - * The tenantId of the Active Directory administrator. + * The tenantId of the Microsoft Entra Administrator. */ private String tenantId; @@ -44,7 +44,7 @@ public AdministratorProperties() { } /** - * Get the principalType property: The principal type used to represent the type of Active Directory Administrator. + * Get the principalType property: The principal type used to represent the type of Microsoft Entra Administrator. * * @return the principalType value. */ @@ -53,7 +53,7 @@ public PrincipalType principalType() { } /** - * Set the principalType property: The principal type used to represent the type of Active Directory Administrator. + * Set the principalType property: The principal type used to represent the type of Microsoft Entra Administrator. * * @param principalType the principalType value to set. * @return the AdministratorProperties object itself. @@ -64,7 +64,7 @@ public AdministratorProperties withPrincipalType(PrincipalType principalType) { } /** - * Get the principalName property: Active Directory administrator principal name. + * Get the principalName property: Microsoft Entra Administrator principal name. * * @return the principalName value. */ @@ -73,7 +73,7 @@ public String principalName() { } /** - * Set the principalName property: Active Directory administrator principal name. + * Set the principalName property: Microsoft Entra Administrator principal name. * * @param principalName the principalName value to set. * @return the AdministratorProperties object itself. @@ -84,7 +84,7 @@ public AdministratorProperties withPrincipalName(String principalName) { } /** - * Get the objectId property: The objectId of the Active Directory administrator. + * Get the objectId property: The objectId of the Microsoft Entra Administrator. * * @return the objectId value. */ @@ -93,7 +93,7 @@ public String objectId() { } /** - * Set the objectId property: The objectId of the Active Directory administrator. + * Set the objectId property: The objectId of the Microsoft Entra Administrator. * * @param objectId the objectId value to set. * @return the AdministratorProperties object itself. @@ -104,7 +104,7 @@ public AdministratorProperties withObjectId(String objectId) { } /** - * Get the tenantId property: The tenantId of the Active Directory administrator. + * Get the tenantId property: The tenantId of the Microsoft Entra Administrator. * * @return the tenantId value. */ @@ -113,7 +113,7 @@ public String tenantId() { } /** - * Set the tenantId property: The tenantId of the Active Directory administrator. + * Set the tenantId property: The tenantId of the Microsoft Entra Administrator. * * @param tenantId the tenantId value to set. * @return the AdministratorProperties object itself. 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 c13a9e87357e..c4cd2307d160 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 @@ -13,22 +13,22 @@ import java.io.IOException; /** - * The properties of an Active Directory administrator. + * The properties of an Microsoft Entra Administrator. */ @Fluent public final class AdministratorPropertiesForAdd implements JsonSerializable { /* - * The principal type used to represent the type of Active Directory Administrator. + * The principal type used to represent the type of Microsoft Entra Administrator. */ private PrincipalType principalType; /* - * Active Directory administrator principal name. + * Microsoft Entra Administrator principal name. */ private String principalName; /* - * The tenantId of the Active Directory administrator. + * The tenantId of the Microsoft Entra Administrator. */ private String tenantId; @@ -39,7 +39,7 @@ public AdministratorPropertiesForAdd() { } /** - * Get the principalType property: The principal type used to represent the type of Active Directory Administrator. + * Get the principalType property: The principal type used to represent the type of Microsoft Entra Administrator. * * @return the principalType value. */ @@ -48,7 +48,7 @@ public PrincipalType principalType() { } /** - * Set the principalType property: The principal type used to represent the type of Active Directory Administrator. + * Set the principalType property: The principal type used to represent the type of Microsoft Entra Administrator. * * @param principalType the principalType value to set. * @return the AdministratorPropertiesForAdd object itself. @@ -59,7 +59,7 @@ public AdministratorPropertiesForAdd withPrincipalType(PrincipalType principalTy } /** - * Get the principalName property: Active Directory administrator principal name. + * Get the principalName property: Microsoft Entra Administrator principal name. * * @return the principalName value. */ @@ -68,7 +68,7 @@ public String principalName() { } /** - * Set the principalName property: Active Directory administrator principal name. + * Set the principalName property: Microsoft Entra Administrator principal name. * * @param principalName the principalName value to set. * @return the AdministratorPropertiesForAdd object itself. @@ -79,7 +79,7 @@ public AdministratorPropertiesForAdd withPrincipalName(String principalName) { } /** - * Get the tenantId property: The tenantId of the Active Directory administrator. + * Get the tenantId property: The tenantId of the Microsoft Entra Administrator. * * @return the tenantId value. */ @@ -88,7 +88,7 @@ public String tenantId() { } /** - * Set the tenantId property: The tenantId of the Active Directory administrator. + * Set the tenantId property: The tenantId of the Microsoft Entra Administrator. * * @param tenantId the tenantId value to set. * @return the AdministratorPropertiesForAdd object itself. 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 ddf05ffe6f1c..6b52db9e0bcb 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/FlexibleServerCapabilityInner.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/FlexibleServerCapabilityInner.java @@ -18,6 +18,7 @@ import com.azure.resourcemanager.postgresqlflexibleserver.models.RestrictedEnum; import com.azure.resourcemanager.postgresqlflexibleserver.models.ServerVersionCapability; import com.azure.resourcemanager.postgresqlflexibleserver.models.StorageAutoGrowthSupportedEnum; +import com.azure.resourcemanager.postgresqlflexibleserver.models.SupportedFeature; import com.azure.resourcemanager.postgresqlflexibleserver.models.ZoneRedundantHaAndGeoBackupSupportedEnum; import com.azure.resourcemanager.postgresqlflexibleserver.models.ZoneRedundantHaSupportedEnum; import java.io.IOException; @@ -43,9 +44,15 @@ public final class FlexibleServerCapabilityInner extends CapabilityBase { */ private List supportedServerVersions; + /* + * The supported features. + */ + private List supportedFeatures; + /* * Gets a value indicating whether fast provisioning is supported. "Enabled" means fast provisioning is supported. - * "Disabled" stands for fast provisioning is not supported. + * "Disabled" stands for fast provisioning is not supported. Will be deprecated in future, please look to Supported + * Features for "FastProvisioning". */ private FastProvisioningSupportedEnum fastProvisioningSupported; @@ -56,38 +63,41 @@ public final class FlexibleServerCapabilityInner extends CapabilityBase { /* * Determines if geo-backup is supported in this region. "Enabled" means geo-backup is supported. "Disabled" stands - * for geo-back is not supported. + * for geo-back is not supported. Will be deprecated in future, please look to Supported Features for "GeoBackup". */ private GeoBackupSupportedEnum geoBackupSupported; /* * A value indicating whether Zone Redundant HA is supported in this region. "Enabled" means zone redundant HA is - * supported. "Disabled" stands for zone redundant HA is not supported. + * supported. "Disabled" stands for zone redundant HA is not supported. Will be deprecated in future, please look to + * Supported Features for "ZoneRedundantHa". */ private ZoneRedundantHaSupportedEnum zoneRedundantHaSupported; /* * A value indicating whether Zone Redundant HA and Geo-backup is supported in this region. "Enabled" means zone * redundant HA and geo-backup is supported. "Disabled" stands for zone redundant HA and geo-backup is not - * supported. + * supported. Will be deprecated in future, please look to Supported Features for "ZoneRedundantHaAndGeoBackup". */ private ZoneRedundantHaAndGeoBackupSupportedEnum zoneRedundantHaAndGeoBackupSupported; /* * A value indicating whether storage auto-grow is supported in this region. "Enabled" means storage auto-grow is - * supported. "Disabled" stands for storage auto-grow is not supported. + * supported. "Disabled" stands for storage auto-grow is not supported. Will be deprecated in future, please look to + * Supported Features for "StorageAutoGrowth". */ private StorageAutoGrowthSupportedEnum storageAutoGrowthSupported; /* * A value indicating whether online resize is supported in this region for the given subscription. "Enabled" means - * storage online resize is supported. "Disabled" means storage online resize is not supported. + * storage online resize is supported. "Disabled" means storage online resize is not supported. Will be deprecated + * in future, please look to Supported Features for "OnlineResize". */ private OnlineResizeSupportedEnum onlineResizeSupported; /* * A value indicating whether this region is restricted. "Enabled" means region is restricted. "Disabled" stands for - * region is not restricted. + * region is not restricted. Will be deprecated in future, please look to Supported Features for "Restricted". */ private RestrictedEnum restricted; @@ -145,9 +155,19 @@ public List supportedServerVersions() { return this.supportedServerVersions; } + /** + * Get the supportedFeatures property: The supported features. + * + * @return the supportedFeatures value. + */ + public List supportedFeatures() { + return this.supportedFeatures; + } + /** * Get the fastProvisioningSupported property: Gets a value indicating whether fast provisioning is supported. - * "Enabled" means fast provisioning is supported. "Disabled" stands for fast provisioning is not supported. + * "Enabled" means fast provisioning is supported. "Disabled" stands for fast provisioning is not supported. Will be + * deprecated in future, please look to Supported Features for "FastProvisioning". * * @return the fastProvisioningSupported value. */ @@ -166,7 +186,8 @@ public List supportedFastProvisioningEditions /** * Get the geoBackupSupported property: Determines if geo-backup is supported in this region. "Enabled" means - * geo-backup is supported. "Disabled" stands for geo-back is not supported. + * geo-backup is supported. "Disabled" stands for geo-back is not supported. Will be deprecated in future, please + * look to Supported Features for "GeoBackup". * * @return the geoBackupSupported value. */ @@ -177,6 +198,7 @@ public GeoBackupSupportedEnum geoBackupSupported() { /** * Get the zoneRedundantHaSupported property: A value indicating whether Zone Redundant HA is supported in this * region. "Enabled" means zone redundant HA is supported. "Disabled" stands for zone redundant HA is not supported. + * Will be deprecated in future, please look to Supported Features for "ZoneRedundantHa". * * @return the zoneRedundantHaSupported value. */ @@ -187,7 +209,8 @@ public ZoneRedundantHaSupportedEnum zoneRedundantHaSupported() { /** * Get the zoneRedundantHaAndGeoBackupSupported property: A value indicating whether Zone Redundant HA and * Geo-backup is supported in this region. "Enabled" means zone redundant HA and geo-backup is supported. "Disabled" - * stands for zone redundant HA and geo-backup is not supported. + * stands for zone redundant HA and geo-backup is not supported. Will be deprecated in future, please look to + * Supported Features for "ZoneRedundantHaAndGeoBackup". * * @return the zoneRedundantHaAndGeoBackupSupported value. */ @@ -198,6 +221,7 @@ public ZoneRedundantHaAndGeoBackupSupportedEnum zoneRedundantHaAndGeoBackupSuppo /** * Get the storageAutoGrowthSupported property: A value indicating whether storage auto-grow is supported in this * region. "Enabled" means storage auto-grow is supported. "Disabled" stands for storage auto-grow is not supported. + * Will be deprecated in future, please look to Supported Features for "StorageAutoGrowth". * * @return the storageAutoGrowthSupported value. */ @@ -208,7 +232,7 @@ public StorageAutoGrowthSupportedEnum storageAutoGrowthSupported() { /** * Get the onlineResizeSupported property: A value indicating whether online resize is supported in this region for * the given subscription. "Enabled" means storage online resize is supported. "Disabled" means storage online - * resize is not supported. + * resize is not supported. Will be deprecated in future, please look to Supported Features for "OnlineResize". * * @return the onlineResizeSupported value. */ @@ -218,7 +242,8 @@ public OnlineResizeSupportedEnum onlineResizeSupported() { /** * Get the restricted property: A value indicating whether this region is restricted. "Enabled" means region is - * restricted. "Disabled" stands for region is not restricted. + * restricted. "Disabled" stands for region is not restricted. Will be deprecated in future, please look to + * Supported Features for "Restricted". * * @return the restricted value. */ @@ -259,6 +284,9 @@ public void validate() { if (supportedServerVersions() != null) { supportedServerVersions().forEach(e -> e.validate()); } + if (supportedFeatures() != null) { + supportedFeatures().forEach(e -> e.validate()); + } if (supportedFastProvisioningEditions() != null) { supportedFastProvisioningEditions().forEach(e -> e.validate()); } @@ -304,6 +332,10 @@ public static FlexibleServerCapabilityInner fromJson(JsonReader jsonReader) thro List supportedServerVersions = reader.readArray(reader1 -> ServerVersionCapability.fromJson(reader1)); deserializedFlexibleServerCapabilityInner.supportedServerVersions = supportedServerVersions; + } else if ("supportedFeatures".equals(fieldName)) { + List supportedFeatures + = reader.readArray(reader1 -> SupportedFeature.fromJson(reader1)); + deserializedFlexibleServerCapabilityInner.supportedFeatures = supportedFeatures; } else if ("fastProvisioningSupported".equals(fieldName)) { deserializedFlexibleServerCapabilityInner.fastProvisioningSupported = FastProvisioningSupportedEnum.fromString(reader.getString()); diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/MigrationResourceInner.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/MigrationResourceInner.java index cb2b052bd6e8..b79736242807 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/MigrationResourceInner.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/MigrationResourceInner.java @@ -219,7 +219,10 @@ public MigrationResourceInner withMigrationOption(MigrationOption migrationOptio /** * Get the sourceType property: migration source server type : OnPremises, AWS, GCP, AzureVM, - * PostgreSQLSingleServer, AWS_RDS, AWS_AURORA, AWS_EC2, GCP_CloudSQL, GCP_AlloyDB, GCP_Compute, or EDB. + * PostgreSQLSingleServer, AWS_RDS, AWS_AURORA, AWS_EC2, GCP_CloudSQL, GCP_AlloyDB, GCP_Compute, EDB, + * EDB_Oracle_Server, EDB_PostgreSQL, PostgreSQLFlexibleServer, PostgreSQLCosmosDB, Huawei_RDS, Huawei_Compute, + * Heroku_PostgreSQL, Crunchy_PostgreSQL, ApsaraDB_RDS, Digital_Ocean_Droplets, Digital_Ocean_PostgreSQL, or + * Supabase_PostgreSQL. * * @return the sourceType value. */ @@ -229,7 +232,10 @@ public SourceType sourceType() { /** * Set the sourceType property: migration source server type : OnPremises, AWS, GCP, AzureVM, - * PostgreSQLSingleServer, AWS_RDS, AWS_AURORA, AWS_EC2, GCP_CloudSQL, GCP_AlloyDB, GCP_Compute, or EDB. + * PostgreSQLSingleServer, AWS_RDS, AWS_AURORA, AWS_EC2, GCP_CloudSQL, GCP_AlloyDB, GCP_Compute, EDB, + * EDB_Oracle_Server, EDB_PostgreSQL, PostgreSQLFlexibleServer, PostgreSQLCosmosDB, Huawei_RDS, Huawei_Compute, + * Heroku_PostgreSQL, Crunchy_PostgreSQL, ApsaraDB_RDS, Digital_Ocean_Droplets, Digital_Ocean_PostgreSQL, or + * Supabase_PostgreSQL. * * @param sourceType the sourceType value to set. * @return the MigrationResourceInner object itself. diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/MigrationResourceProperties.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/MigrationResourceProperties.java index c70cd83bd17a..52eb3cd8491e 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/MigrationResourceProperties.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/MigrationResourceProperties.java @@ -60,7 +60,9 @@ public final class MigrationResourceProperties implements JsonSerializable improvedQueryIds() { + return this.innerProperties() == null ? null : this.innerProperties().improvedQueryIds(); + } + + /** + * Set the improvedQueryIds property: The ImprovedQueryIds. The list will only be populated for CREATE INDEX + * recommendations. + * + * @param improvedQueryIds the improvedQueryIds value to set. + * @return the ObjectRecommendationResourceInner object itself. + */ + public ObjectRecommendationResourceInner withImprovedQueryIds(List improvedQueryIds) { + if (this.innerProperties() == null) { + this.innerProperties = new ObjectRecommendationResourceProperties(); + } + this.innerProperties().withImprovedQueryIds(improvedQueryIds); + return this; + } + + /** + * Get the recommendationReason property: Reason for this recommendation. + * + * @return the recommendationReason value. + */ + public String recommendationReason() { + return this.innerProperties() == null ? null : this.innerProperties().recommendationReason(); + } + + /** + * Set the recommendationReason property: Reason for this recommendation. + * + * @param recommendationReason the recommendationReason value to set. + * @return the ObjectRecommendationResourceInner object itself. + */ + public ObjectRecommendationResourceInner withRecommendationReason(String recommendationReason) { + if (this.innerProperties() == null) { + this.innerProperties = new ObjectRecommendationResourceProperties(); + } + this.innerProperties().withRecommendationReason(recommendationReason); + return this; + } + + /** + * Get the recommendationType property: Type for this recommendation. + * + * @return the recommendationType value. + */ + public RecommendationTypeEnum recommendationType() { + return this.innerProperties() == null ? null : this.innerProperties().recommendationType(); + } + + /** + * Set the recommendationType property: Type for this recommendation. + * + * @param recommendationType the recommendationType value to set. + * @return the ObjectRecommendationResourceInner object itself. + */ + public ObjectRecommendationResourceInner withRecommendationType(RecommendationTypeEnum recommendationType) { + if (this.innerProperties() == null) { + this.innerProperties = new ObjectRecommendationResourceProperties(); + } + this.innerProperties().withRecommendationType(recommendationType); + return this; + } + + /** + * Get the implementationDetails property: Stores implementation details for the recommended action. + * + * @return the implementationDetails value. + */ + public ObjectRecommendationResourcePropertiesImplementationDetails implementationDetails() { + return this.innerProperties() == null ? null : this.innerProperties().implementationDetails(); + } + + /** + * Set the implementationDetails property: Stores implementation details for the recommended action. + * + * @param implementationDetails the implementationDetails value to set. + * @return the ObjectRecommendationResourceInner object itself. + */ + public ObjectRecommendationResourceInner + withImplementationDetails(ObjectRecommendationResourcePropertiesImplementationDetails implementationDetails) { + if (this.innerProperties() == null) { + this.innerProperties = new ObjectRecommendationResourceProperties(); + } + this.innerProperties().withImplementationDetails(implementationDetails); + return this; + } + + /** + * Get the analyzedWorkload property: Stores workload information for the recommended action. + * + * @return the analyzedWorkload value. + */ + public ObjectRecommendationResourcePropertiesAnalyzedWorkload analyzedWorkload() { + return this.innerProperties() == null ? null : this.innerProperties().analyzedWorkload(); + } + + /** + * Set the analyzedWorkload property: Stores workload information for the recommended action. + * + * @param analyzedWorkload the analyzedWorkload value to set. + * @return the ObjectRecommendationResourceInner object itself. + */ + public ObjectRecommendationResourceInner + withAnalyzedWorkload(ObjectRecommendationResourcePropertiesAnalyzedWorkload analyzedWorkload) { + if (this.innerProperties() == null) { + this.innerProperties = new ObjectRecommendationResourceProperties(); + } + this.innerProperties().withAnalyzedWorkload(analyzedWorkload); + return this; + } + + /** + * Get the estimatedImpact property: The estimated impact of this recommended action. + * + * @return the estimatedImpact value. + */ + public List estimatedImpact() { + return this.innerProperties() == null ? null : this.innerProperties().estimatedImpact(); + } + + /** + * Get the details property: Stores recommendation details for the recommended action. + * + * @return the details value. + */ + public ObjectRecommendationDetails details() { + return this.innerProperties() == null ? null : this.innerProperties().details(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ObjectRecommendationResourceInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ObjectRecommendationResourceInner 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 ObjectRecommendationResourceInner. + */ + public static ObjectRecommendationResourceInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ObjectRecommendationResourceInner deserializedObjectRecommendationResourceInner + = new ObjectRecommendationResourceInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedObjectRecommendationResourceInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedObjectRecommendationResourceInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedObjectRecommendationResourceInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedObjectRecommendationResourceInner.innerProperties + = ObjectRecommendationResourceProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedObjectRecommendationResourceInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedObjectRecommendationResourceInner; + }); + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/ObjectRecommendationResourceProperties.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/ObjectRecommendationResourceProperties.java new file mode 100644 index 000000000000..46bbb3260062 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/ObjectRecommendationResourceProperties.java @@ -0,0 +1,365 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.postgresqlflexibleserver.models.ImpactRecord; +import com.azure.resourcemanager.postgresqlflexibleserver.models.ObjectRecommendationDetails; +import com.azure.resourcemanager.postgresqlflexibleserver.models.ObjectRecommendationResourcePropertiesAnalyzedWorkload; +import com.azure.resourcemanager.postgresqlflexibleserver.models.ObjectRecommendationResourcePropertiesImplementationDetails; +import com.azure.resourcemanager.postgresqlflexibleserver.models.RecommendationTypeEnum; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.List; + +/** + * Object recommendation properties. + */ +@Fluent +public final class ObjectRecommendationResourceProperties + implements JsonSerializable { + /* + * Creation time of this recommendation in UTC date-time string format. + */ + private OffsetDateTime initialRecommendedTime; + + /* + * The last refresh of this recommendation in UTC date-time string format. + */ + private OffsetDateTime lastRecommendedTime; + + /* + * The number of times this recommendation has encountered. + */ + private Integer timesRecommended; + + /* + * The ImprovedQueryIds. The list will only be populated for CREATE INDEX recommendations. + */ + private List improvedQueryIds; + + /* + * Reason for this recommendation. + */ + private String recommendationReason; + + /* + * Type for this recommendation. + */ + private RecommendationTypeEnum recommendationType; + + /* + * Stores implementation details for the recommended action. + */ + private ObjectRecommendationResourcePropertiesImplementationDetails implementationDetails; + + /* + * Stores workload information for the recommended action. + */ + private ObjectRecommendationResourcePropertiesAnalyzedWorkload analyzedWorkload; + + /* + * The estimated impact of this recommended action + */ + private List estimatedImpact; + + /* + * Stores recommendation details for the recommended action. + */ + private ObjectRecommendationDetails details; + + /** + * Creates an instance of ObjectRecommendationResourceProperties class. + */ + public ObjectRecommendationResourceProperties() { + } + + /** + * Get the initialRecommendedTime property: Creation time of this recommendation in UTC date-time string format. + * + * @return the initialRecommendedTime value. + */ + public OffsetDateTime initialRecommendedTime() { + return this.initialRecommendedTime; + } + + /** + * Set the initialRecommendedTime property: Creation time of this recommendation in UTC date-time string format. + * + * @param initialRecommendedTime the initialRecommendedTime value to set. + * @return the ObjectRecommendationResourceProperties object itself. + */ + public ObjectRecommendationResourceProperties withInitialRecommendedTime(OffsetDateTime initialRecommendedTime) { + this.initialRecommendedTime = initialRecommendedTime; + return this; + } + + /** + * Get the lastRecommendedTime property: The last refresh of this recommendation in UTC date-time string format. + * + * @return the lastRecommendedTime value. + */ + public OffsetDateTime lastRecommendedTime() { + return this.lastRecommendedTime; + } + + /** + * Set the lastRecommendedTime property: The last refresh of this recommendation in UTC date-time string format. + * + * @param lastRecommendedTime the lastRecommendedTime value to set. + * @return the ObjectRecommendationResourceProperties object itself. + */ + public ObjectRecommendationResourceProperties withLastRecommendedTime(OffsetDateTime lastRecommendedTime) { + this.lastRecommendedTime = lastRecommendedTime; + return this; + } + + /** + * Get the timesRecommended property: The number of times this recommendation has encountered. + * + * @return the timesRecommended value. + */ + public Integer timesRecommended() { + return this.timesRecommended; + } + + /** + * Set the timesRecommended property: The number of times this recommendation has encountered. + * + * @param timesRecommended the timesRecommended value to set. + * @return the ObjectRecommendationResourceProperties object itself. + */ + public ObjectRecommendationResourceProperties withTimesRecommended(Integer timesRecommended) { + this.timesRecommended = timesRecommended; + return this; + } + + /** + * Get the improvedQueryIds property: The ImprovedQueryIds. The list will only be populated for CREATE INDEX + * recommendations. + * + * @return the improvedQueryIds value. + */ + public List improvedQueryIds() { + return this.improvedQueryIds; + } + + /** + * Set the improvedQueryIds property: The ImprovedQueryIds. The list will only be populated for CREATE INDEX + * recommendations. + * + * @param improvedQueryIds the improvedQueryIds value to set. + * @return the ObjectRecommendationResourceProperties object itself. + */ + public ObjectRecommendationResourceProperties withImprovedQueryIds(List improvedQueryIds) { + this.improvedQueryIds = improvedQueryIds; + return this; + } + + /** + * Get the recommendationReason property: Reason for this recommendation. + * + * @return the recommendationReason value. + */ + public String recommendationReason() { + return this.recommendationReason; + } + + /** + * Set the recommendationReason property: Reason for this recommendation. + * + * @param recommendationReason the recommendationReason value to set. + * @return the ObjectRecommendationResourceProperties object itself. + */ + public ObjectRecommendationResourceProperties withRecommendationReason(String recommendationReason) { + this.recommendationReason = recommendationReason; + return this; + } + + /** + * Get the recommendationType property: Type for this recommendation. + * + * @return the recommendationType value. + */ + public RecommendationTypeEnum recommendationType() { + return this.recommendationType; + } + + /** + * Set the recommendationType property: Type for this recommendation. + * + * @param recommendationType the recommendationType value to set. + * @return the ObjectRecommendationResourceProperties object itself. + */ + public ObjectRecommendationResourceProperties withRecommendationType(RecommendationTypeEnum recommendationType) { + this.recommendationType = recommendationType; + return this; + } + + /** + * Get the implementationDetails property: Stores implementation details for the recommended action. + * + * @return the implementationDetails value. + */ + public ObjectRecommendationResourcePropertiesImplementationDetails implementationDetails() { + return this.implementationDetails; + } + + /** + * Set the implementationDetails property: Stores implementation details for the recommended action. + * + * @param implementationDetails the implementationDetails value to set. + * @return the ObjectRecommendationResourceProperties object itself. + */ + public ObjectRecommendationResourceProperties + withImplementationDetails(ObjectRecommendationResourcePropertiesImplementationDetails implementationDetails) { + this.implementationDetails = implementationDetails; + return this; + } + + /** + * Get the analyzedWorkload property: Stores workload information for the recommended action. + * + * @return the analyzedWorkload value. + */ + public ObjectRecommendationResourcePropertiesAnalyzedWorkload analyzedWorkload() { + return this.analyzedWorkload; + } + + /** + * Set the analyzedWorkload property: Stores workload information for the recommended action. + * + * @param analyzedWorkload the analyzedWorkload value to set. + * @return the ObjectRecommendationResourceProperties object itself. + */ + public ObjectRecommendationResourceProperties + withAnalyzedWorkload(ObjectRecommendationResourcePropertiesAnalyzedWorkload analyzedWorkload) { + this.analyzedWorkload = analyzedWorkload; + return this; + } + + /** + * Get the estimatedImpact property: The estimated impact of this recommended action. + * + * @return the estimatedImpact value. + */ + public List estimatedImpact() { + return this.estimatedImpact; + } + + /** + * Get the details property: Stores recommendation details for the recommended action. + * + * @return the details value. + */ + public ObjectRecommendationDetails details() { + return this.details; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (implementationDetails() != null) { + implementationDetails().validate(); + } + if (analyzedWorkload() != null) { + analyzedWorkload().validate(); + } + if (estimatedImpact() != null) { + estimatedImpact().forEach(e -> e.validate()); + } + if (details() != null) { + details().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("initialRecommendedTime", + this.initialRecommendedTime == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.initialRecommendedTime)); + jsonWriter.writeStringField("lastRecommendedTime", + this.lastRecommendedTime == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastRecommendedTime)); + jsonWriter.writeNumberField("timesRecommended", this.timesRecommended); + jsonWriter.writeArrayField("improvedQueryIds", this.improvedQueryIds, + (writer, element) -> writer.writeLong(element)); + jsonWriter.writeStringField("recommendationReason", this.recommendationReason); + jsonWriter.writeStringField("recommendationType", + this.recommendationType == null ? null : this.recommendationType.toString()); + jsonWriter.writeJsonField("implementationDetails", this.implementationDetails); + jsonWriter.writeJsonField("analyzedWorkload", this.analyzedWorkload); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ObjectRecommendationResourceProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ObjectRecommendationResourceProperties 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 ObjectRecommendationResourceProperties. + */ + public static ObjectRecommendationResourceProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ObjectRecommendationResourceProperties deserializedObjectRecommendationResourceProperties + = new ObjectRecommendationResourceProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("initialRecommendedTime".equals(fieldName)) { + deserializedObjectRecommendationResourceProperties.initialRecommendedTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("lastRecommendedTime".equals(fieldName)) { + deserializedObjectRecommendationResourceProperties.lastRecommendedTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("timesRecommended".equals(fieldName)) { + deserializedObjectRecommendationResourceProperties.timesRecommended + = reader.getNullable(JsonReader::getInt); + } else if ("improvedQueryIds".equals(fieldName)) { + List improvedQueryIds = reader.readArray(reader1 -> reader1.getLong()); + deserializedObjectRecommendationResourceProperties.improvedQueryIds = improvedQueryIds; + } else if ("recommendationReason".equals(fieldName)) { + deserializedObjectRecommendationResourceProperties.recommendationReason = reader.getString(); + } else if ("recommendationType".equals(fieldName)) { + deserializedObjectRecommendationResourceProperties.recommendationType + = RecommendationTypeEnum.fromString(reader.getString()); + } else if ("implementationDetails".equals(fieldName)) { + deserializedObjectRecommendationResourceProperties.implementationDetails + = ObjectRecommendationResourcePropertiesImplementationDetails.fromJson(reader); + } else if ("analyzedWorkload".equals(fieldName)) { + deserializedObjectRecommendationResourceProperties.analyzedWorkload + = ObjectRecommendationResourcePropertiesAnalyzedWorkload.fromJson(reader); + } else if ("estimatedImpact".equals(fieldName)) { + List estimatedImpact = reader.readArray(reader1 -> ImpactRecord.fromJson(reader1)); + deserializedObjectRecommendationResourceProperties.estimatedImpact = estimatedImpact; + } else if ("details".equals(fieldName)) { + deserializedObjectRecommendationResourceProperties.details + = ObjectRecommendationDetails.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedObjectRecommendationResourceProperties; + }); + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/OperationInner.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/OperationInner.java new file mode 100644 index 000000000000..e474c919ac20 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/OperationInner.java @@ -0,0 +1,164 @@ +// Copyright (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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.postgresqlflexibleserver.models.OperationDisplay; +import com.azure.resourcemanager.postgresqlflexibleserver.models.OperationOrigin; +import java.io.IOException; +import java.util.Map; + +/** + * REST API operation definition. + */ +@Fluent +public final class OperationInner implements JsonSerializable { + /* + * The name of the operation being performed on this particular object. + */ + private String name; + + /* + * The localized display information for this particular operation or action. + */ + private OperationDisplay display; + + /* + * Indicates whether the operation is a data action + */ + private Boolean isDataAction; + + /* + * The intended executor of the operation. + */ + private OperationOrigin origin; + + /* + * Additional descriptions for the operation. + */ + private Map properties; + + /** + * Creates an instance of OperationInner class. + */ + public OperationInner() { + } + + /** + * Get the name property: The name of the operation being performed on this particular object. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the display property: The localized display information for this particular operation or action. + * + * @return the display value. + */ + public OperationDisplay display() { + return this.display; + } + + /** + * Get the isDataAction property: Indicates whether the operation is a data action. + * + * @return the isDataAction value. + */ + public Boolean isDataAction() { + return this.isDataAction; + } + + /** + * Set the isDataAction property: Indicates whether the operation is a data action. + * + * @param isDataAction the isDataAction value to set. + * @return the OperationInner object itself. + */ + public OperationInner withIsDataAction(Boolean isDataAction) { + this.isDataAction = isDataAction; + return this; + } + + /** + * Get the origin property: The intended executor of the operation. + * + * @return the origin value. + */ + public OperationOrigin origin() { + return this.origin; + } + + /** + * Get the properties property: Additional descriptions for the operation. + * + * @return the properties value. + */ + public Map properties() { + return this.properties; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (display() != null) { + 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 OperationInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationInner 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 OperationInner. + */ + public static OperationInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationInner deserializedOperationInner = new OperationInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedOperationInner.name = reader.getString(); + } else if ("display".equals(fieldName)) { + deserializedOperationInner.display = OperationDisplay.fromJson(reader); + } else if ("isDataAction".equals(fieldName)) { + deserializedOperationInner.isDataAction = reader.getNullable(JsonReader::getBoolean); + } else if ("origin".equals(fieldName)) { + deserializedOperationInner.origin = OperationOrigin.fromString(reader.getString()); + } else if ("properties".equals(fieldName)) { + Map properties = reader.readMap(reader1 -> reader1.readUntyped()); + deserializedOperationInner.properties = properties; + } else { + reader.skipChildren(); + } + } + + return deserializedOperationInner; + }); + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/QuotaUsageInner.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/QuotaUsageInner.java new file mode 100644 index 000000000000..1d4642da1c65 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/QuotaUsageInner.java @@ -0,0 +1,209 @@ +// Copyright (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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.postgresqlflexibleserver.models.NameProperty; +import java.io.IOException; + +/** + * Quota usage for flexible servers. + */ +@Fluent +public final class QuotaUsageInner implements JsonSerializable { + /* + * Name of quota usage for flexible servers + */ + private NameProperty name; + + /* + * Quota limit + */ + private Long limit; + + /* + * Quota unit + */ + private String unit; + + /* + * Current Quota usage value + */ + private Long currentValue; + + /* + * Fully qualified ARM resource Id + */ + private String id; + + /** + * Creates an instance of QuotaUsageInner class. + */ + public QuotaUsageInner() { + } + + /** + * Get the name property: Name of quota usage for flexible servers. + * + * @return the name value. + */ + public NameProperty name() { + return this.name; + } + + /** + * Set the name property: Name of quota usage for flexible servers. + * + * @param name the name value to set. + * @return the QuotaUsageInner object itself. + */ + public QuotaUsageInner withName(NameProperty name) { + this.name = name; + return this; + } + + /** + * Get the limit property: Quota limit. + * + * @return the limit value. + */ + public Long limit() { + return this.limit; + } + + /** + * Set the limit property: Quota limit. + * + * @param limit the limit value to set. + * @return the QuotaUsageInner object itself. + */ + public QuotaUsageInner withLimit(Long limit) { + this.limit = limit; + return this; + } + + /** + * Get the unit property: Quota unit. + * + * @return the unit value. + */ + public String unit() { + return this.unit; + } + + /** + * Set the unit property: Quota unit. + * + * @param unit the unit value to set. + * @return the QuotaUsageInner object itself. + */ + public QuotaUsageInner withUnit(String unit) { + this.unit = unit; + return this; + } + + /** + * Get the currentValue property: Current Quota usage value. + * + * @return the currentValue value. + */ + public Long currentValue() { + return this.currentValue; + } + + /** + * Set the currentValue property: Current Quota usage value. + * + * @param currentValue the currentValue value to set. + * @return the QuotaUsageInner object itself. + */ + public QuotaUsageInner withCurrentValue(Long currentValue) { + this.currentValue = currentValue; + return this; + } + + /** + * Get the id property: Fully qualified ARM resource Id. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Fully qualified ARM resource Id. + * + * @param id the id value to set. + * @return the QuotaUsageInner object itself. + */ + public QuotaUsageInner withId(String id) { + this.id = id; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() != null) { + name().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("name", this.name); + jsonWriter.writeNumberField("limit", this.limit); + jsonWriter.writeStringField("unit", this.unit); + jsonWriter.writeNumberField("currentValue", this.currentValue); + jsonWriter.writeStringField("id", this.id); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of QuotaUsageInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of QuotaUsageInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the QuotaUsageInner. + */ + public static QuotaUsageInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + QuotaUsageInner deserializedQuotaUsageInner = new QuotaUsageInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedQuotaUsageInner.name = NameProperty.fromJson(reader); + } else if ("limit".equals(fieldName)) { + deserializedQuotaUsageInner.limit = reader.getNullable(JsonReader::getLong); + } else if ("unit".equals(fieldName)) { + deserializedQuotaUsageInner.unit = reader.getString(); + } else if ("currentValue".equals(fieldName)) { + deserializedQuotaUsageInner.currentValue = reader.getNullable(JsonReader::getLong); + } else if ("id".equals(fieldName)) { + deserializedQuotaUsageInner.id = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedQuotaUsageInner; + }); + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/ServerInner.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/ServerInner.java index dc708a9932a1..fa7f206b7f5e 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/ServerInner.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/ServerInner.java @@ -12,6 +12,7 @@ import com.azure.json.JsonWriter; import com.azure.resourcemanager.postgresqlflexibleserver.models.AuthConfig; import com.azure.resourcemanager.postgresqlflexibleserver.models.Backup; +import com.azure.resourcemanager.postgresqlflexibleserver.models.Cluster; import com.azure.resourcemanager.postgresqlflexibleserver.models.CreateMode; import com.azure.resourcemanager.postgresqlflexibleserver.models.DataEncryption; import com.azure.resourcemanager.postgresqlflexibleserver.models.HighAvailability; @@ -607,6 +608,29 @@ public List privateEndpointConnections() { return this.innerProperties() == null ? null : this.innerProperties().privateEndpointConnections(); } + /** + * Get the cluster property: Cluster properties of a server. + * + * @return the cluster value. + */ + public Cluster cluster() { + return this.innerProperties() == null ? null : this.innerProperties().cluster(); + } + + /** + * Set the cluster property: Cluster properties of a server. + * + * @param cluster the cluster value to set. + * @return the ServerInner object itself. + */ + public ServerInner withCluster(Cluster cluster) { + if (this.innerProperties() == null) { + this.innerProperties = new ServerProperties(); + } + this.innerProperties().withCluster(cluster); + return this; + } + /** * Validates the instance. * diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/ServerProperties.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/ServerProperties.java index b1ebfc56b687..d927380c4d66 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/ServerProperties.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/ServerProperties.java @@ -12,6 +12,7 @@ import com.azure.json.JsonWriter; import com.azure.resourcemanager.postgresqlflexibleserver.models.AuthConfig; import com.azure.resourcemanager.postgresqlflexibleserver.models.Backup; +import com.azure.resourcemanager.postgresqlflexibleserver.models.Cluster; import com.azure.resourcemanager.postgresqlflexibleserver.models.CreateMode; import com.azure.resourcemanager.postgresqlflexibleserver.models.DataEncryption; import com.azure.resourcemanager.postgresqlflexibleserver.models.HighAvailability; @@ -142,6 +143,11 @@ public final class ServerProperties implements JsonSerializable privateEndpointConnections; + /* + * Cluster properties of a server. + */ + private Cluster cluster; + /** * Creates an instance of ServerProperties class. */ @@ -526,6 +532,26 @@ public List privateEndpointConnections() { return this.privateEndpointConnections; } + /** + * Get the cluster property: Cluster properties of a server. + * + * @return the cluster value. + */ + public Cluster cluster() { + return this.cluster; + } + + /** + * Set the cluster property: Cluster properties of a server. + * + * @param cluster the cluster value to set. + * @return the ServerProperties object itself. + */ + public ServerProperties withCluster(Cluster cluster) { + this.cluster = cluster; + return this; + } + /** * Validates the instance. * @@ -559,6 +585,9 @@ public void validate() { if (privateEndpointConnections() != null) { privateEndpointConnections().forEach(e -> e.validate()); } + if (cluster() != null) { + cluster().validate(); + } } /** @@ -585,6 +614,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { this.replicationRole == null ? null : this.replicationRole.toString()); jsonWriter.writeJsonField("replica", this.replica); jsonWriter.writeStringField("createMode", this.createMode == null ? null : this.createMode.toString()); + jsonWriter.writeJsonField("cluster", this.cluster); return jsonWriter.writeEndObject(); } @@ -648,6 +678,8 @@ public static ServerProperties fromJson(JsonReader jsonReader) throws IOExceptio List privateEndpointConnections = reader.readArray(reader1 -> PrivateEndpointConnectionInner.fromJson(reader1)); deserializedServerProperties.privateEndpointConnections = privateEndpointConnections; + } else if ("cluster".equals(fieldName)) { + deserializedServerProperties.cluster = Cluster.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/ServerPropertiesForUpdate.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/ServerPropertiesForUpdate.java index fc7b07dfd9cf..6bde0f0cae3a 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/ServerPropertiesForUpdate.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/ServerPropertiesForUpdate.java @@ -11,6 +11,7 @@ import com.azure.json.JsonWriter; import com.azure.resourcemanager.postgresqlflexibleserver.models.AuthConfig; import com.azure.resourcemanager.postgresqlflexibleserver.models.Backup; +import com.azure.resourcemanager.postgresqlflexibleserver.models.Cluster; import com.azure.resourcemanager.postgresqlflexibleserver.models.CreateModeForUpdate; import com.azure.resourcemanager.postgresqlflexibleserver.models.DataEncryption; import com.azure.resourcemanager.postgresqlflexibleserver.models.HighAvailability; @@ -39,7 +40,7 @@ public final class ServerPropertiesForUpdate implements JsonSerializable { + /* + * Iteration id. + */ + private String iterationId; + + /* + * Session id. + */ + private String sessionId; + + /* + * Applied configuration for the iteration. + */ + private String appliedConfiguration; + + /* + * Iteration start time. + */ + private String iterationStartTime; + + /* + * The aqr for the iteration. + */ + private String averageQueryRuntimeMs; + + /* + * The tps for the iteration. + */ + private String transactionsPerSecond; + + /** + * Creates an instance of SessionDetailsResourceInner class. + */ + public SessionDetailsResourceInner() { + } + + /** + * Get the iterationId property: Iteration id. + * + * @return the iterationId value. + */ + public String iterationId() { + return this.iterationId; + } + + /** + * Set the iterationId property: Iteration id. + * + * @param iterationId the iterationId value to set. + * @return the SessionDetailsResourceInner object itself. + */ + public SessionDetailsResourceInner withIterationId(String iterationId) { + this.iterationId = iterationId; + return this; + } + + /** + * Get the sessionId property: Session id. + * + * @return the sessionId value. + */ + public String sessionId() { + return this.sessionId; + } + + /** + * Set the sessionId property: Session id. + * + * @param sessionId the sessionId value to set. + * @return the SessionDetailsResourceInner object itself. + */ + public SessionDetailsResourceInner withSessionId(String sessionId) { + this.sessionId = sessionId; + return this; + } + + /** + * Get the appliedConfiguration property: Applied configuration for the iteration. + * + * @return the appliedConfiguration value. + */ + public String appliedConfiguration() { + return this.appliedConfiguration; + } + + /** + * Set the appliedConfiguration property: Applied configuration for the iteration. + * + * @param appliedConfiguration the appliedConfiguration value to set. + * @return the SessionDetailsResourceInner object itself. + */ + public SessionDetailsResourceInner withAppliedConfiguration(String appliedConfiguration) { + this.appliedConfiguration = appliedConfiguration; + return this; + } + + /** + * Get the iterationStartTime property: Iteration start time. + * + * @return the iterationStartTime value. + */ + public String iterationStartTime() { + return this.iterationStartTime; + } + + /** + * Set the iterationStartTime property: Iteration start time. + * + * @param iterationStartTime the iterationStartTime value to set. + * @return the SessionDetailsResourceInner object itself. + */ + public SessionDetailsResourceInner withIterationStartTime(String iterationStartTime) { + this.iterationStartTime = iterationStartTime; + return this; + } + + /** + * Get the averageQueryRuntimeMs property: The aqr for the iteration. + * + * @return the averageQueryRuntimeMs value. + */ + public String averageQueryRuntimeMs() { + return this.averageQueryRuntimeMs; + } + + /** + * Set the averageQueryRuntimeMs property: The aqr for the iteration. + * + * @param averageQueryRuntimeMs the averageQueryRuntimeMs value to set. + * @return the SessionDetailsResourceInner object itself. + */ + public SessionDetailsResourceInner withAverageQueryRuntimeMs(String averageQueryRuntimeMs) { + this.averageQueryRuntimeMs = averageQueryRuntimeMs; + return this; + } + + /** + * Get the transactionsPerSecond property: The tps for the iteration. + * + * @return the transactionsPerSecond value. + */ + public String transactionsPerSecond() { + return this.transactionsPerSecond; + } + + /** + * Set the transactionsPerSecond property: The tps for the iteration. + * + * @param transactionsPerSecond the transactionsPerSecond value to set. + * @return the SessionDetailsResourceInner object itself. + */ + public SessionDetailsResourceInner withTransactionsPerSecond(String transactionsPerSecond) { + this.transactionsPerSecond = transactionsPerSecond; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("iterationId", this.iterationId); + jsonWriter.writeStringField("sessionId", this.sessionId); + jsonWriter.writeStringField("appliedConfiguration", this.appliedConfiguration); + jsonWriter.writeStringField("iterationStartTime", this.iterationStartTime); + jsonWriter.writeStringField("averageQueryRuntimeMs", this.averageQueryRuntimeMs); + jsonWriter.writeStringField("transactionsPerSecond", this.transactionsPerSecond); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SessionDetailsResourceInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SessionDetailsResourceInner 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 SessionDetailsResourceInner. + */ + public static SessionDetailsResourceInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SessionDetailsResourceInner deserializedSessionDetailsResourceInner = new SessionDetailsResourceInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("iterationId".equals(fieldName)) { + deserializedSessionDetailsResourceInner.iterationId = reader.getString(); + } else if ("sessionId".equals(fieldName)) { + deserializedSessionDetailsResourceInner.sessionId = reader.getString(); + } else if ("appliedConfiguration".equals(fieldName)) { + deserializedSessionDetailsResourceInner.appliedConfiguration = reader.getString(); + } else if ("iterationStartTime".equals(fieldName)) { + deserializedSessionDetailsResourceInner.iterationStartTime = reader.getString(); + } else if ("averageQueryRuntimeMs".equals(fieldName)) { + deserializedSessionDetailsResourceInner.averageQueryRuntimeMs = reader.getString(); + } else if ("transactionsPerSecond".equals(fieldName)) { + deserializedSessionDetailsResourceInner.transactionsPerSecond = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSessionDetailsResourceInner; + }); + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/SessionResourceInner.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/SessionResourceInner.java new file mode 100644 index 000000000000..b7092605fd89 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/SessionResourceInner.java @@ -0,0 +1,261 @@ +// Copyright (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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Session resource properties. + */ +@Fluent +public final class SessionResourceInner implements JsonSerializable { + /* + * the tuning session start time. + */ + private String sessionStartTime; + + /* + * Session id. + */ + private String sessionId; + + /* + * The status of the tuning session. + */ + private String status; + + /* + * The pre tuning aqr. + */ + private String preTuningAqr; + + /* + * The post tuning aqr. + */ + private String postTuningAqr; + + /* + * The pre tuning tps. + */ + private String preTuningTps; + + /* + * The post tuning tps. + */ + private String postTuningTps; + + /** + * Creates an instance of SessionResourceInner class. + */ + public SessionResourceInner() { + } + + /** + * Get the sessionStartTime property: the tuning session start time. + * + * @return the sessionStartTime value. + */ + public String sessionStartTime() { + return this.sessionStartTime; + } + + /** + * Set the sessionStartTime property: the tuning session start time. + * + * @param sessionStartTime the sessionStartTime value to set. + * @return the SessionResourceInner object itself. + */ + public SessionResourceInner withSessionStartTime(String sessionStartTime) { + this.sessionStartTime = sessionStartTime; + return this; + } + + /** + * Get the sessionId property: Session id. + * + * @return the sessionId value. + */ + public String sessionId() { + return this.sessionId; + } + + /** + * Set the sessionId property: Session id. + * + * @param sessionId the sessionId value to set. + * @return the SessionResourceInner object itself. + */ + public SessionResourceInner withSessionId(String sessionId) { + this.sessionId = sessionId; + return this; + } + + /** + * Get the status property: The status of the tuning session. + * + * @return the status value. + */ + public String status() { + return this.status; + } + + /** + * Set the status property: The status of the tuning session. + * + * @param status the status value to set. + * @return the SessionResourceInner object itself. + */ + public SessionResourceInner withStatus(String status) { + this.status = status; + return this; + } + + /** + * Get the preTuningAqr property: The pre tuning aqr. + * + * @return the preTuningAqr value. + */ + public String preTuningAqr() { + return this.preTuningAqr; + } + + /** + * Set the preTuningAqr property: The pre tuning aqr. + * + * @param preTuningAqr the preTuningAqr value to set. + * @return the SessionResourceInner object itself. + */ + public SessionResourceInner withPreTuningAqr(String preTuningAqr) { + this.preTuningAqr = preTuningAqr; + return this; + } + + /** + * Get the postTuningAqr property: The post tuning aqr. + * + * @return the postTuningAqr value. + */ + public String postTuningAqr() { + return this.postTuningAqr; + } + + /** + * Set the postTuningAqr property: The post tuning aqr. + * + * @param postTuningAqr the postTuningAqr value to set. + * @return the SessionResourceInner object itself. + */ + public SessionResourceInner withPostTuningAqr(String postTuningAqr) { + this.postTuningAqr = postTuningAqr; + return this; + } + + /** + * Get the preTuningTps property: The pre tuning tps. + * + * @return the preTuningTps value. + */ + public String preTuningTps() { + return this.preTuningTps; + } + + /** + * Set the preTuningTps property: The pre tuning tps. + * + * @param preTuningTps the preTuningTps value to set. + * @return the SessionResourceInner object itself. + */ + public SessionResourceInner withPreTuningTps(String preTuningTps) { + this.preTuningTps = preTuningTps; + return this; + } + + /** + * Get the postTuningTps property: The post tuning tps. + * + * @return the postTuningTps value. + */ + public String postTuningTps() { + return this.postTuningTps; + } + + /** + * Set the postTuningTps property: The post tuning tps. + * + * @param postTuningTps the postTuningTps value to set. + * @return the SessionResourceInner object itself. + */ + public SessionResourceInner withPostTuningTps(String postTuningTps) { + this.postTuningTps = postTuningTps; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("sessionStartTime", this.sessionStartTime); + jsonWriter.writeStringField("sessionId", this.sessionId); + jsonWriter.writeStringField("status", this.status); + jsonWriter.writeStringField("preTuningAqr", this.preTuningAqr); + jsonWriter.writeStringField("postTuningAqr", this.postTuningAqr); + jsonWriter.writeStringField("preTuningTps", this.preTuningTps); + jsonWriter.writeStringField("postTuningTps", this.postTuningTps); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SessionResourceInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SessionResourceInner 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 SessionResourceInner. + */ + public static SessionResourceInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SessionResourceInner deserializedSessionResourceInner = new SessionResourceInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("sessionStartTime".equals(fieldName)) { + deserializedSessionResourceInner.sessionStartTime = reader.getString(); + } else if ("sessionId".equals(fieldName)) { + deserializedSessionResourceInner.sessionId = reader.getString(); + } else if ("status".equals(fieldName)) { + deserializedSessionResourceInner.status = reader.getString(); + } else if ("preTuningAqr".equals(fieldName)) { + deserializedSessionResourceInner.preTuningAqr = reader.getString(); + } else if ("postTuningAqr".equals(fieldName)) { + deserializedSessionResourceInner.postTuningAqr = reader.getString(); + } else if ("preTuningTps".equals(fieldName)) { + deserializedSessionResourceInner.preTuningTps = reader.getString(); + } else if ("postTuningTps".equals(fieldName)) { + deserializedSessionResourceInner.postTuningTps = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSessionResourceInner; + }); + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/TuningOptionsResourceInner.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/TuningOptionsResourceInner.java new file mode 100644 index 000000000000..9bc54208f8cb --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/TuningOptionsResourceInner.java @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.fluent.models; + +import com.azure.core.annotation.Immutable; +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 java.io.IOException; + +/** + * Stores property that features impact on some metric if this recommended action is applied. + */ +@Immutable +public final class TuningOptionsResourceInner extends ProxyResource { + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of TuningOptionsResourceInner class. + */ + public TuningOptionsResourceInner() { + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TuningOptionsResourceInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TuningOptionsResourceInner 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 TuningOptionsResourceInner. + */ + public static TuningOptionsResourceInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TuningOptionsResourceInner deserializedTuningOptionsResourceInner = new TuningOptionsResourceInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedTuningOptionsResourceInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedTuningOptionsResourceInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedTuningOptionsResourceInner.type = reader.getString(); + } else if ("systemData".equals(fieldName)) { + deserializedTuningOptionsResourceInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedTuningOptionsResourceInner; + }); + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/AdministratorsClientImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/AdministratorsClientImpl.java index a03482779ebb..9f09367eefb9 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 @@ -124,11 +124,11 @@ Mono> listByServerNext( * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @param objectId Guid of the objectId for the administrator. - * @param parameters The required parameters for adding an active directory administrator for a server. + * @param parameters The required parameters for adding an Microsoft Entra Administrator for a server. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents an Active Directory administrator along with {@link Response} on successful completion of + * @return represents an Microsoft Entra Administrator along with {@link Response} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -170,12 +170,12 @@ public Mono>> createWithResponseAsync(String resourceG * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @param objectId Guid of the objectId for the administrator. - * @param parameters The required parameters for adding an active directory administrator for a server. + * @param parameters The required parameters for adding an Microsoft Entra Administrator for a server. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents an Active Directory administrator along with {@link Response} on successful completion of + * @return represents an Microsoft Entra Administrator along with {@link Response} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -216,11 +216,11 @@ private Mono>> createWithResponseAsync(String resource * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @param objectId Guid of the objectId for the administrator. - * @param parameters The required parameters for adding an active directory administrator for a server. + * @param parameters The required parameters for adding an Microsoft Entra Administrator for a server. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of represents an Active Directory administrator. + * @return the {@link PollerFlux} for polling of represents an Microsoft Entra Administrator. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public PollerFlux, ActiveDirectoryAdministratorInner> @@ -239,12 +239,12 @@ private Mono>> createWithResponseAsync(String resource * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @param objectId Guid of the objectId for the administrator. - * @param parameters The required parameters for adding an active directory administrator for a server. + * @param parameters The required parameters for adding an Microsoft Entra Administrator for a server. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of represents an Active Directory administrator. + * @return the {@link PollerFlux} for polling of represents an Microsoft Entra Administrator. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, ActiveDirectoryAdministratorInner> @@ -264,11 +264,11 @@ private Mono>> createWithResponseAsync(String resource * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @param objectId Guid of the objectId for the administrator. - * @param parameters The required parameters for adding an active directory administrator for a server. + * @param parameters The required parameters for adding an Microsoft Entra Administrator for a server. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of represents an Active Directory administrator. + * @return the {@link SyncPoller} for polling of represents an Microsoft Entra Administrator. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, ActiveDirectoryAdministratorInner> beginCreate( @@ -282,12 +282,12 @@ public SyncPoller, ActiveDirectory * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @param objectId Guid of the objectId for the administrator. - * @param parameters The required parameters for adding an active directory administrator for a server. + * @param parameters The required parameters for adding an Microsoft Entra Administrator for a server. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of represents an Active Directory administrator. + * @return the {@link SyncPoller} for polling of represents an Microsoft Entra Administrator. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, ActiveDirectoryAdministratorInner> beginCreate( @@ -302,11 +302,11 @@ public SyncPoller, ActiveDirectory * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @param objectId Guid of the objectId for the administrator. - * @param parameters The required parameters for adding an active directory administrator for a server. + * @param parameters The required parameters for adding an Microsoft Entra Administrator for a server. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents an Active Directory administrator on successful completion of {@link Mono}. + * @return represents an Microsoft Entra Administrator on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono createAsync(String resourceGroupName, String serverName, @@ -321,12 +321,12 @@ public Mono createAsync(String resourceGroupN * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @param objectId Guid of the objectId for the administrator. - * @param parameters The required parameters for adding an active directory administrator for a server. + * @param parameters The required parameters for adding an Microsoft Entra Administrator for a server. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents an Active Directory administrator on successful completion of {@link Mono}. + * @return represents an Microsoft Entra Administrator on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createAsync(String resourceGroupName, String serverName, @@ -341,11 +341,11 @@ private Mono createAsync(String resourceGroup * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @param objectId Guid of the objectId for the administrator. - * @param parameters The required parameters for adding an active directory administrator for a server. + * @param parameters The required parameters for adding an Microsoft Entra Administrator for a server. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents an Active Directory administrator. + * @return represents an Microsoft Entra Administrator. */ @ServiceMethod(returns = ReturnType.SINGLE) public ActiveDirectoryAdministratorInner create(String resourceGroupName, String serverName, String objectId, @@ -359,12 +359,12 @@ public ActiveDirectoryAdministratorInner create(String resourceGroupName, String * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @param objectId Guid of the objectId for the administrator. - * @param parameters The required parameters for adding an active directory administrator for a server. + * @param parameters The required parameters for adding an Microsoft Entra Administrator for a server. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents an Active Directory administrator. + * @return represents an Microsoft Entra Administrator. */ @ServiceMethod(returns = ReturnType.SINGLE) public ActiveDirectoryAdministratorInner create(String resourceGroupName, String serverName, String objectId, @@ -373,7 +373,7 @@ public ActiveDirectoryAdministratorInner create(String resourceGroupName, String } /** - * Deletes an Active Directory Administrator associated with the server. + * Deletes an Microsoft Entra Administrator associated with the server. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. @@ -412,7 +412,7 @@ public Mono>> deleteWithResponseAsync(String resourceG } /** - * Deletes an Active Directory Administrator associated with the server. + * Deletes an Microsoft Entra Administrator associated with the server. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. @@ -451,7 +451,7 @@ private Mono>> deleteWithResponseAsync(String resource } /** - * Deletes an Active Directory Administrator associated with the server. + * Deletes an Microsoft Entra Administrator associated with the server. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. @@ -470,7 +470,7 @@ public PollerFlux, Void> beginDeleteAsync(String resourceGroupN } /** - * Deletes an Active Directory Administrator associated with the server. + * Deletes an Microsoft Entra Administrator associated with the server. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. @@ -492,7 +492,7 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup } /** - * Deletes an Active Directory Administrator associated with the server. + * Deletes an Microsoft Entra Administrator associated with the server. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. @@ -509,7 +509,7 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, } /** - * Deletes an Active Directory Administrator associated with the server. + * Deletes an Microsoft Entra Administrator associated with the server. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. @@ -527,7 +527,7 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, } /** - * Deletes an Active Directory Administrator associated with the server. + * Deletes an Microsoft Entra Administrator associated with the server. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. @@ -544,7 +544,7 @@ public Mono deleteAsync(String resourceGroupName, String serverName, Strin } /** - * Deletes an Active Directory Administrator associated with the server. + * Deletes an Microsoft Entra Administrator associated with the server. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. @@ -562,7 +562,7 @@ private Mono deleteAsync(String resourceGroupName, String serverName, Stri } /** - * Deletes an Active Directory Administrator associated with the server. + * Deletes an Microsoft Entra Administrator associated with the server. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. @@ -577,7 +577,7 @@ public void delete(String resourceGroupName, String serverName, String objectId) } /** - * Deletes an Active Directory Administrator associated with the server. + * Deletes an Microsoft Entra Administrator associated with the server. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. @@ -730,7 +730,7 @@ public ActiveDirectoryAdministratorInner get(String resourceGroupName, String se * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of active directory administrators along with {@link PagedResponse} on successful completion of + * @return a list of Microsoft Entra Administrators along with {@link PagedResponse} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -769,7 +769,7 @@ private Mono> listByServerSingl * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of active directory administrators along with {@link PagedResponse} on successful completion of + * @return a list of Microsoft Entra Administrators along with {@link PagedResponse} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -807,7 +807,7 @@ private Mono> listByServerSingl * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of active directory administrators as paginated response with {@link PagedFlux}. + * @return a list of Microsoft Entra Administrators as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedFlux listByServerAsync(String resourceGroupName, String serverName) { @@ -824,7 +824,7 @@ public PagedFlux listByServerAsync(String res * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of active directory administrators as paginated response with {@link PagedFlux}. + * @return a list of Microsoft Entra Administrators as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByServerAsync(String resourceGroupName, String serverName, @@ -841,7 +841,7 @@ private PagedFlux listByServerAsync(String re * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of active directory administrators as paginated response with {@link PagedIterable}. + * @return a list of Microsoft Entra Administrators as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByServer(String resourceGroupName, String serverName) { @@ -857,7 +857,7 @@ public PagedIterable listByServer(String reso * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of active directory administrators as paginated response with {@link PagedIterable}. + * @return a list of Microsoft Entra Administrators as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByServer(String resourceGroupName, String serverName, @@ -872,7 +872,7 @@ public PagedIterable listByServer(String reso * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of active directory administrators along with {@link PagedResponse} on successful completion of + * @return a list of Microsoft Entra Administrators along with {@link PagedResponse} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -900,7 +900,7 @@ private Mono> listByServerNextS * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of active directory administrators along with {@link PagedResponse} on successful completion of + * @return a list of Microsoft Entra Administrators along with {@link PagedResponse} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) 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 ae6f7cefa57b..16dbb57ae0e8 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/FlexibleServerCapabilityImpl.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/FlexibleServerCapabilityImpl.java @@ -15,6 +15,7 @@ import com.azure.resourcemanager.postgresqlflexibleserver.models.RestrictedEnum; import com.azure.resourcemanager.postgresqlflexibleserver.models.ServerVersionCapability; import com.azure.resourcemanager.postgresqlflexibleserver.models.StorageAutoGrowthSupportedEnum; +import com.azure.resourcemanager.postgresqlflexibleserver.models.SupportedFeature; import com.azure.resourcemanager.postgresqlflexibleserver.models.ZoneRedundantHaAndGeoBackupSupportedEnum; import com.azure.resourcemanager.postgresqlflexibleserver.models.ZoneRedundantHaSupportedEnum; import java.util.Collections; @@ -61,6 +62,15 @@ public List supportedServerVersions() { } } + public List supportedFeatures() { + List inner = this.innerModel().supportedFeatures(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + public FastProvisioningSupportedEnum fastProvisioningSupported() { return this.innerModel().fastProvisioningSupported(); } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/ObjectRecommendationResourceImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/ObjectRecommendationResourceImpl.java new file mode 100644 index 000000000000..ddd55821e424 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/ObjectRecommendationResourceImpl.java @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.ObjectRecommendationResourceInner; +import com.azure.resourcemanager.postgresqlflexibleserver.models.ImpactRecord; +import com.azure.resourcemanager.postgresqlflexibleserver.models.ObjectRecommendationDetails; +import com.azure.resourcemanager.postgresqlflexibleserver.models.ObjectRecommendationResource; +import com.azure.resourcemanager.postgresqlflexibleserver.models.ObjectRecommendationResourcePropertiesAnalyzedWorkload; +import com.azure.resourcemanager.postgresqlflexibleserver.models.ObjectRecommendationResourcePropertiesImplementationDetails; +import com.azure.resourcemanager.postgresqlflexibleserver.models.RecommendationTypeEnum; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; + +public final class ObjectRecommendationResourceImpl implements ObjectRecommendationResource { + private ObjectRecommendationResourceInner innerObject; + + private final com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager; + + ObjectRecommendationResourceImpl(ObjectRecommendationResourceInner innerObject, + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public OffsetDateTime initialRecommendedTime() { + return this.innerModel().initialRecommendedTime(); + } + + public OffsetDateTime lastRecommendedTime() { + return this.innerModel().lastRecommendedTime(); + } + + public Integer timesRecommended() { + return this.innerModel().timesRecommended(); + } + + public List improvedQueryIds() { + List inner = this.innerModel().improvedQueryIds(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String recommendationReason() { + return this.innerModel().recommendationReason(); + } + + public RecommendationTypeEnum recommendationType() { + return this.innerModel().recommendationType(); + } + + public ObjectRecommendationResourcePropertiesImplementationDetails implementationDetails() { + return this.innerModel().implementationDetails(); + } + + public ObjectRecommendationResourcePropertiesAnalyzedWorkload analyzedWorkload() { + return this.innerModel().analyzedWorkload(); + } + + public List estimatedImpact() { + List inner = this.innerModel().estimatedImpact(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ObjectRecommendationDetails details() { + return this.innerModel().details(); + } + + public ObjectRecommendationResourceInner 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/OperationImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/OperationImpl.java new file mode 100644 index 000000000000..35fb8ee9e6cb --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/OperationImpl.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.implementation; + +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.OperationInner; +import com.azure.resourcemanager.postgresqlflexibleserver.models.Operation; +import com.azure.resourcemanager.postgresqlflexibleserver.models.OperationDisplay; +import com.azure.resourcemanager.postgresqlflexibleserver.models.OperationOrigin; +import java.util.Collections; +import java.util.Map; + +public final class OperationImpl implements Operation { + private OperationInner innerObject; + + private final com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager; + + OperationImpl(OperationInner innerObject, + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String name() { + return this.innerModel().name(); + } + + public OperationDisplay display() { + return this.innerModel().display(); + } + + public Boolean isDataAction() { + return this.innerModel().isDataAction(); + } + + public OperationOrigin origin() { + return this.innerModel().origin(); + } + + public Map properties() { + Map inner = this.innerModel().properties(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public OperationInner 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/OperationsClientImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/OperationsClientImpl.java index d0dc22382967..27220e2a09b4 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 @@ -10,18 +10,24 @@ 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.OperationsClient; -import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.OperationListResultInner; +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.OperationInner; +import com.azure.resourcemanager.postgresqlflexibleserver.models.OperationListResult; import reactor.core.publisher.Mono; /** @@ -60,8 +66,15 @@ public interface OperationsService { @Get("/providers/Microsoft.DBforPostgreSQL/operations") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, + Mono> list(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @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); } /** @@ -69,11 +82,11 @@ Mono> list(@HostParam("$host") String endpoin * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of resource provider operations along with {@link Response} on successful completion of + * @return a list of resource provider operations along with {@link PagedResponse} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listWithResponseAsync() { + private Mono> listSinglePageAsync() { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -82,6 +95,8 @@ public Mono> listWithResponseAsync() { return FluxUtil .withContext( context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), 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())); } @@ -92,18 +107,20 @@ public Mono> listWithResponseAsync() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of resource provider operations along with {@link Response} on successful completion of + * @return a list of resource provider operations along with {@link PagedResponse} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWithResponseAsync(Context context) { + private Mono> listSinglePageAsync(Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context); + return service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** @@ -111,11 +128,11 @@ private Mono> listWithResponseAsync(Context c * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of resource provider operations on successful completion of {@link Mono}. + * @return a list of resource provider operations as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono listAsync() { - return listWithResponseAsync().flatMap(res -> Mono.justOrEmpty(res.getValue())); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); } /** @@ -125,11 +142,12 @@ public Mono listAsync() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of resource provider operations along with {@link Response}. + * @return a list of resource provider operations as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listWithResponse(Context context) { - return listWithResponseAsync(context).block(); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listNextSinglePageAsync(nextLink, context)); } /** @@ -137,10 +155,77 @@ public Response listWithResponse(Context context) { * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of resource provider operations. + * @return a list of resource provider operations as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Lists all of the available REST API operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of resource provider operations as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of resource provider operations along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of resource provider operations along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public OperationListResultInner list() { - return listWithResponse(Context.NONE).getValue(); + 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/OperationsImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/OperationsImpl.java index 31c5934e5b80..fd1c7177f3a7 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 @@ -4,13 +4,12 @@ package com.azure.resourcemanager.postgresqlflexibleserver.implementation; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; +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.OperationsClient; -import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.OperationListResultInner; -import com.azure.resourcemanager.postgresqlflexibleserver.models.OperationListResult; +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.OperationInner; +import com.azure.resourcemanager.postgresqlflexibleserver.models.Operation; import com.azure.resourcemanager.postgresqlflexibleserver.models.Operations; public final class OperationsImpl implements Operations { @@ -26,23 +25,14 @@ public OperationsImpl(OperationsClient innerClient, this.serviceManager = serviceManager; } - public Response listWithResponse(Context context) { - Response inner = this.serviceClient().listWithResponse(context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new OperationListResultImpl(inner.getValue(), this.manager())); - } else { - return null; - } + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); } - public OperationListResult list() { - OperationListResultInner inner = this.serviceClient().list(); - if (inner != null) { - return new OperationListResultImpl(inner, this.manager()); - } else { - return null; - } + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); } private OperationsClient serviceClient() { diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/PostgreSqlManagementClientImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/PostgreSqlManagementClientImpl.java index e7154902c1ca..9be25623277f 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/PostgreSqlManagementClientImpl.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/PostgreSqlManagementClientImpl.java @@ -41,11 +41,15 @@ import com.azure.resourcemanager.postgresqlflexibleserver.fluent.PrivateEndpointConnectionOperationsClient; import com.azure.resourcemanager.postgresqlflexibleserver.fluent.PrivateEndpointConnectionsClient; import com.azure.resourcemanager.postgresqlflexibleserver.fluent.PrivateLinkResourcesClient; +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.QuotaUsagesClient; import com.azure.resourcemanager.postgresqlflexibleserver.fluent.ReplicasClient; import com.azure.resourcemanager.postgresqlflexibleserver.fluent.ResourceProvidersClient; import com.azure.resourcemanager.postgresqlflexibleserver.fluent.ServerCapabilitiesClient; import com.azure.resourcemanager.postgresqlflexibleserver.fluent.ServerThreatProtectionSettingsClient; import com.azure.resourcemanager.postgresqlflexibleserver.fluent.ServersClient; +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.TuningConfigurationsClient; +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.TuningIndexesClient; +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.TuningOptionsClient; import com.azure.resourcemanager.postgresqlflexibleserver.fluent.VirtualEndpointsClient; import com.azure.resourcemanager.postgresqlflexibleserver.fluent.VirtualNetworkSubnetUsagesClient; import java.io.IOException; @@ -412,6 +416,20 @@ public PrivateLinkResourcesClient getPrivateLinkResources() { return this.privateLinkResources; } + /** + * The QuotaUsagesClient object to access its operations. + */ + private final QuotaUsagesClient quotaUsages; + + /** + * Gets the QuotaUsagesClient object to access its operations. + * + * @return the QuotaUsagesClient object. + */ + public QuotaUsagesClient getQuotaUsages() { + return this.quotaUsages; + } + /** * The ReplicasClient object to access its operations. */ @@ -454,6 +472,48 @@ public ServerThreatProtectionSettingsClient getServerThreatProtectionSettings() return this.serverThreatProtectionSettings; } + /** + * The TuningOptionsClient object to access its operations. + */ + private final TuningOptionsClient tuningOptions; + + /** + * Gets the TuningOptionsClient object to access its operations. + * + * @return the TuningOptionsClient object. + */ + public TuningOptionsClient getTuningOptions() { + return this.tuningOptions; + } + + /** + * The TuningIndexesClient object to access its operations. + */ + private final TuningIndexesClient tuningIndexes; + + /** + * Gets the TuningIndexesClient object to access its operations. + * + * @return the TuningIndexesClient object. + */ + public TuningIndexesClient getTuningIndexes() { + return this.tuningIndexes; + } + + /** + * The TuningConfigurationsClient object to access its operations. + */ + private final TuningConfigurationsClient tuningConfigurations; + + /** + * Gets the TuningConfigurationsClient object to access its operations. + * + * @return the TuningConfigurationsClient object. + */ + public TuningConfigurationsClient getTuningConfigurations() { + return this.tuningConfigurations; + } + /** * The VirtualEndpointsClient object to access its operations. */ @@ -499,7 +559,7 @@ public VirtualNetworkSubnetUsagesClient getVirtualNetworkSubnetUsages() { this.defaultPollInterval = defaultPollInterval; this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.apiVersion = "2024-08-01"; + this.apiVersion = "2025-01-01-preview"; this.administrators = new AdministratorsClientImpl(this); this.backups = new BackupsClientImpl(this); this.locationBasedCapabilities = new LocationBasedCapabilitiesClientImpl(this); @@ -519,9 +579,13 @@ public VirtualNetworkSubnetUsagesClient getVirtualNetworkSubnetUsages() { this.privateEndpointConnections = new PrivateEndpointConnectionsClientImpl(this); this.privateEndpointConnectionOperations = new PrivateEndpointConnectionOperationsClientImpl(this); this.privateLinkResources = new PrivateLinkResourcesClientImpl(this); + this.quotaUsages = new QuotaUsagesClientImpl(this); this.replicas = new ReplicasClientImpl(this); this.logFiles = new LogFilesClientImpl(this); this.serverThreatProtectionSettings = new ServerThreatProtectionSettingsClientImpl(this); + this.tuningOptions = new TuningOptionsClientImpl(this); + this.tuningIndexes = new TuningIndexesClientImpl(this); + this.tuningConfigurations = new TuningConfigurationsClientImpl(this); this.virtualEndpoints = new VirtualEndpointsClientImpl(this); this.virtualNetworkSubnetUsages = new VirtualNetworkSubnetUsagesClientImpl(this); } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/OperationListResultImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/QuotaUsageImpl.java similarity index 56% rename from sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/OperationListResultImpl.java rename to sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/QuotaUsageImpl.java index 72b44ea76a16..7e4b096d6581 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/QuotaUsageImpl.java @@ -4,37 +4,42 @@ package com.azure.resourcemanager.postgresqlflexibleserver.implementation; -import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.OperationListResultInner; -import com.azure.resourcemanager.postgresqlflexibleserver.models.Operation; -import com.azure.resourcemanager.postgresqlflexibleserver.models.OperationListResult; -import java.util.Collections; -import java.util.List; +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 OperationListResultImpl implements OperationListResult { - private OperationListResultInner innerObject; +public final class QuotaUsageImpl implements QuotaUsage { + private QuotaUsageInner innerObject; private final com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager; - OperationListResultImpl(OperationListResultInner innerObject, + QuotaUsageImpl(QuotaUsageInner innerObject, com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } - public List value() { - List inner = this.innerModel().value(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } + public NameProperty name() { + return this.innerModel().name(); } - public String nextLink() { - return this.innerModel().nextLink(); + public Long limit() { + return this.innerModel().limit(); } - public OperationListResultInner innerModel() { + 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; } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/QuotaUsagesClientImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/QuotaUsagesClientImpl.java new file mode 100644 index 000000000000..86be3cf855b6 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/QuotaUsagesClientImpl.java @@ -0,0 +1,259 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.QuotaUsagesClient; +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.QuotaUsageInner; +import com.azure.resourcemanager.postgresqlflexibleserver.models.QuotaUsagesListResult; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in QuotaUsagesClient. + */ +public final class QuotaUsagesClientImpl implements QuotaUsagesClient { + /** + * The proxy service used to perform REST calls. + */ + private final QuotaUsagesService service; + + /** + * The service client containing this operation class. + */ + private final PostgreSqlManagementClientImpl client; + + /** + * Initializes an instance of QuotaUsagesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + QuotaUsagesClientImpl(PostgreSqlManagementClientImpl client) { + this.service + = RestProxy.create(QuotaUsagesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for PostgreSqlManagementClientQuotaUsages to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "PostgreSqlManagement") + public interface QuotaUsagesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.DBforPostgreSQL/locations/{locationName}/resourceType/flexibleServers/usages") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("locationName") String locationName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + } + + /** + * Get quota usages at specified location in a given subscription. + * + * @param locationName The name of the location. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return quota usages at specified location in a given subscription along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String locationName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (locationName == null) { + return Mono.error(new IllegalArgumentException("Parameter locationName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), locationName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get quota usages at specified location in a given subscription. + * + * @param locationName The name of the location. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return quota usages at specified location in a given subscription along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String locationName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (locationName == null) { + return Mono.error(new IllegalArgumentException("Parameter locationName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), locationName, + accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get quota usages at specified location in a given subscription. + * + * @param locationName The name of the location. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return quota usages at specified location in a given subscription as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAsync(String locationName) { + return new PagedFlux<>(() -> listSinglePageAsync(locationName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Get quota usages at specified location in a given subscription. + * + * @param locationName The name of the location. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return quota usages at specified location in a given subscription as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String locationName, Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(locationName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Get quota usages at specified location in a given subscription. + * + * @param locationName The name of the location. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return quota usages at specified location in a given subscription as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String locationName) { + return new PagedIterable<>(listAsync(locationName)); + } + + /** + * Get quota usages at specified location in a given subscription. + * + * @param locationName The name of the location. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return quota usages at specified location in a given subscription as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String locationName, Context context) { + return new PagedIterable<>(listAsync(locationName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return capability for the PostgreSQL server along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return capability for the PostgreSQL server along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/QuotaUsagesImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/QuotaUsagesImpl.java new file mode 100644 index 000000000000..47d5bef6e5f6 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/QuotaUsagesImpl.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.QuotaUsagesClient; +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.QuotaUsageInner; +import com.azure.resourcemanager.postgresqlflexibleserver.models.QuotaUsage; +import com.azure.resourcemanager.postgresqlflexibleserver.models.QuotaUsages; + +public final class QuotaUsagesImpl implements QuotaUsages { + private static final ClientLogger LOGGER = new ClientLogger(QuotaUsagesImpl.class); + + private final QuotaUsagesClient innerClient; + + private final com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager; + + public QuotaUsagesImpl(QuotaUsagesClient innerClient, + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String locationName) { + PagedIterable inner = this.serviceClient().list(locationName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new QuotaUsageImpl(inner1, this.manager())); + } + + public PagedIterable list(String locationName, Context context) { + PagedIterable inner = this.serviceClient().list(locationName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new QuotaUsageImpl(inner1, this.manager())); + } + + private QuotaUsagesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/ServerImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/ServerImpl.java index 684673b9cb70..1abda05900b2 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/ServerImpl.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/ServerImpl.java @@ -11,6 +11,7 @@ import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.ServerInner; import com.azure.resourcemanager.postgresqlflexibleserver.models.AuthConfig; import com.azure.resourcemanager.postgresqlflexibleserver.models.Backup; +import com.azure.resourcemanager.postgresqlflexibleserver.models.Cluster; import com.azure.resourcemanager.postgresqlflexibleserver.models.CreateMode; import com.azure.resourcemanager.postgresqlflexibleserver.models.CreateModeForUpdate; import com.azure.resourcemanager.postgresqlflexibleserver.models.DataEncryption; @@ -167,6 +168,10 @@ public List privateEndpointConnections() { } } + public Cluster cluster() { + return this.innerModel().cluster(); + } + public Region region() { return Region.fromName(this.regionName()); } @@ -445,6 +450,16 @@ public ServerImpl withCreateMode(CreateMode createMode) { return this; } + public ServerImpl withCluster(Cluster cluster) { + if (isInCreateMode()) { + this.innerModel().withCluster(cluster); + return this; + } else { + this.updateParameters.withCluster(cluster); + return this; + } + } + public ServerImpl withMaintenanceWindow(MaintenanceWindow maintenanceWindow) { this.updateParameters.withMaintenanceWindow(maintenanceWindow); return this; diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/SessionDetailsResourceImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/SessionDetailsResourceImpl.java new file mode 100644 index 000000000000..be90209f3940 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/SessionDetailsResourceImpl.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.implementation; + +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.SessionDetailsResourceInner; +import com.azure.resourcemanager.postgresqlflexibleserver.models.SessionDetailsResource; + +public final class SessionDetailsResourceImpl implements SessionDetailsResource { + private SessionDetailsResourceInner innerObject; + + private final com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager; + + SessionDetailsResourceImpl(SessionDetailsResourceInner innerObject, + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String iterationId() { + return this.innerModel().iterationId(); + } + + public String sessionId() { + return this.innerModel().sessionId(); + } + + public String appliedConfiguration() { + return this.innerModel().appliedConfiguration(); + } + + public String iterationStartTime() { + return this.innerModel().iterationStartTime(); + } + + public String averageQueryRuntimeMs() { + return this.innerModel().averageQueryRuntimeMs(); + } + + public String transactionsPerSecond() { + return this.innerModel().transactionsPerSecond(); + } + + public SessionDetailsResourceInner 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/SessionResourceImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/SessionResourceImpl.java new file mode 100644 index 000000000000..81ca8c158b36 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/SessionResourceImpl.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.implementation; + +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.SessionResourceInner; +import com.azure.resourcemanager.postgresqlflexibleserver.models.SessionResource; + +public final class SessionResourceImpl implements SessionResource { + private SessionResourceInner innerObject; + + private final com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager; + + SessionResourceImpl(SessionResourceInner innerObject, + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String sessionStartTime() { + return this.innerModel().sessionStartTime(); + } + + public String sessionId() { + return this.innerModel().sessionId(); + } + + public String status() { + return this.innerModel().status(); + } + + public String preTuningAqr() { + return this.innerModel().preTuningAqr(); + } + + public String postTuningAqr() { + return this.innerModel().postTuningAqr(); + } + + public String preTuningTps() { + return this.innerModel().preTuningTps(); + } + + public String postTuningTps() { + return this.innerModel().postTuningTps(); + } + + public SessionResourceInner 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/TuningConfigurationsClientImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/TuningConfigurationsClientImpl.java new file mode 100644 index 000000000000..45eccb7bd307 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/TuningConfigurationsClientImpl.java @@ -0,0 +1,1510 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.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.TuningConfigurationsClient; +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.SessionDetailsResourceInner; +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.SessionResourceInner; +import com.azure.resourcemanager.postgresqlflexibleserver.models.ConfigTuningRequestParameter; +import com.azure.resourcemanager.postgresqlflexibleserver.models.SessionDetailsListResult; +import com.azure.resourcemanager.postgresqlflexibleserver.models.SessionsListResult; +import com.azure.resourcemanager.postgresqlflexibleserver.models.TuningOptionEnum; +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 TuningConfigurationsClient. + */ +public final class TuningConfigurationsClientImpl implements TuningConfigurationsClient { + /** + * The proxy service used to perform REST calls. + */ + private final TuningConfigurationsService service; + + /** + * The service client containing this operation class. + */ + private final PostgreSqlManagementClientImpl client; + + /** + * Initializes an instance of TuningConfigurationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + TuningConfigurationsClientImpl(PostgreSqlManagementClientImpl client) { + this.service = RestProxy.create(TuningConfigurationsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for PostgreSqlManagementClientTuningConfigurations to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "PostgreSqlManagement") + public interface TuningConfigurationsService { + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/tuningOptions/{tuningOption}/enable") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> enable(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("serverName") String serverName, + @PathParam("tuningOption") TuningOptionEnum tuningOption, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/tuningOptions/{tuningOption}/disable") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> disable(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("serverName") String serverName, + @PathParam("tuningOption") TuningOptionEnum tuningOption, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/tuningOptions/{tuningOption}/startSession") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> startSession(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("serverName") String serverName, + @PathParam("tuningOption") TuningOptionEnum tuningOption, + @BodyParam("application/json") ConfigTuningRequestParameter configTuningRequest, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/tuningOptions/{tuningOption}/stopSession") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> stopSession(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("serverName") String serverName, + @PathParam("tuningOption") TuningOptionEnum tuningOption, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/tuningOptions/{tuningOption}/sessions") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listSessions(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("serverName") String serverName, + @PathParam("tuningOption") TuningOptionEnum tuningOption, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/tuningOptions/{tuningOption}/sessionDetails") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listSessionDetails(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("serverName") String serverName, + @PathParam("tuningOption") TuningOptionEnum tuningOption, @QueryParam("sessionId") String sessionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listSessionsNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listSessionDetailsNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Enables the config tuning. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> enableWithResponseAsync(String resourceGroupName, String serverName, + TuningOptionEnum tuningOption) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serverName == null) { + return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); + } + if (tuningOption == null) { + return Mono.error(new IllegalArgumentException("Parameter tuningOption is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.enable(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serverName, tuningOption, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Enables the config tuning. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> enableWithResponseAsync(String resourceGroupName, String serverName, + TuningOptionEnum tuningOption, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serverName == null) { + return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); + } + if (tuningOption == null) { + return Mono.error(new IllegalArgumentException("Parameter tuningOption is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.enable(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, serverName, tuningOption, accept, context); + } + + /** + * Enables the config tuning. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux, Void> beginEnableAsync(String resourceGroupName, String serverName, + TuningOptionEnum tuningOption) { + Mono>> mono = enableWithResponseAsync(resourceGroupName, serverName, tuningOption); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Enables the config tuning. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginEnableAsync(String resourceGroupName, String serverName, + TuningOptionEnum tuningOption, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = enableWithResponseAsync(resourceGroupName, serverName, tuningOption, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Enables the config tuning. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginEnable(String resourceGroupName, String serverName, + TuningOptionEnum tuningOption) { + return this.beginEnableAsync(resourceGroupName, serverName, tuningOption).getSyncPoller(); + } + + /** + * Enables the config tuning. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginEnable(String resourceGroupName, String serverName, + TuningOptionEnum tuningOption, Context context) { + return this.beginEnableAsync(resourceGroupName, serverName, tuningOption, context).getSyncPoller(); + } + + /** + * Enables the config tuning. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono enableAsync(String resourceGroupName, String serverName, TuningOptionEnum tuningOption) { + return beginEnableAsync(resourceGroupName, serverName, tuningOption).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Enables the config tuning. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono enableAsync(String resourceGroupName, String serverName, TuningOptionEnum tuningOption, + Context context) { + return beginEnableAsync(resourceGroupName, serverName, tuningOption, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Enables the config tuning. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void enable(String resourceGroupName, String serverName, TuningOptionEnum tuningOption) { + enableAsync(resourceGroupName, serverName, tuningOption).block(); + } + + /** + * Enables the config tuning. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void enable(String resourceGroupName, String serverName, TuningOptionEnum tuningOption, Context context) { + enableAsync(resourceGroupName, serverName, tuningOption, context).block(); + } + + /** + * Disables the config tuning. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> disableWithResponseAsync(String resourceGroupName, String serverName, + TuningOptionEnum tuningOption) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serverName == null) { + return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); + } + if (tuningOption == null) { + return Mono.error(new IllegalArgumentException("Parameter tuningOption is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.disable(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serverName, tuningOption, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Disables the config tuning. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> disableWithResponseAsync(String resourceGroupName, String serverName, + TuningOptionEnum tuningOption, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serverName == null) { + return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); + } + if (tuningOption == null) { + return Mono.error(new IllegalArgumentException("Parameter tuningOption is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.disable(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, serverName, tuningOption, accept, context); + } + + /** + * Disables the config tuning. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux, Void> beginDisableAsync(String resourceGroupName, String serverName, + TuningOptionEnum tuningOption) { + Mono>> mono = disableWithResponseAsync(resourceGroupName, serverName, tuningOption); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Disables the config tuning. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDisableAsync(String resourceGroupName, String serverName, + TuningOptionEnum tuningOption, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = disableWithResponseAsync(resourceGroupName, serverName, tuningOption, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Disables the config tuning. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDisable(String resourceGroupName, String serverName, + TuningOptionEnum tuningOption) { + return this.beginDisableAsync(resourceGroupName, serverName, tuningOption).getSyncPoller(); + } + + /** + * Disables the config tuning. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDisable(String resourceGroupName, String serverName, + TuningOptionEnum tuningOption, Context context) { + return this.beginDisableAsync(resourceGroupName, serverName, tuningOption, context).getSyncPoller(); + } + + /** + * Disables the config tuning. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono disableAsync(String resourceGroupName, String serverName, TuningOptionEnum tuningOption) { + return beginDisableAsync(resourceGroupName, serverName, tuningOption).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Disables the config tuning. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono disableAsync(String resourceGroupName, String serverName, TuningOptionEnum tuningOption, + Context context) { + return beginDisableAsync(resourceGroupName, serverName, tuningOption, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Disables the config tuning. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void disable(String resourceGroupName, String serverName, TuningOptionEnum tuningOption) { + disableAsync(resourceGroupName, serverName, tuningOption).block(); + } + + /** + * Disables the config tuning. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void disable(String resourceGroupName, String serverName, TuningOptionEnum tuningOption, Context context) { + disableAsync(resourceGroupName, serverName, tuningOption, context).block(); + } + + /** + * Starts up the config tuning session. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @param configTuningRequest The parameters for tuning request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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>> startSessionWithResponseAsync(String resourceGroupName, String serverName, + TuningOptionEnum tuningOption, ConfigTuningRequestParameter configTuningRequest) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serverName == null) { + return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); + } + if (tuningOption == null) { + return Mono.error(new IllegalArgumentException("Parameter tuningOption is required and cannot be null.")); + } + if (configTuningRequest == null) { + return Mono + .error(new IllegalArgumentException("Parameter configTuningRequest is required and cannot be null.")); + } else { + configTuningRequest.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.startSession(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serverName, tuningOption, configTuningRequest, + accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Starts up the config tuning session. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @param configTuningRequest The parameters for tuning request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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>> startSessionWithResponseAsync(String resourceGroupName, String serverName, + TuningOptionEnum tuningOption, ConfigTuningRequestParameter configTuningRequest, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serverName == null) { + return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); + } + if (tuningOption == null) { + return Mono.error(new IllegalArgumentException("Parameter tuningOption is required and cannot be null.")); + } + if (configTuningRequest == null) { + return Mono + .error(new IllegalArgumentException("Parameter configTuningRequest is required and cannot be null.")); + } else { + configTuningRequest.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.startSession(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serverName, tuningOption, configTuningRequest, accept, + context); + } + + /** + * Starts up the config tuning session. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @param configTuningRequest The parameters for tuning request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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> beginStartSessionAsync(String resourceGroupName, String serverName, + TuningOptionEnum tuningOption, ConfigTuningRequestParameter configTuningRequest) { + Mono>> mono + = startSessionWithResponseAsync(resourceGroupName, serverName, tuningOption, configTuningRequest); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Starts up the config tuning session. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @param configTuningRequest The parameters for tuning request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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> beginStartSessionAsync(String resourceGroupName, String serverName, + TuningOptionEnum tuningOption, ConfigTuningRequestParameter configTuningRequest, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = startSessionWithResponseAsync(resourceGroupName, serverName, tuningOption, configTuningRequest, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Starts up the config tuning session. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @param configTuningRequest The parameters for tuning request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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> beginStartSession(String resourceGroupName, String serverName, + TuningOptionEnum tuningOption, ConfigTuningRequestParameter configTuningRequest) { + return this.beginStartSessionAsync(resourceGroupName, serverName, tuningOption, configTuningRequest) + .getSyncPoller(); + } + + /** + * Starts up the config tuning session. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @param configTuningRequest The parameters for tuning request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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> beginStartSession(String resourceGroupName, String serverName, + TuningOptionEnum tuningOption, ConfigTuningRequestParameter configTuningRequest, Context context) { + return this.beginStartSessionAsync(resourceGroupName, serverName, tuningOption, configTuningRequest, context) + .getSyncPoller(); + } + + /** + * Starts up the config tuning session. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @param configTuningRequest The parameters for tuning request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 startSessionAsync(String resourceGroupName, String serverName, TuningOptionEnum tuningOption, + ConfigTuningRequestParameter configTuningRequest) { + return beginStartSessionAsync(resourceGroupName, serverName, tuningOption, configTuningRequest).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Starts up the config tuning session. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @param configTuningRequest The parameters for tuning request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 startSessionAsync(String resourceGroupName, String serverName, TuningOptionEnum tuningOption, + ConfigTuningRequestParameter configTuningRequest, Context context) { + return beginStartSessionAsync(resourceGroupName, serverName, tuningOption, configTuningRequest, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Starts up the config tuning session. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @param configTuningRequest The parameters for tuning request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 startSession(String resourceGroupName, String serverName, TuningOptionEnum tuningOption, + ConfigTuningRequestParameter configTuningRequest) { + startSessionAsync(resourceGroupName, serverName, tuningOption, configTuningRequest).block(); + } + + /** + * Starts up the config tuning session. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @param configTuningRequest The parameters for tuning request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 startSession(String resourceGroupName, String serverName, TuningOptionEnum tuningOption, + ConfigTuningRequestParameter configTuningRequest, Context context) { + startSessionAsync(resourceGroupName, serverName, tuningOption, configTuningRequest, context).block(); + } + + /** + * Stops the config tuning session. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> stopSessionWithResponseAsync(String resourceGroupName, String serverName, + TuningOptionEnum tuningOption) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serverName == null) { + return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); + } + if (tuningOption == null) { + return Mono.error(new IllegalArgumentException("Parameter tuningOption is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.stopSession(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serverName, tuningOption, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Stops the config tuning session. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> stopSessionWithResponseAsync(String resourceGroupName, String serverName, + TuningOptionEnum tuningOption, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serverName == null) { + return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); + } + if (tuningOption == null) { + return Mono.error(new IllegalArgumentException("Parameter tuningOption is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.stopSession(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serverName, tuningOption, accept, context); + } + + /** + * Stops the config tuning session. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux, Void> beginStopSessionAsync(String resourceGroupName, String serverName, + TuningOptionEnum tuningOption) { + Mono>> mono + = stopSessionWithResponseAsync(resourceGroupName, serverName, tuningOption); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Stops the config tuning session. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginStopSessionAsync(String resourceGroupName, String serverName, + TuningOptionEnum tuningOption, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = stopSessionWithResponseAsync(resourceGroupName, serverName, tuningOption, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Stops the config tuning session. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginStopSession(String resourceGroupName, String serverName, + TuningOptionEnum tuningOption) { + return this.beginStopSessionAsync(resourceGroupName, serverName, tuningOption).getSyncPoller(); + } + + /** + * Stops the config tuning session. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginStopSession(String resourceGroupName, String serverName, + TuningOptionEnum tuningOption, Context context) { + return this.beginStopSessionAsync(resourceGroupName, serverName, tuningOption, context).getSyncPoller(); + } + + /** + * Stops the config tuning session. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono stopSessionAsync(String resourceGroupName, String serverName, TuningOptionEnum tuningOption) { + return beginStopSessionAsync(resourceGroupName, serverName, tuningOption).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Stops the config tuning session. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono stopSessionAsync(String resourceGroupName, String serverName, TuningOptionEnum tuningOption, + Context context) { + return beginStopSessionAsync(resourceGroupName, serverName, tuningOption, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Stops the config tuning session. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void stopSession(String resourceGroupName, String serverName, TuningOptionEnum tuningOption) { + stopSessionAsync(resourceGroupName, serverName, tuningOption).block(); + } + + /** + * Stops the config tuning session. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void stopSession(String resourceGroupName, String serverName, TuningOptionEnum tuningOption, + Context context) { + stopSessionAsync(resourceGroupName, serverName, tuningOption, context).block(); + } + + /** + * Gets up the config tuning session status. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return up the config tuning session status along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSessionsSinglePageAsync(String resourceGroupName, + String serverName, TuningOptionEnum tuningOption) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serverName == null) { + return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); + } + if (tuningOption == null) { + return Mono.error(new IllegalArgumentException("Parameter tuningOption is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listSessions(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serverName, tuningOption, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets up the config tuning session status. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return up the config tuning session status along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSessionsSinglePageAsync(String resourceGroupName, + String serverName, TuningOptionEnum tuningOption, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serverName == null) { + return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); + } + if (tuningOption == null) { + return Mono.error(new IllegalArgumentException("Parameter tuningOption is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listSessions(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, serverName, tuningOption, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Gets up the config tuning session status. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return up the config tuning session status as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listSessionsAsync(String resourceGroupName, String serverName, + TuningOptionEnum tuningOption) { + return new PagedFlux<>(() -> listSessionsSinglePageAsync(resourceGroupName, serverName, tuningOption), + nextLink -> listSessionsNextSinglePageAsync(nextLink)); + } + + /** + * Gets up the config tuning session status. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return up the config tuning session status as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listSessionsAsync(String resourceGroupName, String serverName, + TuningOptionEnum tuningOption, Context context) { + return new PagedFlux<>(() -> listSessionsSinglePageAsync(resourceGroupName, serverName, tuningOption, context), + nextLink -> listSessionsNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets up the config tuning session status. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return up the config tuning session status as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listSessions(String resourceGroupName, String serverName, + TuningOptionEnum tuningOption) { + return new PagedIterable<>(listSessionsAsync(resourceGroupName, serverName, tuningOption)); + } + + /** + * Gets up the config tuning session status. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return up the config tuning session status as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listSessions(String resourceGroupName, String serverName, + TuningOptionEnum tuningOption, Context context) { + return new PagedIterable<>(listSessionsAsync(resourceGroupName, serverName, tuningOption, context)); + } + + /** + * Gets the session details of a config tuning session. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @param sessionId Guid of the objectId for the session. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 session details of a config tuning session along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSessionDetailsSinglePageAsync(String resourceGroupName, + String serverName, TuningOptionEnum tuningOption, String sessionId) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serverName == null) { + return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); + } + if (tuningOption == null) { + return Mono.error(new IllegalArgumentException("Parameter tuningOption is required and cannot be null.")); + } + if (sessionId == null) { + return Mono.error(new IllegalArgumentException("Parameter sessionId is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listSessionDetails(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serverName, tuningOption, sessionId, accept, + context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the session details of a config tuning session. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @param sessionId Guid of the objectId for the session. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 session details of a config tuning session along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSessionDetailsSinglePageAsync(String resourceGroupName, + String serverName, TuningOptionEnum tuningOption, String sessionId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serverName == null) { + return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); + } + if (tuningOption == null) { + return Mono.error(new IllegalArgumentException("Parameter tuningOption is required and cannot be null.")); + } + if (sessionId == null) { + return Mono.error(new IllegalArgumentException("Parameter sessionId is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listSessionDetails(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, serverName, tuningOption, sessionId, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Gets the session details of a config tuning session. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @param sessionId Guid of the objectId for the session. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 session details of a config tuning session as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listSessionDetailsAsync(String resourceGroupName, String serverName, + TuningOptionEnum tuningOption, String sessionId) { + return new PagedFlux<>( + () -> listSessionDetailsSinglePageAsync(resourceGroupName, serverName, tuningOption, sessionId), + nextLink -> listSessionDetailsNextSinglePageAsync(nextLink)); + } + + /** + * Gets the session details of a config tuning session. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @param sessionId Guid of the objectId for the session. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 session details of a config tuning session as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listSessionDetailsAsync(String resourceGroupName, String serverName, + TuningOptionEnum tuningOption, String sessionId, Context context) { + return new PagedFlux<>( + () -> listSessionDetailsSinglePageAsync(resourceGroupName, serverName, tuningOption, sessionId, context), + nextLink -> listSessionDetailsNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets the session details of a config tuning session. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @param sessionId Guid of the objectId for the session. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 session details of a config tuning session as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listSessionDetails(String resourceGroupName, String serverName, + TuningOptionEnum tuningOption, String sessionId) { + return new PagedIterable<>(listSessionDetailsAsync(resourceGroupName, serverName, tuningOption, sessionId)); + } + + /** + * Gets the session details of a config tuning session. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @param sessionId Guid of the objectId for the session. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 session details of a config tuning session as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listSessionDetails(String resourceGroupName, String serverName, + TuningOptionEnum tuningOption, String sessionId, Context context) { + return new PagedIterable<>( + listSessionDetailsAsync(resourceGroupName, serverName, tuningOption, sessionId, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of tuning configuration sessions along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSessionsNextSinglePageAsync(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.listSessionsNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of tuning configuration sessions along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSessionsNextSinglePageAsync(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.listSessionsNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of tuning configuration sessions along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSessionDetailsNextSinglePageAsync(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.listSessionDetailsNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of tuning configuration sessions along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSessionDetailsNextSinglePageAsync(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.listSessionDetailsNext(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/TuningConfigurationsImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/TuningConfigurationsImpl.java new file mode 100644 index 000000000000..b1bdeb8fe124 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/TuningConfigurationsImpl.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.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.TuningConfigurationsClient; +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.SessionDetailsResourceInner; +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.SessionResourceInner; +import com.azure.resourcemanager.postgresqlflexibleserver.models.ConfigTuningRequestParameter; +import com.azure.resourcemanager.postgresqlflexibleserver.models.SessionDetailsResource; +import com.azure.resourcemanager.postgresqlflexibleserver.models.SessionResource; +import com.azure.resourcemanager.postgresqlflexibleserver.models.TuningConfigurations; +import com.azure.resourcemanager.postgresqlflexibleserver.models.TuningOptionEnum; + +public final class TuningConfigurationsImpl implements TuningConfigurations { + private static final ClientLogger LOGGER = new ClientLogger(TuningConfigurationsImpl.class); + + private final TuningConfigurationsClient innerClient; + + private final com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager; + + public TuningConfigurationsImpl(TuningConfigurationsClient innerClient, + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void enable(String resourceGroupName, String serverName, TuningOptionEnum tuningOption) { + this.serviceClient().enable(resourceGroupName, serverName, tuningOption); + } + + public void enable(String resourceGroupName, String serverName, TuningOptionEnum tuningOption, Context context) { + this.serviceClient().enable(resourceGroupName, serverName, tuningOption, context); + } + + public void disable(String resourceGroupName, String serverName, TuningOptionEnum tuningOption) { + this.serviceClient().disable(resourceGroupName, serverName, tuningOption); + } + + public void disable(String resourceGroupName, String serverName, TuningOptionEnum tuningOption, Context context) { + this.serviceClient().disable(resourceGroupName, serverName, tuningOption, context); + } + + public void startSession(String resourceGroupName, String serverName, TuningOptionEnum tuningOption, + ConfigTuningRequestParameter configTuningRequest) { + this.serviceClient().startSession(resourceGroupName, serverName, tuningOption, configTuningRequest); + } + + public void startSession(String resourceGroupName, String serverName, TuningOptionEnum tuningOption, + ConfigTuningRequestParameter configTuningRequest, Context context) { + this.serviceClient().startSession(resourceGroupName, serverName, tuningOption, configTuningRequest, context); + } + + public void stopSession(String resourceGroupName, String serverName, TuningOptionEnum tuningOption) { + this.serviceClient().stopSession(resourceGroupName, serverName, tuningOption); + } + + public void stopSession(String resourceGroupName, String serverName, TuningOptionEnum tuningOption, + Context context) { + this.serviceClient().stopSession(resourceGroupName, serverName, tuningOption, context); + } + + public PagedIterable listSessions(String resourceGroupName, String serverName, + TuningOptionEnum tuningOption) { + PagedIterable inner + = this.serviceClient().listSessions(resourceGroupName, serverName, tuningOption); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SessionResourceImpl(inner1, this.manager())); + } + + public PagedIterable listSessions(String resourceGroupName, String serverName, + TuningOptionEnum tuningOption, Context context) { + PagedIterable inner + = this.serviceClient().listSessions(resourceGroupName, serverName, tuningOption, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SessionResourceImpl(inner1, this.manager())); + } + + public PagedIterable listSessionDetails(String resourceGroupName, String serverName, + TuningOptionEnum tuningOption, String sessionId) { + PagedIterable inner + = this.serviceClient().listSessionDetails(resourceGroupName, serverName, tuningOption, sessionId); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SessionDetailsResourceImpl(inner1, this.manager())); + } + + public PagedIterable listSessionDetails(String resourceGroupName, String serverName, + TuningOptionEnum tuningOption, String sessionId, Context context) { + PagedIterable inner + = this.serviceClient().listSessionDetails(resourceGroupName, serverName, tuningOption, sessionId, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SessionDetailsResourceImpl(inner1, this.manager())); + } + + private TuningConfigurationsClient 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/TuningIndexesClientImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/TuningIndexesClientImpl.java new file mode 100644 index 000000000000..71e2f4978ebd --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/TuningIndexesClientImpl.java @@ -0,0 +1,333 @@ +// Copyright (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.TuningIndexesClient; +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.ObjectRecommendationResourceInner; +import com.azure.resourcemanager.postgresqlflexibleserver.models.ObjectRecommendationListResult; +import com.azure.resourcemanager.postgresqlflexibleserver.models.RecommendationType; +import com.azure.resourcemanager.postgresqlflexibleserver.models.TuningOptionEnum; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in TuningIndexesClient. + */ +public final class TuningIndexesClientImpl implements TuningIndexesClient { + /** + * The proxy service used to perform REST calls. + */ + private final TuningIndexesService service; + + /** + * The service client containing this operation class. + */ + private final PostgreSqlManagementClientImpl client; + + /** + * Initializes an instance of TuningIndexesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + TuningIndexesClientImpl(PostgreSqlManagementClientImpl client) { + this.service + = RestProxy.create(TuningIndexesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for PostgreSqlManagementClientTuningIndexes to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "PostgreSqlManagement") + public interface TuningIndexesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/tuningOptions/{tuningOption}/recommendations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listRecommendations(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("serverName") String serverName, + @PathParam("tuningOption") TuningOptionEnum tuningOption, + @QueryParam("recommendationType") RecommendationType recommendationType, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listRecommendationsNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Retrieve the list of available tuning recommendations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @param recommendationType Recommendations list filter. Retrieves recommendations based on type. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of available recommendations along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listRecommendationsSinglePageAsync( + String resourceGroupName, String serverName, TuningOptionEnum tuningOption, + RecommendationType recommendationType) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serverName == null) { + return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); + } + if (tuningOption == null) { + return Mono.error(new IllegalArgumentException("Parameter tuningOption is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listRecommendations(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serverName, tuningOption, recommendationType, + accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieve the list of available tuning recommendations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @param recommendationType Recommendations list filter. Retrieves recommendations based on type. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of available recommendations along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listRecommendationsSinglePageAsync( + String resourceGroupName, String serverName, TuningOptionEnum tuningOption, + RecommendationType recommendationType, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serverName == null) { + return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); + } + if (tuningOption == null) { + return Mono.error(new IllegalArgumentException("Parameter tuningOption is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listRecommendations(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serverName, tuningOption, recommendationType, + accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Retrieve the list of available tuning recommendations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @param recommendationType Recommendations list filter. Retrieves recommendations based on type. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of available recommendations as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listRecommendationsAsync(String resourceGroupName, + String serverName, TuningOptionEnum tuningOption, RecommendationType recommendationType) { + return new PagedFlux<>( + () -> listRecommendationsSinglePageAsync(resourceGroupName, serverName, tuningOption, recommendationType), + nextLink -> listRecommendationsNextSinglePageAsync(nextLink)); + } + + /** + * Retrieve the list of available tuning recommendations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of available recommendations as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listRecommendationsAsync(String resourceGroupName, + String serverName, TuningOptionEnum tuningOption) { + final RecommendationType recommendationType = null; + return new PagedFlux<>( + () -> listRecommendationsSinglePageAsync(resourceGroupName, serverName, tuningOption, recommendationType), + nextLink -> listRecommendationsNextSinglePageAsync(nextLink)); + } + + /** + * Retrieve the list of available tuning recommendations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @param recommendationType Recommendations list filter. Retrieves recommendations based on type. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of available recommendations as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listRecommendationsAsync(String resourceGroupName, + String serverName, TuningOptionEnum tuningOption, RecommendationType recommendationType, Context context) { + return new PagedFlux<>(() -> listRecommendationsSinglePageAsync(resourceGroupName, serverName, tuningOption, + recommendationType, context), nextLink -> listRecommendationsNextSinglePageAsync(nextLink, context)); + } + + /** + * Retrieve the list of available tuning recommendations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of available recommendations as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listRecommendations(String resourceGroupName, + String serverName, TuningOptionEnum tuningOption) { + final RecommendationType recommendationType = null; + return new PagedIterable<>( + listRecommendationsAsync(resourceGroupName, serverName, tuningOption, recommendationType)); + } + + /** + * Retrieve the list of available tuning recommendations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @param recommendationType Recommendations list filter. Retrieves recommendations based on type. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of available recommendations as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listRecommendations(String resourceGroupName, + String serverName, TuningOptionEnum tuningOption, RecommendationType recommendationType, Context context) { + return new PagedIterable<>( + listRecommendationsAsync(resourceGroupName, serverName, tuningOption, recommendationType, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of available recommendations along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listRecommendationsNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listRecommendationsNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of available recommendations along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listRecommendationsNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listRecommendationsNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/TuningIndexesImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/TuningIndexesImpl.java new file mode 100644 index 000000000000..ef24e0a96ab2 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/TuningIndexesImpl.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.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.TuningIndexesClient; +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.ObjectRecommendationResourceInner; +import com.azure.resourcemanager.postgresqlflexibleserver.models.ObjectRecommendationResource; +import com.azure.resourcemanager.postgresqlflexibleserver.models.RecommendationType; +import com.azure.resourcemanager.postgresqlflexibleserver.models.TuningIndexes; +import com.azure.resourcemanager.postgresqlflexibleserver.models.TuningOptionEnum; + +public final class TuningIndexesImpl implements TuningIndexes { + private static final ClientLogger LOGGER = new ClientLogger(TuningIndexesImpl.class); + + private final TuningIndexesClient innerClient; + + private final com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager; + + public TuningIndexesImpl(TuningIndexesClient innerClient, + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listRecommendations(String resourceGroupName, String serverName, + TuningOptionEnum tuningOption) { + PagedIterable inner + = this.serviceClient().listRecommendations(resourceGroupName, serverName, tuningOption); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new ObjectRecommendationResourceImpl(inner1, this.manager())); + } + + public PagedIterable listRecommendations(String resourceGroupName, String serverName, + TuningOptionEnum tuningOption, RecommendationType recommendationType, Context context) { + PagedIterable inner = this.serviceClient() + .listRecommendations(resourceGroupName, serverName, tuningOption, recommendationType, context); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new ObjectRecommendationResourceImpl(inner1, this.manager())); + } + + private TuningIndexesClient 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/TuningOptionsClientImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/TuningOptionsClientImpl.java new file mode 100644 index 000000000000..46512443bf72 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/TuningOptionsClientImpl.java @@ -0,0 +1,425 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.TuningOptionsClient; +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.TuningOptionsResourceInner; +import com.azure.resourcemanager.postgresqlflexibleserver.models.TuningOptionEnum; +import com.azure.resourcemanager.postgresqlflexibleserver.models.TuningOptionsListResult; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in TuningOptionsClient. + */ +public final class TuningOptionsClientImpl implements TuningOptionsClient { + /** + * The proxy service used to perform REST calls. + */ + private final TuningOptionsService service; + + /** + * The service client containing this operation class. + */ + private final PostgreSqlManagementClientImpl client; + + /** + * Initializes an instance of TuningOptionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + TuningOptionsClientImpl(PostgreSqlManagementClientImpl client) { + this.service + = RestProxy.create(TuningOptionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for PostgreSqlManagementClientTuningOptions to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "PostgreSqlManagement") + public interface TuningOptionsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/tuningOptions/{tuningOption}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("serverName") String serverName, + @PathParam("tuningOption") TuningOptionEnum tuningOption, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/tuningOptions") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByServer(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("serverName") String serverName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByServerNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Retrieve the tuning option on a server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return stores property that features impact on some metric if this recommended action is applied along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponseAsync(String resourceGroupName, String serverName, + TuningOptionEnum tuningOption) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serverName == null) { + return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); + } + if (tuningOption == null) { + return Mono.error(new IllegalArgumentException("Parameter tuningOption is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serverName, tuningOption, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieve the tuning option on a server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return stores property that features impact on some metric if this recommended action is applied along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String serverName, + TuningOptionEnum tuningOption, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serverName == null) { + return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); + } + if (tuningOption == null) { + return Mono.error(new IllegalArgumentException("Parameter tuningOption is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, serverName, tuningOption, accept, context); + } + + /** + * Retrieve the tuning option on a server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return stores property that features impact on some metric if this recommended action is applied on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getAsync(String resourceGroupName, String serverName, + TuningOptionEnum tuningOption) { + return getWithResponseAsync(resourceGroupName, serverName, tuningOption) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Retrieve the tuning option on a server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return stores property that features impact on some metric if this recommended action is applied along with + * {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String serverName, + TuningOptionEnum tuningOption, Context context) { + return getWithResponseAsync(resourceGroupName, serverName, tuningOption, context).block(); + } + + /** + * Retrieve the tuning option on a server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return stores property that features impact on some metric if this recommended action is applied. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public TuningOptionsResourceInner get(String resourceGroupName, String serverName, TuningOptionEnum tuningOption) { + return getWithResponse(resourceGroupName, serverName, tuningOption, Context.NONE).getValue(); + } + + /** + * Retrieve the list of available tuning options. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of server tuning options along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServerSinglePageAsync(String resourceGroupName, + String serverName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serverName == null) { + return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByServer(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serverName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieve the list of available tuning options. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of server tuning options along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServerSinglePageAsync(String resourceGroupName, + String serverName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serverName == null) { + return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByServer(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, serverName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Retrieve the list of available tuning options. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of server tuning options as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listByServerAsync(String resourceGroupName, String serverName) { + return new PagedFlux<>(() -> listByServerSinglePageAsync(resourceGroupName, serverName), + nextLink -> listByServerNextSinglePageAsync(nextLink)); + } + + /** + * Retrieve the list of available tuning options. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of server tuning options as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByServerAsync(String resourceGroupName, String serverName, + Context context) { + return new PagedFlux<>(() -> listByServerSinglePageAsync(resourceGroupName, serverName, context), + nextLink -> listByServerNextSinglePageAsync(nextLink, context)); + } + + /** + * Retrieve the list of available tuning options. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of server tuning options as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByServer(String resourceGroupName, String serverName) { + return new PagedIterable<>(listByServerAsync(resourceGroupName, serverName)); + } + + /** + * Retrieve the list of available tuning options. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of server tuning options as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByServer(String resourceGroupName, String serverName, + Context context) { + return new PagedIterable<>(listByServerAsync(resourceGroupName, serverName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of server tuning options along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServerNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByServerNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of server tuning options along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServerNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByServerNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/TuningOptionsImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/TuningOptionsImpl.java new file mode 100644 index 000000000000..02efa8b14405 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/TuningOptionsImpl.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.TuningOptionsClient; +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.TuningOptionsResourceInner; +import com.azure.resourcemanager.postgresqlflexibleserver.models.TuningOptionEnum; +import com.azure.resourcemanager.postgresqlflexibleserver.models.TuningOptions; +import com.azure.resourcemanager.postgresqlflexibleserver.models.TuningOptionsResource; + +public final class TuningOptionsImpl implements TuningOptions { + private static final ClientLogger LOGGER = new ClientLogger(TuningOptionsImpl.class); + + private final TuningOptionsClient innerClient; + + private final com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager; + + public TuningOptionsImpl(TuningOptionsClient innerClient, + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String resourceGroupName, String serverName, + TuningOptionEnum tuningOption, Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, serverName, tuningOption, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new TuningOptionsResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public TuningOptionsResource get(String resourceGroupName, String serverName, TuningOptionEnum tuningOption) { + TuningOptionsResourceInner inner = this.serviceClient().get(resourceGroupName, serverName, tuningOption); + if (inner != null) { + return new TuningOptionsResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable listByServer(String resourceGroupName, String serverName) { + PagedIterable inner + = this.serviceClient().listByServer(resourceGroupName, serverName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new TuningOptionsResourceImpl(inner1, this.manager())); + } + + public PagedIterable listByServer(String resourceGroupName, String serverName, + Context context) { + PagedIterable inner + = this.serviceClient().listByServer(resourceGroupName, serverName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new TuningOptionsResourceImpl(inner1, this.manager())); + } + + private TuningOptionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/TuningOptionsResourceImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/TuningOptionsResourceImpl.java new file mode 100644 index 000000000000..becdc8f9556a --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/TuningOptionsResourceImpl.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.TuningOptionsResourceInner; +import com.azure.resourcemanager.postgresqlflexibleserver.models.TuningOptionsResource; + +public final class TuningOptionsResourceImpl implements TuningOptionsResource { + private TuningOptionsResourceInner innerObject; + + private final com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager; + + TuningOptionsResourceImpl(TuningOptionsResourceInner innerObject, + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public TuningOptionsResourceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ActiveDirectoryAdministrator.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ActiveDirectoryAdministrator.java index 327fe5fdb614..5b0f9fa1eef7 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ActiveDirectoryAdministrator.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ActiveDirectoryAdministrator.java @@ -41,28 +41,28 @@ public interface ActiveDirectoryAdministrator { SystemData systemData(); /** - * Gets the principalType property: The principal type used to represent the type of Active Directory Administrator. + * Gets the principalType property: The principal type used to represent the type of Microsoft Entra Administrator. * * @return the principalType value. */ PrincipalType principalType(); /** - * Gets the principalName property: Active Directory administrator principal name. + * Gets the principalName property: Microsoft Entra Administrator principal name. * * @return the principalName value. */ String principalName(); /** - * Gets the objectId property: The objectId of the Active Directory administrator. + * Gets the objectId property: The objectId of the Microsoft Entra Administrator. * * @return the objectId value. */ String objectId(); /** - * Gets the tenantId property: The tenantId of the Active Directory administrator. + * Gets the tenantId property: The tenantId of the Microsoft Entra Administrator. * * @return the tenantId value. */ @@ -134,10 +134,10 @@ interface WithCreate extends DefinitionStages.WithPrincipalType, DefinitionStage */ interface WithPrincipalType { /** - * Specifies the principalType property: The principal type used to represent the type of Active Directory + * Specifies the principalType property: The principal type used to represent the type of Microsoft Entra * Administrator.. * - * @param principalType The principal type used to represent the type of Active Directory Administrator. + * @param principalType The principal type used to represent the type of Microsoft Entra Administrator. * @return the next definition stage. */ WithCreate withPrincipalType(PrincipalType principalType); @@ -148,9 +148,9 @@ interface WithPrincipalType { */ interface WithPrincipalName { /** - * Specifies the principalName property: Active Directory administrator principal name.. + * Specifies the principalName property: Microsoft Entra Administrator principal name.. * - * @param principalName Active Directory administrator principal name. + * @param principalName Microsoft Entra Administrator principal name. * @return the next definition stage. */ WithCreate withPrincipalName(String principalName); @@ -161,9 +161,9 @@ interface WithPrincipalName { */ interface WithTenantId { /** - * Specifies the tenantId property: The tenantId of the Active Directory administrator.. + * Specifies the tenantId property: The tenantId of the Microsoft Entra Administrator.. * - * @param tenantId The tenantId of the Active Directory administrator. + * @param tenantId The tenantId of the Microsoft Entra Administrator. * @return the next definition stage. */ WithCreate withTenantId(String tenantId); 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 c101a4fbf7f6..ac791721746c 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 @@ -13,12 +13,12 @@ import java.io.IOException; /** - * Represents an Active Directory administrator. + * Represents an Microsoft Entra Administrator. */ @Fluent public final class ActiveDirectoryAdministratorAdd implements JsonSerializable { /* - * Properties of the active directory administrator. + * Properties of the Microsoft Entra Administrator. */ private AdministratorPropertiesForAdd innerProperties; @@ -29,7 +29,7 @@ public ActiveDirectoryAdministratorAdd() { } /** - * Get the innerProperties property: Properties of the active directory administrator. + * Get the innerProperties property: Properties of the Microsoft Entra Administrator. * * @return the innerProperties value. */ @@ -38,7 +38,7 @@ private AdministratorPropertiesForAdd innerProperties() { } /** - * Get the principalType property: The principal type used to represent the type of Active Directory Administrator. + * Get the principalType property: The principal type used to represent the type of Microsoft Entra Administrator. * * @return the principalType value. */ @@ -47,7 +47,7 @@ public PrincipalType principalType() { } /** - * Set the principalType property: The principal type used to represent the type of Active Directory Administrator. + * Set the principalType property: The principal type used to represent the type of Microsoft Entra Administrator. * * @param principalType the principalType value to set. * @return the ActiveDirectoryAdministratorAdd object itself. @@ -61,7 +61,7 @@ public ActiveDirectoryAdministratorAdd withPrincipalType(PrincipalType principal } /** - * Get the principalName property: Active Directory administrator principal name. + * Get the principalName property: Microsoft Entra Administrator principal name. * * @return the principalName value. */ @@ -70,7 +70,7 @@ public String principalName() { } /** - * Set the principalName property: Active Directory administrator principal name. + * Set the principalName property: Microsoft Entra Administrator principal name. * * @param principalName the principalName value to set. * @return the ActiveDirectoryAdministratorAdd object itself. @@ -84,7 +84,7 @@ public ActiveDirectoryAdministratorAdd withPrincipalName(String principalName) { } /** - * Get the tenantId property: The tenantId of the Active Directory administrator. + * Get the tenantId property: The tenantId of the Microsoft Entra Administrator. * * @return the tenantId value. */ @@ -93,7 +93,7 @@ public String tenantId() { } /** - * Set the tenantId property: The tenantId of the Active Directory administrator. + * Set the tenantId property: The tenantId of the Microsoft Entra Administrator. * * @param tenantId the tenantId value to set. * @return the ActiveDirectoryAdministratorAdd object itself. 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 0773e47827ad..1b8c9800f652 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 @@ -8,7 +8,7 @@ import java.util.Collection; /** - * If Enabled, Azure Active Directory authentication is enabled. + * If Enabled, Microsoft Entra authentication is enabled. */ public final class ActiveDirectoryAuthEnum extends ExpandableStringEnum { /** 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 1fdc68ca96fd..b547fb12c3a8 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 @@ -14,17 +14,17 @@ import java.util.List; /** - * A list of active directory administrators. + * A list of Microsoft Entra Administrators. */ @Fluent public final class AdministratorListResult implements JsonSerializable { /* - * The list of active directory administrators + * The list of Microsoft Entra Administrators */ private List value; /* - * The link used to get the next page of active directory. + * The link used to get the next page of Microsoft Entra administrators. */ private String nextLink; @@ -35,7 +35,7 @@ public AdministratorListResult() { } /** - * Get the value property: The list of active directory administrators. + * Get the value property: The list of Microsoft Entra Administrators. * * @return the value value. */ @@ -44,7 +44,7 @@ public List value() { } /** - * Set the value property: The list of active directory administrators. + * Set the value property: The list of Microsoft Entra Administrators. * * @param value the value value to set. * @return the AdministratorListResult object itself. @@ -55,7 +55,7 @@ public AdministratorListResult withValue(List } /** - * Get the nextLink property: The link used to get the next page of active directory. + * Get the nextLink property: The link used to get the next page of Microsoft Entra administrators. * * @return the nextLink value. */ @@ -64,7 +64,7 @@ public String nextLink() { } /** - * Set the nextLink property: The link used to get the next page of active directory. + * Set the nextLink property: The link used to get the next page of Microsoft Entra administrators. * * @param nextLink the nextLink value to set. * @return the AdministratorListResult object itself. diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/Administrators.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/Administrators.java index 96f57d693d9f..3ae117f77073 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/Administrators.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/Administrators.java @@ -13,7 +13,7 @@ */ public interface Administrators { /** - * Deletes an Active Directory Administrator associated with the server. + * Deletes an Microsoft Entra Administrator associated with the server. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. @@ -25,7 +25,7 @@ public interface Administrators { void delete(String resourceGroupName, String serverName, String objectId); /** - * Deletes an Active Directory Administrator associated with the server. + * Deletes an Microsoft Entra Administrator associated with the server. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. @@ -73,7 +73,7 @@ Response getWithResponse(String resourceGroupName, * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of active directory administrators as paginated response with {@link PagedIterable}. + * @return a list of Microsoft Entra Administrators as paginated response with {@link PagedIterable}. */ PagedIterable listByServer(String resourceGroupName, String serverName); @@ -86,7 +86,7 @@ Response getWithResponse(String resourceGroupName, * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of active directory administrators as paginated response with {@link PagedIterable}. + * @return a list of Microsoft Entra Administrators as paginated response with {@link PagedIterable}. */ PagedIterable listByServer(String resourceGroupName, String serverName, Context context); @@ -115,7 +115,7 @@ PagedIterable listByServer(String resourceGroupNam Response getByIdWithResponse(String id, Context context); /** - * Deletes an Active Directory Administrator associated with the server. + * Deletes an Microsoft Entra Administrator associated with the server. * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -125,7 +125,7 @@ PagedIterable listByServer(String resourceGroupNam void deleteById(String id); /** - * Deletes an Active Directory Administrator associated with the server. + * Deletes an Microsoft Entra Administrator associated with the server. * * @param id the resource ID. * @param context The context to associate with this operation. 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 7d2113b95b06..02900dbb7e6a 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 @@ -17,7 +17,7 @@ @Fluent public final class AuthConfig implements JsonSerializable { /* - * If Enabled, Azure Active Directory authentication is enabled. + * If Enabled, Microsoft Entra authentication is enabled. */ private ActiveDirectoryAuthEnum activeDirectoryAuth; @@ -38,7 +38,7 @@ public AuthConfig() { } /** - * Get the activeDirectoryAuth property: If Enabled, Azure Active Directory authentication is enabled. + * Get the activeDirectoryAuth property: If Enabled, Microsoft Entra authentication is enabled. * * @return the activeDirectoryAuth value. */ @@ -47,7 +47,7 @@ public ActiveDirectoryAuthEnum activeDirectoryAuth() { } /** - * Set the activeDirectoryAuth property: If Enabled, Azure Active Directory authentication is enabled. + * Set the activeDirectoryAuth property: If Enabled, Microsoft Entra authentication is enabled. * * @param activeDirectoryAuth the activeDirectoryAuth value to set. * @return the AuthConfig object itself. diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/Cluster.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/Cluster.java new file mode 100644 index 000000000000..0880429954b4 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/Cluster.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Cluster properties of a server. + */ +@Fluent +public final class Cluster implements JsonSerializable { + /* + * The node count for the cluster. + */ + private Integer clusterSize; + + /** + * Creates an instance of Cluster class. + */ + public Cluster() { + } + + /** + * Get the clusterSize property: The node count for the cluster. + * + * @return the clusterSize value. + */ + public Integer clusterSize() { + return this.clusterSize; + } + + /** + * Set the clusterSize property: The node count for the cluster. + * + * @param clusterSize the clusterSize value to set. + * @return the Cluster object itself. + */ + public Cluster withClusterSize(Integer clusterSize) { + this.clusterSize = clusterSize; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("clusterSize", this.clusterSize); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Cluster from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Cluster if the JsonReader was pointing to an instance of it, or null if it was pointing to + * JSON null. + * @throws IOException If an error occurs while reading the Cluster. + */ + public static Cluster fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Cluster deserializedCluster = new Cluster(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("clusterSize".equals(fieldName)) { + deserializedCluster.clusterSize = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedCluster; + }); + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ConfigTuningRequestParameter.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ConfigTuningRequestParameter.java new file mode 100644 index 000000000000..f1593d8696b4 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ConfigTuningRequestParameter.java @@ -0,0 +1,179 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Config tuning request parameters. + */ +@Fluent +public final class ConfigTuningRequestParameter implements JsonSerializable { + /* + * The name of server. + */ + private String serverName; + + /* + * Indicates whether PG should be restarted during a tuning session. + */ + private Boolean allowServerRestarts; + + /* + * The target metric the tuning session is trying to improve. + */ + private String targetImprovementMetric; + + /* + * The mode with which the feature will be enabled. + */ + private Boolean configTuningUsageMode; + + /** + * Creates an instance of ConfigTuningRequestParameter class. + */ + public ConfigTuningRequestParameter() { + } + + /** + * Get the serverName property: The name of server. + * + * @return the serverName value. + */ + public String serverName() { + return this.serverName; + } + + /** + * Set the serverName property: The name of server. + * + * @param serverName the serverName value to set. + * @return the ConfigTuningRequestParameter object itself. + */ + public ConfigTuningRequestParameter withServerName(String serverName) { + this.serverName = serverName; + return this; + } + + /** + * Get the allowServerRestarts property: Indicates whether PG should be restarted during a tuning session. + * + * @return the allowServerRestarts value. + */ + public Boolean allowServerRestarts() { + return this.allowServerRestarts; + } + + /** + * Set the allowServerRestarts property: Indicates whether PG should be restarted during a tuning session. + * + * @param allowServerRestarts the allowServerRestarts value to set. + * @return the ConfigTuningRequestParameter object itself. + */ + public ConfigTuningRequestParameter withAllowServerRestarts(Boolean allowServerRestarts) { + this.allowServerRestarts = allowServerRestarts; + return this; + } + + /** + * Get the targetImprovementMetric property: The target metric the tuning session is trying to improve. + * + * @return the targetImprovementMetric value. + */ + public String targetImprovementMetric() { + return this.targetImprovementMetric; + } + + /** + * Set the targetImprovementMetric property: The target metric the tuning session is trying to improve. + * + * @param targetImprovementMetric the targetImprovementMetric value to set. + * @return the ConfigTuningRequestParameter object itself. + */ + public ConfigTuningRequestParameter withTargetImprovementMetric(String targetImprovementMetric) { + this.targetImprovementMetric = targetImprovementMetric; + return this; + } + + /** + * Get the configTuningUsageMode property: The mode with which the feature will be enabled. + * + * @return the configTuningUsageMode value. + */ + public Boolean configTuningUsageMode() { + return this.configTuningUsageMode; + } + + /** + * Set the configTuningUsageMode property: The mode with which the feature will be enabled. + * + * @param configTuningUsageMode the configTuningUsageMode value to set. + * @return the ConfigTuningRequestParameter object itself. + */ + public ConfigTuningRequestParameter withConfigTuningUsageMode(Boolean configTuningUsageMode) { + this.configTuningUsageMode = configTuningUsageMode; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("serverName", this.serverName); + jsonWriter.writeBooleanField("allowServerRestarts", this.allowServerRestarts); + jsonWriter.writeStringField("targetImprovementMetric", this.targetImprovementMetric); + jsonWriter.writeBooleanField("configTuningUsageMode", this.configTuningUsageMode); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ConfigTuningRequestParameter from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ConfigTuningRequestParameter 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 ConfigTuningRequestParameter. + */ + public static ConfigTuningRequestParameter fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ConfigTuningRequestParameter deserializedConfigTuningRequestParameter = new ConfigTuningRequestParameter(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("serverName".equals(fieldName)) { + deserializedConfigTuningRequestParameter.serverName = reader.getString(); + } else if ("allowServerRestarts".equals(fieldName)) { + deserializedConfigTuningRequestParameter.allowServerRestarts + = reader.getNullable(JsonReader::getBoolean); + } else if ("targetImprovementMetric".equals(fieldName)) { + deserializedConfigTuningRequestParameter.targetImprovementMetric = reader.getString(); + } else if ("configTuningUsageMode".equals(fieldName)) { + deserializedConfigTuningRequestParameter.configTuningUsageMode + = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedConfigTuningRequestParameter; + }); + } +} 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 616b5ac85268..2c0d60b0dd37 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/FastProvisioningSupportedEnum.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/FastProvisioningSupportedEnum.java @@ -9,7 +9,8 @@ /** * Gets a value indicating whether fast provisioning is supported. "Enabled" means fast provisioning is supported. - * "Disabled" stands for fast provisioning is not supported. + * "Disabled" stands for fast provisioning is not supported. Will be deprecated in future, please look to Supported + * Features for "FastProvisioning". */ public final class FastProvisioningSupportedEnum extends ExpandableStringEnum { /** diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/FlexibleServerCapability.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/FlexibleServerCapability.java index 5a2620a2d3c0..8c97306ca642 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/FlexibleServerCapability.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/FlexibleServerCapability.java @@ -46,9 +46,17 @@ public interface FlexibleServerCapability { */ List supportedServerVersions(); + /** + * Gets the supportedFeatures property: The supported features. + * + * @return the supportedFeatures value. + */ + List supportedFeatures(); + /** * Gets the fastProvisioningSupported property: Gets a value indicating whether fast provisioning is supported. - * "Enabled" means fast provisioning is supported. "Disabled" stands for fast provisioning is not supported. + * "Enabled" means fast provisioning is supported. "Disabled" stands for fast provisioning is not supported. Will be + * deprecated in future, please look to Supported Features for "FastProvisioning". * * @return the fastProvisioningSupported value. */ @@ -63,7 +71,8 @@ public interface FlexibleServerCapability { /** * Gets the geoBackupSupported property: Determines if geo-backup is supported in this region. "Enabled" means - * geo-backup is supported. "Disabled" stands for geo-back is not supported. + * geo-backup is supported. "Disabled" stands for geo-back is not supported. Will be deprecated in future, please + * look to Supported Features for "GeoBackup". * * @return the geoBackupSupported value. */ @@ -72,6 +81,7 @@ public interface FlexibleServerCapability { /** * Gets the zoneRedundantHaSupported property: A value indicating whether Zone Redundant HA is supported in this * region. "Enabled" means zone redundant HA is supported. "Disabled" stands for zone redundant HA is not supported. + * Will be deprecated in future, please look to Supported Features for "ZoneRedundantHa". * * @return the zoneRedundantHaSupported value. */ @@ -80,7 +90,8 @@ public interface FlexibleServerCapability { /** * Gets the zoneRedundantHaAndGeoBackupSupported property: A value indicating whether Zone Redundant HA and * Geo-backup is supported in this region. "Enabled" means zone redundant HA and geo-backup is supported. "Disabled" - * stands for zone redundant HA and geo-backup is not supported. + * stands for zone redundant HA and geo-backup is not supported. Will be deprecated in future, please look to + * Supported Features for "ZoneRedundantHaAndGeoBackup". * * @return the zoneRedundantHaAndGeoBackupSupported value. */ @@ -89,6 +100,7 @@ public interface FlexibleServerCapability { /** * Gets the storageAutoGrowthSupported property: A value indicating whether storage auto-grow is supported in this * region. "Enabled" means storage auto-grow is supported. "Disabled" stands for storage auto-grow is not supported. + * Will be deprecated in future, please look to Supported Features for "StorageAutoGrowth". * * @return the storageAutoGrowthSupported value. */ @@ -97,7 +109,7 @@ public interface FlexibleServerCapability { /** * Gets the onlineResizeSupported property: A value indicating whether online resize is supported in this region for * the given subscription. "Enabled" means storage online resize is supported. "Disabled" means storage online - * resize is not supported. + * resize is not supported. Will be deprecated in future, please look to Supported Features for "OnlineResize". * * @return the onlineResizeSupported value. */ @@ -105,7 +117,8 @@ public interface FlexibleServerCapability { /** * Gets the restricted property: A value indicating whether this region is restricted. "Enabled" means region is - * restricted. "Disabled" stands for region is not restricted. + * restricted. "Disabled" stands for region is not restricted. Will be deprecated in future, please look to + * Supported Features for "Restricted". * * @return the restricted value. */ diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/GeoBackupSupportedEnum.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/GeoBackupSupportedEnum.java index 90eb394f96a1..8c098fa8361f 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/GeoBackupSupportedEnum.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/GeoBackupSupportedEnum.java @@ -9,7 +9,7 @@ /** * Determines if geo-backup is supported in this region. "Enabled" means geo-backup is supported. "Disabled" stands for - * geo-back is not supported. + * geo-back is not supported. Will be deprecated in future, please look to Supported Features for "GeoBackup". */ public final class GeoBackupSupportedEnum extends ExpandableStringEnum { /** diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/IdentityType.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/IdentityType.java index 1993c8567765..0312b15e90dd 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/IdentityType.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/IdentityType.java @@ -8,7 +8,7 @@ import java.util.Collection; /** - * the types of identities associated with this resource; currently restricted to 'None and UserAssigned'. + * the types of identities associated with this resource. */ public final class IdentityType extends ExpandableStringEnum { /** @@ -26,6 +26,11 @@ public final class IdentityType extends ExpandableStringEnum { */ public static final IdentityType SYSTEM_ASSIGNED = fromString("SystemAssigned"); + /** + * Static value SystemAssigned,UserAssigned for IdentityType. + */ + public static final IdentityType SYSTEM_ASSIGNED_USER_ASSIGNED = fromString("SystemAssigned,UserAssigned"); + /** * Creates a new instance of IdentityType value. * diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ImpactRecord.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ImpactRecord.java new file mode 100644 index 000000000000..265cb23da1e5 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ImpactRecord.java @@ -0,0 +1,179 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Stores property that features impact on some metric if this recommended action is applied. + */ +@Fluent +public final class ImpactRecord implements JsonSerializable { + /* + * Dimension name + */ + private String dimensionName; + + /* + * Dimension unit + */ + private String unit; + + /* + * Optional property that can be used to store the QueryId if the metric is for a specific query. + */ + private Long queryId; + + /* + * Absolute value + */ + private Double absoluteValue; + + /** + * Creates an instance of ImpactRecord class. + */ + public ImpactRecord() { + } + + /** + * Get the dimensionName property: Dimension name. + * + * @return the dimensionName value. + */ + public String dimensionName() { + return this.dimensionName; + } + + /** + * Set the dimensionName property: Dimension name. + * + * @param dimensionName the dimensionName value to set. + * @return the ImpactRecord object itself. + */ + public ImpactRecord withDimensionName(String dimensionName) { + this.dimensionName = dimensionName; + return this; + } + + /** + * Get the unit property: Dimension unit. + * + * @return the unit value. + */ + public String unit() { + return this.unit; + } + + /** + * Set the unit property: Dimension unit. + * + * @param unit the unit value to set. + * @return the ImpactRecord object itself. + */ + public ImpactRecord withUnit(String unit) { + this.unit = unit; + return this; + } + + /** + * Get the queryId property: Optional property that can be used to store the QueryId if the metric is for a specific + * query. + * + * @return the queryId value. + */ + public Long queryId() { + return this.queryId; + } + + /** + * Set the queryId property: Optional property that can be used to store the QueryId if the metric is for a specific + * query. + * + * @param queryId the queryId value to set. + * @return the ImpactRecord object itself. + */ + public ImpactRecord withQueryId(Long queryId) { + this.queryId = queryId; + return this; + } + + /** + * Get the absoluteValue property: Absolute value. + * + * @return the absoluteValue value. + */ + public Double absoluteValue() { + return this.absoluteValue; + } + + /** + * Set the absoluteValue property: Absolute value. + * + * @param absoluteValue the absoluteValue value to set. + * @return the ImpactRecord object itself. + */ + public ImpactRecord withAbsoluteValue(Double absoluteValue) { + this.absoluteValue = absoluteValue; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("dimensionName", this.dimensionName); + jsonWriter.writeStringField("unit", this.unit); + jsonWriter.writeNumberField("queryId", this.queryId); + jsonWriter.writeNumberField("absoluteValue", this.absoluteValue); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ImpactRecord from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ImpactRecord if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ImpactRecord. + */ + public static ImpactRecord fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ImpactRecord deserializedImpactRecord = new ImpactRecord(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("dimensionName".equals(fieldName)) { + deserializedImpactRecord.dimensionName = reader.getString(); + } else if ("unit".equals(fieldName)) { + deserializedImpactRecord.unit = reader.getString(); + } else if ("queryId".equals(fieldName)) { + deserializedImpactRecord.queryId = reader.getNullable(JsonReader::getLong); + } else if ("absoluteValue".equals(fieldName)) { + deserializedImpactRecord.absoluteValue = reader.getNullable(JsonReader::getDouble); + } else { + reader.skipChildren(); + } + } + + return deserializedImpactRecord; + }); + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/MigrationResource.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/MigrationResource.java index 3f6c745d6674..c181239fecb1 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/MigrationResource.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/MigrationResource.java @@ -95,7 +95,10 @@ public interface MigrationResource { /** * Gets the sourceType property: migration source server type : OnPremises, AWS, GCP, AzureVM, - * PostgreSQLSingleServer, AWS_RDS, AWS_AURORA, AWS_EC2, GCP_CloudSQL, GCP_AlloyDB, GCP_Compute, or EDB. + * PostgreSQLSingleServer, AWS_RDS, AWS_AURORA, AWS_EC2, GCP_CloudSQL, GCP_AlloyDB, GCP_Compute, EDB, + * EDB_Oracle_Server, EDB_PostgreSQL, PostgreSQLFlexibleServer, PostgreSQLCosmosDB, Huawei_RDS, Huawei_Compute, + * Heroku_PostgreSQL, Crunchy_PostgreSQL, ApsaraDB_RDS, Digital_Ocean_Droplets, Digital_Ocean_PostgreSQL, or + * Supabase_PostgreSQL. * * @return the sourceType value. */ @@ -416,10 +419,16 @@ interface WithMigrationOption { interface WithSourceType { /** * Specifies the sourceType property: migration source server type : OnPremises, AWS, GCP, AzureVM, - * PostgreSQLSingleServer, AWS_RDS, AWS_AURORA, AWS_EC2, GCP_CloudSQL, GCP_AlloyDB, GCP_Compute, or EDB. + * PostgreSQLSingleServer, AWS_RDS, AWS_AURORA, AWS_EC2, GCP_CloudSQL, GCP_AlloyDB, GCP_Compute, EDB, + * EDB_Oracle_Server, EDB_PostgreSQL, PostgreSQLFlexibleServer, PostgreSQLCosmosDB, Huawei_RDS, + * Huawei_Compute, Heroku_PostgreSQL, Crunchy_PostgreSQL, ApsaraDB_RDS, Digital_Ocean_Droplets, + * Digital_Ocean_PostgreSQL, or Supabase_PostgreSQL. * * @param sourceType migration source server type : OnPremises, AWS, GCP, AzureVM, PostgreSQLSingleServer, - * AWS_RDS, AWS_AURORA, AWS_EC2, GCP_CloudSQL, GCP_AlloyDB, GCP_Compute, or EDB. + * AWS_RDS, AWS_AURORA, AWS_EC2, GCP_CloudSQL, GCP_AlloyDB, GCP_Compute, EDB, EDB_Oracle_Server, + * EDB_PostgreSQL, PostgreSQLFlexibleServer, PostgreSQLCosmosDB, Huawei_RDS, Huawei_Compute, + * Heroku_PostgreSQL, Crunchy_PostgreSQL, ApsaraDB_RDS, Digital_Ocean_Droplets, Digital_Ocean_PostgreSQL, or + * Supabase_PostgreSQL. * @return the next definition stage. */ WithCreate withSourceType(SourceType sourceType); diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/NameProperty.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/NameProperty.java new file mode 100644 index 000000000000..48cf6475bcae --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/NameProperty.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Name property for quota usage. + */ +@Fluent +public final class NameProperty implements JsonSerializable { + /* + * Name value + */ + private String value; + + /* + * Localized name + */ + private String localizedValue; + + /** + * Creates an instance of NameProperty class. + */ + public NameProperty() { + } + + /** + * Get the value property: Name value. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: Name value. + * + * @param value the value value to set. + * @return the NameProperty object itself. + */ + public NameProperty withValue(String value) { + this.value = value; + return this; + } + + /** + * Get the localizedValue property: Localized name. + * + * @return the localizedValue value. + */ + public String localizedValue() { + return this.localizedValue; + } + + /** + * Set the localizedValue property: Localized name. + * + * @param localizedValue the localizedValue value to set. + * @return the NameProperty object itself. + */ + public NameProperty withLocalizedValue(String localizedValue) { + this.localizedValue = localizedValue; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", this.value); + jsonWriter.writeStringField("localizedValue", this.localizedValue); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NameProperty from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NameProperty if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the NameProperty. + */ + public static NameProperty fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NameProperty deserializedNameProperty = new NameProperty(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedNameProperty.value = reader.getString(); + } else if ("localizedValue".equals(fieldName)) { + deserializedNameProperty.localizedValue = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedNameProperty; + }); + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ObjectRecommendationDetails.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ObjectRecommendationDetails.java new file mode 100644 index 000000000000..24640033c675 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ObjectRecommendationDetails.java @@ -0,0 +1,265 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Recommendation details for the recommended action. + */ +@Fluent +public final class ObjectRecommendationDetails implements JsonSerializable { + /* + * Database name. + */ + private String databaseName; + + /* + * Schema name. + */ + private String schema; + + /* + * Table name. + */ + private String table; + + /* + * Index type. + */ + private String indexType; + + /* + * Index name. + */ + private String indexName; + + /* + * Index columns. + */ + private List indexColumns; + + /* + * Index included columns. + */ + private List includedColumns; + + /** + * Creates an instance of ObjectRecommendationDetails class. + */ + public ObjectRecommendationDetails() { + } + + /** + * Get the databaseName property: Database name. + * + * @return the databaseName value. + */ + public String databaseName() { + return this.databaseName; + } + + /** + * Set the databaseName property: Database name. + * + * @param databaseName the databaseName value to set. + * @return the ObjectRecommendationDetails object itself. + */ + public ObjectRecommendationDetails withDatabaseName(String databaseName) { + this.databaseName = databaseName; + return this; + } + + /** + * Get the schema property: Schema name. + * + * @return the schema value. + */ + public String schema() { + return this.schema; + } + + /** + * Set the schema property: Schema name. + * + * @param schema the schema value to set. + * @return the ObjectRecommendationDetails object itself. + */ + public ObjectRecommendationDetails withSchema(String schema) { + this.schema = schema; + return this; + } + + /** + * Get the table property: Table name. + * + * @return the table value. + */ + public String table() { + return this.table; + } + + /** + * Set the table property: Table name. + * + * @param table the table value to set. + * @return the ObjectRecommendationDetails object itself. + */ + public ObjectRecommendationDetails withTable(String table) { + this.table = table; + return this; + } + + /** + * Get the indexType property: Index type. + * + * @return the indexType value. + */ + public String indexType() { + return this.indexType; + } + + /** + * Set the indexType property: Index type. + * + * @param indexType the indexType value to set. + * @return the ObjectRecommendationDetails object itself. + */ + public ObjectRecommendationDetails withIndexType(String indexType) { + this.indexType = indexType; + return this; + } + + /** + * Get the indexName property: Index name. + * + * @return the indexName value. + */ + public String indexName() { + return this.indexName; + } + + /** + * Set the indexName property: Index name. + * + * @param indexName the indexName value to set. + * @return the ObjectRecommendationDetails object itself. + */ + public ObjectRecommendationDetails withIndexName(String indexName) { + this.indexName = indexName; + return this; + } + + /** + * Get the indexColumns property: Index columns. + * + * @return the indexColumns value. + */ + public List indexColumns() { + return this.indexColumns; + } + + /** + * Set the indexColumns property: Index columns. + * + * @param indexColumns the indexColumns value to set. + * @return the ObjectRecommendationDetails object itself. + */ + public ObjectRecommendationDetails withIndexColumns(List indexColumns) { + this.indexColumns = indexColumns; + return this; + } + + /** + * Get the includedColumns property: Index included columns. + * + * @return the includedColumns value. + */ + public List includedColumns() { + return this.includedColumns; + } + + /** + * Set the includedColumns property: Index included columns. + * + * @param includedColumns the includedColumns value to set. + * @return the ObjectRecommendationDetails object itself. + */ + public ObjectRecommendationDetails withIncludedColumns(List includedColumns) { + this.includedColumns = includedColumns; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("databaseName", this.databaseName); + jsonWriter.writeStringField("schema", this.schema); + jsonWriter.writeStringField("table", this.table); + jsonWriter.writeStringField("indexType", this.indexType); + jsonWriter.writeStringField("indexName", this.indexName); + jsonWriter.writeArrayField("indexColumns", this.indexColumns, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("includedColumns", this.includedColumns, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ObjectRecommendationDetails from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ObjectRecommendationDetails 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 ObjectRecommendationDetails. + */ + public static ObjectRecommendationDetails fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ObjectRecommendationDetails deserializedObjectRecommendationDetails = new ObjectRecommendationDetails(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("databaseName".equals(fieldName)) { + deserializedObjectRecommendationDetails.databaseName = reader.getString(); + } else if ("schema".equals(fieldName)) { + deserializedObjectRecommendationDetails.schema = reader.getString(); + } else if ("table".equals(fieldName)) { + deserializedObjectRecommendationDetails.table = reader.getString(); + } else if ("indexType".equals(fieldName)) { + deserializedObjectRecommendationDetails.indexType = reader.getString(); + } else if ("indexName".equals(fieldName)) { + deserializedObjectRecommendationDetails.indexName = reader.getString(); + } else if ("indexColumns".equals(fieldName)) { + List indexColumns = reader.readArray(reader1 -> reader1.getString()); + deserializedObjectRecommendationDetails.indexColumns = indexColumns; + } else if ("includedColumns".equals(fieldName)) { + List includedColumns = reader.readArray(reader1 -> reader1.getString()); + deserializedObjectRecommendationDetails.includedColumns = includedColumns; + } else { + reader.skipChildren(); + } + } + + return deserializedObjectRecommendationDetails; + }); + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ObjectRecommendationListResult.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ObjectRecommendationListResult.java new file mode 100644 index 000000000000..3ecb5c9c99b5 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ObjectRecommendationListResult.java @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.ObjectRecommendationResourceInner; +import java.io.IOException; +import java.util.List; + +/** + * A list of available recommendations. + */ +@Fluent +public final class ObjectRecommendationListResult implements JsonSerializable { + /* + * A list of available recommendations. + */ + private List value; + + /* + * URL client should use to fetch the next page (per server side paging). + * It's null for now, added for future use. + */ + private String nextLink; + + /** + * Creates an instance of ObjectRecommendationListResult class. + */ + public ObjectRecommendationListResult() { + } + + /** + * Get the value property: A list of available recommendations. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of available recommendations. + * + * @param value the value value to set. + * @return the ObjectRecommendationListResult object itself. + */ + public ObjectRecommendationListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL client should use to fetch the next page (per server side paging). + * It's null for now, added for future use. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL client should use to fetch the next page (per server side paging). + * It's null for now, added for future use. + * + * @param nextLink the nextLink value to set. + * @return the ObjectRecommendationListResult object itself. + */ + public ObjectRecommendationListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ObjectRecommendationListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ObjectRecommendationListResult 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 ObjectRecommendationListResult. + */ + public static ObjectRecommendationListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ObjectRecommendationListResult deserializedObjectRecommendationListResult + = new ObjectRecommendationListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> ObjectRecommendationResourceInner.fromJson(reader1)); + deserializedObjectRecommendationListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedObjectRecommendationListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedObjectRecommendationListResult; + }); + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ObjectRecommendationResource.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ObjectRecommendationResource.java new file mode 100644 index 000000000000..f36650bcfab3 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ObjectRecommendationResource.java @@ -0,0 +1,122 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.ObjectRecommendationResourceInner; +import java.time.OffsetDateTime; +import java.util.List; + +/** + * An immutable client-side representation of ObjectRecommendationResource. + */ +public interface ObjectRecommendationResource { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the initialRecommendedTime property: Creation time of this recommendation in UTC date-time string format. + * + * @return the initialRecommendedTime value. + */ + OffsetDateTime initialRecommendedTime(); + + /** + * Gets the lastRecommendedTime property: The last refresh of this recommendation in UTC date-time string format. + * + * @return the lastRecommendedTime value. + */ + OffsetDateTime lastRecommendedTime(); + + /** + * Gets the timesRecommended property: The number of times this recommendation has encountered. + * + * @return the timesRecommended value. + */ + Integer timesRecommended(); + + /** + * Gets the improvedQueryIds property: The ImprovedQueryIds. The list will only be populated for CREATE INDEX + * recommendations. + * + * @return the improvedQueryIds value. + */ + List improvedQueryIds(); + + /** + * Gets the recommendationReason property: Reason for this recommendation. + * + * @return the recommendationReason value. + */ + String recommendationReason(); + + /** + * Gets the recommendationType property: Type for this recommendation. + * + * @return the recommendationType value. + */ + RecommendationTypeEnum recommendationType(); + + /** + * Gets the implementationDetails property: Stores implementation details for the recommended action. + * + * @return the implementationDetails value. + */ + ObjectRecommendationResourcePropertiesImplementationDetails implementationDetails(); + + /** + * Gets the analyzedWorkload property: Stores workload information for the recommended action. + * + * @return the analyzedWorkload value. + */ + ObjectRecommendationResourcePropertiesAnalyzedWorkload analyzedWorkload(); + + /** + * Gets the estimatedImpact property: The estimated impact of this recommended action. + * + * @return the estimatedImpact value. + */ + List estimatedImpact(); + + /** + * Gets the details property: Stores recommendation details for the recommended action. + * + * @return the details value. + */ + ObjectRecommendationDetails details(); + + /** + * Gets the inner com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.ObjectRecommendationResourceInner + * object. + * + * @return the inner object. + */ + ObjectRecommendationResourceInner innerModel(); +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ObjectRecommendationResourcePropertiesAnalyzedWorkload.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ObjectRecommendationResourcePropertiesAnalyzedWorkload.java new file mode 100644 index 000000000000..d834413fc7a6 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ObjectRecommendationResourcePropertiesAnalyzedWorkload.java @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; + +/** + * Stores workload information for the recommended action. + */ +@Fluent +public final class ObjectRecommendationResourcePropertiesAnalyzedWorkload + implements JsonSerializable { + /* + * Workload start time in UTC date-time string format. + */ + private OffsetDateTime startTime; + + /* + * Workload end time in UTC date-time string format. + */ + private OffsetDateTime endTime; + + /* + * Workload query examined count. For DROP INDEX will be 0. + */ + private Integer queryCount; + + /** + * Creates an instance of ObjectRecommendationResourcePropertiesAnalyzedWorkload class. + */ + public ObjectRecommendationResourcePropertiesAnalyzedWorkload() { + } + + /** + * Get the startTime property: Workload start time in UTC date-time string format. + * + * @return the startTime value. + */ + public OffsetDateTime startTime() { + return this.startTime; + } + + /** + * Set the startTime property: Workload start time in UTC date-time string format. + * + * @param startTime the startTime value to set. + * @return the ObjectRecommendationResourcePropertiesAnalyzedWorkload object itself. + */ + public ObjectRecommendationResourcePropertiesAnalyzedWorkload withStartTime(OffsetDateTime startTime) { + this.startTime = startTime; + return this; + } + + /** + * Get the endTime property: Workload end time in UTC date-time string format. + * + * @return the endTime value. + */ + public OffsetDateTime endTime() { + return this.endTime; + } + + /** + * Set the endTime property: Workload end time in UTC date-time string format. + * + * @param endTime the endTime value to set. + * @return the ObjectRecommendationResourcePropertiesAnalyzedWorkload object itself. + */ + public ObjectRecommendationResourcePropertiesAnalyzedWorkload withEndTime(OffsetDateTime endTime) { + this.endTime = endTime; + return this; + } + + /** + * Get the queryCount property: Workload query examined count. For DROP INDEX will be 0. + * + * @return the queryCount value. + */ + public Integer queryCount() { + return this.queryCount; + } + + /** + * Set the queryCount property: Workload query examined count. For DROP INDEX will be 0. + * + * @param queryCount the queryCount value to set. + * @return the ObjectRecommendationResourcePropertiesAnalyzedWorkload object itself. + */ + public ObjectRecommendationResourcePropertiesAnalyzedWorkload withQueryCount(Integer queryCount) { + this.queryCount = queryCount; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("startTime", + this.startTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.startTime)); + jsonWriter.writeStringField("endTime", + this.endTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.endTime)); + jsonWriter.writeNumberField("queryCount", this.queryCount); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ObjectRecommendationResourcePropertiesAnalyzedWorkload from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ObjectRecommendationResourcePropertiesAnalyzedWorkload 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 ObjectRecommendationResourcePropertiesAnalyzedWorkload. + */ + public static ObjectRecommendationResourcePropertiesAnalyzedWorkload fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + ObjectRecommendationResourcePropertiesAnalyzedWorkload deserializedObjectRecommendationResourcePropertiesAnalyzedWorkload + = new ObjectRecommendationResourcePropertiesAnalyzedWorkload(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("startTime".equals(fieldName)) { + deserializedObjectRecommendationResourcePropertiesAnalyzedWorkload.startTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("endTime".equals(fieldName)) { + deserializedObjectRecommendationResourcePropertiesAnalyzedWorkload.endTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("queryCount".equals(fieldName)) { + deserializedObjectRecommendationResourcePropertiesAnalyzedWorkload.queryCount + = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedObjectRecommendationResourcePropertiesAnalyzedWorkload; + }); + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ObjectRecommendationResourcePropertiesImplementationDetails.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ObjectRecommendationResourcePropertiesImplementationDetails.java new file mode 100644 index 000000000000..ce2e0ecbf01d --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ObjectRecommendationResourcePropertiesImplementationDetails.java @@ -0,0 +1,125 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Stores implementation details for the recommended action. + */ +@Fluent +public final class ObjectRecommendationResourcePropertiesImplementationDetails + implements JsonSerializable { + /* + * Method of implementation for recommended action + */ + private String method; + + /* + * Implementation script for the recommended action + */ + private String script; + + /** + * Creates an instance of ObjectRecommendationResourcePropertiesImplementationDetails class. + */ + public ObjectRecommendationResourcePropertiesImplementationDetails() { + } + + /** + * Get the method property: Method of implementation for recommended action. + * + * @return the method value. + */ + public String method() { + return this.method; + } + + /** + * Set the method property: Method of implementation for recommended action. + * + * @param method the method value to set. + * @return the ObjectRecommendationResourcePropertiesImplementationDetails object itself. + */ + public ObjectRecommendationResourcePropertiesImplementationDetails withMethod(String method) { + this.method = method; + return this; + } + + /** + * Get the script property: Implementation script for the recommended action. + * + * @return the script value. + */ + public String script() { + return this.script; + } + + /** + * Set the script property: Implementation script for the recommended action. + * + * @param script the script value to set. + * @return the ObjectRecommendationResourcePropertiesImplementationDetails object itself. + */ + public ObjectRecommendationResourcePropertiesImplementationDetails withScript(String script) { + this.script = script; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("method", this.method); + jsonWriter.writeStringField("script", this.script); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ObjectRecommendationResourcePropertiesImplementationDetails from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ObjectRecommendationResourcePropertiesImplementationDetails 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 + * ObjectRecommendationResourcePropertiesImplementationDetails. + */ + public static ObjectRecommendationResourcePropertiesImplementationDetails fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + ObjectRecommendationResourcePropertiesImplementationDetails deserializedObjectRecommendationResourcePropertiesImplementationDetails + = new ObjectRecommendationResourcePropertiesImplementationDetails(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("method".equals(fieldName)) { + deserializedObjectRecommendationResourcePropertiesImplementationDetails.method = reader.getString(); + } else if ("script".equals(fieldName)) { + deserializedObjectRecommendationResourcePropertiesImplementationDetails.script = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedObjectRecommendationResourcePropertiesImplementationDetails; + }); + } +} 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 2a754a896d96..87b9162a1709 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/OnlineResizeSupportedEnum.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/OnlineResizeSupportedEnum.java @@ -9,7 +9,8 @@ /** * A value indicating whether online resize is supported in this region for the given subscription. "Enabled" means - * storage online resize is supported. "Disabled" means storage online resize is not supported. + * storage online resize is supported. "Disabled" means storage online resize is not supported. Will be deprecated in + * future, please look to Supported Features for "OnlineResize". */ public final class OnlineResizeSupportedEnum extends ExpandableStringEnum { /** diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/Operation.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/Operation.java index bc78e30472af..4b2f806f69c6 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 @@ -4,159 +4,52 @@ package com.azure.resourcemanager.postgresqlflexibleserver.models; -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.OperationInner; import java.util.Map; /** - * REST API operation definition. + * An immutable client-side representation of Operation. */ -@Fluent -public final class Operation implements JsonSerializable { - /* - * The name of the operation being performed on this particular object. - */ - private String name; - - /* - * The localized display information for this particular operation or action. - */ - private OperationDisplay display; - - /* - * Indicates whether the operation is a data action - */ - private Boolean isDataAction; - - /* - * The intended executor of the operation. - */ - private OperationOrigin origin; - - /* - * Additional descriptions for the operation. - */ - private Map properties; - - /** - * Creates an instance of Operation class. - */ - public Operation() { - } - +public interface Operation { /** - * Get the name property: The name of the operation being performed on this particular object. + * Gets the name property: The name of the operation being performed on this particular object. * * @return the name value. */ - public String name() { - return this.name; - } + String name(); /** - * Get the display property: The localized display information for this particular operation or action. + * Gets the display property: The localized display information for this particular operation or action. * * @return the display value. */ - public OperationDisplay display() { - return this.display; - } + OperationDisplay display(); /** - * Get the isDataAction property: Indicates whether the operation is a data action. + * Gets the isDataAction property: Indicates whether the operation is a data action. * * @return the isDataAction value. */ - public Boolean isDataAction() { - return this.isDataAction; - } + Boolean isDataAction(); /** - * Set the isDataAction property: Indicates whether the operation is a data action. - * - * @param isDataAction the isDataAction value to set. - * @return the Operation object itself. - */ - public Operation withIsDataAction(Boolean isDataAction) { - this.isDataAction = isDataAction; - return this; - } - - /** - * Get the origin property: The intended executor of the operation. + * Gets the origin property: The intended executor of the operation. * * @return the origin value. */ - public OperationOrigin origin() { - return this.origin; - } + OperationOrigin origin(); /** - * Get the properties property: Additional descriptions for the operation. + * Gets the properties property: Additional descriptions for the operation. * * @return the properties value. */ - public Map properties() { - return this.properties; - } + Map properties(); /** - * Validates the instance. + * Gets the inner com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.OperationInner object. * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (display() != null) { - display().validate(); - } - } - - /** - * {@inheritDoc} + * @return the inner object. */ - @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; - }); - } + OperationInner innerModel(); } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/OperationListResult.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/OperationListResult.java index f8de93f233f4..a009ba9cbd91 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/OperationListResult.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/OperationListResult.java @@ -4,32 +4,127 @@ package com.azure.resourcemanager.postgresqlflexibleserver.models; -import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.OperationListResultInner; +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.OperationInner; +import java.io.IOException; import java.util.List; /** - * An immutable client-side representation of OperationListResult. + * A list of resource provider operations. */ -public interface OperationListResult { +@Fluent +public final class OperationListResult implements JsonSerializable { + /* + * Collection of available operation details + */ + private List value; + + /* + * URL client should use to fetch the next page (per server side paging). + * It's null for now, added for future use. + */ + private String nextLink; + /** - * Gets the value property: Collection of available operation details. + * Creates an instance of OperationListResult class. + */ + public OperationListResult() { + } + + /** + * Get the value property: Collection of available operation details. * * @return the value value. */ - List value(); + public List value() { + return this.value; + } + + /** + * Set the value property: Collection of available operation details. + * + * @param value the value value to set. + * @return the OperationListResult object itself. + */ + public OperationListResult withValue(List value) { + this.value = value; + return this; + } /** - * Gets the nextLink property: URL client should use to fetch the next page (per server side paging). + * Get the nextLink property: URL client should use to fetch the next page (per server side paging). * It's null for now, added for future use. * * @return the nextLink value. */ - String nextLink(); + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL client should use to fetch the next page (per server side paging). + * It's null for now, added for future use. + * + * @param nextLink the nextLink value to set. + * @return the OperationListResult object itself. + */ + public OperationListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } /** - * Gets the inner com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.OperationListResultInner object. + * Validates the instance. * - * @return the inner object. + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} */ - OperationListResultInner innerModel(); + @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 OperationListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationListResult 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 OperationListResult. + */ + public static OperationListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationListResult deserializedOperationListResult = new OperationListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> OperationInner.fromJson(reader1)); + deserializedOperationListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedOperationListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedOperationListResult; + }); + } } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/Operations.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/Operations.java index 411a4501b6ba..21ec92f2e236 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/Operations.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/Operations.java @@ -4,7 +4,7 @@ package com.azure.resourcemanager.postgresqlflexibleserver.models; -import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.PagedIterable; import com.azure.core.util.Context; /** @@ -14,20 +14,20 @@ public interface Operations { /** * Lists all of the available REST API operations. * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of resource provider operations along with {@link Response}. + * @return a list of resource provider operations as paginated response with {@link PagedIterable}. */ - Response listWithResponse(Context context); + PagedIterable list(); /** * Lists all of the available REST API operations. * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of resource provider operations. + * @return a list of resource provider operations as paginated response with {@link PagedIterable}. */ - OperationListResult list(); + PagedIterable list(Context context); } 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 3303e6a29c14..3861d9728641 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 @@ -8,7 +8,7 @@ import java.util.Collection; /** - * The principal type used to represent the type of Active Directory Administrator. + * The principal type used to represent the type of Microsoft Entra Administrator. */ public final class PrincipalType extends ExpandableStringEnum { /** diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/QuotaUsage.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/QuotaUsage.java new file mode 100644 index 000000000000..42fc8e3aba59 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/QuotaUsage.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.models; + +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.QuotaUsageInner; + +/** + * An immutable client-side representation of QuotaUsage. + */ +public interface QuotaUsage { + /** + * Gets the name property: Name of quota usage for flexible servers. + * + * @return the name value. + */ + NameProperty name(); + + /** + * Gets the limit property: Quota limit. + * + * @return the limit value. + */ + Long limit(); + + /** + * Gets the unit property: Quota unit. + * + * @return the unit value. + */ + String unit(); + + /** + * Gets the currentValue property: Current Quota usage value. + * + * @return the currentValue value. + */ + Long currentValue(); + + /** + * Gets the id property: Fully qualified ARM resource Id. + * + * @return the id value. + */ + String id(); + + /** + * Gets the inner com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.QuotaUsageInner object. + * + * @return the inner object. + */ + QuotaUsageInner innerModel(); +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/QuotaUsages.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/QuotaUsages.java new file mode 100644 index 000000000000..b2243c0d4723 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/QuotaUsages.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** + * Resource collection API of QuotaUsages. + */ +public interface QuotaUsages { + /** + * Get quota usages at specified location in a given subscription. + * + * @param locationName The name of the location. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return quota usages at specified location in a given subscription as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(String locationName); + + /** + * Get quota usages at specified location in a given subscription. + * + * @param locationName The name of the location. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return quota usages at specified location in a given subscription as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(String locationName, Context context); +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/QuotaUsagesListResult.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/QuotaUsagesListResult.java new file mode 100644 index 000000000000..30745c74c1f3 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/QuotaUsagesListResult.java @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.QuotaUsageInner; +import java.io.IOException; +import java.util.List; + +/** + * Capability for the PostgreSQL server. + */ +@Immutable +public final class QuotaUsagesListResult implements JsonSerializable { + /* + * A list of quota usages. + */ + private List value; + + /* + * Link to retrieve next page of results. + */ + private String nextLink; + + /** + * Creates an instance of QuotaUsagesListResult class. + */ + public QuotaUsagesListResult() { + } + + /** + * Get the value property: A list of quota usages. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: Link to retrieve next page of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of QuotaUsagesListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of QuotaUsagesListResult if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the QuotaUsagesListResult. + */ + public static QuotaUsagesListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + QuotaUsagesListResult deserializedQuotaUsagesListResult = new QuotaUsagesListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> QuotaUsageInner.fromJson(reader1)); + deserializedQuotaUsagesListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedQuotaUsagesListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedQuotaUsagesListResult; + }); + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/RecommendationType.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/RecommendationType.java new file mode 100644 index 000000000000..10f0c105b82d --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/RecommendationType.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Defines values for RecommendationType. + */ +public final class RecommendationType extends ExpandableStringEnum { + /** + * Static value CreateIndex for RecommendationType. + */ + public static final RecommendationType CREATE_INDEX = fromString("CreateIndex"); + + /** + * Static value DropIndex for RecommendationType. + */ + public static final RecommendationType DROP_INDEX = fromString("DropIndex"); + + /** + * Static value AnalyzeTable for RecommendationType. + */ + public static final RecommendationType ANALYZE_TABLE = fromString("AnalyzeTable"); + + /** + * Creates a new instance of RecommendationType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public RecommendationType() { + } + + /** + * Creates or finds a RecommendationType from its string representation. + * + * @param name a name to look for. + * @return the corresponding RecommendationType. + */ + public static RecommendationType fromString(String name) { + return fromString(name, RecommendationType.class); + } + + /** + * Gets known RecommendationType values. + * + * @return known RecommendationType values. + */ + public static Collection values() { + return values(RecommendationType.class); + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/RecommendationTypeEnum.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/RecommendationTypeEnum.java new file mode 100644 index 000000000000..2e8af8ac605e --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/RecommendationTypeEnum.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Type for this recommendation. + */ +public final class RecommendationTypeEnum extends ExpandableStringEnum { + /** + * Static value CreateIndex for RecommendationTypeEnum. + */ + public static final RecommendationTypeEnum CREATE_INDEX = fromString("CreateIndex"); + + /** + * Static value DropIndex for RecommendationTypeEnum. + */ + public static final RecommendationTypeEnum DROP_INDEX = fromString("DropIndex"); + + /** + * Static value ReIndex for RecommendationTypeEnum. + */ + public static final RecommendationTypeEnum RE_INDEX = fromString("ReIndex"); + + /** + * Static value AnalyzeTable for RecommendationTypeEnum. + */ + public static final RecommendationTypeEnum ANALYZE_TABLE = fromString("AnalyzeTable"); + + /** + * Creates a new instance of RecommendationTypeEnum value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public RecommendationTypeEnum() { + } + + /** + * Creates or finds a RecommendationTypeEnum from its string representation. + * + * @param name a name to look for. + * @return the corresponding RecommendationTypeEnum. + */ + public static RecommendationTypeEnum fromString(String name) { + return fromString(name, RecommendationTypeEnum.class); + } + + /** + * Gets known RecommendationTypeEnum values. + * + * @return known RecommendationTypeEnum values. + */ + public static Collection values() { + return values(RecommendationTypeEnum.class); + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/RestrictedEnum.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/RestrictedEnum.java index 7e9d344449f3..a4432f0b0764 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/RestrictedEnum.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/RestrictedEnum.java @@ -9,7 +9,7 @@ /** * A value indicating whether this region is restricted. "Enabled" means region is restricted. "Disabled" stands for - * region is not restricted. + * region is not restricted. Will be deprecated in future, please look to Supported Features for "Restricted". */ public final class RestrictedEnum extends ExpandableStringEnum { /** diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/Server.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/Server.java index 651c795fa2b8..5b22aebb4ac7 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/Server.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/Server.java @@ -226,6 +226,13 @@ public interface Server { */ List privateEndpointConnections(); + /** + * Gets the cluster property: Cluster properties of a server. + * + * @return the cluster value. + */ + Cluster cluster(); + /** * Gets the region of the resource. * @@ -315,7 +322,7 @@ interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithSku DefinitionStages.WithDataEncryption, DefinitionStages.WithBackup, DefinitionStages.WithNetwork, DefinitionStages.WithHighAvailability, DefinitionStages.WithSourceServerResourceId, DefinitionStages.WithPointInTimeUtc, DefinitionStages.WithAvailabilityZone, - DefinitionStages.WithReplicationRole, DefinitionStages.WithCreateMode { + DefinitionStages.WithReplicationRole, DefinitionStages.WithCreateMode, DefinitionStages.WithCluster { /** * Executes the create request. * @@ -564,6 +571,19 @@ interface WithCreateMode { */ WithCreate withCreateMode(CreateMode createMode); } + + /** + * The stage of the Server definition allowing to specify cluster. + */ + interface WithCluster { + /** + * Specifies the cluster property: Cluster properties of a server.. + * + * @param cluster Cluster properties of a server. + * @return the next definition stage. + */ + WithCreate withCluster(Cluster cluster); + } } /** @@ -581,7 +601,7 @@ interface Update extends UpdateStages.WithTags, UpdateStages.WithSku, UpdateStag UpdateStages.WithStorage, UpdateStages.WithBackup, UpdateStages.WithHighAvailability, UpdateStages.WithMaintenanceWindow, UpdateStages.WithAuthConfig, UpdateStages.WithDataEncryption, UpdateStages.WithCreateMode, UpdateStages.WithReplicationRole, UpdateStages.WithReplica, - UpdateStages.WithNetwork { + UpdateStages.WithNetwork, UpdateStages.WithCluster { /** * Executes the update request. * @@ -675,10 +695,10 @@ interface WithAdministratorLoginPassword { */ interface WithVersion { /** - * Specifies the version property: PostgreSQL Server version. Version 16 is currently not supported for + * Specifies the version property: PostgreSQL Server version. Version 17 is currently not supported for * MVU.. * - * @param version PostgreSQL Server version. Version 16 is currently not supported for MVU. + * @param version PostgreSQL Server version. Version 17 is currently not supported for MVU. * @return the next definition stage. */ Update withVersion(ServerVersion version); @@ -817,6 +837,19 @@ interface WithNetwork { */ Update withNetwork(Network network); } + + /** + * The stage of the Server update allowing to specify cluster. + */ + interface WithCluster { + /** + * Specifies the cluster property: Cluster properties of a server.. + * + * @param cluster Cluster properties of a server. + * @return the next definition stage. + */ + Update withCluster(Cluster cluster); + } } /** diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ServerForUpdate.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ServerForUpdate.java index a754d623d7b6..165e061be555 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 @@ -162,7 +162,7 @@ public ServerForUpdate withAdministratorLoginPassword(String administratorLoginP } /** - * Get the version property: PostgreSQL Server version. Version 16 is currently not supported for MVU. + * Get the version property: PostgreSQL Server version. Version 17 is currently not supported for MVU. * * @return the version value. */ @@ -171,7 +171,7 @@ public ServerVersion version() { } /** - * Set the version property: PostgreSQL Server version. Version 16 is currently not supported for MVU. + * Set the version property: PostgreSQL Server version. Version 17 is currently not supported for MVU. * * @param version the version value to set. * @return the ServerForUpdate object itself. @@ -418,6 +418,29 @@ public ServerForUpdate withNetwork(Network network) { return this; } + /** + * Get the cluster property: Cluster properties of a server. + * + * @return the cluster value. + */ + public Cluster cluster() { + return this.innerProperties() == null ? null : this.innerProperties().cluster(); + } + + /** + * Set the cluster property: Cluster properties of a server. + * + * @param cluster the cluster value to set. + * @return the ServerForUpdate object itself. + */ + public ServerForUpdate withCluster(Cluster cluster) { + if (this.innerProperties() == null) { + this.innerProperties = new ServerPropertiesForUpdate(); + } + this.innerProperties().withCluster(cluster); + return this; + } + /** * Validates the instance. * diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ServerSkuCapability.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ServerSkuCapability.java index c9523b6952d2..3d2b935bf3ee 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ServerSkuCapability.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ServerSkuCapability.java @@ -46,6 +46,16 @@ public final class ServerSkuCapability extends CapabilityBase { */ private List supportedHaMode; + /* + * The supported features. + */ + private List supportedFeatures; + + /* + * The value of security profile indicating if its confidential vm + */ + private String securityProfile; + /* * The reason for the capability not being available. */ @@ -116,6 +126,24 @@ public List supportedHaMode() { return this.supportedHaMode; } + /** + * Get the supportedFeatures property: The supported features. + * + * @return the supportedFeatures value. + */ + public List supportedFeatures() { + return this.supportedFeatures; + } + + /** + * Get the securityProfile property: The value of security profile indicating if its confidential vm. + * + * @return the securityProfile value. + */ + public String securityProfile() { + return this.securityProfile; + } + /** * Get the reason property: The reason for the capability not being available. * @@ -143,6 +171,9 @@ public CapabilityStatus status() { */ @Override public void validate() { + if (supportedFeatures() != null) { + supportedFeatures().forEach(e -> e.validate()); + } } /** @@ -187,6 +218,12 @@ public static ServerSkuCapability fromJson(JsonReader jsonReader) throws IOExcep } else if ("supportedHaMode".equals(fieldName)) { List supportedHaMode = reader.readArray(reader1 -> HaMode.fromString(reader1.getString())); deserializedServerSkuCapability.supportedHaMode = supportedHaMode; + } else if ("supportedFeatures".equals(fieldName)) { + List supportedFeatures + = reader.readArray(reader1 -> SupportedFeature.fromJson(reader1)); + deserializedServerSkuCapability.supportedFeatures = supportedFeatures; + } else if ("securityProfile".equals(fieldName)) { + deserializedServerSkuCapability.securityProfile = reader.getString(); } else { reader.skipChildren(); } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ServerState.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ServerState.java index a85bf6e086ce..c0d72cc1c59a 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 @@ -46,6 +46,21 @@ public final class ServerState extends ExpandableStringEnum { */ public static final ServerState UPDATING = fromString("Updating"); + /** + * Static value Restarting for ServerState. + */ + public static final ServerState RESTARTING = fromString("Restarting"); + + /** + * Static value Inaccessible for ServerState. + */ + public static final ServerState INACCESSIBLE = fromString("Inaccessible"); + + /** + * Static value Provisioning for ServerState. + */ + public static final ServerState PROVISIONING = fromString("Provisioning"); + /** * Creates a new instance of ServerState value. * 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 6b152fa9b30a..d32b5c9d571f 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ServerVersion.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ServerVersion.java @@ -11,6 +11,11 @@ * The version of a server. */ public final class ServerVersion extends ExpandableStringEnum { + /** + * Static value 17 for ServerVersion. + */ + public static final ServerVersion ONE_SEVEN = fromString("17"); + /** * Static value 16 for ServerVersion. */ diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ServerVersionCapability.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ServerVersionCapability.java index 89a71e12cb41..c380981455ef 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ServerVersionCapability.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ServerVersionCapability.java @@ -26,6 +26,11 @@ public final class ServerVersionCapability extends CapabilityBase { */ private List supportedVersionsToUpgrade; + /* + * The supported features. + */ + private List supportedFeatures; + /* * The reason for the capability not being available. */ @@ -60,6 +65,15 @@ public List supportedVersionsToUpgrade() { return this.supportedVersionsToUpgrade; } + /** + * Get the supportedFeatures property: The supported features. + * + * @return the supportedFeatures value. + */ + public List supportedFeatures() { + return this.supportedFeatures; + } + /** * Get the reason property: The reason for the capability not being available. * @@ -87,6 +101,9 @@ public CapabilityStatus status() { */ @Override public void validate() { + if (supportedFeatures() != null) { + supportedFeatures().forEach(e -> e.validate()); + } } /** @@ -122,6 +139,10 @@ public static ServerVersionCapability fromJson(JsonReader jsonReader) throws IOE } else if ("supportedVersionsToUpgrade".equals(fieldName)) { List supportedVersionsToUpgrade = reader.readArray(reader1 -> reader1.getString()); deserializedServerVersionCapability.supportedVersionsToUpgrade = supportedVersionsToUpgrade; + } else if ("supportedFeatures".equals(fieldName)) { + List supportedFeatures + = reader.readArray(reader1 -> SupportedFeature.fromJson(reader1)); + deserializedServerVersionCapability.supportedFeatures = supportedFeatures; } else { reader.skipChildren(); } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/OperationListResultInner.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/SessionDetailsListResult.java similarity index 63% rename from sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/OperationListResultInner.java rename to sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/SessionDetailsListResult.java index 3cf4df3efece..6a0193fbdba9 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/models/SessionDetailsListResult.java @@ -2,26 +2,26 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.postgresqlflexibleserver.fluent.models; +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.models.Operation; +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.SessionDetailsResourceInner; import java.io.IOException; import java.util.List; /** - * A list of resource provider operations. + * A list of tuning configuration sessions. */ @Fluent -public final class OperationListResultInner implements JsonSerializable { +public final class SessionDetailsListResult implements JsonSerializable { /* - * Collection of available operation details + * A list of details of the session. */ - private List value; + private List value; /* * URL client should use to fetch the next page (per server side paging). @@ -30,27 +30,27 @@ public final class OperationListResultInner implements JsonSerializable value() { + public List value() { return this.value; } /** - * Set the value property: Collection of available operation details. + * Set the value property: A list of details of the session. * * @param value the value value to set. - * @return the OperationListResultInner object itself. + * @return the SessionDetailsListResult object itself. */ - public OperationListResultInner withValue(List value) { + public SessionDetailsListResult withValue(List value) { this.value = value; return this; } @@ -70,9 +70,9 @@ public String nextLink() { * It's null for now, added for future use. * * @param nextLink the nextLink value to set. - * @return the OperationListResultInner object itself. + * @return the SessionDetailsListResult object itself. */ - public OperationListResultInner withNextLink(String nextLink) { + public SessionDetailsListResult withNextLink(String nextLink) { this.nextLink = nextLink; return this; } @@ -100,31 +100,32 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { } /** - * Reads an instance of OperationListResultInner from the JsonReader. + * Reads an instance of SessionDetailsListResult 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 + * @return An instance of SessionDetailsListResult 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. + * @throws IOException If an error occurs while reading the SessionDetailsListResult. */ - public static OperationListResultInner fromJson(JsonReader jsonReader) throws IOException { + public static SessionDetailsListResult fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { - OperationListResultInner deserializedOperationListResultInner = new OperationListResultInner(); + SessionDetailsListResult deserializedSessionDetailsListResult = new SessionDetailsListResult(); 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; + List value + = reader.readArray(reader1 -> SessionDetailsResourceInner.fromJson(reader1)); + deserializedSessionDetailsListResult.value = value; } else if ("nextLink".equals(fieldName)) { - deserializedOperationListResultInner.nextLink = reader.getString(); + deserializedSessionDetailsListResult.nextLink = reader.getString(); } else { reader.skipChildren(); } } - return deserializedOperationListResultInner; + return deserializedSessionDetailsListResult; }); } } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/SessionDetailsResource.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/SessionDetailsResource.java new file mode 100644 index 000000000000..64cf897507f4 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/SessionDetailsResource.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.models; + +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.SessionDetailsResourceInner; + +/** + * An immutable client-side representation of SessionDetailsResource. + */ +public interface SessionDetailsResource { + /** + * Gets the iterationId property: Iteration id. + * + * @return the iterationId value. + */ + String iterationId(); + + /** + * Gets the sessionId property: Session id. + * + * @return the sessionId value. + */ + String sessionId(); + + /** + * Gets the appliedConfiguration property: Applied configuration for the iteration. + * + * @return the appliedConfiguration value. + */ + String appliedConfiguration(); + + /** + * Gets the iterationStartTime property: Iteration start time. + * + * @return the iterationStartTime value. + */ + String iterationStartTime(); + + /** + * Gets the averageQueryRuntimeMs property: The aqr for the iteration. + * + * @return the averageQueryRuntimeMs value. + */ + String averageQueryRuntimeMs(); + + /** + * Gets the transactionsPerSecond property: The tps for the iteration. + * + * @return the transactionsPerSecond value. + */ + String transactionsPerSecond(); + + /** + * Gets the inner com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.SessionDetailsResourceInner + * object. + * + * @return the inner object. + */ + SessionDetailsResourceInner innerModel(); +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/SessionResource.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/SessionResource.java new file mode 100644 index 000000000000..0b52ee8553d8 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/SessionResource.java @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.models; + +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.SessionResourceInner; + +/** + * An immutable client-side representation of SessionResource. + */ +public interface SessionResource { + /** + * Gets the sessionStartTime property: the tuning session start time. + * + * @return the sessionStartTime value. + */ + String sessionStartTime(); + + /** + * Gets the sessionId property: Session id. + * + * @return the sessionId value. + */ + String sessionId(); + + /** + * Gets the status property: The status of the tuning session. + * + * @return the status value. + */ + String status(); + + /** + * Gets the preTuningAqr property: The pre tuning aqr. + * + * @return the preTuningAqr value. + */ + String preTuningAqr(); + + /** + * Gets the postTuningAqr property: The post tuning aqr. + * + * @return the postTuningAqr value. + */ + String postTuningAqr(); + + /** + * Gets the preTuningTps property: The pre tuning tps. + * + * @return the preTuningTps value. + */ + String preTuningTps(); + + /** + * Gets the postTuningTps property: The post tuning tps. + * + * @return the postTuningTps value. + */ + String postTuningTps(); + + /** + * Gets the inner com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.SessionResourceInner object. + * + * @return the inner object. + */ + SessionResourceInner innerModel(); +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/SessionsListResult.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/SessionsListResult.java new file mode 100644 index 000000000000..dc73b8e394fb --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/SessionsListResult.java @@ -0,0 +1,131 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.SessionResourceInner; +import java.io.IOException; +import java.util.List; + +/** + * A list of tuning configuration sessions. + */ +@Fluent +public final class SessionsListResult implements JsonSerializable { + /* + * A list of tuning configuration sessions. + */ + private List value; + + /* + * URL client should use to fetch the next page (per server side paging). + * It's null for now, added for future use. + */ + private String nextLink; + + /** + * Creates an instance of SessionsListResult class. + */ + public SessionsListResult() { + } + + /** + * Get the value property: A list of tuning configuration sessions. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of tuning configuration sessions. + * + * @param value the value value to set. + * @return the SessionsListResult object itself. + */ + public SessionsListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL client should use to fetch the next page (per server side paging). + * It's null for now, added for future use. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL client should use to fetch the next page (per server side paging). + * It's null for now, added for future use. + * + * @param nextLink the nextLink value to set. + * @return the SessionsListResult object itself. + */ + public SessionsListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SessionsListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SessionsListResult 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 SessionsListResult. + */ + public static SessionsListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SessionsListResult deserializedSessionsListResult = new SessionsListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> SessionResourceInner.fromJson(reader1)); + deserializedSessionsListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedSessionsListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSessionsListResult; + }); + } +} 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 b983a13f55c1..a4a35c753c4c 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/SourceType.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/SourceType.java @@ -9,7 +9,9 @@ /** * Migration source server type : OnPremises, AWS, GCP, AzureVM, PostgreSQLSingleServer, AWS_RDS, AWS_AURORA, AWS_EC2, - * GCP_CloudSQL, GCP_AlloyDB, GCP_Compute, or EDB. + * GCP_CloudSQL, GCP_AlloyDB, GCP_Compute, EDB, EDB_Oracle_Server, EDB_PostgreSQL, PostgreSQLFlexibleServer, + * PostgreSQLCosmosDB, Huawei_RDS, Huawei_Compute, Heroku_PostgreSQL, Crunchy_PostgreSQL, ApsaraDB_RDS, + * Digital_Ocean_Droplets, Digital_Ocean_PostgreSQL, or Supabase_PostgreSQL. */ public final class SourceType extends ExpandableStringEnum { /** @@ -72,6 +74,66 @@ public final class SourceType extends ExpandableStringEnum { */ public static final SourceType EDB = fromString("EDB"); + /** + * Static value EDB_Oracle_Server for SourceType. + */ + public static final SourceType EDB_ORACLE_SERVER = fromString("EDB_Oracle_Server"); + + /** + * Static value EDB_PostgreSQL for SourceType. + */ + public static final SourceType EDB_POSTGRE_SQL = fromString("EDB_PostgreSQL"); + + /** + * Static value PostgreSQLFlexibleServer for SourceType. + */ + public static final SourceType POSTGRE_SQLFLEXIBLE_SERVER = fromString("PostgreSQLFlexibleServer"); + + /** + * Static value PostgreSQLCosmosDB for SourceType. + */ + public static final SourceType POSTGRE_SQLCOSMOS_DB = fromString("PostgreSQLCosmosDB"); + + /** + * Static value Huawei_RDS for SourceType. + */ + public static final SourceType HUAWEI_RDS = fromString("Huawei_RDS"); + + /** + * Static value Huawei_Compute for SourceType. + */ + public static final SourceType HUAWEI_COMPUTE = fromString("Huawei_Compute"); + + /** + * Static value Heroku_PostgreSQL for SourceType. + */ + public static final SourceType HEROKU_POSTGRE_SQL = fromString("Heroku_PostgreSQL"); + + /** + * Static value Crunchy_PostgreSQL for SourceType. + */ + public static final SourceType CRUNCHY_POSTGRE_SQL = fromString("Crunchy_PostgreSQL"); + + /** + * Static value ApsaraDB_RDS for SourceType. + */ + public static final SourceType APSARA_DB_RDS = fromString("ApsaraDB_RDS"); + + /** + * Static value Digital_Ocean_Droplets for SourceType. + */ + public static final SourceType DIGITAL_OCEAN_DROPLETS = fromString("Digital_Ocean_Droplets"); + + /** + * Static value Digital_Ocean_PostgreSQL for SourceType. + */ + public static final SourceType DIGITAL_OCEAN_POSTGRE_SQL = fromString("Digital_Ocean_PostgreSQL"); + + /** + * Static value Supabase_PostgreSQL for SourceType. + */ + public static final SourceType SUPABASE_POSTGRE_SQL = fromString("Supabase_PostgreSQL"); + /** * Creates a new instance of SourceType value. * diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/Storage.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/Storage.java index f0028e4fa628..2fbf44928867 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/Storage.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/Storage.java @@ -32,18 +32,18 @@ public final class Storage implements JsonSerializable { private AzureManagedDiskPerformanceTiers tier; /* - * Storage tier IOPS quantity. This property is required to be set for storage Type PremiumV2_LRS + * Storage IOPS quantity. This property is required to be set for storage Type PremiumV2_LRS and UltraSSD_LRS. */ private Integer iops; /* - * Storage throughput for the server. This is required to be set for storage Type PremiumV2_LRS + * Storage throughput for the server. This is required to be set for storage Type PremiumV2_LRS and UltraSSD_LRS. */ private Integer throughput; /* - * Storage type for the server. Allowed values are Premium_LRS and PremiumV2_LRS, and default is Premium_LRS if not - * specified + * Storage type for the server. Allowed values are Premium_LRS, PremiumV2_LRS, and UltraSSD_LRS. Default is + * Premium_LRS if not specified */ private StorageType type; @@ -114,8 +114,8 @@ public Storage withTier(AzureManagedDiskPerformanceTiers tier) { } /** - * Get the iops property: Storage tier IOPS quantity. This property is required to be set for storage Type - * PremiumV2_LRS. + * Get the iops property: Storage IOPS quantity. This property is required to be set for storage Type PremiumV2_LRS + * and UltraSSD_LRS. * * @return the iops value. */ @@ -124,8 +124,8 @@ public Integer iops() { } /** - * Set the iops property: Storage tier IOPS quantity. This property is required to be set for storage Type - * PremiumV2_LRS. + * Set the iops property: Storage IOPS quantity. This property is required to be set for storage Type PremiumV2_LRS + * and UltraSSD_LRS. * * @param iops the iops value to set. * @return the Storage object itself. @@ -137,7 +137,7 @@ public Storage withIops(Integer iops) { /** * Get the throughput property: Storage throughput for the server. This is required to be set for storage Type - * PremiumV2_LRS. + * PremiumV2_LRS and UltraSSD_LRS. * * @return the throughput value. */ @@ -147,7 +147,7 @@ public Integer throughput() { /** * Set the throughput property: Storage throughput for the server. This is required to be set for storage Type - * PremiumV2_LRS. + * PremiumV2_LRS and UltraSSD_LRS. * * @param throughput the throughput value to set. * @return the Storage object itself. @@ -158,8 +158,8 @@ public Storage withThroughput(Integer throughput) { } /** - * Get the type property: Storage type for the server. Allowed values are Premium_LRS and PremiumV2_LRS, and default - * is Premium_LRS if not specified. + * Get the type property: Storage type for the server. Allowed values are Premium_LRS, PremiumV2_LRS, and + * UltraSSD_LRS. Default is Premium_LRS if not specified. * * @return the type value. */ @@ -168,8 +168,8 @@ public StorageType type() { } /** - * Set the type property: Storage type for the server. Allowed values are Premium_LRS and PremiumV2_LRS, and default - * is Premium_LRS if not specified. + * Set the type property: Storage type for the server. Allowed values are Premium_LRS, PremiumV2_LRS, and + * UltraSSD_LRS. Default is Premium_LRS if not specified. * * @param type the type value to set. * @return the Storage object itself. diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/StorageAutoGrowthSupportedEnum.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/StorageAutoGrowthSupportedEnum.java index b92cde1e775a..5ce1e1e5ac26 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/StorageAutoGrowthSupportedEnum.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/StorageAutoGrowthSupportedEnum.java @@ -9,7 +9,8 @@ /** * A value indicating whether storage auto-grow is supported in this region. "Enabled" means storage auto-grow is - * supported. "Disabled" stands for storage auto-grow is not supported. + * supported. "Disabled" stands for storage auto-grow is not supported. Will be deprecated in future, please look to + * Supported Features for "StorageAutoGrowth". */ public final class StorageAutoGrowthSupportedEnum extends ExpandableStringEnum { /** diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/StorageType.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/StorageType.java index aee52348ee0f..95d307215ab0 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/StorageType.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/StorageType.java @@ -8,8 +8,8 @@ import java.util.Collection; /** - * Storage type for the server. Allowed values are Premium_LRS and PremiumV2_LRS, and default is Premium_LRS if not - * specified. + * Storage type for the server. Allowed values are Premium_LRS, PremiumV2_LRS, and UltraSSD_LRS. Default is Premium_LRS + * if not specified. */ public final class StorageType extends ExpandableStringEnum { /** @@ -22,6 +22,11 @@ public final class StorageType extends ExpandableStringEnum { */ public static final StorageType PREMIUM_V2_LRS = fromString("PremiumV2_LRS"); + /** + * Static value UltraSSD_LRS for StorageType. + */ + public static final StorageType ULTRA_SSD_LRS = fromString("UltraSSD_LRS"); + /** * Creates a new instance of StorageType value. * diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/SupportedFeature.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/SupportedFeature.java new file mode 100644 index 000000000000..10ea9a216afd --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/SupportedFeature.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The supported features. + */ +@Immutable +public final class SupportedFeature implements JsonSerializable { + /* + * Name of feature + */ + private String name; + + /* + * Status of feature + */ + private SupportedFeatureStatusEnum status; + + /** + * Creates an instance of SupportedFeature class. + */ + public SupportedFeature() { + } + + /** + * Get the name property: Name of feature. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the status property: Status of feature. + * + * @return the status value. + */ + public SupportedFeatureStatusEnum status() { + return this.status; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SupportedFeature from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SupportedFeature if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the SupportedFeature. + */ + public static SupportedFeature fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SupportedFeature deserializedSupportedFeature = new SupportedFeature(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedSupportedFeature.name = reader.getString(); + } else if ("status".equals(fieldName)) { + deserializedSupportedFeature.status = SupportedFeatureStatusEnum.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedSupportedFeature; + }); + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/SupportedFeatureStatusEnum.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/SupportedFeatureStatusEnum.java new file mode 100644 index 000000000000..2d1e2755bc6d --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/SupportedFeatureStatusEnum.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Status of feature. + */ +public final class SupportedFeatureStatusEnum extends ExpandableStringEnum { + /** + * Static value Enabled for SupportedFeatureStatusEnum. + */ + public static final SupportedFeatureStatusEnum ENABLED = fromString("Enabled"); + + /** + * Static value Disabled for SupportedFeatureStatusEnum. + */ + public static final SupportedFeatureStatusEnum DISABLED = fromString("Disabled"); + + /** + * Creates a new instance of SupportedFeatureStatusEnum value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SupportedFeatureStatusEnum() { + } + + /** + * Creates or finds a SupportedFeatureStatusEnum from its string representation. + * + * @param name a name to look for. + * @return the corresponding SupportedFeatureStatusEnum. + */ + public static SupportedFeatureStatusEnum fromString(String name) { + return fromString(name, SupportedFeatureStatusEnum.class); + } + + /** + * Gets known SupportedFeatureStatusEnum values. + * + * @return known SupportedFeatureStatusEnum values. + */ + public static Collection values() { + return values(SupportedFeatureStatusEnum.class); + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/TuningConfigurations.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/TuningConfigurations.java new file mode 100644 index 000000000000..633b08c5980b --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/TuningConfigurations.java @@ -0,0 +1,177 @@ +// Copyright (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 TuningConfigurations. + */ +public interface TuningConfigurations { + /** + * Enables the config tuning. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void enable(String resourceGroupName, String serverName, TuningOptionEnum tuningOption); + + /** + * Enables the config tuning. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void enable(String resourceGroupName, String serverName, TuningOptionEnum tuningOption, Context context); + + /** + * Disables the config tuning. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void disable(String resourceGroupName, String serverName, TuningOptionEnum tuningOption); + + /** + * Disables the config tuning. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void disable(String resourceGroupName, String serverName, TuningOptionEnum tuningOption, Context context); + + /** + * Starts up the config tuning session. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @param configTuningRequest The parameters for tuning request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 startSession(String resourceGroupName, String serverName, TuningOptionEnum tuningOption, + ConfigTuningRequestParameter configTuningRequest); + + /** + * Starts up the config tuning session. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @param configTuningRequest The parameters for tuning request. + * @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 startSession(String resourceGroupName, String serverName, TuningOptionEnum tuningOption, + ConfigTuningRequestParameter configTuningRequest, Context context); + + /** + * Stops the config tuning session. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void stopSession(String resourceGroupName, String serverName, TuningOptionEnum tuningOption); + + /** + * Stops the config tuning session. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void stopSession(String resourceGroupName, String serverName, TuningOptionEnum tuningOption, Context context); + + /** + * Gets up the config tuning session status. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return up the config tuning session status as paginated response with {@link PagedIterable}. + */ + PagedIterable listSessions(String resourceGroupName, String serverName, + TuningOptionEnum tuningOption); + + /** + * Gets up the config tuning session status. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return up the config tuning session status as paginated response with {@link PagedIterable}. + */ + PagedIterable listSessions(String resourceGroupName, String serverName, + TuningOptionEnum tuningOption, Context context); + + /** + * Gets the session details of a config tuning session. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @param sessionId Guid of the objectId for the session. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 session details of a config tuning session as paginated response with {@link PagedIterable}. + */ + PagedIterable listSessionDetails(String resourceGroupName, String serverName, + TuningOptionEnum tuningOption, String sessionId); + + /** + * Gets the session details of a config tuning session. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @param sessionId Guid of the objectId for the session. + * @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 session details of a config tuning session as paginated response with {@link PagedIterable}. + */ + PagedIterable listSessionDetails(String resourceGroupName, String serverName, + TuningOptionEnum tuningOption, String sessionId, Context context); +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/TuningIndexes.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/TuningIndexes.java new file mode 100644 index 000000000000..a2bbebe2ae32 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/TuningIndexes.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** + * Resource collection API of TuningIndexes. + */ +public interface TuningIndexes { + /** + * Retrieve the list of available tuning recommendations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of available recommendations as paginated response with {@link PagedIterable}. + */ + PagedIterable listRecommendations(String resourceGroupName, String serverName, + TuningOptionEnum tuningOption); + + /** + * Retrieve the list of available tuning recommendations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @param recommendationType Recommendations list filter. Retrieves recommendations based on type. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of available recommendations as paginated response with {@link PagedIterable}. + */ + PagedIterable listRecommendations(String resourceGroupName, String serverName, + TuningOptionEnum tuningOption, RecommendationType recommendationType, Context context); +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/TuningOptionEnum.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/TuningOptionEnum.java new file mode 100644 index 000000000000..c6a919fc9b0a --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/TuningOptionEnum.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Defines values for TuningOptionEnum. + */ +public final class TuningOptionEnum extends ExpandableStringEnum { + /** + * Static value index for TuningOptionEnum. + */ + public static final TuningOptionEnum INDEX = fromString("index"); + + /** + * Static value configuration for TuningOptionEnum. + */ + public static final TuningOptionEnum CONFIGURATION = fromString("configuration"); + + /** + * Static value table for TuningOptionEnum. + */ + public static final TuningOptionEnum TABLE = fromString("table"); + + /** + * Creates a new instance of TuningOptionEnum value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public TuningOptionEnum() { + } + + /** + * Creates or finds a TuningOptionEnum from its string representation. + * + * @param name a name to look for. + * @return the corresponding TuningOptionEnum. + */ + public static TuningOptionEnum fromString(String name) { + return fromString(name, TuningOptionEnum.class); + } + + /** + * Gets known TuningOptionEnum values. + * + * @return known TuningOptionEnum values. + */ + public static Collection values() { + return values(TuningOptionEnum.class); + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/TuningOptions.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/TuningOptions.java new file mode 100644 index 000000000000..35f1f517f30e --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/TuningOptions.java @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of TuningOptions. + */ +public interface TuningOptions { + /** + * Retrieve the tuning option on a server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return stores property that features impact on some metric if this recommended action is applied along with + * {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String serverName, + TuningOptionEnum tuningOption, Context context); + + /** + * Retrieve the tuning option on a server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param tuningOption The name of the tuning option. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return stores property that features impact on some metric if this recommended action is applied. + */ + TuningOptionsResource get(String resourceGroupName, String serverName, TuningOptionEnum tuningOption); + + /** + * Retrieve the list of available tuning options. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of server tuning options as paginated response with {@link PagedIterable}. + */ + PagedIterable listByServer(String resourceGroupName, String serverName); + + /** + * Retrieve the list of available tuning options. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of server tuning options as paginated response with {@link PagedIterable}. + */ + PagedIterable listByServer(String resourceGroupName, String serverName, Context context); +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/TuningOptionsListResult.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/TuningOptionsListResult.java new file mode 100644 index 000000000000..db3fbdfdcca7 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/TuningOptionsListResult.java @@ -0,0 +1,131 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.TuningOptionsResourceInner; +import java.io.IOException; +import java.util.List; + +/** + * A list of server tuning options. + */ +@Fluent +public final class TuningOptionsListResult implements JsonSerializable { + /* + * A list of available tuning options. + */ + private List value; + + /* + * URL client should use to fetch the next page (per server side paging). + * It's null for now, added for future use. + */ + private String nextLink; + + /** + * Creates an instance of TuningOptionsListResult class. + */ + public TuningOptionsListResult() { + } + + /** + * Get the value property: A list of available tuning options. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of available tuning options. + * + * @param value the value value to set. + * @return the TuningOptionsListResult object itself. + */ + public TuningOptionsListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL client should use to fetch the next page (per server side paging). + * It's null for now, added for future use. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL client should use to fetch the next page (per server side paging). + * It's null for now, added for future use. + * + * @param nextLink the nextLink value to set. + * @return the TuningOptionsListResult object itself. + */ + public TuningOptionsListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TuningOptionsListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TuningOptionsListResult if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the TuningOptionsListResult. + */ + public static TuningOptionsListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TuningOptionsListResult deserializedTuningOptionsListResult = new TuningOptionsListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> TuningOptionsResourceInner.fromJson(reader1)); + deserializedTuningOptionsListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedTuningOptionsListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedTuningOptionsListResult; + }); + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/TuningOptionsResource.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/TuningOptionsResource.java new file mode 100644 index 000000000000..a998e785913a --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/TuningOptionsResource.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.TuningOptionsResourceInner; + +/** + * An immutable client-side representation of TuningOptionsResource. + */ +public interface TuningOptionsResource { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the inner com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.TuningOptionsResourceInner + * object. + * + * @return the inner object. + */ + TuningOptionsResourceInner innerModel(); +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/UserAssignedIdentity.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/UserAssignedIdentity.java index 06a9d485b2d8..37460b560aab 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/UserAssignedIdentity.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/UserAssignedIdentity.java @@ -24,7 +24,12 @@ public final class UserAssignedIdentity implements JsonSerializable userAssignedIdentities; /* - * the types of identities associated with this resource; currently restricted to 'None and UserAssigned' + * the identity principal Id of the server. + */ + private String principalId; + + /* + * the types of identities associated with this resource */ private IdentityType type; @@ -60,8 +65,27 @@ public UserAssignedIdentity withUserAssignedIdentities(Map } /** - * Get the type property: the types of identities associated with this resource; currently restricted to 'None and - * UserAssigned'. + * Get the principalId property: the identity principal Id of the server. + * + * @return the principalId value. + */ + public String principalId() { + return this.principalId; + } + + /** + * Set the principalId property: the identity principal Id of the server. + * + * @param principalId the principalId value to set. + * @return the UserAssignedIdentity object itself. + */ + public UserAssignedIdentity withPrincipalId(String principalId) { + this.principalId = principalId; + return this; + } + + /** + * Get the type property: the types of identities associated with this resource. * * @return the type value. */ @@ -70,8 +94,7 @@ public IdentityType type() { } /** - * Set the type property: the types of identities associated with this resource; currently restricted to 'None and - * UserAssigned'. + * Set the type property: the types of identities associated with this resource. * * @param type the type value to set. * @return the UserAssignedIdentity object itself. @@ -120,6 +143,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); jsonWriter.writeMapField("userAssignedIdentities", this.userAssignedIdentities, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("principalId", this.principalId); return jsonWriter.writeEndObject(); } @@ -145,6 +169,8 @@ public static UserAssignedIdentity fromJson(JsonReader jsonReader) throws IOExce Map userAssignedIdentities = reader.readMap(reader1 -> UserIdentity.fromJson(reader1)); deserializedUserAssignedIdentity.userAssignedIdentities = userAssignedIdentities; + } else if ("principalId".equals(fieldName)) { + deserializedUserAssignedIdentity.principalId = reader.getString(); } else if ("tenantId".equals(fieldName)) { deserializedUserAssignedIdentity.tenantId = reader.getString(); } else { 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 0e1d9e706f8a..3d603c02c172 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ZoneRedundantHaAndGeoBackupSupportedEnum.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ZoneRedundantHaAndGeoBackupSupportedEnum.java @@ -10,6 +10,7 @@ /** * A value indicating whether Zone Redundant HA and Geo-backup is supported in this region. "Enabled" means zone * redundant HA and geo-backup is supported. "Disabled" stands for zone redundant HA and geo-backup is not supported. + * Will be deprecated in future, please look to Supported Features for "ZoneRedundantHaAndGeoBackup". */ public final class ZoneRedundantHaAndGeoBackupSupportedEnum extends ExpandableStringEnum { diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ZoneRedundantHaSupportedEnum.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ZoneRedundantHaSupportedEnum.java index b321c4fc8b4c..afa367f7b085 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ZoneRedundantHaSupportedEnum.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ZoneRedundantHaSupportedEnum.java @@ -9,7 +9,8 @@ /** * A value indicating whether Zone Redundant HA is supported in this region. "Enabled" means zone redundant HA is - * supported. "Disabled" stands for zone redundant HA is not supported. + * supported. "Disabled" stands for zone redundant HA is not supported. Will be deprecated in future, please look to + * Supported Features for "ZoneRedundantHa". */ public final class ZoneRedundantHaSupportedEnum extends ExpandableStringEnum { /** diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-postgresqlflexibleserver/proxy-config.json b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-postgresqlflexibleserver/proxy-config.json index 15d392fdd4a2..7f70e5e05fa3 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-postgresqlflexibleserver/proxy-config.json +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-postgresqlflexibleserver/proxy-config.json @@ -1 +1 @@ -[["com.azure.resourcemanager.postgresqlflexibleserver.implementation.AdministratorsClientImpl$AdministratorsService"],["com.azure.resourcemanager.postgresqlflexibleserver.implementation.BackupsClientImpl$BackupsService"],["com.azure.resourcemanager.postgresqlflexibleserver.implementation.CheckNameAvailabilitiesClientImpl$CheckNameAvailabilitiesService"],["com.azure.resourcemanager.postgresqlflexibleserver.implementation.CheckNameAvailabilityWithLocationsClientImpl$CheckNameAvailabilityWithLocationsService"],["com.azure.resourcemanager.postgresqlflexibleserver.implementation.ConfigurationsClientImpl$ConfigurationsService"],["com.azure.resourcemanager.postgresqlflexibleserver.implementation.DatabasesClientImpl$DatabasesService"],["com.azure.resourcemanager.postgresqlflexibleserver.implementation.FirewallRulesClientImpl$FirewallRulesService"],["com.azure.resourcemanager.postgresqlflexibleserver.implementation.FlexibleServersClientImpl$FlexibleServersService"],["com.azure.resourcemanager.postgresqlflexibleserver.implementation.GetPrivateDnsZoneSuffixesClientImpl$GetPrivateDnsZoneSuffixesService"],["com.azure.resourcemanager.postgresqlflexibleserver.implementation.LocationBasedCapabilitiesClientImpl$LocationBasedCapabilitiesService"],["com.azure.resourcemanager.postgresqlflexibleserver.implementation.LogFilesClientImpl$LogFilesService"],["com.azure.resourcemanager.postgresqlflexibleserver.implementation.LtrBackupOperationsClientImpl$LtrBackupOperationsService"],["com.azure.resourcemanager.postgresqlflexibleserver.implementation.MigrationsClientImpl$MigrationsService"],["com.azure.resourcemanager.postgresqlflexibleserver.implementation.OperationsClientImpl$OperationsService"],["com.azure.resourcemanager.postgresqlflexibleserver.implementation.PrivateEndpointConnectionOperationsClientImpl$PrivateEndpointConnectionOperationsService"],["com.azure.resourcemanager.postgresqlflexibleserver.implementation.PrivateEndpointConnectionsClientImpl$PrivateEndpointConnectionsService"],["com.azure.resourcemanager.postgresqlflexibleserver.implementation.PrivateLinkResourcesClientImpl$PrivateLinkResourcesService"],["com.azure.resourcemanager.postgresqlflexibleserver.implementation.ReplicasClientImpl$ReplicasService"],["com.azure.resourcemanager.postgresqlflexibleserver.implementation.ResourceProvidersClientImpl$ResourceProvidersService"],["com.azure.resourcemanager.postgresqlflexibleserver.implementation.ServerCapabilitiesClientImpl$ServerCapabilitiesService"],["com.azure.resourcemanager.postgresqlflexibleserver.implementation.ServerThreatProtectionSettingsClientImpl$ServerThreatProtectionSettingsService"],["com.azure.resourcemanager.postgresqlflexibleserver.implementation.ServersClientImpl$ServersService"],["com.azure.resourcemanager.postgresqlflexibleserver.implementation.VirtualEndpointsClientImpl$VirtualEndpointsService"],["com.azure.resourcemanager.postgresqlflexibleserver.implementation.VirtualNetworkSubnetUsagesClientImpl$VirtualNetworkSubnetUsagesService"]] \ No newline at end of file +[["com.azure.resourcemanager.postgresqlflexibleserver.implementation.AdministratorsClientImpl$AdministratorsService"],["com.azure.resourcemanager.postgresqlflexibleserver.implementation.BackupsClientImpl$BackupsService"],["com.azure.resourcemanager.postgresqlflexibleserver.implementation.CheckNameAvailabilitiesClientImpl$CheckNameAvailabilitiesService"],["com.azure.resourcemanager.postgresqlflexibleserver.implementation.CheckNameAvailabilityWithLocationsClientImpl$CheckNameAvailabilityWithLocationsService"],["com.azure.resourcemanager.postgresqlflexibleserver.implementation.ConfigurationsClientImpl$ConfigurationsService"],["com.azure.resourcemanager.postgresqlflexibleserver.implementation.DatabasesClientImpl$DatabasesService"],["com.azure.resourcemanager.postgresqlflexibleserver.implementation.FirewallRulesClientImpl$FirewallRulesService"],["com.azure.resourcemanager.postgresqlflexibleserver.implementation.FlexibleServersClientImpl$FlexibleServersService"],["com.azure.resourcemanager.postgresqlflexibleserver.implementation.GetPrivateDnsZoneSuffixesClientImpl$GetPrivateDnsZoneSuffixesService"],["com.azure.resourcemanager.postgresqlflexibleserver.implementation.LocationBasedCapabilitiesClientImpl$LocationBasedCapabilitiesService"],["com.azure.resourcemanager.postgresqlflexibleserver.implementation.LogFilesClientImpl$LogFilesService"],["com.azure.resourcemanager.postgresqlflexibleserver.implementation.LtrBackupOperationsClientImpl$LtrBackupOperationsService"],["com.azure.resourcemanager.postgresqlflexibleserver.implementation.MigrationsClientImpl$MigrationsService"],["com.azure.resourcemanager.postgresqlflexibleserver.implementation.OperationsClientImpl$OperationsService"],["com.azure.resourcemanager.postgresqlflexibleserver.implementation.PrivateEndpointConnectionOperationsClientImpl$PrivateEndpointConnectionOperationsService"],["com.azure.resourcemanager.postgresqlflexibleserver.implementation.PrivateEndpointConnectionsClientImpl$PrivateEndpointConnectionsService"],["com.azure.resourcemanager.postgresqlflexibleserver.implementation.PrivateLinkResourcesClientImpl$PrivateLinkResourcesService"],["com.azure.resourcemanager.postgresqlflexibleserver.implementation.QuotaUsagesClientImpl$QuotaUsagesService"],["com.azure.resourcemanager.postgresqlflexibleserver.implementation.ReplicasClientImpl$ReplicasService"],["com.azure.resourcemanager.postgresqlflexibleserver.implementation.ResourceProvidersClientImpl$ResourceProvidersService"],["com.azure.resourcemanager.postgresqlflexibleserver.implementation.ServerCapabilitiesClientImpl$ServerCapabilitiesService"],["com.azure.resourcemanager.postgresqlflexibleserver.implementation.ServerThreatProtectionSettingsClientImpl$ServerThreatProtectionSettingsService"],["com.azure.resourcemanager.postgresqlflexibleserver.implementation.ServersClientImpl$ServersService"],["com.azure.resourcemanager.postgresqlflexibleserver.implementation.TuningConfigurationsClientImpl$TuningConfigurationsService"],["com.azure.resourcemanager.postgresqlflexibleserver.implementation.TuningIndexesClientImpl$TuningIndexesService"],["com.azure.resourcemanager.postgresqlflexibleserver.implementation.TuningOptionsClientImpl$TuningOptionsService"],["com.azure.resourcemanager.postgresqlflexibleserver.implementation.VirtualEndpointsClientImpl$VirtualEndpointsService"],["com.azure.resourcemanager.postgresqlflexibleserver.implementation.VirtualNetworkSubnetUsagesClientImpl$VirtualNetworkSubnetUsagesService"]] \ No newline at end of file diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/resources/azure-resourcemanager-postgresqlflexibleserver.properties b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/resources/azure-resourcemanager-postgresqlflexibleserver.properties new file mode 100644 index 000000000000..defbd48204e4 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/resources/azure-resourcemanager-postgresqlflexibleserver.properties @@ -0,0 +1 @@ +version=${project.version} 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 c8da7bb0fd04..e143b6ff5413 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/AdministratorsCreateSamples.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/AdministratorsCreateSamples.java @@ -12,15 +12,15 @@ public final class AdministratorsCreateSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/AdministratorAdd. - * json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ + * AdministratorAdd.json */ /** - * Sample code: Adds an Active DIrectory Administrator for the server. + * Sample code: Adds an Microsoft Entra Administrator for the server. * * @param manager Entry point to PostgreSqlManager. */ - public static void addsAnActiveDIrectoryAdministratorForTheServer( + public static void addsAnMicrosoftEntraAdministratorForTheServer( com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { manager.administrators() .define("oooooooo-oooo-oooo-oooo-oooooooooooo") 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 a5ce53c36868..a1525a223f2a 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/AdministratorsDeleteSamples.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/AdministratorsDeleteSamples.java @@ -10,7 +10,7 @@ public final class AdministratorsDeleteSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ * AdministratorDelete.json */ /** diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/AdministratorsGetSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/AdministratorsGetSamples.java index fd0f575d0f4c..ed5440a383a2 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/AdministratorsGetSamples.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/AdministratorsGetSamples.java @@ -10,8 +10,8 @@ public final class AdministratorsGetSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/AdministratorGet. - * json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ + * AdministratorGet.json */ /** * Sample code: ServerGet. diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/AdministratorsListByServerSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/AdministratorsListByServerSamples.java index dc885e832996..037cf0d88b51 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/AdministratorsListByServerSamples.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/AdministratorsListByServerSamples.java @@ -10,7 +10,7 @@ public final class AdministratorsListByServerSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ * AdministratorsListByServer.json */ /** diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/BackupsCreateSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/BackupsCreateSamples.java index 6f0546c397d2..723466f0536c 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/BackupsCreateSamples.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/BackupsCreateSamples.java @@ -10,7 +10,8 @@ public final class BackupsCreateSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/BackupCreate.json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ + * BackupCreate.json */ /** * Sample code: Create a new Backup for a flexible server. @@ -20,6 +21,6 @@ public final class BackupsCreateSamples { public static void createANewBackupForAFlexibleServer( com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { manager.backups() - .create("TestGroup", "postgresqltestserver", "backup_20210615T160516", com.azure.core.util.Context.NONE); + .create("TestGroup", "postgresqltestserver", "backup_20250303T160516", 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 index 066f4f44dbea..a244ecab93a8 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/BackupsDeleteSamples.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/BackupsDeleteSamples.java @@ -10,7 +10,8 @@ public final class BackupsDeleteSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/BackupDelete.json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ + * BackupDelete.json */ /** * Sample code: Delete a specific backup. @@ -19,6 +20,6 @@ public final class BackupsDeleteSamples { */ public static void deleteASpecificBackup(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { - manager.backups().delete("TestGroup", "testserver", "backup_20210615T160516", com.azure.core.util.Context.NONE); + manager.backups().delete("TestGroup", "testserver", "backup_20250303T160516", 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 5405f4a7916a..21d653002839 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/BackupsGetSamples.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/BackupsGetSamples.java @@ -10,7 +10,8 @@ public final class BackupsGetSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/BackupGet.json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/BackupGet + * .json */ /** * Sample code: Get a backup for a server. @@ -20,7 +21,7 @@ public final class BackupsGetSamples { public static void getABackupForAServer(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { manager.backups() - .getWithResponse("TestGroup", "postgresqltestserver", "daily_20210615T160516", + .getWithResponse("TestGroup", "postgresqltestserver", "daily_20250303T160516", 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 0a0c6b713e8f..9ad6c27b13f0 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/BackupsListByServerSamples.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/BackupsListByServerSamples.java @@ -10,8 +10,8 @@ public final class BackupsListByServerSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/BackupListByServer - * .json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ + * BackupListByServer.json */ /** * Sample code: List backups for a server. diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/CheckNameAvailabilityExecuteSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/CheckNameAvailabilityExecuteSamples.java index c986ef8de0ad..123b614436de 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/CheckNameAvailabilityExecuteSamples.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/CheckNameAvailabilityExecuteSamples.java @@ -12,7 +12,7 @@ public final class CheckNameAvailabilityExecuteSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ * CheckNameAvailability.json */ /** diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/CheckNameAvailabilityWithLocationExecuteSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/CheckNameAvailabilityWithLocationExecuteSamples.java index 1f0c044766e7..81c5255e966d 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/CheckNameAvailabilityWithLocationExecuteSamples.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/CheckNameAvailabilityWithLocationExecuteSamples.java @@ -12,7 +12,7 @@ public final class CheckNameAvailabilityWithLocationExecuteSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ * CheckNameAvailabilityLocationBased.json */ /** diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ConfigurationsGetSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ConfigurationsGetSamples.java index e9f497a40bd8..71c407fc1147 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ConfigurationsGetSamples.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ConfigurationsGetSamples.java @@ -10,8 +10,8 @@ public final class ConfigurationsGetSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ConfigurationGet. - * json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ + * ConfigurationGet.json */ /** * Sample code: ConfigurationGet. diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ConfigurationsListByServerSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ConfigurationsListByServerSamples.java index cf66792c1c55..02537eb0552a 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ConfigurationsListByServerSamples.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ConfigurationsListByServerSamples.java @@ -10,7 +10,7 @@ public final class ConfigurationsListByServerSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ * ConfigurationListByServer.json */ /** diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ConfigurationsPutSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ConfigurationsPutSamples.java index 9e36145f98ab..09776d77f4ca 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ConfigurationsPutSamples.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ConfigurationsPutSamples.java @@ -10,7 +10,7 @@ public final class ConfigurationsPutSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ * ConfigurationUpdate.json */ /** @@ -21,7 +21,7 @@ public final class ConfigurationsPutSamples { public static void updateAUserConfiguration(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { manager.configurations() - .define("event_scheduler") + .define("constraint_exclusion") .withExistingFlexibleServer("testrg", "testserver") .withValue("on") .withSource("user-override") 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 c5c413e03959..aff7bc555e9e 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ConfigurationsUpdateSamples.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ConfigurationsUpdateSamples.java @@ -12,7 +12,7 @@ public final class ConfigurationsUpdateSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ * ConfigurationUpdate.json */ /** @@ -23,7 +23,7 @@ public final class ConfigurationsUpdateSamples { public static void updateAUserConfiguration(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { Configuration resource = manager.configurations() - .getWithResponse("testrg", "testserver", "event_scheduler", com.azure.core.util.Context.NONE) + .getWithResponse("testrg", "testserver", "constraint_exclusion", com.azure.core.util.Context.NONE) .getValue(); resource.update().withValue("on").withSource("user-override").apply(); } 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 6d44230028c7..77a77204da47 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/DatabasesCreateSamples.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/DatabasesCreateSamples.java @@ -10,8 +10,8 @@ public final class DatabasesCreateSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/DatabaseCreate. - * json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ + * DatabaseCreate.json */ /** * Sample code: Create a database. diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/DatabasesDeleteSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/DatabasesDeleteSamples.java index 77b4e31a7554..991c2b9aa5a6 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/DatabasesDeleteSamples.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/DatabasesDeleteSamples.java @@ -10,8 +10,8 @@ public final class DatabasesDeleteSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/DatabaseDelete. - * json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ + * DatabaseDelete.json */ /** * Sample code: Delete a database. diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/DatabasesGetSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/DatabasesGetSamples.java index e47d311d7898..5d36c746aa3c 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/DatabasesGetSamples.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/DatabasesGetSamples.java @@ -10,7 +10,8 @@ public final class DatabasesGetSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/DatabaseGet.json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ + * DatabaseGet.json */ /** * Sample code: Get a database. diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/DatabasesListByServerSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/DatabasesListByServerSamples.java index c85e307ed8ed..1fed2eac0881 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/DatabasesListByServerSamples.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/DatabasesListByServerSamples.java @@ -10,7 +10,7 @@ public final class DatabasesListByServerSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ * DatabasesListByServer.json */ /** diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/FirewallRulesCreateOrUpdateSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/FirewallRulesCreateOrUpdateSamples.java index a3603597959e..06fa11067ea6 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/FirewallRulesCreateOrUpdateSamples.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/FirewallRulesCreateOrUpdateSamples.java @@ -10,8 +10,8 @@ public final class FirewallRulesCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/FirewallRuleCreate - * .json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ + * FirewallRuleCreate.json */ /** * Sample code: FirewallRuleCreate. diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/FirewallRulesDeleteSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/FirewallRulesDeleteSamples.java index 08412f8b92de..6501c0749027 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/FirewallRulesDeleteSamples.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/FirewallRulesDeleteSamples.java @@ -10,8 +10,8 @@ public final class FirewallRulesDeleteSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/FirewallRuleDelete - * .json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ + * FirewallRuleDelete.json */ /** * Sample code: FirewallRuleDelete. diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/FirewallRulesGetSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/FirewallRulesGetSamples.java index ce57988ef060..8794b840ff97 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/FirewallRulesGetSamples.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/FirewallRulesGetSamples.java @@ -10,8 +10,8 @@ public final class FirewallRulesGetSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/FirewallRuleGet. - * json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ + * FirewallRuleGet.json */ /** * Sample code: FirewallRuleList. diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/FirewallRulesListByServerSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/FirewallRulesListByServerSamples.java index ac5e219773c4..50e295e870ff 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/FirewallRulesListByServerSamples.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/FirewallRulesListByServerSamples.java @@ -10,7 +10,7 @@ public final class FirewallRulesListByServerSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ * FirewallRuleListByServer.json */ /** diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/FlexibleServerStartLtrBackupSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/FlexibleServerStartLtrBackupSamples.java index 7b7a09e32a03..d0db810e140a 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/FlexibleServerStartLtrBackupSamples.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/FlexibleServerStartLtrBackupSamples.java @@ -15,7 +15,7 @@ public final class FlexibleServerStartLtrBackupSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ * LongTermRetentionBackup.json */ /** diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/FlexibleServerTriggerLtrPreBackupSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/FlexibleServerTriggerLtrPreBackupSamples.java index 3b4fe01e4530..424845d3271c 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/FlexibleServerTriggerLtrPreBackupSamples.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/FlexibleServerTriggerLtrPreBackupSamples.java @@ -13,7 +13,7 @@ public final class FlexibleServerTriggerLtrPreBackupSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ * LongTermRetentionPreBackup.json */ /** diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/GetPrivateDnsZoneSuffixExecuteSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/GetPrivateDnsZoneSuffixExecuteSamples.java index f368ac1cd277..43f61c40b939 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/GetPrivateDnsZoneSuffixExecuteSamples.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/GetPrivateDnsZoneSuffixExecuteSamples.java @@ -10,7 +10,7 @@ public final class GetPrivateDnsZoneSuffixExecuteSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ * GetPrivateDnsZoneSuffix.json */ /** diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/LocationBasedCapabilitiesExecuteSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/LocationBasedCapabilitiesExecuteSamples.java index 42e796cd6b57..ab59124b8f86 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/LocationBasedCapabilitiesExecuteSamples.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/LocationBasedCapabilitiesExecuteSamples.java @@ -10,7 +10,7 @@ public final class LocationBasedCapabilitiesExecuteSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ * CapabilitiesByLocation.json */ /** diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/LogFilesListByServerSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/LogFilesListByServerSamples.java index 8a784c8dd247..340a1125c0ec 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/LogFilesListByServerSamples.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/LogFilesListByServerSamples.java @@ -10,7 +10,7 @@ public final class LogFilesListByServerSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ * LogFilesListByServer.json */ /** diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/LtrBackupOperationsGetSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/LtrBackupOperationsGetSamples.java index 2027eab2e397..42e7112ad748 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/LtrBackupOperationsGetSamples.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/LtrBackupOperationsGetSamples.java @@ -10,7 +10,7 @@ public final class LtrBackupOperationsGetSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ * LongTermRetentionOperationGet.json */ /** diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/LtrBackupOperationsListByServerSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/LtrBackupOperationsListByServerSamples.java index 85b38c5ebf49..8cd7161a5f0d 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/LtrBackupOperationsListByServerSamples.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/LtrBackupOperationsListByServerSamples.java @@ -10,7 +10,7 @@ public final class LtrBackupOperationsListByServerSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ * LongTermRetentionOperationListByServer.json */ /** diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/MigrationsCreateSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/MigrationsCreateSamples.java index 016860d07dc0..e4679b5666af 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/MigrationsCreateSamples.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/MigrationsCreateSamples.java @@ -20,7 +20,7 @@ public final class MigrationsCreateSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ * Migrations_Create_With_PrivateEndpoint_Servers.json */ /** @@ -49,7 +49,7 @@ public static void migrationsCreateWithPrivateEndpoint( /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ * Migrations_Create_With_Roles.json */ /** @@ -77,7 +77,36 @@ public static void migrationsCreateWithPrivateEndpoint( /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ + * Migrations_Create_With_FullyQualifiedDomainName.json + */ + /** + * Sample code: Migrations Create with fully qualified domain name. + * + * @param manager Entry point to PostgreSqlManager. + */ + public static void migrationsCreateWithFullyQualifiedDomainName( + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager.migrations() + .define("testmigration") + .withRegion("westus") + .withExistingFlexibleServer("ffffffff-ffff-ffff-ffff-ffffffffffff", "testrg", "testtarget") + .withMigrationMode(MigrationMode.OFFLINE) + .withSourceDbServerResourceId( + "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/servers/testsource") + .withSourceDbServerFullyQualifiedDomainName("testsourcefqdn.example.com") + .withTargetDbServerFullyQualifiedDomainName("test-target-fqdn.example.com") + .withSecretParameters(new MigrationSecretParameters() + .withAdminCredentials(new AdminCredentials().withSourceServerPassword("fakeTokenPlaceholder") + .withTargetServerPassword("fakeTokenPlaceholder"))) + .withDbsToMigrate(Arrays.asList("db1", "db2", "db3", "db4")) + .withOverwriteDbsInTarget(OverwriteDbsInTargetEnum.TRUE) + .create(); + } + + /* + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ * Migrations_Create_Validate_Only.json */ /** @@ -105,7 +134,7 @@ public static void migrationsCreateWithPrivateEndpoint( /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ * Migrations_Create_With_Other_Users.json */ /** @@ -133,8 +162,8 @@ public static void migrationsCreateByPassingUserNames( /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/Migrations_Create. - * json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ + * Migrations_Create.json */ /** * Sample code: Migrations_Create. @@ -146,8 +175,6 @@ public static void migrationsCreate(com.azure.resourcemanager.postgresqlflexible .define("testmigration") .withRegion("westus") .withExistingFlexibleServer("ffffffff-ffff-ffff-ffff-ffffffffffff", "testrg", "testtarget") - .withMigrationInstanceResourceId( - "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/flexibleServers/testsourcemigration") .withMigrationMode(MigrationMode.OFFLINE) .withSourceDbServerResourceId( "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/servers/testsource") @@ -161,7 +188,7 @@ public static void migrationsCreate(com.azure.resourcemanager.postgresqlflexible /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ * Migrations_Create_Other_SourceTypes_Validate_Migrate.json */ /** diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/MigrationsDeleteSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/MigrationsDeleteSamples.java index 48a7f76441b9..e42aaf8c27ed 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/MigrationsDeleteSamples.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/MigrationsDeleteSamples.java @@ -10,8 +10,8 @@ public final class MigrationsDeleteSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/Migrations_Delete. - * json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ + * Migrations_Delete.json */ /** * Sample code: Migrations_Delete. diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/MigrationsGetSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/MigrationsGetSamples.java index 9d51abb8b08e..3afdecbfe1e6 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/MigrationsGetSamples.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/MigrationsGetSamples.java @@ -10,7 +10,7 @@ public final class MigrationsGetSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ * Migrations_GetMigrationWithSuccessfulValidationOnly.json */ /** @@ -27,8 +27,8 @@ public static void migrationsGetMigrationWithSuccessfulValidationOnly( /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/Migrations_Get. - * json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ + * Migrations_Get.json */ /** * Sample code: Migrations_Get. @@ -43,7 +43,7 @@ public static void migrationsGet(com.azure.resourcemanager.postgresqlflexibleser /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ * Migrations_GetMigrationWithSuccessfulValidationButMigrationFailure.json */ /** @@ -60,7 +60,7 @@ public static void migrationsGetMigrationWithSuccessfulValidationButMigrationFai /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ * Migrations_GetMigrationWithSuccessfulValidationAndMigration.json */ /** @@ -77,7 +77,7 @@ public static void migrationsGetMigrationWithSuccessfulValidationAndMigration( /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ * Migrations_GetMigrationWithValidationFailures.json */ /** diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/MigrationsListByTargetServerSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/MigrationsListByTargetServerSamples.java index d78612f8125d..ed455ca7348a 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/MigrationsListByTargetServerSamples.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/MigrationsListByTargetServerSamples.java @@ -12,7 +12,7 @@ public final class MigrationsListByTargetServerSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ * Migrations_ListByTargetServer.json */ /** diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/MigrationsUpdateSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/MigrationsUpdateSamples.java index 2c0bbb312a19..d18fe57294e3 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/MigrationsUpdateSamples.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/MigrationsUpdateSamples.java @@ -14,8 +14,8 @@ public final class MigrationsUpdateSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/Migrations_Cancel. - * json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ + * Migrations_Cancel.json */ /** * Sample code: Cancel migration. @@ -32,8 +32,8 @@ public static void cancelMigration(com.azure.resourcemanager.postgresqlflexibles /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/Migrations_Update. - * json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ + * Migrations_Update.json */ /** * Sample code: Migrations_Update. diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/OperationsListSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/OperationsListSamples.java index 6ae70ae058af..efe722b23299 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/OperationsListSamples.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/OperationsListSamples.java @@ -10,7 +10,8 @@ public final class OperationsListSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/OperationList.json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ + * OperationList.json */ /** * Sample code: OperationList. @@ -18,6 +19,6 @@ public final class OperationsListSamples { * @param manager Entry point to PostgreSqlManager. */ public static void operationList(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { - manager.operations().listWithResponse(com.azure.core.util.Context.NONE); + manager.operations().list(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 8beb0397758f..6e63c7746916 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/PrivateEndpointConnectionOperationDeleteSamples.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/PrivateEndpointConnectionOperationDeleteSamples.java @@ -10,7 +10,7 @@ public final class PrivateEndpointConnectionOperationDeleteSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ * PrivateEndpointConnectionDelete.json */ /** diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/PrivateEndpointConnectionOperationUpdateSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/PrivateEndpointConnectionOperationUpdateSamples.java index ab47986e8212..df28322ad6c2 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/PrivateEndpointConnectionOperationUpdateSamples.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/PrivateEndpointConnectionOperationUpdateSamples.java @@ -14,7 +14,7 @@ public final class PrivateEndpointConnectionOperationUpdateSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ * PrivateEndpointConnectionUpdate.json */ /** diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/PrivateEndpointConnectionsGetSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/PrivateEndpointConnectionsGetSamples.java index 87e75c5f7438..ca86d978097a 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/PrivateEndpointConnectionsGetSamples.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/PrivateEndpointConnectionsGetSamples.java @@ -10,7 +10,7 @@ public final class PrivateEndpointConnectionsGetSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ * PrivateEndpointConnectionGet.json */ /** diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/PrivateEndpointConnectionsListByServerSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/PrivateEndpointConnectionsListByServerSamples.java index a21888da5660..b269a97e90e4 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/PrivateEndpointConnectionsListByServerSamples.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/PrivateEndpointConnectionsListByServerSamples.java @@ -10,7 +10,7 @@ public final class PrivateEndpointConnectionsListByServerSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ * PrivateEndpointConnectionList.json */ /** diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/PrivateLinkResourcesGetSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/PrivateLinkResourcesGetSamples.java index 781d4af866b7..a19014df95d5 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/PrivateLinkResourcesGetSamples.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/PrivateLinkResourcesGetSamples.java @@ -10,7 +10,7 @@ public final class PrivateLinkResourcesGetSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ * PrivateLinkResourcesGet.json */ /** diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/PrivateLinkResourcesListByServerSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/PrivateLinkResourcesListByServerSamples.java index 2ba6b79e73b2..225b5b3b2811 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/PrivateLinkResourcesListByServerSamples.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/PrivateLinkResourcesListByServerSamples.java @@ -10,7 +10,7 @@ public final class PrivateLinkResourcesListByServerSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ * PrivateLinkResourcesList.json */ /** diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/QuotaUsagesListSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/QuotaUsagesListSamples.java new file mode 100644 index 000000000000..0aafad9b5dc7 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/QuotaUsagesListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.generated; + +/** + * Samples for QuotaUsages List. + */ +public final class QuotaUsagesListSamples { + /* + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-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 35b198b3b040..dec17080dec6 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ReplicasListByServerSamples.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ReplicasListByServerSamples.java @@ -10,7 +10,7 @@ public final class ReplicasListByServerSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ * ReplicasListByServer.json */ /** diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ResourceProviderCheckMigrationNameAvailabilitySamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ResourceProviderCheckMigrationNameAvailabilitySamples.java index 6ce4872776ef..634166243f74 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ResourceProviderCheckMigrationNameAvailabilitySamples.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ResourceProviderCheckMigrationNameAvailabilitySamples.java @@ -12,7 +12,7 @@ public final class ResourceProviderCheckMigrationNameAvailabilitySamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ * CheckMigrationNameAvailability.json */ /** diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServerCapabilitiesListSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServerCapabilitiesListSamples.java index e4fc1b3d7f40..1b06c9d34a8c 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServerCapabilitiesListSamples.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServerCapabilitiesListSamples.java @@ -10,8 +10,8 @@ public final class ServerCapabilitiesListSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ServerCapabilities - * .json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ + * ServerCapabilities.json */ /** * Sample code: ServerCapabilitiesList. diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServerThreatProtectionSettingsCreateOrUpdateSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServerThreatProtectionSettingsCreateOrUpdateSamples.java index 3a0c1c3c10e3..94229f939356 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServerThreatProtectionSettingsCreateOrUpdateSamples.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServerThreatProtectionSettingsCreateOrUpdateSamples.java @@ -14,7 +14,7 @@ public final class ServerThreatProtectionSettingsCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ * ServerThreatProtectionSettingsCreateOrUpdate.json */ /** diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServerThreatProtectionSettingsGetSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServerThreatProtectionSettingsGetSamples.java index 83a139be15a4..0618d0313953 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServerThreatProtectionSettingsGetSamples.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServerThreatProtectionSettingsGetSamples.java @@ -12,7 +12,7 @@ public final class ServerThreatProtectionSettingsGetSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ * ServerThreatProtectionSettingsGet.json */ /** diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServerThreatProtectionSettingsListByServerSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServerThreatProtectionSettingsListByServerSamples.java index b792f1cd761a..a883cb18a8f7 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServerThreatProtectionSettingsListByServerSamples.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServerThreatProtectionSettingsListByServerSamples.java @@ -10,7 +10,7 @@ public final class ServerThreatProtectionSettingsListByServerSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ * ServerThreatProtectionSettingsListByServer.json */ /** diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServersCreateSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServersCreateSamples.java index 043ea557ed95..114c96b9bad9 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServersCreateSamples.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServersCreateSamples.java @@ -9,6 +9,7 @@ import com.azure.resourcemanager.postgresqlflexibleserver.models.AuthConfig; import com.azure.resourcemanager.postgresqlflexibleserver.models.AzureManagedDiskPerformanceTiers; import com.azure.resourcemanager.postgresqlflexibleserver.models.Backup; +import com.azure.resourcemanager.postgresqlflexibleserver.models.Cluster; import com.azure.resourcemanager.postgresqlflexibleserver.models.CreateMode; import com.azure.resourcemanager.postgresqlflexibleserver.models.DataEncryption; import com.azure.resourcemanager.postgresqlflexibleserver.models.GeoRedundantBackupEnum; @@ -17,6 +18,7 @@ import com.azure.resourcemanager.postgresqlflexibleserver.models.IdentityType; import com.azure.resourcemanager.postgresqlflexibleserver.models.Network; import com.azure.resourcemanager.postgresqlflexibleserver.models.PasswordAuthEnum; +import com.azure.resourcemanager.postgresqlflexibleserver.models.ServerPublicNetworkAccessState; import com.azure.resourcemanager.postgresqlflexibleserver.models.ServerVersion; import com.azure.resourcemanager.postgresqlflexibleserver.models.Sku; import com.azure.resourcemanager.postgresqlflexibleserver.models.SkuTier; @@ -34,7 +36,7 @@ public final class ServersCreateSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ * ServerCreateWithDataEncryptionEnabled.json */ /** @@ -48,15 +50,16 @@ public static void serverCreateWithDataEncryptionEnabled( .define("pgtestsvc4") .withRegion("westus") .withExistingResourceGroup("testrg") - .withTags(mapOf("ElasticServer", "1")) - .withSku(new Sku().withName("Standard_D4s_v3").withTier(SkuTier.GENERAL_PURPOSE)) + .withSku(new Sku().withName("Standard_D4ds_v5").withTier(SkuTier.GENERAL_PURPOSE)) .withIdentity(new UserAssignedIdentity().withUserAssignedIdentities(mapOf( "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-usermanagedidentity", new UserIdentity())).withType(IdentityType.USER_ASSIGNED)) - .withAdministratorLogin("cloudsa") - .withAdministratorLoginPassword("password") - .withVersion(ServerVersion.ONE_TWO) - .withStorage(new Storage().withStorageSizeGB(512).withAutoGrow(StorageAutoGrow.DISABLED)) + .withAdministratorLogin("login") + .withAdministratorLoginPassword("Password1") + .withVersion(ServerVersion.ONE_SIX) + .withStorage(new Storage().withStorageSizeGB(512) + .withAutoGrow(StorageAutoGrow.DISABLED) + .withTier(AzureManagedDiskPerformanceTiers.P20)) .withDataEncryption(new DataEncryption().withPrimaryKeyUri("fakeTokenPlaceholder") .withPrimaryUserAssignedIdentityId( "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-usermanagedidentity") @@ -76,7 +79,7 @@ public static void serverCreateWithDataEncryptionEnabled( /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ * ServerCreateReviveDropped.json */ /** @@ -99,7 +102,7 @@ public static void serverCreateWithDataEncryptionEnabled( /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ * ServerCreateGeoRestoreWithDataEncryptionEnabled.json */ /** @@ -134,7 +137,8 @@ public static void createADatabaseAsAGeoRestoreInGeoPairedLocation( /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ServerCreate.json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ + * ServerCreate.json */ /** * Sample code: Create a new server. @@ -143,22 +147,22 @@ public static void createADatabaseAsAGeoRestoreInGeoPairedLocation( */ public static void createANewServer(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { manager.servers() - .define("pgtestsvc4") - .withRegion("westus") + .define("testpgflex") + .withRegion("eastus") .withExistingResourceGroup("testrg") - .withTags(mapOf("ElasticServer", "1")) - .withSku(new Sku().withName("Standard_D4s_v3").withTier(SkuTier.GENERAL_PURPOSE)) - .withAdministratorLogin("cloudsa") - .withAdministratorLoginPassword("password") - .withVersion(ServerVersion.ONE_TWO) + .withTags(mapOf("VNetServer", "1")) + .withSku(new Sku().withName("Standard_D4ds_v5").withTier(SkuTier.GENERAL_PURPOSE)) + .withAdministratorLogin("login") + .withAdministratorLoginPassword("Password1") + .withVersion(ServerVersion.ONE_SIX) .withStorage(new Storage().withStorageSizeGB(512) .withAutoGrow(StorageAutoGrow.DISABLED) .withTier(AzureManagedDiskPerformanceTiers.P20)) - .withBackup(new Backup().withBackupRetentionDays(7).withGeoRedundantBackup(GeoRedundantBackupEnum.DISABLED)) + .withBackup(new Backup().withBackupRetentionDays(7).withGeoRedundantBackup(GeoRedundantBackupEnum.ENABLED)) .withNetwork(new Network().withDelegatedSubnetResourceId( - "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/test-vnet-subnet") + "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/test-subnet") .withPrivateDnsZoneArmResourceId( - "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourcegroups/testrg/providers/Microsoft.Network/privateDnsZones/test-private-dns-zone.postgres.database.azure.com")) + "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/privateDnsZones/testpgflex.private.postgres.database")) .withHighAvailability(new HighAvailability().withMode(HighAvailabilityMode.ZONE_REDUNDANT)) .withAvailabilityZone("1") .withCreateMode(CreateMode.CREATE) @@ -167,25 +171,25 @@ public static void createANewServer(com.azure.resourcemanager.postgresqlflexible /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ - * ServerCreateWithAadAuthEnabled.json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ + * ServerCreateWithMicrosoftEntraEnabled.json */ /** - * Sample code: Create a new server with active directory authentication enabled. + * Sample code: Create a new server with Microsoft Entra authentication enabled. * * @param manager Entry point to PostgreSqlManager. */ - public static void createANewServerWithActiveDirectoryAuthenticationEnabled( + public static void createANewServerWithMicrosoftEntraAuthenticationEnabled( com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { manager.servers() .define("pgtestsvc4") .withRegion("westus") .withExistingResourceGroup("testrg") .withTags(mapOf("ElasticServer", "1")) - .withSku(new Sku().withName("Standard_D4s_v3").withTier(SkuTier.GENERAL_PURPOSE)) - .withAdministratorLogin("cloudsa") - .withAdministratorLoginPassword("password") - .withVersion(ServerVersion.ONE_TWO) + .withSku(new Sku().withName("Standard_D4ds_v5").withTier(SkuTier.GENERAL_PURPOSE)) + .withAdministratorLogin("login") + .withAdministratorLoginPassword("Password1") + .withVersion(ServerVersion.ONE_SIX) .withStorage(new Storage().withStorageSizeGB(512) .withAutoGrow(StorageAutoGrow.DISABLED) .withTier(AzureManagedDiskPerformanceTiers.P20)) @@ -206,7 +210,7 @@ public static void createANewServerWithActiveDirectoryAuthenticationEnabled( /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ * ServerCreateReplica.json */ /** @@ -238,7 +242,37 @@ public static void createANewServerWithActiveDirectoryAuthenticationEnabled( /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ + * ClusterCreate.json + */ + /** + * Sample code: ClusterCreate. + * + * @param manager Entry point to PostgreSqlManager. + */ + public static void clusterCreate(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager.servers() + .define("pgtestcluster") + .withRegion("westus") + .withExistingResourceGroup("testrg") + .withSku(new Sku().withName("Standard_D4ds_v5").withTier(SkuTier.GENERAL_PURPOSE)) + .withAdministratorLogin("login") + .withAdministratorLoginPassword("Password1") + .withVersion(ServerVersion.ONE_SIX) + .withStorage(new Storage().withStorageSizeGB(256) + .withAutoGrow(StorageAutoGrow.DISABLED) + .withTier(AzureManagedDiskPerformanceTiers.P15)) + .withBackup(new Backup().withBackupRetentionDays(7).withGeoRedundantBackup(GeoRedundantBackupEnum.DISABLED)) + .withNetwork(new Network().withPublicNetworkAccess(ServerPublicNetworkAccessState.DISABLED)) + .withHighAvailability(new HighAvailability().withMode(HighAvailabilityMode.DISABLED)) + .withCreateMode(CreateMode.CREATE) + .withCluster(new Cluster().withClusterSize(2)) + .create(); + } + + /* + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ * ServerCreatePointInTimeRestore.json */ /** diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServersDeleteSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServersDeleteSamples.java index d2ee043ae3d6..ded3289d49fd 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServersDeleteSamples.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServersDeleteSamples.java @@ -10,7 +10,8 @@ public final class ServersDeleteSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ServerDelete.json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ + * ServerDelete.json */ /** * Sample code: ServerDelete. diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServersGetByResourceGroupSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServersGetByResourceGroupSamples.java index 05bda087cbc3..2022d7ad4685 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServersGetByResourceGroupSamples.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServersGetByResourceGroupSamples.java @@ -10,7 +10,7 @@ public final class ServersGetByResourceGroupSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ * ServerGetWithPrivateEndpoints.json */ /** @@ -25,7 +25,8 @@ public final class ServersGetByResourceGroupSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ServerGet.json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ServerGet + * .json */ /** * Sample code: ServerGet. @@ -33,13 +34,13 @@ public final class ServersGetByResourceGroupSamples { * @param manager Entry point to PostgreSqlManager. */ public static void serverGet(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { - manager.servers().getByResourceGroupWithResponse("testrg", "pgtestsvc1", com.azure.core.util.Context.NONE); + manager.servers().getByResourceGroupWithResponse("testrg", "testpgflex", com.azure.core.util.Context.NONE); } /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ServerGetWithVnet. - * json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ + * ServerGetWithVnet.json */ /** * Sample code: ServerGetWithVnet. @@ -47,6 +48,6 @@ public static void serverGet(com.azure.resourcemanager.postgresqlflexibleserver. * @param manager Entry point to PostgreSqlManager. */ public static void serverGetWithVnet(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { - manager.servers().getByResourceGroupWithResponse("testrg", "pgtestsvc4", com.azure.core.util.Context.NONE); + manager.servers().getByResourceGroupWithResponse("testrg", "testpgflex", 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 0be7c0ac29f7..a00499c9a33e 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServersListByResourceGroupSamples.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServersListByResourceGroupSamples.java @@ -10,7 +10,7 @@ public final class ServersListByResourceGroupSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ * ServerListByResourceGroup.json */ /** @@ -20,6 +20,6 @@ public final class ServersListByResourceGroupSamples { */ public static void serverListByResourceGroup(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { - manager.servers().listByResourceGroup("testrg", com.azure.core.util.Context.NONE); + manager.servers().listByResourceGroup("testrgn", 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 9985a9a298db..5d95c0d67633 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServersListSamples.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServersListSamples.java @@ -10,7 +10,8 @@ public final class ServersListSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ServerList.json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ + * ServerList.json */ /** * Sample code: ServerList. diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServersRestartSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServersRestartSamples.java index 87b281bf4f1f..47965aed7b3c 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServersRestartSamples.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServersRestartSamples.java @@ -13,7 +13,8 @@ public final class ServersRestartSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ServerRestart.json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ + * ServerRestart.json */ /** * Sample code: ServerRestart. @@ -26,7 +27,7 @@ public static void serverRestart(com.azure.resourcemanager.postgresqlflexibleser /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ * ServerRestartWithFailover.json */ /** diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServersStartSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServersStartSamples.java index 931a547d3f50..55fadc31dcfb 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServersStartSamples.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServersStartSamples.java @@ -10,7 +10,8 @@ public final class ServersStartSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ServerStart.json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ + * ServerStart.json */ /** * Sample code: ServerStart. diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServersStopSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServersStopSamples.java index 9ca7f7ce4940..7185755a2f11 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServersStopSamples.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServersStopSamples.java @@ -10,7 +10,8 @@ public final class ServersStopSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ServerStop.json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ + * ServerStop.json */ /** * Sample code: ServerStop. diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServersUpdateSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServersUpdateSamples.java index 7d302eb2ac73..ba0715516b92 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServersUpdateSamples.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServersUpdateSamples.java @@ -34,36 +34,7 @@ public final class ServersUpdateSamples { /* * 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. - */ - public static void - serverUpdateWithAadAuthEnabled(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { - Server resource = manager.servers() - .getByResourceGroupWithResponse("TestGroup", "pgtestsvc4", com.azure.core.util.Context.NONE) - .getValue(); - resource.update() - .withSku(new Sku().withName("Standard_D8s_v3").withTier(SkuTier.GENERAL_PURPOSE)) - .withAdministratorLoginPassword("newpassword") - .withStorage(new Storage().withStorageSizeGB(1024) - .withAutoGrow(StorageAutoGrow.DISABLED) - .withTier(AzureManagedDiskPerformanceTiers.P30)) - .withBackup(new Backup().withBackupRetentionDays(20)) - .withAuthConfig(new AuthConfig().withActiveDirectoryAuth(ActiveDirectoryAuthEnum.ENABLED) - .withPasswordAuth(PasswordAuthEnum.ENABLED) - .withTenantId("tttttt-tttt-tttt-tttt-tttttttttttt")) - .withCreateMode(CreateModeForUpdate.UPDATE) - .apply(); - } - - /* - * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ * ServerUpdateWithDataEncryptionEnabled.json */ /** @@ -98,7 +69,7 @@ public static void serverUpdateWithDataEncryptionEnabled( /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ * PromoteReplicaAsPlannedSwitchover.json */ /** @@ -121,7 +92,7 @@ public static void serverUpdateWithDataEncryptionEnabled( /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ * PromoteReplicaAsForcedSwitchover.json */ /** @@ -144,7 +115,8 @@ public static void serverUpdateWithDataEncryptionEnabled( /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ServerUpdate.json + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ + * ServerUpdate.json */ /** * Sample code: ServerUpdate. @@ -168,7 +140,7 @@ public static void serverUpdate(com.azure.resourcemanager.postgresqlflexibleserv /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ * ServerUpdateWithMajorVersionUpgrade.json */ /** @@ -181,12 +153,12 @@ public static void serverUpdateWithMajorVersionUpgrade( Server resource = manager.servers() .getByResourceGroupWithResponse("testrg", "pgtestsvc4", com.azure.core.util.Context.NONE) .getValue(); - resource.update().withVersion(ServerVersion.ONE_FOUR).withCreateMode(CreateModeForUpdate.UPDATE).apply(); + resource.update().withVersion(ServerVersion.ONE_SIX).withCreateMode(CreateModeForUpdate.UPDATE).apply(); } /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ * ServerUpdateWithCustomerMaintenanceWindow.json */ /** @@ -210,7 +182,36 @@ public static void serverUpdateWithCustomerMaintenanceWindow( /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ + * ServerUpdateWithMicrosoftEntraEnabled.json + */ + /** + * Sample code: ServerUpdateWithMicrosoftEntraEnabled. + * + * @param manager Entry point to PostgreSqlManager. + */ + public static void serverUpdateWithMicrosoftEntraEnabled( + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + Server resource = manager.servers() + .getByResourceGroupWithResponse("TestGroup", "pgtestsvc4", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withSku(new Sku().withName("Standard_D8s_v3").withTier(SkuTier.GENERAL_PURPOSE)) + .withAdministratorLoginPassword("newpassword") + .withStorage(new Storage().withStorageSizeGB(1024) + .withAutoGrow(StorageAutoGrow.DISABLED) + .withTier(AzureManagedDiskPerformanceTiers.P30)) + .withBackup(new Backup().withBackupRetentionDays(20)) + .withAuthConfig(new AuthConfig().withActiveDirectoryAuth(ActiveDirectoryAuthEnum.ENABLED) + .withPasswordAuth(PasswordAuthEnum.ENABLED) + .withTenantId("tttttt-tttt-tttt-tttt-tttttttttttt")) + .withCreateMode(CreateModeForUpdate.UPDATE) + .apply(); + } + + /* + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ * PromoteReplicaAsForcedStandaloneServer.json */ /** @@ -233,7 +234,7 @@ public static void serverUpdateWithCustomerMaintenanceWindow( /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ * PromoteReplicaAsPlannedStandaloneServer.json */ /** diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/TuningConfigurationDisableSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/TuningConfigurationDisableSamples.java new file mode 100644 index 000000000000..f36a34096904 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/TuningConfigurationDisableSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.generated; + +import com.azure.resourcemanager.postgresqlflexibleserver.models.TuningOptionEnum; + +/** + * Samples for TuningConfiguration Disable. + */ +public final class TuningConfigurationDisableSamples { + /* + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ + * TuningConfiguration_Disable.json + */ + /** + * Sample code: TuningConfiguration_Disable. + * + * @param manager Entry point to PostgreSqlManager. + */ + public static void + tuningConfigurationDisable(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager.tuningConfigurations() + .disable("testrg", "testserver", TuningOptionEnum.CONFIGURATION, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/TuningConfigurationEnableSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/TuningConfigurationEnableSamples.java new file mode 100644 index 000000000000..52edc04a36bd --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/TuningConfigurationEnableSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.generated; + +import com.azure.resourcemanager.postgresqlflexibleserver.models.TuningOptionEnum; + +/** + * Samples for TuningConfiguration Enable. + */ +public final class TuningConfigurationEnableSamples { + /* + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ + * TuningConfiguration_Enable.json + */ + /** + * Sample code: TuningConfiguration_Enable. + * + * @param manager Entry point to PostgreSqlManager. + */ + public static void + tuningConfigurationEnable(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager.tuningConfigurations() + .enable("testrg", "testserver", TuningOptionEnum.CONFIGURATION, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/TuningConfigurationListSessionDetailsSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/TuningConfigurationListSessionDetailsSamples.java new file mode 100644 index 000000000000..546a4d3e1912 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/TuningConfigurationListSessionDetailsSamples.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.generated; + +import com.azure.resourcemanager.postgresqlflexibleserver.models.TuningOptionEnum; + +/** + * Samples for TuningConfiguration ListSessionDetails. + */ +public final class TuningConfigurationListSessionDetailsSamples { + /* + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ + * TuningConfiguration_ListSessionDetails.json + */ + /** + * Sample code: TuningConfiguration_ListSessionDetails. + * + * @param manager Entry point to PostgreSqlManager. + */ + public static void tuningConfigurationListSessionDetails( + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager.tuningConfigurations() + .listSessionDetails("testrg", "testserver", TuningOptionEnum.CONFIGURATION, + "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/TuningConfigurationListSessionsSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/TuningConfigurationListSessionsSamples.java new file mode 100644 index 000000000000..dd6044b10b78 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/TuningConfigurationListSessionsSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.generated; + +import com.azure.resourcemanager.postgresqlflexibleserver.models.TuningOptionEnum; + +/** + * Samples for TuningConfiguration ListSessions. + */ +public final class TuningConfigurationListSessionsSamples { + /* + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ + * TuningConfiguration_ListSessions.json + */ + /** + * Sample code: TuningConfiguration_ListSessions. + * + * @param manager Entry point to PostgreSqlManager. + */ + public static void + tuningConfigurationListSessions(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager.tuningConfigurations() + .listSessions("testrg", "testserver", TuningOptionEnum.CONFIGURATION, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/TuningConfigurationStartSessionSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/TuningConfigurationStartSessionSamples.java new file mode 100644 index 000000000000..9509be701cfc --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/TuningConfigurationStartSessionSamples.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.generated; + +import com.azure.resourcemanager.postgresqlflexibleserver.models.ConfigTuningRequestParameter; +import com.azure.resourcemanager.postgresqlflexibleserver.models.TuningOptionEnum; + +/** + * Samples for TuningConfiguration StartSession. + */ +public final class TuningConfigurationStartSessionSamples { + /* + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ + * TuningConfiguration_StartSession.json + */ + /** + * Sample code: TuningConfiguration_StartSession. + * + * @param manager Entry point to PostgreSqlManager. + */ + public static void + tuningConfigurationStartSession(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager.tuningConfigurations() + .startSession("testrg", "testserver", TuningOptionEnum.CONFIGURATION, + new ConfigTuningRequestParameter().withAllowServerRestarts(false) + .withTargetImprovementMetric("targetImprovementMetric"), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/TuningConfigurationStopSessionSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/TuningConfigurationStopSessionSamples.java new file mode 100644 index 000000000000..6d183f5bb366 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/TuningConfigurationStopSessionSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.generated; + +import com.azure.resourcemanager.postgresqlflexibleserver.models.TuningOptionEnum; + +/** + * Samples for TuningConfiguration StopSession. + */ +public final class TuningConfigurationStopSessionSamples { + /* + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ + * TuningConfiguration_StopSession.json + */ + /** + * Sample code: TuningConfiguration_StopSession. + * + * @param manager Entry point to PostgreSqlManager. + */ + public static void + tuningConfigurationStopSession(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager.tuningConfigurations() + .stopSession("testrg", "testserver", TuningOptionEnum.CONFIGURATION, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/TuningIndexListRecommendationsSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/TuningIndexListRecommendationsSamples.java new file mode 100644 index 000000000000..381f3d5e46a6 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/TuningIndexListRecommendationsSamples.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.generated; + +import com.azure.resourcemanager.postgresqlflexibleserver.models.RecommendationType; +import com.azure.resourcemanager.postgresqlflexibleserver.models.TuningOptionEnum; + +/** + * Samples for TuningIndex ListRecommendations. + */ +public final class TuningIndexListRecommendationsSamples { + /* + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ + * TuningIndex_GetFilteredTableRecommendations.json + */ + /** + * Sample code: TuningIndex_ListFilteredTableRecommendations. + * + * @param manager Entry point to PostgreSqlManager. + */ + public static void tuningIndexListFilteredTableRecommendations( + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager.tuningIndexes() + .listRecommendations("s0403mllorentpimmy", "arm3", TuningOptionEnum.TABLE, RecommendationType.ANALYZE_TABLE, + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ + * TuningIndex_GetFilteredRecommendations.json + */ + /** + * Sample code: TuningIndex_ListFilteredRecommendations. + * + * @param manager Entry point to PostgreSqlManager. + */ + public static void tuningIndexListFilteredRecommendations( + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager.tuningIndexes() + .listRecommendations("testrg", "pgtestrecs", TuningOptionEnum.INDEX, RecommendationType.CREATE_INDEX, + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ + * TuningIndex_GetRecommendations.json + */ + /** + * Sample code: TuningIndex_ListRecommendations. + * + * @param manager Entry point to PostgreSqlManager. + */ + public static void + tuningIndexListRecommendations(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager.tuningIndexes() + .listRecommendations("testrg", "pgtestsvc4", TuningOptionEnum.INDEX, null, + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ + * TuningIndex_GetTableRecommendations.json + */ + /** + * Sample code: TuningIndex_ListTableRecommendations. + * + * @param manager Entry point to PostgreSqlManager. + */ + public static void tuningIndexListTableRecommendations( + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager.tuningIndexes() + .listRecommendations("testrg", "pgtestsvc4", TuningOptionEnum.TABLE, null, + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/TuningOptionsGetSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/TuningOptionsGetSamples.java new file mode 100644 index 000000000000..50f364ae79cc --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/TuningOptionsGetSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.generated; + +import com.azure.resourcemanager.postgresqlflexibleserver.models.TuningOptionEnum; + +/** + * Samples for TuningOptions Get. + */ +public final class TuningOptionsGetSamples { + /* + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ + * Tuning_GetTuningOption.json + */ + /** + * Sample code: TuningOptions_Get. + * + * @param manager Entry point to PostgreSqlManager. + */ + public static void tuningOptionsGet(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager.tuningOptions() + .getWithResponse("testrg", "testserver", TuningOptionEnum.INDEX, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/TuningOptionsListByServerSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/TuningOptionsListByServerSamples.java new file mode 100644 index 000000000000..4fa128e20520 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/TuningOptionsListByServerSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.generated; + +/** + * Samples for TuningOptions ListByServer. + */ +public final class TuningOptionsListByServerSamples { + /* + * x-ms-original-file: + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ + * Tuning_ListTuningOptions.json + */ + /** + * Sample code: TuningOptions_ListByServer. + * + * @param manager Entry point to PostgreSqlManager. + */ + public static void + tuningOptionsListByServer(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager.tuningOptions().listByServer("s0403mllorentpimmy", "arm3", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/VirtualEndpointsCreateSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/VirtualEndpointsCreateSamples.java index 00bdc0f50c00..cc87c9e45078 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/VirtualEndpointsCreateSamples.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/VirtualEndpointsCreateSamples.java @@ -13,7 +13,7 @@ public final class VirtualEndpointsCreateSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ * VirtualEndpointCreate.json */ /** diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/VirtualEndpointsDeleteSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/VirtualEndpointsDeleteSamples.java index 1cfeb9816080..1d93491f21b6 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/VirtualEndpointsDeleteSamples.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/VirtualEndpointsDeleteSamples.java @@ -10,7 +10,7 @@ public final class VirtualEndpointsDeleteSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ * VirtualEndpointDelete.json */ /** diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/VirtualEndpointsGetSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/VirtualEndpointsGetSamples.java index da06bfbb49de..3e14be038bbf 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/VirtualEndpointsGetSamples.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/VirtualEndpointsGetSamples.java @@ -10,7 +10,7 @@ public final class VirtualEndpointsGetSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ * VirtualEndpointsGet.json */ /** diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/VirtualEndpointsListByServerSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/VirtualEndpointsListByServerSamples.java index 2385749f6f35..6b60ccf14627 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/VirtualEndpointsListByServerSamples.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/VirtualEndpointsListByServerSamples.java @@ -10,7 +10,7 @@ public final class VirtualEndpointsListByServerSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ * VirtualEndpointsListByServer.json */ /** diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/VirtualEndpointsUpdateSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/VirtualEndpointsUpdateSamples.java index 158bd8c1aa75..a72338b64c50 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/VirtualEndpointsUpdateSamples.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/VirtualEndpointsUpdateSamples.java @@ -14,7 +14,7 @@ public final class VirtualEndpointsUpdateSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ * VirtualEndpointUpdate.json */ /** diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/VirtualNetworkSubnetUsageExecuteSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/VirtualNetworkSubnetUsageExecuteSamples.java index 3248d459e397..383d56df2a30 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/VirtualNetworkSubnetUsageExecuteSamples.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/VirtualNetworkSubnetUsageExecuteSamples.java @@ -12,7 +12,7 @@ public final class VirtualNetworkSubnetUsageExecuteSamples { /* * x-ms-original-file: - * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ + * specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ * VirtualNetworkSubnetUsage.json */ /** diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ActiveDirectoryAdministratorAddTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ActiveDirectoryAdministratorAddTests.java deleted file mode 100644 index a29cc16246fa..000000000000 --- 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 ebc3b53e6103..000000000000 --- 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 6e664d88b914..000000000000 --- 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 1312e8a16e56..000000000000 --- 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 d22f7e073bc1..000000000000 --- 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 3423cadebdec..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/AdministratorsCreateMockTests.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager; -import com.azure.resourcemanager.postgresqlflexibleserver.models.ActiveDirectoryAdministrator; -import com.azure.resourcemanager.postgresqlflexibleserver.models.PrincipalType; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class AdministratorsCreateMockTests { - @Test - public void testCreate() throws Exception { - String responseStr - = "{\"properties\":{\"principalType\":\"Group\",\"principalName\":\"brhu\",\"objectId\":\"kh\",\"tenantId\":\"ygo\"},\"id\":\"kkqfqjbvle\",\"name\":\"rfmluiqtq\",\"type\":\"fa\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - PostgreSqlManager manager = PostgreSqlManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ActiveDirectoryAdministrator response = manager.administrators() - .define("odqkdlwwqfb") - .withExistingFlexibleServer("gzibthostgktstv", "xeclzedqbcvhzlhp") - .withPrincipalType(PrincipalType.USER) - .withPrincipalName("trqjfsmlmbtx") - .withTenantId("gfwsrtaw") - .create(); - - Assertions.assertEquals(PrincipalType.GROUP, response.principalType()); - Assertions.assertEquals("brhu", response.principalName()); - Assertions.assertEquals("kh", response.objectId()); - Assertions.assertEquals("ygo", response.tenantId()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/AdministratorsDeleteMockTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/AdministratorsDeleteMockTests.java deleted file mode 100644 index 95bc1147d079..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/AdministratorsDeleteMockTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class AdministratorsDeleteMockTests { - @Test - public void testDelete() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - PostgreSqlManager manager = PostgreSqlManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.administrators().delete("rykqgaifmvikl", "ydv", "hbejdznxcvdsrhnj", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/AdministratorsGetWithResponseMockTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/AdministratorsGetWithResponseMockTests.java deleted file mode 100644 index f48d172dcaf4..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/AdministratorsGetWithResponseMockTests.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager; -import com.azure.resourcemanager.postgresqlflexibleserver.models.ActiveDirectoryAdministrator; -import com.azure.resourcemanager.postgresqlflexibleserver.models.PrincipalType; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class AdministratorsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"principalType\":\"Group\",\"principalName\":\"ftul\",\"objectId\":\"tduceamt\",\"tenantId\":\"zuo\"},\"id\":\"jw\",\"name\":\"w\",\"type\":\"qioknssxmojm\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - PostgreSqlManager manager = PostgreSqlManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ActiveDirectoryAdministrator response = manager.administrators() - .getWithResponse("volvtn", "v", "fzg", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(PrincipalType.GROUP, response.principalType()); - Assertions.assertEquals("ftul", response.principalName()); - Assertions.assertEquals("tduceamt", response.objectId()); - Assertions.assertEquals("zuo", response.tenantId()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/AdministratorsListByServerMockTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/AdministratorsListByServerMockTests.java deleted file mode 100644 index ecd931dea43a..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/AdministratorsListByServerMockTests.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager; -import com.azure.resourcemanager.postgresqlflexibleserver.models.ActiveDirectoryAdministrator; -import com.azure.resourcemanager.postgresqlflexibleserver.models.PrincipalType; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class AdministratorsListByServerMockTests { - @Test - public void testListByServer() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"principalType\":\"Group\",\"principalName\":\"yxgtczh\",\"objectId\":\"dbsdshm\",\"tenantId\":\"maehvbbxurip\"},\"id\":\"fnhtbaxkgxyw\",\"name\":\"ckpyklyhplu\",\"type\":\"dpvruud\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - PostgreSqlManager manager = PostgreSqlManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response - = manager.administrators().listByServer("vpkjpr", "kwcf", com.azure.core.util.Context.NONE); - - Assertions.assertEquals(PrincipalType.GROUP, response.iterator().next().principalType()); - Assertions.assertEquals("yxgtczh", response.iterator().next().principalName()); - Assertions.assertEquals("dbsdshm", response.iterator().next().objectId()); - Assertions.assertEquals("maehvbbxurip", response.iterator().next().tenantId()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/BackupRequestBaseTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/BackupRequestBaseTests.java deleted file mode 100644 index d32be37d0cb8..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/BackupRequestBaseTests.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.postgresqlflexibleserver.models.BackupRequestBase; -import com.azure.resourcemanager.postgresqlflexibleserver.models.BackupSettings; -import org.junit.jupiter.api.Assertions; - -public final class BackupRequestBaseTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - BackupRequestBase model = BinaryData.fromString("{\"backupSettings\":{\"backupName\":\"zhxgktrmgucn\"}}") - .toObject(BackupRequestBase.class); - Assertions.assertEquals("zhxgktrmgucn", model.backupSettings().backupName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - BackupRequestBase model - = new BackupRequestBase().withBackupSettings(new BackupSettings().withBackupName("zhxgktrmgucn")); - model = BinaryData.fromObject(model).toObject(BackupRequestBase.class); - Assertions.assertEquals("zhxgktrmgucn", model.backupSettings().backupName()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/BackupSettingsTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/BackupSettingsTests.java deleted file mode 100644 index ed6e4ba6c490..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/BackupSettingsTests.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.postgresqlflexibleserver.models.BackupSettings; -import org.junit.jupiter.api.Assertions; - -public final class BackupSettingsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - BackupSettings model = BinaryData.fromString("{\"backupName\":\"pkteo\"}").toObject(BackupSettings.class); - Assertions.assertEquals("pkteo", model.backupName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - BackupSettings model = new BackupSettings().withBackupName("pkteo"); - model = BinaryData.fromObject(model).toObject(BackupSettings.class); - Assertions.assertEquals("pkteo", model.backupName()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/BackupStoreDetailsTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/BackupStoreDetailsTests.java deleted file mode 100644 index c2579dca3c6b..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/BackupStoreDetailsTests.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.postgresqlflexibleserver.models.BackupStoreDetails; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class BackupStoreDetailsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - BackupStoreDetails model - = BinaryData.fromString("{\"sasUriList\":[\"zfq\",\"hhuao\",\"ppcqeqxolz\",\"ahzxctobgbk\"]}") - .toObject(BackupStoreDetails.class); - Assertions.assertEquals("zfq", model.sasUriList().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - BackupStoreDetails model - = new BackupStoreDetails().withSasUriList(Arrays.asList("zfq", "hhuao", "ppcqeqxolz", "ahzxctobgbk")); - model = BinaryData.fromObject(model).toObject(BackupStoreDetails.class); - Assertions.assertEquals("zfq", model.sasUriList().get(0)); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/BackupTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/BackupTests.java deleted file mode 100644 index cfe4e3ac2f3e..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/BackupTests.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.postgresqlflexibleserver.models.Backup; -import com.azure.resourcemanager.postgresqlflexibleserver.models.GeoRedundantBackupEnum; -import org.junit.jupiter.api.Assertions; - -public final class BackupTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Backup model = BinaryData.fromString( - "{\"backupRetentionDays\":585337534,\"geoRedundantBackup\":\"Enabled\",\"earliestRestoreDate\":\"2021-10-15T08:45:58Z\"}") - .toObject(Backup.class); - Assertions.assertEquals(585337534, model.backupRetentionDays()); - Assertions.assertEquals(GeoRedundantBackupEnum.ENABLED, model.geoRedundantBackup()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Backup model - = new Backup().withBackupRetentionDays(585337534).withGeoRedundantBackup(GeoRedundantBackupEnum.ENABLED); - model = BinaryData.fromObject(model).toObject(Backup.class); - Assertions.assertEquals(585337534, model.backupRetentionDays()); - Assertions.assertEquals(GeoRedundantBackupEnum.ENABLED, model.geoRedundantBackup()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/BackupsCreateMockTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/BackupsCreateMockTests.java deleted file mode 100644 index ab80c3151268..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/BackupsCreateMockTests.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager; -import com.azure.resourcemanager.postgresqlflexibleserver.models.Origin; -import com.azure.resourcemanager.postgresqlflexibleserver.models.ServerBackup; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class BackupsCreateMockTests { - @Test - public void testCreate() throws Exception { - String responseStr - = "{\"properties\":{\"backupType\":\"Customer On-Demand\",\"completedTime\":\"2021-09-10T03:49:52Z\",\"source\":\"cv\"},\"id\":\"uwrbehwagoh\",\"name\":\"uffkmrqemvvh\",\"type\":\"xtdr\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - PostgreSqlManager manager = PostgreSqlManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ServerBackup response - = manager.backups().create("yvnqqybaryeuay", "kq", "bqgzslesjcbhern", com.azure.core.util.Context.NONE); - - Assertions.assertEquals(Origin.CUSTOMER_ON_DEMAND, response.backupType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-10T03:49:52Z"), response.completedTime()); - Assertions.assertEquals("cv", response.source()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/BackupsGetWithResponseMockTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/BackupsGetWithResponseMockTests.java deleted file mode 100644 index 0c42201d8c2a..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/BackupsGetWithResponseMockTests.java +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager; -import com.azure.resourcemanager.postgresqlflexibleserver.models.Origin; -import com.azure.resourcemanager.postgresqlflexibleserver.models.ServerBackup; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class BackupsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"backupType\":\"Customer On-Demand\",\"completedTime\":\"2021-02-14T17:29:05Z\",\"source\":\"uxxpshne\"},\"id\":\"ulfgslqu\",\"name\":\"kwdlenrdsutujba\",\"type\":\"pjuohminyfl\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - PostgreSqlManager manager = PostgreSqlManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ServerBackup response = manager.backups() - .getWithResponse("futacoebjvewzc", "znmwcp", "guaadraufactkahz", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(Origin.CUSTOMER_ON_DEMAND, response.backupType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-14T17:29:05Z"), response.completedTime()); - Assertions.assertEquals("uxxpshne", response.source()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/BackupsListByServerMockTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/BackupsListByServerMockTests.java deleted file mode 100644 index 56038b3c4d14..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/BackupsListByServerMockTests.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager; -import com.azure.resourcemanager.postgresqlflexibleserver.models.Origin; -import com.azure.resourcemanager.postgresqlflexibleserver.models.ServerBackup; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class BackupsListByServerMockTests { - @Test - public void testListByServer() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"backupType\":\"Customer On-Demand\",\"completedTime\":\"2021-08-06T16:36:03Z\",\"source\":\"pqchiszep\"},\"id\":\"bjcrxgibbdaxco\",\"name\":\"fozauorsuk\",\"type\":\"kwbqplhlvnuu\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - PostgreSqlManager manager = PostgreSqlManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response - = manager.backups().listByServer("orwmduvwpklv", "w", com.azure.core.util.Context.NONE); - - Assertions.assertEquals(Origin.CUSTOMER_ON_DEMAND, response.iterator().next().backupType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-06T16:36:03Z"), - response.iterator().next().completedTime()); - Assertions.assertEquals("pqchiszep", response.iterator().next().source()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/CapabilitiesListResultTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/CapabilitiesListResultTests.java deleted file mode 100644 index 9ebdc9c5ad91..000000000000 --- 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 ca199787d04c..000000000000 --- 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 6ad9e338edf8..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/CheckNameAvailabilitiesExecuteWithResponseMockTests.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager; -import com.azure.resourcemanager.postgresqlflexibleserver.models.CheckNameAvailabilityReason; -import com.azure.resourcemanager.postgresqlflexibleserver.models.CheckNameAvailabilityRequest; -import com.azure.resourcemanager.postgresqlflexibleserver.models.NameAvailability; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class CheckNameAvailabilitiesExecuteWithResponseMockTests { - @Test - public void testExecuteWithResponse() throws Exception { - String responseStr - = "{\"name\":\"oqbeitpkxzt\",\"type\":\"ob\",\"nameAvailable\":false,\"reason\":\"Invalid\",\"message\":\"gfcwqmpimaqxzhem\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - PostgreSqlManager manager = PostgreSqlManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - NameAvailability response = manager.checkNameAvailabilities() - .executeWithResponse(new CheckNameAvailabilityRequest().withName("vvib").withType("jj"), - com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(false, response.nameAvailable()); - Assertions.assertEquals(CheckNameAvailabilityReason.INVALID, response.reason()); - Assertions.assertEquals("gfcwqmpimaqxzhem", response.message()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/CheckNameAvailabilityRequestTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/CheckNameAvailabilityRequestTests.java deleted file mode 100644 index 6f2879240e99..000000000000 --- 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 e989b159c70a..000000000000 --- 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 79351669a23d..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/CheckNameAvailabilityWithLocationsExecuteWithResponseMockTests.java +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager; -import com.azure.resourcemanager.postgresqlflexibleserver.models.CheckNameAvailabilityReason; -import com.azure.resourcemanager.postgresqlflexibleserver.models.CheckNameAvailabilityRequest; -import com.azure.resourcemanager.postgresqlflexibleserver.models.NameAvailability; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class CheckNameAvailabilityWithLocationsExecuteWithResponseMockTests { - @Test - public void testExecuteWithResponse() throws Exception { - String responseStr - = "{\"name\":\"ktalhsnvkcdmxz\",\"type\":\"oaimlnw\",\"nameAvailable\":false,\"reason\":\"AlreadyExists\",\"message\":\"l\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - PostgreSqlManager manager = PostgreSqlManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - NameAvailability response = manager.checkNameAvailabilityWithLocations() - .executeWithResponse("yhohujswtwkozzwc", - new CheckNameAvailabilityRequest().withName("kb").withType("pfajnjwltlwtjj"), - com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(false, response.nameAvailable()); - Assertions.assertEquals(CheckNameAvailabilityReason.ALREADY_EXISTS, response.reason()); - Assertions.assertEquals("l", response.message()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ConfigurationForUpdateTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ConfigurationForUpdateTests.java deleted file mode 100644 index 34580683b0ac..000000000000 --- 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 d96bc61c9deb..000000000000 --- 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 758fd3f6e202..000000000000 --- 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 36ea214a9dcf..000000000000 --- 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 5921f9f702d0..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ConfigurationsGetWithResponseMockTests.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager; -import com.azure.resourcemanager.postgresqlflexibleserver.models.Configuration; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ConfigurationsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"value\":\"vl\",\"description\":\"fcq\",\"defaultValue\":\"rdve\",\"dataType\":\"Integer\",\"allowedValues\":\"dtutnwldu\",\"source\":\"vuzhyr\",\"isDynamicConfig\":true,\"isReadOnly\":true,\"isConfigPendingRestart\":true,\"unit\":\"k\",\"documentationLink\":\"ukuqgsj\"},\"id\":\"undxgketw\",\"name\":\"hhzjhfj\",\"type\":\"hvvmuvgpmun\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - PostgreSqlManager manager = PostgreSqlManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Configuration response = manager.configurations() - .getWithResponse("nzqodfvpg", "hoxgsgbpf", "zdjtxvzflbqv", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("vl", response.value()); - Assertions.assertEquals("vuzhyr", response.source()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ConfigurationsListByServerMockTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ConfigurationsListByServerMockTests.java deleted file mode 100644 index abde24ecdfe3..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ConfigurationsListByServerMockTests.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager; -import com.azure.resourcemanager.postgresqlflexibleserver.models.Configuration; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ConfigurationsListByServerMockTests { - @Test - public void testListByServer() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"value\":\"l\",\"description\":\"swpchwahfbousn\",\"defaultValue\":\"pgfewetwlyx\",\"dataType\":\"Boolean\",\"allowedValues\":\"ykxhdjh\",\"source\":\"mmbcxfhbcp\",\"isDynamicConfig\":false,\"isReadOnly\":true,\"isConfigPendingRestart\":false,\"unit\":\"hqizxfpxtgqscj\",\"documentationLink\":\"ftjuh\"},\"id\":\"azkmtgguwp\",\"name\":\"jrajcivm\",\"type\":\"ghfcfiwrxgkneuvy\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - PostgreSqlManager manager = PostgreSqlManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response - = manager.configurations().listByServer("eazulcs", "thwwn", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("l", response.iterator().next().value()); - Assertions.assertEquals("mmbcxfhbcp", response.iterator().next().source()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ConfigurationsPutMockTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ConfigurationsPutMockTests.java deleted file mode 100644 index cf14c7e9f58e..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ConfigurationsPutMockTests.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager; -import com.azure.resourcemanager.postgresqlflexibleserver.models.Configuration; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ConfigurationsPutMockTests { - @Test - public void testPut() throws Exception { - String responseStr - = "{\"properties\":{\"value\":\"frpmpdnqqskaw\",\"description\":\"qvmmbn\",\"defaultValue\":\"fr\",\"dataType\":\"Enumeration\",\"allowedValues\":\"zmegnitgvk\",\"source\":\"zyqdrfegcealzx\",\"isDynamicConfig\":true,\"isReadOnly\":true,\"isConfigPendingRestart\":false,\"unit\":\"oyqhlwig\",\"documentationLink\":\"vbkbxgomf\"},\"id\":\"uwasqvd\",\"name\":\"e\",\"type\":\"y\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - PostgreSqlManager manager = PostgreSqlManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Configuration response = manager.configurations() - .define("yue") - .withExistingFlexibleServer("qsxvmhf", "uzjyihsasbhudypo") - .withValue("ynsqyrpfoobr") - .withSource("yvi") - .create(); - - Assertions.assertEquals("frpmpdnqqskaw", response.value()); - Assertions.assertEquals("zyqdrfegcealzx", response.source()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/DatabaseInnerTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/DatabaseInnerTests.java deleted file mode 100644 index 2f2d9f79d634..000000000000 --- 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 101b96e9ac8c..000000000000 --- 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 3e51fe6ad66f..000000000000 --- 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 8b0b2dea4b37..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/DatabasesCreateMockTests.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager; -import com.azure.resourcemanager.postgresqlflexibleserver.models.Database; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class DatabasesCreateMockTests { - @Test - public void testCreate() throws Exception { - String responseStr - = "{\"properties\":{\"charset\":\"d\",\"collation\":\"nsiru\"},\"id\":\"z\",\"name\":\"mes\",\"type\":\"kdlpa\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - PostgreSqlManager manager = PostgreSqlManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Database response = manager.databases() - .define("tvtzeexavoxtfg") - .withExistingFlexibleServer("awddjibab", "vit") - .withCharset("dmdqb") - .withCollation("ypq") - .create(); - - Assertions.assertEquals("d", response.charset()); - Assertions.assertEquals("nsiru", response.collation()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/DatabasesDeleteMockTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/DatabasesDeleteMockTests.java deleted file mode 100644 index 85f2f5384032..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/DatabasesDeleteMockTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class DatabasesDeleteMockTests { - @Test - public void testDelete() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - PostgreSqlManager manager = PostgreSqlManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.databases() - .delete("uxakjsqzhzbezk", "imsidxasicddyvvj", "kgfmocwahpq", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/DatabasesGetWithResponseMockTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/DatabasesGetWithResponseMockTests.java deleted file mode 100644 index fe7e46ae74f2..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/DatabasesGetWithResponseMockTests.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager; -import com.azure.resourcemanager.postgresqlflexibleserver.models.Database; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class DatabasesGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"charset\":\"idjks\",\"collation\":\"kyxvxevblbjedn\"},\"id\":\"lageuaulxun\",\"name\":\"mjbnk\",\"type\":\"pxynenlsvxeizzg\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - PostgreSqlManager manager = PostgreSqlManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Database response = manager.databases() - .getWithResponse("atjeaahh", "jhhn", "kzyb", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("idjks", response.charset()); - Assertions.assertEquals("kyxvxevblbjedn", response.collation()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/DatabasesListByServerMockTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/DatabasesListByServerMockTests.java deleted file mode 100644 index 48f8bfef7014..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/DatabasesListByServerMockTests.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager; -import com.azure.resourcemanager.postgresqlflexibleserver.models.Database; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class DatabasesListByServerMockTests { - @Test - public void testListByServer() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"charset\":\"ekkkzd\",\"collation\":\"tkgdojbmxva\"},\"id\":\"efdeesve\",\"name\":\"uij\",\"type\":\"xtxsuwprtujw\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - PostgreSqlManager manager = PostgreSqlManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response - = manager.databases().listByServer("klnsrmffey", "xcktpiymerteeamm", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("ekkkzd", response.iterator().next().charset()); - Assertions.assertEquals("tkgdojbmxva", response.iterator().next().collation()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/DbLevelValidationStatusTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/DbLevelValidationStatusTests.java deleted file mode 100644 index 17c9b51b8f99..000000000000 --- 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 b2e4395665c8..000000000000 --- 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 2c6c438a845b..000000000000 --- 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 e37410e9de58..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/DelegatedSubnetUsageTests.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.postgresqlflexibleserver.models.DelegatedSubnetUsage; - -public final class DelegatedSubnetUsageTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DelegatedSubnetUsage model = BinaryData.fromString("{\"subnetName\":\"x\",\"usage\":7062133650624687777}") - .toObject(DelegatedSubnetUsage.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DelegatedSubnetUsage model = new DelegatedSubnetUsage(); - model = BinaryData.fromObject(model).toObject(DelegatedSubnetUsage.class); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/FastProvisioningEditionCapabilityTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/FastProvisioningEditionCapabilityTests.java deleted file mode 100644 index d17b8cdec4e1..000000000000 --- 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 05950b2abf1d..000000000000 --- 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 9a15a912a55d..000000000000 --- 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 aad68f53961a..000000000000 --- 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 1d36cb0ce7fa..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/FirewallRulesCreateOrUpdateMockTests.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager; -import com.azure.resourcemanager.postgresqlflexibleserver.models.FirewallRule; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class FirewallRulesCreateOrUpdateMockTests { - @Test - public void testCreateOrUpdate() throws Exception { - String responseStr - = "{\"properties\":{\"startIpAddress\":\"iqtgdqoh\",\"endIpAddress\":\"cwsldri\"},\"id\":\"tpwb\",\"name\":\"a\",\"type\":\"llibphbqzmizak\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - PostgreSqlManager manager = PostgreSqlManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - FirewallRule response = manager.firewallRules() - .define("ehgpp") - .withExistingFlexibleServer("wxezwzhok", "bwnhhtql") - .withStartIpAddress("pifhpfeoajvgcxtx") - .withEndIpAddress("csheafidltugsr") - .create(); - - Assertions.assertEquals("iqtgdqoh", response.startIpAddress()); - Assertions.assertEquals("cwsldri", response.endIpAddress()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/FirewallRulesDeleteMockTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/FirewallRulesDeleteMockTests.java deleted file mode 100644 index ac40851d9f29..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/FirewallRulesDeleteMockTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class FirewallRulesDeleteMockTests { - @Test - public void testDelete() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - PostgreSqlManager manager = PostgreSqlManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.firewallRules().delete("zrcxfailcfxwmdbo", "dfgsftufqobrj", "nac", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/FirewallRulesGetWithResponseMockTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/FirewallRulesGetWithResponseMockTests.java deleted file mode 100644 index e872dc4b673c..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/FirewallRulesGetWithResponseMockTests.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager; -import com.azure.resourcemanager.postgresqlflexibleserver.models.FirewallRule; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class FirewallRulesGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"startIpAddress\":\"zvulj\",\"endIpAddress\":\"aaeranokqgukk\"},\"id\":\"nvbroylaxx\",\"name\":\"lcdisd\",\"type\":\"sfjbjsvg\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - PostgreSqlManager manager = PostgreSqlManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - FirewallRule response = manager.firewallRules() - .getWithResponse("cc", "knh", "kizvytn", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("zvulj", response.startIpAddress()); - Assertions.assertEquals("aaeranokqgukk", response.endIpAddress()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/FirewallRulesListByServerMockTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/FirewallRulesListByServerMockTests.java deleted file mode 100644 index 03c6843e9358..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/FirewallRulesListByServerMockTests.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager; -import com.azure.resourcemanager.postgresqlflexibleserver.models.FirewallRule; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class FirewallRulesListByServerMockTests { - @Test - public void testListByServer() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"startIpAddress\":\"pdvjdhttzaefedx\",\"endIpAddress\":\"hchrphkmcrjdqn\"},\"id\":\"fzpbgtgkyl\",\"name\":\"dgh\",\"type\":\"jeuut\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - PostgreSqlManager manager = PostgreSqlManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response - = manager.firewallRules().listByServer("rwhryvycytd", "lxgccknfnwmbtm", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("pdvjdhttzaefedx", response.iterator().next().startIpAddress()); - Assertions.assertEquals("hchrphkmcrjdqn", response.iterator().next().endIpAddress()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/FlexibleServerCapabilityInnerTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/FlexibleServerCapabilityInnerTests.java deleted file mode 100644 index 9e83142dd589..000000000000 --- 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 cc2a220fb74a..000000000000 --- 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 92dd850775d7..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/FlexibleServersTriggerLtrPreBackupWithResponseMockTests.java +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager; -import com.azure.resourcemanager.postgresqlflexibleserver.models.BackupSettings; -import com.azure.resourcemanager.postgresqlflexibleserver.models.LtrPreBackupRequest; -import com.azure.resourcemanager.postgresqlflexibleserver.models.LtrPreBackupResponse; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class FlexibleServersTriggerLtrPreBackupWithResponseMockTests { - @Test - public void testTriggerLtrPreBackupWithResponse() throws Exception { - String responseStr = "{\"properties\":{\"numberOfContainers\":1318617256}}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - PostgreSqlManager manager = PostgreSqlManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - LtrPreBackupResponse response = manager.flexibleServers() - .triggerLtrPreBackupWithResponse("mqspkcdqzhlctdd", "nqndyfpchrqbn", - new LtrPreBackupRequest().withBackupSettings(new BackupSettings().withBackupName("jrcg")), - com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(1318617256, response.numberOfContainers()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/GetPrivateDnsZoneSuffixesExecuteWithResponseMockTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/GetPrivateDnsZoneSuffixesExecuteWithResponseMockTests.java deleted file mode 100644 index 1b487697ee2d..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/GetPrivateDnsZoneSuffixesExecuteWithResponseMockTests.java +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class GetPrivateDnsZoneSuffixesExecuteWithResponseMockTests { - @Test - public void testExecuteWithResponse() throws Exception { - String responseStr = "\"ghgshejjtbxqmu\""; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - PostgreSqlManager manager = PostgreSqlManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - String response - = manager.getPrivateDnsZoneSuffixes().executeWithResponse(com.azure.core.util.Context.NONE).getValue(); - - Assertions.assertEquals("ghgshejjtbxqmu", response); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/HighAvailabilityTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/HighAvailabilityTests.java deleted file mode 100644 index f6425506c59a..000000000000 --- 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 449307a678e7..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/LocationBasedCapabilitiesExecuteMockTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager; -import com.azure.resourcemanager.postgresqlflexibleserver.models.FlexibleServerCapability; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class LocationBasedCapabilitiesExecuteMockTests { - @Test - public void testExecute() throws Exception { - String responseStr - = "{\"value\":[{\"name\":\"oldweyuqdu\",\"supportedServerEditions\":[{\"name\":\"nrwrbiork\",\"defaultSkuName\":\"lywjhh\",\"supportedStorageEditions\":[{\"name\":\"xmsivfomiloxggdu\",\"defaultStorageSizeMb\":322470867216638009,\"supportedStorageMb\":[{},{},{},{}],\"status\":\"Disabled\",\"reason\":\"ao\"},{\"name\":\"chvcyyysfgdo\",\"defaultStorageSizeMb\":7467577489537815272,\"supportedStorageMb\":[{}],\"status\":\"Disabled\",\"reason\":\"pwoqo\"}],\"supportedServerSkus\":[{\"name\":\"jeknizshq\",\"vCores\":1591499316,\"supportedIops\":932128156,\"supportedMemoryPerVcoreMb\":4510672218626509110,\"supportedZones\":[\"b\",\"rrilbywdxsmic\",\"wrwfscjfnyns\"],\"supportedHaMode\":[\"ZoneRedundant\"],\"status\":\"Disabled\",\"reason\":\"voqyt\"},{\"name\":\"yo\",\"vCores\":853520386,\"supportedIops\":1293894339,\"supportedMemoryPerVcoreMb\":2703223552159511284,\"supportedZones\":[\"pthjoxo\"],\"supportedHaMode\":[\"SameZone\",\"ZoneRedundant\"],\"status\":\"Disabled\",\"reason\":\"iml\"}],\"status\":\"Default\",\"reason\":\"xkcgxxlxsffgcvi\"},{\"name\":\"zdwlvwlyoupfgfb\",\"defaultSkuName\":\"ubdyhgk\",\"supportedStorageEditions\":[{\"name\":\"sgow\",\"defaultStorageSizeMb\":7972724077673531011,\"supportedStorageMb\":[{},{},{}],\"status\":\"Available\",\"reason\":\"lahb\"}],\"supportedServerSkus\":[{\"name\":\"xtgzukxitmmqtgqq\",\"vCores\":1748959674,\"supportedIops\":107951618,\"supportedMemoryPerVcoreMb\":3154721021246185511,\"supportedZones\":[\"juisavokqdzf\"],\"supportedHaMode\":[\"ZoneRedundant\"],\"status\":\"Available\",\"reason\":\"frqttbajlkatnw\"},{\"name\":\"iopid\",\"vCores\":1150651693,\"supportedIops\":128266879,\"supportedMemoryPerVcoreMb\":3873613137312097491,\"supportedZones\":[\"kdmligovi\",\"rxkpmloazuruoc\"],\"supportedHaMode\":[\"SameZone\"],\"status\":\"Available\",\"reason\":\"eoybfhjxakvvjgs\"},{\"name\":\"r\",\"vCores\":1486233885,\"supportedIops\":482425656,\"supportedMemoryPerVcoreMb\":1679876509876130353,\"supportedZones\":[\"kxn\",\"edabgyvudtjue\",\"bcihxuuwhc\"],\"supportedHaMode\":[\"SameZone\",\"ZoneRedundant\"],\"status\":\"Visible\",\"reason\":\"payakkud\"}],\"status\":\"Disabled\",\"reason\":\"wjplma\"}],\"supportedServerVersions\":[{\"name\":\"yohpfkyrkdbdgiog\",\"supportedVersionsToUpgrade\":[\"mnwqj\",\"obaiyhddviaceg\",\"n\",\"ntfpmvmemfnc\"],\"status\":\"Visible\",\"reason\":\"vbalxlllc\"},{\"name\":\"odbzevwrdnhf\",\"supportedVersionsToUpgrade\":[\"vsjcswsmystuluqy\"],\"status\":\"Disabled\",\"reason\":\"lerchpq\"},{\"name\":\"f\",\"supportedVersionsToUpgrade\":[\"abwidfcxsspuun\",\"oxyhkxgqddrihpf\",\"oqcaaewdaomdj\"],\"status\":\"Available\",\"reason\":\"x\"}],\"fastProvisioningSupported\":\"Enabled\",\"supportedFastProvisioningEditions\":[{\"supportedTier\":\"sgeivsiy\",\"supportedSku\":\"kdncj\",\"supportedStorageGb\":1690186599,\"supportedServerVersions\":\"bzo\",\"serverCount\":1760548701,\"status\":\"Available\",\"reason\":\"p\"},{\"supportedTier\":\"y\",\"supportedSku\":\"gogtqxepnylbf\",\"supportedStorageGb\":347721012,\"supportedServerVersions\":\"yjt\",\"serverCount\":279762954,\"status\":\"Visible\",\"reason\":\"hvfcibyfmow\"},{\"supportedTier\":\"rkjpvdwxfzwii\",\"supportedSku\":\"zjb\",\"supportedStorageGb\":1608749608,\"supportedServerVersions\":\"xjrk\",\"serverCount\":2109306549,\"status\":\"Available\",\"reason\":\"egv\"},{\"supportedTier\":\"vuqeqvldspast\",\"supportedSku\":\"kkdmfl\",\"supportedStorageGb\":922777,\"supportedServerVersions\":\"mjlxrrilozapeewc\",\"serverCount\":159855339,\"status\":\"Default\",\"reason\":\"wk\"}],\"geoBackupSupported\":\"Disabled\",\"zoneRedundantHaSupported\":\"Disabled\",\"zoneRedundantHaAndGeoBackupSupported\":\"Disabled\",\"storageAutoGrowthSupported\":\"Enabled\",\"onlineResizeSupported\":\"Enabled\",\"restricted\":\"Enabled\",\"status\":\"Available\",\"reason\":\"tyh\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - PostgreSqlManager manager = PostgreSqlManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response - = manager.locationBasedCapabilities().execute("pzlrphw", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("oldweyuqdu", response.iterator().next().name()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/LogFileInnerTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/LogFileInnerTests.java deleted file mode 100644 index fdca96006c74..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/LogFileInnerTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.LogFileInner; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; - -public final class LogFileInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - LogFileInner model = BinaryData.fromString( - "{\"properties\":{\"createdTime\":\"2021-04-03T12:46:32Z\",\"lastModifiedTime\":\"2021-12-09T11:25:56Z\",\"sizeInKb\":3934291710122169990,\"type\":\"ubxcbihw\",\"url\":\"nfdn\"},\"id\":\"jchrdgoihxumw\",\"name\":\"ton\",\"type\":\"zj\"}") - .toObject(LogFileInner.class); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-03T12:46:32Z"), model.createdTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-12-09T11:25:56Z"), model.lastModifiedTime()); - Assertions.assertEquals(3934291710122169990L, model.sizeInKb()); - Assertions.assertEquals("ubxcbihw", model.typePropertiesType()); - Assertions.assertEquals("nfdn", model.url()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - LogFileInner model = new LogFileInner().withCreatedTime(OffsetDateTime.parse("2021-04-03T12:46:32Z")) - .withLastModifiedTime(OffsetDateTime.parse("2021-12-09T11:25:56Z")) - .withSizeInKb(3934291710122169990L) - .withTypePropertiesType("ubxcbihw") - .withUrl("nfdn"); - model = BinaryData.fromObject(model).toObject(LogFileInner.class); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-03T12:46:32Z"), model.createdTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-12-09T11:25:56Z"), model.lastModifiedTime()); - Assertions.assertEquals(3934291710122169990L, model.sizeInKb()); - Assertions.assertEquals("ubxcbihw", model.typePropertiesType()); - Assertions.assertEquals("nfdn", model.url()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/LogFileListResultTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/LogFileListResultTests.java deleted file mode 100644 index 1fbfa93073a9..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/LogFileListResultTests.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.LogFileInner; -import com.azure.resourcemanager.postgresqlflexibleserver.models.LogFileListResult; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class LogFileListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - LogFileListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"createdTime\":\"2021-10-31T02:18:42Z\",\"lastModifiedTime\":\"2021-04-04T17:22:28Z\",\"sizeInKb\":7989893119356760730,\"type\":\"m\",\"url\":\"d\"},\"id\":\"mmji\",\"name\":\"yeozphvwauyqncy\",\"type\":\"upkvipmdsc\"},{\"properties\":{\"createdTime\":\"2021-09-24T17:39:42Z\",\"lastModifiedTime\":\"2021-06-13T19:10:51Z\",\"sizeInKb\":7138744715268482510,\"type\":\"stotxh\",\"url\":\"ujbypelmcuvhixb\"},\"id\":\"yfwnylr\",\"name\":\"ool\",\"type\":\"ttpkiwkkbnujrywv\"}],\"nextLink\":\"lbfpncurd\"}") - .toObject(LogFileListResult.class); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-31T02:18:42Z"), model.value().get(0).createdTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-04T17:22:28Z"), model.value().get(0).lastModifiedTime()); - Assertions.assertEquals(7989893119356760730L, model.value().get(0).sizeInKb()); - Assertions.assertEquals("m", model.value().get(0).typePropertiesType()); - Assertions.assertEquals("d", model.value().get(0).url()); - Assertions.assertEquals("lbfpncurd", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - LogFileListResult model = new LogFileListResult().withValue(Arrays.asList( - new LogFileInner().withCreatedTime(OffsetDateTime.parse("2021-10-31T02:18:42Z")) - .withLastModifiedTime(OffsetDateTime.parse("2021-04-04T17:22:28Z")) - .withSizeInKb(7989893119356760730L) - .withTypePropertiesType("m") - .withUrl("d"), - new LogFileInner().withCreatedTime(OffsetDateTime.parse("2021-09-24T17:39:42Z")) - .withLastModifiedTime(OffsetDateTime.parse("2021-06-13T19:10:51Z")) - .withSizeInKb(7138744715268482510L) - .withTypePropertiesType("stotxh") - .withUrl("ujbypelmcuvhixb"))) - .withNextLink("lbfpncurd"); - model = BinaryData.fromObject(model).toObject(LogFileListResult.class); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-31T02:18:42Z"), model.value().get(0).createdTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-04T17:22:28Z"), model.value().get(0).lastModifiedTime()); - Assertions.assertEquals(7989893119356760730L, model.value().get(0).sizeInKb()); - Assertions.assertEquals("m", model.value().get(0).typePropertiesType()); - Assertions.assertEquals("d", model.value().get(0).url()); - Assertions.assertEquals("lbfpncurd", model.nextLink()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/LogFilePropertiesTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/LogFilePropertiesTests.java deleted file mode 100644 index e77535f94fc2..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/LogFilePropertiesTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.LogFileProperties; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; - -public final class LogFilePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - LogFileProperties model = BinaryData.fromString( - "{\"createdTime\":\"2021-04-03T13:31:04Z\",\"lastModifiedTime\":\"2021-10-05T06:38:19Z\",\"sizeInKb\":2404210463735215567,\"type\":\"gytsbwtovv\",\"url\":\"seinqfiuf\"}") - .toObject(LogFileProperties.class); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-03T13:31:04Z"), model.createdTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-05T06:38:19Z"), model.lastModifiedTime()); - Assertions.assertEquals(2404210463735215567L, model.sizeInKb()); - Assertions.assertEquals("gytsbwtovv", model.type()); - Assertions.assertEquals("seinqfiuf", model.url()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - LogFileProperties model = new LogFileProperties().withCreatedTime(OffsetDateTime.parse("2021-04-03T13:31:04Z")) - .withLastModifiedTime(OffsetDateTime.parse("2021-10-05T06:38:19Z")) - .withSizeInKb(2404210463735215567L) - .withType("gytsbwtovv") - .withUrl("seinqfiuf"); - model = BinaryData.fromObject(model).toObject(LogFileProperties.class); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-03T13:31:04Z"), model.createdTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-05T06:38:19Z"), model.lastModifiedTime()); - Assertions.assertEquals(2404210463735215567L, model.sizeInKb()); - Assertions.assertEquals("gytsbwtovv", model.type()); - Assertions.assertEquals("seinqfiuf", model.url()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/LogFilesListByServerMockTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/LogFilesListByServerMockTests.java deleted file mode 100644 index 3b865c9dd4b2..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/LogFilesListByServerMockTests.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager; -import com.azure.resourcemanager.postgresqlflexibleserver.models.LogFile; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class LogFilesListByServerMockTests { - @Test - public void testListByServer() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"createdTime\":\"2021-10-10T10:22:02Z\",\"lastModifiedTime\":\"2021-11-03T03:19:16Z\",\"sizeInKb\":3437193079645331762,\"type\":\"zizvuxmmk\",\"url\":\"vthn\"},\"id\":\"zt\",\"name\":\"kovmribiatt\",\"type\":\"plucfotangcfhnyk\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - PostgreSqlManager manager = PostgreSqlManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response - = manager.logFiles().listByServer("fr", "xousxauzl", com.azure.core.util.Context.NONE); - - Assertions.assertEquals(OffsetDateTime.parse("2021-10-10T10:22:02Z"), response.iterator().next().createdTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-03T03:19:16Z"), - response.iterator().next().lastModifiedTime()); - Assertions.assertEquals(3437193079645331762L, response.iterator().next().sizeInKb()); - Assertions.assertEquals("zizvuxmmk", response.iterator().next().typePropertiesType()); - Assertions.assertEquals("vthn", response.iterator().next().url()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/LtrBackupRequestTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/LtrBackupRequestTests.java deleted file mode 100644 index 9a31b7680679..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/LtrBackupRequestTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.postgresqlflexibleserver.models.BackupSettings; -import com.azure.resourcemanager.postgresqlflexibleserver.models.BackupStoreDetails; -import com.azure.resourcemanager.postgresqlflexibleserver.models.LtrBackupRequest; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class LtrBackupRequestTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - LtrBackupRequest model = BinaryData - .fromString( - "{\"targetDetails\":{\"sasUriList\":[\"pt\",\"d\"]},\"backupSettings\":{\"backupName\":\"gpfqbuace\"}}") - .toObject(LtrBackupRequest.class); - Assertions.assertEquals("gpfqbuace", model.backupSettings().backupName()); - Assertions.assertEquals("pt", model.targetDetails().sasUriList().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - LtrBackupRequest model - = new LtrBackupRequest().withBackupSettings(new BackupSettings().withBackupName("gpfqbuace")) - .withTargetDetails(new BackupStoreDetails().withSasUriList(Arrays.asList("pt", "d"))); - model = BinaryData.fromObject(model).toObject(LtrBackupRequest.class); - Assertions.assertEquals("gpfqbuace", model.backupSettings().backupName()); - Assertions.assertEquals("pt", model.targetDetails().sasUriList().get(0)); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/LtrPreBackupRequestTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/LtrPreBackupRequestTests.java deleted file mode 100644 index b20248569b24..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/LtrPreBackupRequestTests.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.postgresqlflexibleserver.models.BackupSettings; -import com.azure.resourcemanager.postgresqlflexibleserver.models.LtrPreBackupRequest; -import org.junit.jupiter.api.Assertions; - -public final class LtrPreBackupRequestTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - LtrPreBackupRequest model = BinaryData.fromString("{\"backupSettings\":{\"backupName\":\"ncw\"}}") - .toObject(LtrPreBackupRequest.class); - Assertions.assertEquals("ncw", model.backupSettings().backupName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - LtrPreBackupRequest model - = new LtrPreBackupRequest().withBackupSettings(new BackupSettings().withBackupName("ncw")); - model = BinaryData.fromObject(model).toObject(LtrPreBackupRequest.class); - Assertions.assertEquals("ncw", model.backupSettings().backupName()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/LtrPreBackupResponseInnerTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/LtrPreBackupResponseInnerTests.java deleted file mode 100644 index 87869d984f9e..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/LtrPreBackupResponseInnerTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.LtrPreBackupResponseInner; -import org.junit.jupiter.api.Assertions; - -public final class LtrPreBackupResponseInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - LtrPreBackupResponseInner model = BinaryData.fromString("{\"properties\":{\"numberOfContainers\":1950925712}}") - .toObject(LtrPreBackupResponseInner.class); - Assertions.assertEquals(1950925712, model.numberOfContainers()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - LtrPreBackupResponseInner model = new LtrPreBackupResponseInner().withNumberOfContainers(1950925712); - model = BinaryData.fromObject(model).toObject(LtrPreBackupResponseInner.class); - Assertions.assertEquals(1950925712, model.numberOfContainers()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/LtrPreBackupResponsePropertiesTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/LtrPreBackupResponsePropertiesTests.java deleted file mode 100644 index a9b028c867b4..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/LtrPreBackupResponsePropertiesTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.LtrPreBackupResponseProperties; -import org.junit.jupiter.api.Assertions; - -public final class LtrPreBackupResponsePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - LtrPreBackupResponseProperties model = BinaryData.fromString("{\"numberOfContainers\":1761160515}") - .toObject(LtrPreBackupResponseProperties.class); - Assertions.assertEquals(1761160515, model.numberOfContainers()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - LtrPreBackupResponseProperties model = new LtrPreBackupResponseProperties().withNumberOfContainers(1761160515); - model = BinaryData.fromObject(model).toObject(LtrPreBackupResponseProperties.class); - Assertions.assertEquals(1761160515, model.numberOfContainers()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/MaintenanceWindowTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/MaintenanceWindowTests.java deleted file mode 100644 index acc204f694be..000000000000 --- 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 582bf663e717..000000000000 --- 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 6fe3aaa10057..000000000000 --- 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 abdeb05c1899..000000000000 --- 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 bbe04f2ef187..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/MigrationsDeleteWithResponseMockTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class MigrationsDeleteWithResponseMockTests { - @Test - public void testDeleteWithResponse() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - PostgreSqlManager manager = PostgreSqlManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.migrations().deleteWithResponse("czurtlei", "q", "bkwvzg", "zvd", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/NameAvailabilityInnerTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/NameAvailabilityInnerTests.java deleted file mode 100644 index c0bf3657768a..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/NameAvailabilityInnerTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.NameAvailabilityInner; -import com.azure.resourcemanager.postgresqlflexibleserver.models.CheckNameAvailabilityReason; -import org.junit.jupiter.api.Assertions; - -public final class NameAvailabilityInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NameAvailabilityInner model = BinaryData.fromString( - "{\"name\":\"fhyhltrpmopjmcma\",\"type\":\"okth\",\"nameAvailable\":false,\"reason\":\"AlreadyExists\",\"message\":\"dsfcpkvxodpuoz\"}") - .toObject(NameAvailabilityInner.class); - Assertions.assertEquals(false, model.nameAvailable()); - Assertions.assertEquals(CheckNameAvailabilityReason.ALREADY_EXISTS, model.reason()); - Assertions.assertEquals("dsfcpkvxodpuoz", model.message()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NameAvailabilityInner model = new NameAvailabilityInner().withNameAvailable(false) - .withReason(CheckNameAvailabilityReason.ALREADY_EXISTS) - .withMessage("dsfcpkvxodpuoz"); - model = BinaryData.fromObject(model).toObject(NameAvailabilityInner.class); - Assertions.assertEquals(false, model.nameAvailable()); - Assertions.assertEquals(CheckNameAvailabilityReason.ALREADY_EXISTS, model.reason()); - Assertions.assertEquals("dsfcpkvxodpuoz", model.message()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/NetworkTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/NetworkTests.java deleted file mode 100644 index de85923fa9a1..000000000000 --- 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 5500bd85ae56..000000000000 --- 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 13826a277c84..000000000000 --- 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 b74a63638716..000000000000 --- 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 0461c4955634..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/OperationsListWithResponseMockTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager; -import com.azure.resourcemanager.postgresqlflexibleserver.models.OperationListResult; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class OperationsListWithResponseMockTests { - @Test - public void testListWithResponse() throws Exception { - String responseStr - = "{\"value\":[{\"name\":\"e\",\"display\":{\"provider\":\"zqn\",\"resource\":\"vsqltnzoibgsxg\",\"operation\":\"fyq\",\"description\":\"mpqoxw\"},\"isDataAction\":true,\"origin\":\"user\",\"properties\":{\"h\":\"dataqxeiiqbimhtmwwi\",\"bcblemb\":\"datahfqpofv\",\"ihebwtsw\":\"datakbwvqvxkdiv\"}},{\"name\":\"uwfmduragegizvc\",\"display\":{\"provider\":\"lisdjubggbq\",\"resource\":\"kxkbsazgakgacyr\",\"operation\":\"jdmspofapvuhryln\",\"description\":\"frzgbzjed\"},\"isDataAction\":true,\"origin\":\"system\",\"properties\":{\"bcuiiz\":\"datav\"}},{\"name\":\"twfans\",\"display\":{\"provider\":\"dibmikostbzbkiwb\",\"resource\":\"n\",\"operation\":\"phzfylsgcrp\",\"description\":\"cunezzcezelfw\"},\"isDataAction\":false,\"origin\":\"NotSpecified\",\"properties\":{\"afzvaylptrs\":\"datawetnpsihc\",\"cxwaxfewz\":\"dataqwztcmwqkc\",\"ylkkshkbffmbm\":\"datakjexfdeqvhp\"}},{\"name\":\"jrgywwpgjxsn\",\"display\":{\"provider\":\"ujgicgaaoe\",\"resource\":\"taqutdewem\",\"operation\":\"wvruunzzj\",\"description\":\"hkfkimrtixokf\"},\"isDataAction\":false,\"origin\":\"user\",\"properties\":{\"tshi\":\"dataqepqwhixmon\",\"vuwcobiegstmnin\":\"dataxgvelfclduccbird\"}}],\"nextLink\":\"izcil\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - PostgreSqlManager manager = PostgreSqlManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - OperationListResult response - = manager.operations().listWithResponse(com.azure.core.util.Context.NONE).getValue(); - - Assertions.assertEquals(true, response.value().get(0).isDataAction()); - Assertions.assertEquals("izcil", response.nextLink()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/PrivateEndpointConnectionInnerTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/PrivateEndpointConnectionInnerTests.java deleted file mode 100644 index 3b64a806f5e7..000000000000 --- 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 29cdc81cbf55..000000000000 --- 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 5063482d4e36..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/PrivateEndpointConnectionOperationsUpdateMockTests.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager; -import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.PrivateEndpointConnectionInner; -import com.azure.resourcemanager.postgresqlflexibleserver.models.PrivateEndpoint; -import com.azure.resourcemanager.postgresqlflexibleserver.models.PrivateEndpointConnection; -import com.azure.resourcemanager.postgresqlflexibleserver.models.PrivateEndpointServiceConnectionStatus; -import com.azure.resourcemanager.postgresqlflexibleserver.models.PrivateLinkServiceConnectionState; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class PrivateEndpointConnectionOperationsUpdateMockTests { - @Test - public void testUpdate() throws Exception { - String responseStr - = "{\"properties\":{\"groupIds\":[\"sn\",\"wfl\",\"qmp\",\"zruwn\"],\"privateEndpoint\":{\"id\":\"pxiwf\"},\"privateLinkServiceConnectionState\":{\"status\":\"Rejected\",\"description\":\"saasiixtmkzj\",\"actionsRequired\":\"viirhgfgrws\"},\"provisioningState\":\"Succeeded\"},\"id\":\"atzv\",\"name\":\"bglbyvict\",\"type\":\"tbrxkjz\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - PostgreSqlManager manager = PostgreSqlManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PrivateEndpointConnection response = manager.privateEndpointConnectionOperations() - .update("nbsoqeqalarv", "agunbtgfebw", "nbmhyree", - new PrivateEndpointConnectionInner().withPrivateEndpoint(new PrivateEndpoint()) - .withPrivateLinkServiceConnectionState(new PrivateLinkServiceConnectionState() - .withStatus(PrivateEndpointServiceConnectionStatus.REJECTED) - .withDescription("jkwrusnkq") - .withActionsRequired("syrq")), - com.azure.core.util.Context.NONE); - - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.REJECTED, - response.privateLinkServiceConnectionState().status()); - Assertions.assertEquals("saasiixtmkzj", response.privateLinkServiceConnectionState().description()); - Assertions.assertEquals("viirhgfgrws", response.privateLinkServiceConnectionState().actionsRequired()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/PrivateEndpointConnectionPropertiesTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/PrivateEndpointConnectionPropertiesTests.java deleted file mode 100644 index b0236c4e523b..000000000000 --- 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 11e3f80ffcf9..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/PrivateEndpointConnectionsGetWithResponseMockTests.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager; -import com.azure.resourcemanager.postgresqlflexibleserver.models.PrivateEndpointConnection; -import com.azure.resourcemanager.postgresqlflexibleserver.models.PrivateEndpointServiceConnectionStatus; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class PrivateEndpointConnectionsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"groupIds\":[\"gfuhokzrusw\",\"vhczznvfby\",\"jsxjwwix\"],\"privateEndpoint\":{\"id\":\"mwmxqhndvnoamld\"},\"privateLinkServiceConnectionState\":{\"status\":\"Rejected\",\"description\":\"ohdjhhflzok\",\"actionsRequired\":\"ox\"},\"provisioningState\":\"Deleting\"},\"id\":\"jetagltsxoatft\",\"name\":\"zpnpbswv\",\"type\":\"floccsrmozih\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - PostgreSqlManager manager = PostgreSqlManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PrivateEndpointConnection response = manager.privateEndpointConnections() - .getWithResponse("uxlxqzvners", "ycucrwnamikzeb", "qbsms", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.REJECTED, - response.privateLinkServiceConnectionState().status()); - Assertions.assertEquals("ohdjhhflzok", response.privateLinkServiceConnectionState().description()); - Assertions.assertEquals("ox", response.privateLinkServiceConnectionState().actionsRequired()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/PrivateEndpointConnectionsListByServerMockTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/PrivateEndpointConnectionsListByServerMockTests.java deleted file mode 100644 index 7ce1bca14d5c..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/PrivateEndpointConnectionsListByServerMockTests.java +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager; -import com.azure.resourcemanager.postgresqlflexibleserver.models.PrivateEndpointConnection; -import com.azure.resourcemanager.postgresqlflexibleserver.models.PrivateEndpointServiceConnectionStatus; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class PrivateEndpointConnectionsListByServerMockTests { - @Test - public void testListByServer() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"groupIds\":[\"jxgrytfmp\",\"ycilrmcaykggnox\"],\"privateEndpoint\":{\"id\":\"rksxwpndfc\"},\"privateLinkServiceConnectionState\":{\"status\":\"Approved\",\"description\":\"nthjtwkjaosrxuzv\",\"actionsRequired\":\"mktcqiosmgbza\"},\"provisioningState\":\"Failed\"},\"id\":\"dl\",\"name\":\"rtltla\",\"type\":\"rltzkatbhjmz\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - PostgreSqlManager manager = PostgreSqlManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response - = manager.privateEndpointConnections().listByServer("ipgawtxx", "ky", com.azure.core.util.Context.NONE); - - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.APPROVED, - response.iterator().next().privateLinkServiceConnectionState().status()); - Assertions.assertEquals("nthjtwkjaosrxuzv", - response.iterator().next().privateLinkServiceConnectionState().description()); - Assertions.assertEquals("mktcqiosmgbza", - response.iterator().next().privateLinkServiceConnectionState().actionsRequired()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/PrivateEndpointTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/PrivateEndpointTests.java deleted file mode 100644 index 7dce36b22906..000000000000 --- 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 82a8a4511907..000000000000 --- 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 d1af6a9b6370..000000000000 --- 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 83e3cf154e80..000000000000 --- 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 56a9e3bc0354..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/PrivateLinkResourcesGetWithResponseMockTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager; -import com.azure.resourcemanager.postgresqlflexibleserver.models.PrivateLinkResource; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class PrivateLinkResourcesGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"groupId\":\"jbmzyospspsh\",\"requiredMembers\":[\"kyjpmspbps\",\"df\",\"pyogtieyuj\",\"vczkcnyxrxmunjd\"],\"requiredZoneNames\":[\"lnkvxlx\",\"aglqivbgkcvkh\",\"zvuqdflvon\"]},\"id\":\"pfpubcpzgpx\",\"name\":\"ivhjknidi\",\"type\":\"gqjxgpnrhgovfgp\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - PostgreSqlManager manager = PostgreSqlManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PrivateLinkResource response = manager.privateLinkResources() - .getWithResponse("dtmaa", "quhuxylrj", "m", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("lnkvxlx", response.requiredZoneNames().get(0)); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/PrivateLinkResourcesListByServerMockTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/PrivateLinkResourcesListByServerMockTests.java deleted file mode 100644 index d321f962d65c..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/PrivateLinkResourcesListByServerMockTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager; -import com.azure.resourcemanager.postgresqlflexibleserver.models.PrivateLinkResource; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class PrivateLinkResourcesListByServerMockTests { - @Test - public void testListByServer() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"groupId\":\"clnapxbiygnugjkn\",\"requiredMembers\":[\"fcttuxuuyilfl\",\"oiquvrehmrnjhvs\"],\"requiredZoneNames\":[\"tczytqjtwh\",\"uunfprnjletlxsm\"]},\"id\":\"ddoui\",\"name\":\"amowaziynknlqwzd\",\"type\":\"piwhxqs\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - PostgreSqlManager manager = PostgreSqlManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.privateLinkResources() - .listByServer("rgxffmshkw", "bkgozxwopdbydpi", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("tczytqjtwh", response.iterator().next().requiredZoneNames().get(0)); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/PrivateLinkServiceConnectionStateTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/PrivateLinkServiceConnectionStateTests.java deleted file mode 100644 index b07081de996c..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/PrivateLinkServiceConnectionStateTests.java +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.postgresqlflexibleserver.models.PrivateEndpointServiceConnectionStatus; -import com.azure.resourcemanager.postgresqlflexibleserver.models.PrivateLinkServiceConnectionState; -import org.junit.jupiter.api.Assertions; - -public final class PrivateLinkServiceConnectionStateTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrivateLinkServiceConnectionState model = BinaryData - .fromString( - "{\"status\":\"Approved\",\"description\":\"iebwwaloayqcgwrt\",\"actionsRequired\":\"uzgwyzmhtx\"}") - .toObject(PrivateLinkServiceConnectionState.class); - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.APPROVED, model.status()); - Assertions.assertEquals("iebwwaloayqcgwrt", model.description()); - Assertions.assertEquals("uzgwyzmhtx", model.actionsRequired()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateLinkServiceConnectionState model - = new PrivateLinkServiceConnectionState().withStatus(PrivateEndpointServiceConnectionStatus.APPROVED) - .withDescription("iebwwaloayqcgwrt") - .withActionsRequired("uzgwyzmhtx"); - model = BinaryData.fromObject(model).toObject(PrivateLinkServiceConnectionState.class); - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.APPROVED, model.status()); - Assertions.assertEquals("iebwwaloayqcgwrt", model.description()); - Assertions.assertEquals("uzgwyzmhtx", model.actionsRequired()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ReplicaTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ReplicaTests.java deleted file mode 100644 index 9b157ab1d9fd..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ReplicaTests.java +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.postgresqlflexibleserver.models.ReadReplicaPromoteMode; -import com.azure.resourcemanager.postgresqlflexibleserver.models.Replica; -import com.azure.resourcemanager.postgresqlflexibleserver.models.ReplicationPromoteOption; -import com.azure.resourcemanager.postgresqlflexibleserver.models.ReplicationRole; -import org.junit.jupiter.api.Assertions; - -public final class ReplicaTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Replica model = BinaryData.fromString( - "{\"role\":\"AsyncReplica\",\"capacity\":1026391011,\"replicationState\":\"Updating\",\"promoteMode\":\"switchover\",\"promoteOption\":\"planned\"}") - .toObject(Replica.class); - Assertions.assertEquals(ReplicationRole.ASYNC_REPLICA, model.role()); - Assertions.assertEquals(ReadReplicaPromoteMode.SWITCHOVER, model.promoteMode()); - Assertions.assertEquals(ReplicationPromoteOption.PLANNED, model.promoteOption()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Replica model = new Replica().withRole(ReplicationRole.ASYNC_REPLICA) - .withPromoteMode(ReadReplicaPromoteMode.SWITCHOVER) - .withPromoteOption(ReplicationPromoteOption.PLANNED); - model = BinaryData.fromObject(model).toObject(Replica.class); - Assertions.assertEquals(ReplicationRole.ASYNC_REPLICA, model.role()); - Assertions.assertEquals(ReadReplicaPromoteMode.SWITCHOVER, model.promoteMode()); - Assertions.assertEquals(ReplicationPromoteOption.PLANNED, model.promoteOption()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ResourceProvidersCheckMigrationNameAvailabilityWithRMockTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ResourceProvidersCheckMigrationNameAvailabilityWithRMockTests.java deleted file mode 100644 index 5dcc37b14e93..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ResourceProvidersCheckMigrationNameAvailabilityWithRMockTests.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager; -import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.MigrationNameAvailabilityResourceInner; -import com.azure.resourcemanager.postgresqlflexibleserver.models.MigrationNameAvailabilityResource; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ResourceProvidersCheckMigrationNameAvailabilityWithRMockTests { - @Test - public void testCheckMigrationNameAvailabilityWithResponse() throws Exception { - String responseStr - = "{\"name\":\"tqyryuzcbmqqv\",\"type\":\"mv\",\"nameAvailable\":true,\"reason\":\"AlreadyExists\",\"message\":\"xo\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - PostgreSqlManager manager = PostgreSqlManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - MigrationNameAvailabilityResource response = manager.resourceProviders() - .checkMigrationNameAvailabilityWithResponse("qscazuawxtz", "puamwabzxr", "xcushs", - new MigrationNameAvailabilityResourceInner().withName("haivm").withType("yasflvgsgzwy"), - com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("tqyryuzcbmqqv", response.name()); - Assertions.assertEquals("mv", response.type()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/RestartParameterTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/RestartParameterTests.java deleted file mode 100644 index de4819a85468..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/RestartParameterTests.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.postgresqlflexibleserver.models.FailoverMode; -import com.azure.resourcemanager.postgresqlflexibleserver.models.RestartParameter; -import org.junit.jupiter.api.Assertions; - -public final class RestartParameterTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - RestartParameter model - = BinaryData.fromString("{\"restartWithFailover\":true,\"failoverMode\":\"PlannedSwitchover\"}") - .toObject(RestartParameter.class); - Assertions.assertEquals(true, model.restartWithFailover()); - Assertions.assertEquals(FailoverMode.PLANNED_SWITCHOVER, model.failoverMode()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - RestartParameter model - = new RestartParameter().withRestartWithFailover(true).withFailoverMode(FailoverMode.PLANNED_SWITCHOVER); - model = BinaryData.fromObject(model).toObject(RestartParameter.class); - Assertions.assertEquals(true, model.restartWithFailover()); - Assertions.assertEquals(FailoverMode.PLANNED_SWITCHOVER, model.failoverMode()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServerBackupInnerTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServerBackupInnerTests.java deleted file mode 100644 index 389a73eb09a3..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServerBackupInnerTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.ServerBackupInner; -import com.azure.resourcemanager.postgresqlflexibleserver.models.Origin; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; - -public final class ServerBackupInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ServerBackupInner model = BinaryData.fromString( - "{\"properties\":{\"backupType\":\"Customer On-Demand\",\"completedTime\":\"2021-02-10T03:30:23Z\",\"source\":\"x\"},\"id\":\"ivyqniwbybrkxvd\",\"name\":\"mjgr\",\"type\":\"fwvuk\"}") - .toObject(ServerBackupInner.class); - Assertions.assertEquals(Origin.CUSTOMER_ON_DEMAND, model.backupType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-10T03:30:23Z"), model.completedTime()); - Assertions.assertEquals("x", model.source()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ServerBackupInner model = new ServerBackupInner().withBackupType(Origin.CUSTOMER_ON_DEMAND) - .withCompletedTime(OffsetDateTime.parse("2021-02-10T03:30:23Z")) - .withSource("x"); - model = BinaryData.fromObject(model).toObject(ServerBackupInner.class); - Assertions.assertEquals(Origin.CUSTOMER_ON_DEMAND, model.backupType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-10T03:30:23Z"), model.completedTime()); - Assertions.assertEquals("x", model.source()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServerBackupListResultTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServerBackupListResultTests.java deleted file mode 100644 index 1fd20caacddc..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServerBackupListResultTests.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.ServerBackupInner; -import com.azure.resourcemanager.postgresqlflexibleserver.models.Origin; -import com.azure.resourcemanager.postgresqlflexibleserver.models.ServerBackupListResult; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ServerBackupListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ServerBackupListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"backupType\":\"Customer On-Demand\",\"completedTime\":\"2021-08-18T11:52:54Z\",\"source\":\"hkryhtn\"},\"id\":\"czwlokjyem\",\"name\":\"kvnipjoxz\",\"type\":\"nchgej\"}],\"nextLink\":\"odmailzyd\"}") - .toObject(ServerBackupListResult.class); - Assertions.assertEquals(Origin.CUSTOMER_ON_DEMAND, model.value().get(0).backupType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-18T11:52:54Z"), model.value().get(0).completedTime()); - Assertions.assertEquals("hkryhtn", model.value().get(0).source()); - Assertions.assertEquals("odmailzyd", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ServerBackupListResult model = new ServerBackupListResult() - .withValue(Arrays.asList(new ServerBackupInner().withBackupType(Origin.CUSTOMER_ON_DEMAND) - .withCompletedTime(OffsetDateTime.parse("2021-08-18T11:52:54Z")) - .withSource("hkryhtn"))) - .withNextLink("odmailzyd"); - model = BinaryData.fromObject(model).toObject(ServerBackupListResult.class); - Assertions.assertEquals(Origin.CUSTOMER_ON_DEMAND, model.value().get(0).backupType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-18T11:52:54Z"), model.value().get(0).completedTime()); - Assertions.assertEquals("hkryhtn", model.value().get(0).source()); - Assertions.assertEquals("odmailzyd", model.nextLink()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServerBackupPropertiesTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServerBackupPropertiesTests.java deleted file mode 100644 index fe9fe126c0df..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServerBackupPropertiesTests.java +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.ServerBackupProperties; -import com.azure.resourcemanager.postgresqlflexibleserver.models.Origin; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; - -public final class ServerBackupPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ServerBackupProperties model = BinaryData - .fromString( - "{\"backupType\":\"Customer On-Demand\",\"completedTime\":\"2021-02-24T15:23:22Z\",\"source\":\"cs\"}") - .toObject(ServerBackupProperties.class); - Assertions.assertEquals(Origin.CUSTOMER_ON_DEMAND, model.backupType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-24T15:23:22Z"), model.completedTime()); - Assertions.assertEquals("cs", model.source()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ServerBackupProperties model = new ServerBackupProperties().withBackupType(Origin.CUSTOMER_ON_DEMAND) - .withCompletedTime(OffsetDateTime.parse("2021-02-24T15:23:22Z")) - .withSource("cs"); - model = BinaryData.fromObject(model).toObject(ServerBackupProperties.class); - Assertions.assertEquals(Origin.CUSTOMER_ON_DEMAND, model.backupType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-24T15:23:22Z"), model.completedTime()); - Assertions.assertEquals("cs", model.source()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServerCapabilitiesListMockTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServerCapabilitiesListMockTests.java deleted file mode 100644 index e7201e0b0a61..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServerCapabilitiesListMockTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager; -import com.azure.resourcemanager.postgresqlflexibleserver.models.FlexibleServerCapability; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ServerCapabilitiesListMockTests { - @Test - public void testList() throws Exception { - String responseStr - = "{\"value\":[{\"name\":\"jvpglydzgk\",\"supportedServerEditions\":[{\"name\":\"ev\",\"defaultSkuName\":\"epr\",\"supportedStorageEditions\":[{\"name\":\"wytpzdmovz\",\"defaultStorageSizeMb\":1753829479410952479,\"supportedStorageMb\":[{}],\"status\":\"Visible\",\"reason\":\"dflgzuri\"}],\"supportedServerSkus\":[{\"name\":\"cx\",\"vCores\":103057298,\"supportedIops\":1221508981,\"supportedMemoryPerVcoreMb\":7263296405580029992,\"supportedZones\":[\"mlqtmldgxob\",\"irclnpk\",\"iayz\"],\"supportedHaMode\":[\"ZoneRedundant\",\"SameZone\",\"ZoneRedundant\",\"ZoneRedundant\"],\"status\":\"Disabled\",\"reason\":\"jlb\"},{\"name\":\"qvkjlmxho\",\"vCores\":298942523,\"supportedIops\":1117354707,\"supportedMemoryPerVcoreMb\":5593659060766409421,\"supportedZones\":[\"umbnraauzzp\",\"jazysdzhezwwvaiq\",\"uvvfonkp\",\"hqyikvy\"],\"supportedHaMode\":[\"ZoneRedundant\"],\"status\":\"Default\",\"reason\":\"uwmncs\"},{\"name\":\"ijf\",\"vCores\":671639646,\"supportedIops\":263453714,\"supportedMemoryPerVcoreMb\":7136773832934056620,\"supportedZones\":[\"sgbdhuz\",\"gnjdgkynscliqhz\",\"h\"],\"supportedHaMode\":[\"SameZone\",\"SameZone\",\"ZoneRedundant\"],\"status\":\"Visible\",\"reason\":\"otppnv\"}],\"status\":\"Visible\",\"reason\":\"hihfrbbcevqagtlt\"},{\"name\":\"lfkqojpy\",\"defaultSkuName\":\"gtrd\",\"supportedStorageEditions\":[{\"name\":\"mzzs\",\"defaultStorageSizeMb\":911542749738488125,\"supportedStorageMb\":[{},{},{},{}],\"status\":\"Available\",\"reason\":\"xmprafwg\"},{\"name\":\"hocxvdfffwafqrou\",\"defaultStorageSizeMb\":5073586645904040665,\"supportedStorageMb\":[{},{},{},{}],\"status\":\"Visible\",\"reason\":\"r\"}],\"supportedServerSkus\":[{\"name\":\"n\",\"vCores\":1824103868,\"supportedIops\":35410717,\"supportedMemoryPerVcoreMb\":5535477679816636437,\"supportedZones\":[\"moy\",\"cdyuibhmfdnbzyd\",\"f\"],\"supportedHaMode\":[\"SameZone\",\"SameZone\",\"SameZone\",\"ZoneRedundant\"],\"status\":\"Available\",\"reason\":\"rvhmgor\"},{\"name\":\"ukiscvwmzhw\",\"vCores\":157711526,\"supportedIops\":57384767,\"supportedMemoryPerVcoreMb\":7279041380388525299,\"supportedZones\":[\"cbtgnhnz\"],\"supportedHaMode\":[\"ZoneRedundant\",\"SameZone\",\"ZoneRedundant\",\"ZoneRedundant\"],\"status\":\"Available\",\"reason\":\"lqhy\"},{\"name\":\"vodggxdbee\",\"vCores\":1327302833,\"supportedIops\":1658504364,\"supportedMemoryPerVcoreMb\":1833714202725458886,\"supportedZones\":[\"iaa\"],\"supportedHaMode\":[\"SameZone\",\"SameZone\",\"ZoneRedundant\",\"SameZone\"],\"status\":\"Visible\",\"reason\":\"bylyrfgia\"}],\"status\":\"Disabled\",\"reason\":\"jocqwogfnzjvusf\"}],\"supportedServerVersions\":[{\"name\":\"ozuxylfsbtkadpys\",\"supportedVersionsToUpgrade\":[\"btgkbugrjqctoj\",\"mi\",\"of\",\"eypefojyqd\"],\"status\":\"Visible\",\"reason\":\"lcplc\"},{\"name\":\"hihihlhzdsqtzbsr\",\"supportedVersionsToUpgrade\":[\"wcjhfgmv\"],\"status\":\"Disabled\",\"reason\":\"txmwoteyow\"}],\"fastProvisioningSupported\":\"Disabled\",\"supportedFastProvisioningEditions\":[{\"supportedTier\":\"ekqvgqouwif\",\"supportedSku\":\"pjwyiv\",\"supportedStorageGb\":18074725,\"supportedServerVersions\":\"xcvhrfs\",\"serverCount\":1587826907,\"status\":\"Disabled\",\"reason\":\"ttikteusqczkvykl\"},{\"supportedTier\":\"byjaffmmf\",\"supportedSku\":\"cqc\",\"supportedStorageGb\":661332141,\"supportedServerVersions\":\"qibrtalme\",\"serverCount\":38344578,\"status\":\"Disabled\",\"reason\":\"slqxi\"},{\"supportedTier\":\"rmooizqse\",\"supportedSku\":\"xiutcx\",\"supportedStorageGb\":2081194366,\"supportedServerVersions\":\"y\",\"serverCount\":1111738970,\"status\":\"Visible\",\"reason\":\"e\"}],\"geoBackupSupported\":\"Enabled\",\"zoneRedundantHaSupported\":\"Disabled\",\"zoneRedundantHaAndGeoBackupSupported\":\"Enabled\",\"storageAutoGrowthSupported\":\"Enabled\",\"onlineResizeSupported\":\"Disabled\",\"restricted\":\"Disabled\",\"status\":\"Visible\",\"reason\":\"kkzjcjbtrga\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - PostgreSqlManager manager = PostgreSqlManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response - = manager.serverCapabilities().list("tqedcgzulwm", "rqzz", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("jvpglydzgk", response.iterator().next().name()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServerSkuCapabilityTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServerSkuCapabilityTests.java deleted file mode 100644 index 754ff8161a57..000000000000 --- 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 a9cf647e4559..000000000000 --- 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 5fe5852420f6..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServerThreatProtectionListResultTests.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.postgresqlflexibleserver.models.ServerThreatProtectionListResult; - -public final class ServerThreatProtectionListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ServerThreatProtectionListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"state\":\"Disabled\",\"creationTime\":\"2021-01-02T14:34:14Z\"},\"id\":\"twqmsniffcdmqnr\",\"name\":\"jlpijnkrx\",\"type\":\"rddh\"},{\"properties\":{\"state\":\"Enabled\",\"creationTime\":\"2021-10-24T17:40:19Z\"},\"id\":\"zronasxift\",\"name\":\"zq\",\"type\":\"zh\"},{\"properties\":{\"state\":\"Disabled\",\"creationTime\":\"2021-11-23T02:30:56Z\"},\"id\":\"ogczhonnxkrlg\",\"name\":\"yhmossxkkg\",\"type\":\"h\"},{\"properties\":{\"state\":\"Enabled\",\"creationTime\":\"2021-07-14T05:25:31Z\"},\"id\":\"bdhqxvcxgf\",\"name\":\"pdso\",\"type\":\"bshrnsvbuswd\"}],\"nextLink\":\"yybyc\"}") - .toObject(ServerThreatProtectionListResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ServerThreatProtectionListResult model = new ServerThreatProtectionListResult(); - model = BinaryData.fromObject(model).toObject(ServerThreatProtectionListResult.class); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServerThreatProtectionPropertiesTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServerThreatProtectionPropertiesTests.java deleted file mode 100644 index 57460b8eae1a..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServerThreatProtectionPropertiesTests.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.ServerThreatProtectionProperties; -import com.azure.resourcemanager.postgresqlflexibleserver.models.ThreatProtectionState; -import org.junit.jupiter.api.Assertions; - -public final class ServerThreatProtectionPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ServerThreatProtectionProperties model - = BinaryData.fromString("{\"state\":\"Enabled\",\"creationTime\":\"2021-06-25T00:23:13Z\"}") - .toObject(ServerThreatProtectionProperties.class); - Assertions.assertEquals(ThreatProtectionState.ENABLED, model.state()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ServerThreatProtectionProperties model - = new ServerThreatProtectionProperties().withState(ThreatProtectionState.ENABLED); - model = BinaryData.fromObject(model).toObject(ServerThreatProtectionProperties.class); - Assertions.assertEquals(ThreatProtectionState.ENABLED, model.state()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServerThreatProtectionSettingsCreateOrUpdateMockTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServerThreatProtectionSettingsCreateOrUpdateMockTests.java deleted file mode 100644 index 9d5725fdd6c1..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServerThreatProtectionSettingsCreateOrUpdateMockTests.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager; -import com.azure.resourcemanager.postgresqlflexibleserver.models.ServerThreatProtectionSettingsModel; -import com.azure.resourcemanager.postgresqlflexibleserver.models.ThreatProtectionName; -import com.azure.resourcemanager.postgresqlflexibleserver.models.ThreatProtectionState; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ServerThreatProtectionSettingsCreateOrUpdateMockTests { - @Test - public void testCreateOrUpdate() throws Exception { - String responseStr - = "{\"properties\":{\"state\":\"Disabled\",\"creationTime\":\"2021-08-26T01:20:28Z\"},\"id\":\"p\",\"name\":\"ilkmk\",\"type\":\"holvdn\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - PostgreSqlManager manager = PostgreSqlManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ServerThreatProtectionSettingsModel response = manager.serverThreatProtectionSettings() - .define(ThreatProtectionName.DEFAULT) - .withExistingFlexibleServer("vqylkmqpzoyhl", "bcg") - .withState(ThreatProtectionState.DISABLED) - .create(); - - Assertions.assertEquals(ThreatProtectionState.DISABLED, response.state()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServerThreatProtectionSettingsGetWithResponseMockTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServerThreatProtectionSettingsGetWithResponseMockTests.java deleted file mode 100644 index b1c169b6e9fe..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServerThreatProtectionSettingsGetWithResponseMockTests.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager; -import com.azure.resourcemanager.postgresqlflexibleserver.models.ServerThreatProtectionSettingsModel; -import com.azure.resourcemanager.postgresqlflexibleserver.models.ThreatProtectionName; -import com.azure.resourcemanager.postgresqlflexibleserver.models.ThreatProtectionState; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ServerThreatProtectionSettingsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"state\":\"Enabled\",\"creationTime\":\"2021-10-30T16:37:34Z\"},\"id\":\"btozipqwje\",\"name\":\"mur\",\"type\":\"xxgewpk\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - PostgreSqlManager manager = PostgreSqlManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ServerThreatProtectionSettingsModel response = manager.serverThreatProtectionSettings() - .getWithResponse("n", "gox", ThreatProtectionName.DEFAULT, com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(ThreatProtectionState.ENABLED, response.state()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServerThreatProtectionSettingsListByServerMockTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServerThreatProtectionSettingsListByServerMockTests.java deleted file mode 100644 index b2e93368bf5c..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServerThreatProtectionSettingsListByServerMockTests.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager; -import com.azure.resourcemanager.postgresqlflexibleserver.models.ServerThreatProtectionSettingsModel; -import com.azure.resourcemanager.postgresqlflexibleserver.models.ThreatProtectionState; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ServerThreatProtectionSettingsListByServerMockTests { - @Test - public void testListByServer() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"state\":\"Enabled\",\"creationTime\":\"2021-01-01T06:59:38Z\"},\"id\":\"ynpdkvgfab\",\"name\":\"iyji\",\"type\":\"uzphdugnei\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - PostgreSqlManager manager = PostgreSqlManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.serverThreatProtectionSettings() - .listByServer("cugswvxwlmzqw", "vtxnjmxmcuqud", com.azure.core.util.Context.NONE); - - Assertions.assertEquals(ThreatProtectionState.ENABLED, response.iterator().next().state()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServerThreatProtectionSettingsModelInnerTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServerThreatProtectionSettingsModelInnerTests.java deleted file mode 100644 index 723f81eb4867..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServerThreatProtectionSettingsModelInnerTests.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.ServerThreatProtectionSettingsModelInner; -import com.azure.resourcemanager.postgresqlflexibleserver.models.ThreatProtectionState; -import org.junit.jupiter.api.Assertions; - -public final class ServerThreatProtectionSettingsModelInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ServerThreatProtectionSettingsModelInner model = BinaryData.fromString( - "{\"properties\":{\"state\":\"Disabled\",\"creationTime\":\"2021-09-24T12:06:55Z\"},\"id\":\"rtkfawnopq\",\"name\":\"ikyzirtxdy\",\"type\":\"x\"}") - .toObject(ServerThreatProtectionSettingsModelInner.class); - Assertions.assertEquals(ThreatProtectionState.DISABLED, model.state()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ServerThreatProtectionSettingsModelInner model - = new ServerThreatProtectionSettingsModelInner().withState(ThreatProtectionState.DISABLED); - model = BinaryData.fromObject(model).toObject(ServerThreatProtectionSettingsModelInner.class); - Assertions.assertEquals(ThreatProtectionState.DISABLED, model.state()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServerVersionCapabilityTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServerVersionCapabilityTests.java deleted file mode 100644 index d6f6e79e6900..000000000000 --- 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 924afbc51399..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServersDeleteMockTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ServersDeleteMockTests { - @Test - public void testDelete() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - PostgreSqlManager manager = PostgreSqlManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.servers().delete("kan", "jpdn", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServersRestartMockTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServersRestartMockTests.java deleted file mode 100644 index 2516edf1acfb..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServersRestartMockTests.java +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager; -import com.azure.resourcemanager.postgresqlflexibleserver.models.FailoverMode; -import com.azure.resourcemanager.postgresqlflexibleserver.models.RestartParameter; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ServersRestartMockTests { - @Test - public void testRestart() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - PostgreSqlManager manager = PostgreSqlManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.servers() - .restart("kelvidizozsdb", "cxjmonfdgnwncyp", - new RestartParameter().withRestartWithFailover(false).withFailoverMode(FailoverMode.PLANNED_FAILOVER), - com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServersStartMockTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServersStartMockTests.java deleted file mode 100644 index 1121c1f7c05d..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServersStartMockTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ServersStartMockTests { - @Test - public void testStart() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - PostgreSqlManager manager = PostgreSqlManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.servers().start("tvuqjctzenkeifzz", "mkdasv", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServersStopMockTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServersStopMockTests.java deleted file mode 100644 index edbb68d1debb..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServersStopMockTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ServersStopMockTests { - @Test - public void testStop() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - PostgreSqlManager manager = PostgreSqlManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.servers().stop("lyhb", "cu", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/SkuTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/SkuTests.java deleted file mode 100644 index baaa0358d4f3..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/SkuTests.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.postgresqlflexibleserver.models.Sku; -import com.azure.resourcemanager.postgresqlflexibleserver.models.SkuTier; -import org.junit.jupiter.api.Assertions; - -public final class SkuTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Sku model = BinaryData.fromString("{\"name\":\"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 00401b8b14db..000000000000 --- 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 ce223ffa746a..000000000000 --- 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 ea6943882269..000000000000 --- 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 76c4afc4a7cf..000000000000 --- 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 5489ac6f4768..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/UserAssignedIdentityTests.java +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.postgresqlflexibleserver.models.IdentityType; -import com.azure.resourcemanager.postgresqlflexibleserver.models.UserAssignedIdentity; -import com.azure.resourcemanager.postgresqlflexibleserver.models.UserIdentity; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class UserAssignedIdentityTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - UserAssignedIdentity model = BinaryData.fromString( - "{\"userAssignedIdentities\":{\"hahvljuahaq\":{\"principalId\":\"kv\",\"clientId\":\"elmqk\"}},\"type\":\"SystemAssigned\",\"tenantId\":\"dhmdua\"}") - .toObject(UserAssignedIdentity.class); - Assertions.assertEquals("kv", model.userAssignedIdentities().get("hahvljuahaq").principalId()); - Assertions.assertEquals("elmqk", model.userAssignedIdentities().get("hahvljuahaq").clientId()); - Assertions.assertEquals(IdentityType.SYSTEM_ASSIGNED, model.type()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - UserAssignedIdentity model = new UserAssignedIdentity() - .withUserAssignedIdentities( - mapOf("hahvljuahaq", new UserIdentity().withPrincipalId("kv").withClientId("elmqk"))) - .withType(IdentityType.SYSTEM_ASSIGNED); - model = BinaryData.fromObject(model).toObject(UserAssignedIdentity.class); - Assertions.assertEquals("kv", model.userAssignedIdentities().get("hahvljuahaq").principalId()); - Assertions.assertEquals("elmqk", model.userAssignedIdentities().get("hahvljuahaq").clientId()); - Assertions.assertEquals(IdentityType.SYSTEM_ASSIGNED, model.type()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/UserIdentityTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/UserIdentityTests.java deleted file mode 100644 index ec7496c72dcd..000000000000 --- 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 55625b15a20e..000000000000 --- 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 0a6ea42e91dd..000000000000 --- 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 87e02f997356..000000000000 --- 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 f4aeaefad778..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/VirtualEndpointResourceForPatchTests.java +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.postgresqlflexibleserver.models.VirtualEndpointResourceForPatch; -import com.azure.resourcemanager.postgresqlflexibleserver.models.VirtualEndpointType; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class VirtualEndpointResourceForPatchTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - VirtualEndpointResourceForPatch model = BinaryData.fromString( - "{\"properties\":{\"endpointType\":\"ReadWrite\",\"members\":[\"yhwzdgiruj\"],\"virtualEndpoints\":[\"omvzzbtd\",\"qvpn\",\"yujviylwdshfssn\"]}}") - .toObject(VirtualEndpointResourceForPatch.class); - Assertions.assertEquals(VirtualEndpointType.READ_WRITE, model.endpointType()); - Assertions.assertEquals("yhwzdgiruj", model.members().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - VirtualEndpointResourceForPatch model - = new VirtualEndpointResourceForPatch().withEndpointType(VirtualEndpointType.READ_WRITE) - .withMembers(Arrays.asList("yhwzdgiruj")); - model = BinaryData.fromObject(model).toObject(VirtualEndpointResourceForPatch.class); - Assertions.assertEquals(VirtualEndpointType.READ_WRITE, model.endpointType()); - Assertions.assertEquals("yhwzdgiruj", model.members().get(0)); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/VirtualEndpointResourceInnerTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/VirtualEndpointResourceInnerTests.java deleted file mode 100644 index 8b92e1e397d3..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/VirtualEndpointResourceInnerTests.java +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.VirtualEndpointResourceInner; -import com.azure.resourcemanager.postgresqlflexibleserver.models.VirtualEndpointType; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class VirtualEndpointResourceInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - VirtualEndpointResourceInner model = BinaryData.fromString( - "{\"id\":\"psew\",\"name\":\"oi\",\"type\":\"ukry\",\"properties\":{\"endpointType\":\"ReadWrite\",\"members\":[\"ox\",\"rgguf\",\"yaomtb\",\"hhavgrvkffovjz\"],\"virtualEndpoints\":[\"bibgjmfxumv\",\"cluyovwxnbkf\"]}}") - .toObject(VirtualEndpointResourceInner.class); - Assertions.assertEquals(VirtualEndpointType.READ_WRITE, model.endpointType()); - Assertions.assertEquals("ox", model.members().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - VirtualEndpointResourceInner model - = new VirtualEndpointResourceInner().withEndpointType(VirtualEndpointType.READ_WRITE) - .withMembers(Arrays.asList("ox", "rgguf", "yaomtb", "hhavgrvkffovjz")); - model = BinaryData.fromObject(model).toObject(VirtualEndpointResourceInner.class); - Assertions.assertEquals(VirtualEndpointType.READ_WRITE, model.endpointType()); - Assertions.assertEquals("ox", model.members().get(0)); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/VirtualEndpointResourcePropertiesTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/VirtualEndpointResourcePropertiesTests.java deleted file mode 100644 index 438a38243229..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/VirtualEndpointResourcePropertiesTests.java +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.VirtualEndpointResourceProperties; -import com.azure.resourcemanager.postgresqlflexibleserver.models.VirtualEndpointType; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class VirtualEndpointResourcePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - VirtualEndpointResourceProperties model = BinaryData.fromString( - "{\"endpointType\":\"ReadWrite\",\"members\":[\"frymsgaojfmwnc\"],\"virtualEndpoints\":[\"rfh\",\"rctym\",\"xoftpipiwyczu\"]}") - .toObject(VirtualEndpointResourceProperties.class); - Assertions.assertEquals(VirtualEndpointType.READ_WRITE, model.endpointType()); - Assertions.assertEquals("frymsgaojfmwnc", model.members().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - VirtualEndpointResourceProperties model - = new VirtualEndpointResourceProperties().withEndpointType(VirtualEndpointType.READ_WRITE) - .withMembers(Arrays.asList("frymsgaojfmwnc")); - model = BinaryData.fromObject(model).toObject(VirtualEndpointResourceProperties.class); - Assertions.assertEquals(VirtualEndpointType.READ_WRITE, model.endpointType()); - Assertions.assertEquals("frymsgaojfmwnc", model.members().get(0)); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/VirtualEndpointsCreateMockTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/VirtualEndpointsCreateMockTests.java deleted file mode 100644 index 0eeaa446f3ab..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/VirtualEndpointsCreateMockTests.java +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager; -import com.azure.resourcemanager.postgresqlflexibleserver.models.VirtualEndpointResource; -import com.azure.resourcemanager.postgresqlflexibleserver.models.VirtualEndpointType; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class VirtualEndpointsCreateMockTests { - @Test - public void testCreate() throws Exception { - String responseStr - = "{\"id\":\"uicbuewmrsw\",\"name\":\"lx\",\"type\":\"rhwpus\",\"properties\":{\"endpointType\":\"ReadWrite\",\"members\":[\"gpdohzj\",\"atucoigebxncn\"],\"virtualEndpoints\":[\"pbnwgfmxjgcg\",\"jbgdlfgtdysnaquf\"]}}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - PostgreSqlManager manager = PostgreSqlManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - VirtualEndpointResource response = manager.virtualEndpoints() - .define("bauiropi") - .withExistingFlexibleServer("rjvzuyt", "rmlmuowo") - .withEndpointType(VirtualEndpointType.READ_WRITE) - .withMembers(Arrays.asList("rd")) - .create(); - - Assertions.assertEquals(VirtualEndpointType.READ_WRITE, response.endpointType()); - Assertions.assertEquals("gpdohzj", response.members().get(0)); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/VirtualEndpointsGetWithResponseMockTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/VirtualEndpointsGetWithResponseMockTests.java deleted file mode 100644 index bc1ba74fc2b5..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/VirtualEndpointsGetWithResponseMockTests.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager; -import com.azure.resourcemanager.postgresqlflexibleserver.models.VirtualEndpointResource; -import com.azure.resourcemanager.postgresqlflexibleserver.models.VirtualEndpointType; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class VirtualEndpointsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - String responseStr - = "{\"id\":\"jqirwrw\",\"name\":\"oxffif\",\"type\":\"wrsnewmozqvbu\",\"properties\":{\"endpointType\":\"ReadWrite\",\"members\":[\"ycxhxzgaztta\",\"o\",\"dvmfqhppub\"],\"virtualEndpoints\":[\"epdfgkmtdherng\",\"tcjuahokqto\"]}}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - PostgreSqlManager manager = PostgreSqlManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - VirtualEndpointResource response = manager.virtualEndpoints() - .getWithResponse("viauogphua", "tvt", "ukyefchnmnahmnxh", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(VirtualEndpointType.READ_WRITE, response.endpointType()); - Assertions.assertEquals("ycxhxzgaztta", response.members().get(0)); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/VirtualEndpointsListByServerMockTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/VirtualEndpointsListByServerMockTests.java deleted file mode 100644 index bbdf822032e6..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/VirtualEndpointsListByServerMockTests.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager; -import com.azure.resourcemanager.postgresqlflexibleserver.models.VirtualEndpointResource; -import com.azure.resourcemanager.postgresqlflexibleserver.models.VirtualEndpointType; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class VirtualEndpointsListByServerMockTests { - @Test - public void testListByServer() throws Exception { - String responseStr - = "{\"value\":[{\"id\":\"whslwkoj\",\"name\":\"l\",\"type\":\"npdwr\",\"properties\":{\"endpointType\":\"ReadWrite\",\"members\":[\"gsnnf\"],\"virtualEndpoints\":[\"tefypococtfjgti\"]}}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - PostgreSqlManager manager = PostgreSqlManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response - = manager.virtualEndpoints().listByServer("kauxof", "hfphwpnulaiywze", com.azure.core.util.Context.NONE); - - Assertions.assertEquals(VirtualEndpointType.READ_WRITE, response.iterator().next().endpointType()); - Assertions.assertEquals("gsnnf", response.iterator().next().members().get(0)); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/VirtualEndpointsListResultTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/VirtualEndpointsListResultTests.java deleted file mode 100644 index 9d12a3d557ce..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/VirtualEndpointsListResultTests.java +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.VirtualEndpointResourceInner; -import com.azure.resourcemanager.postgresqlflexibleserver.models.VirtualEndpointType; -import com.azure.resourcemanager.postgresqlflexibleserver.models.VirtualEndpointsListResult; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class VirtualEndpointsListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - VirtualEndpointsListResult model = BinaryData.fromString( - "{\"value\":[{\"id\":\"pqjlihhyusps\",\"name\":\"sdvlmfwdgzxulucv\",\"type\":\"mrsreuzvxurisjnh\",\"properties\":{\"endpointType\":\"ReadWrite\",\"members\":[\"jzgxmrhublwp\",\"esutrgjupauutpw\",\"qhih\"],\"virtualEndpoints\":[\"g\"]}}],\"nextLink\":\"pnfqntcyp\"}") - .toObject(VirtualEndpointsListResult.class); - Assertions.assertEquals(VirtualEndpointType.READ_WRITE, model.value().get(0).endpointType()); - Assertions.assertEquals("jzgxmrhublwp", model.value().get(0).members().get(0)); - Assertions.assertEquals("pnfqntcyp", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - VirtualEndpointsListResult model - = new VirtualEndpointsListResult() - .withValue( - Arrays.asList(new VirtualEndpointResourceInner().withEndpointType(VirtualEndpointType.READ_WRITE) - .withMembers(Arrays.asList("jzgxmrhublwp", "esutrgjupauutpw", "qhih")))) - .withNextLink("pnfqntcyp"); - model = BinaryData.fromObject(model).toObject(VirtualEndpointsListResult.class); - Assertions.assertEquals(VirtualEndpointType.READ_WRITE, model.value().get(0).endpointType()); - Assertions.assertEquals("jzgxmrhublwp", model.value().get(0).members().get(0)); - Assertions.assertEquals("pnfqntcyp", model.nextLink()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/VirtualNetworkSubnetUsageParameterTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/VirtualNetworkSubnetUsageParameterTests.java deleted file mode 100644 index f91f16a6f587..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/VirtualNetworkSubnetUsageParameterTests.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.postgresqlflexibleserver.models.VirtualNetworkSubnetUsageParameter; -import org.junit.jupiter.api.Assertions; - -public final class VirtualNetworkSubnetUsageParameterTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - VirtualNetworkSubnetUsageParameter model = BinaryData.fromString("{\"virtualNetworkArmResourceId\":\"jv\"}") - .toObject(VirtualNetworkSubnetUsageParameter.class); - Assertions.assertEquals("jv", model.virtualNetworkArmResourceId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - VirtualNetworkSubnetUsageParameter model - = new VirtualNetworkSubnetUsageParameter().withVirtualNetworkArmResourceId("jv"); - model = BinaryData.fromObject(model).toObject(VirtualNetworkSubnetUsageParameter.class); - Assertions.assertEquals("jv", model.virtualNetworkArmResourceId()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/VirtualNetworkSubnetUsageResultInnerTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/VirtualNetworkSubnetUsageResultInnerTests.java deleted file mode 100644 index 884be31835b8..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/VirtualNetworkSubnetUsageResultInnerTests.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.VirtualNetworkSubnetUsageResultInner; - -public final class VirtualNetworkSubnetUsageResultInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - VirtualNetworkSubnetUsageResultInner model = BinaryData.fromString( - "{\"delegatedSubnetsUsage\":[{\"subnetName\":\"wkslir\",\"usage\":1648418859978390426},{\"subnetName\":\"vydfceacvlhvygdy\",\"usage\":2478564510622036028},{\"subnetName\":\"twnawjslbiwkojgc\",\"usage\":2684891506891853322}],\"location\":\"mznbaeqphch\",\"subscriptionId\":\"rn\"}") - .toObject(VirtualNetworkSubnetUsageResultInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - VirtualNetworkSubnetUsageResultInner model = new VirtualNetworkSubnetUsageResultInner(); - model = BinaryData.fromObject(model).toObject(VirtualNetworkSubnetUsageResultInner.class); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/VirtualNetworkSubnetUsagesExecuteWithResponseMockTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/VirtualNetworkSubnetUsagesExecuteWithResponseMockTests.java deleted file mode 100644 index 4ec3c76129d0..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/VirtualNetworkSubnetUsagesExecuteWithResponseMockTests.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager; -import com.azure.resourcemanager.postgresqlflexibleserver.models.VirtualNetworkSubnetUsageParameter; -import com.azure.resourcemanager.postgresqlflexibleserver.models.VirtualNetworkSubnetUsageResult; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class VirtualNetworkSubnetUsagesExecuteWithResponseMockTests { - @Test - public void testExecuteWithResponse() throws Exception { - String responseStr - = "{\"delegatedSubnetsUsage\":[{\"subnetName\":\"leziunjxdfzant\",\"usage\":7973738400365966100},{\"subnetName\":\"yamlbnse\",\"usage\":6409376933110730693},{\"subnetName\":\"vpilg\",\"usage\":2023691682107427976}],\"location\":\"agmdit\",\"subscriptionId\":\"eiookjbsah\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - PostgreSqlManager manager = PostgreSqlManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - VirtualNetworkSubnetUsageResult response = manager.virtualNetworkSubnetUsages() - .executeWithResponse("qbctqha", - new VirtualNetworkSubnetUsageParameter().withVirtualNetworkArmResourceId("jrwdkqz"), - com.azure.core.util.Context.NONE) - .getValue(); - - } -}