diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/CHANGELOG.md b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/CHANGELOG.md index deab5cf17969..ed39b6b63493 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/CHANGELOG.md +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/CHANGELOG.md @@ -1,5 +1,344 @@ # Release History +## 5.0.0 (2025-11-12) +### Breaking Changes + +- Function `*ConfigurationsClient.BeginPut` parameter(s) have been changed from `(context.Context, string, string, string, Configuration, *ConfigurationsClientBeginPutOptions)` to `(context.Context, string, string, string, ConfigurationForUpdate, *ConfigurationsClientBeginPutOptions)` +- Function `NewMigrationsClient` parameter(s) have been changed from `(azcore.TokenCredential, *arm.ClientOptions)` to `(string, azcore.TokenCredential, *arm.ClientOptions)` +- Function `*MigrationsClient.Create` parameter(s) have been changed from `(context.Context, string, string, string, string, MigrationResource, *MigrationsClientCreateOptions)` to `(context.Context, string, string, string, Migration, *MigrationsClientCreateOptions)` +- Function `*MigrationsClient.Get` parameter(s) have been changed from `(context.Context, string, string, string, string, *MigrationsClientGetOptions)` to `(context.Context, string, string, string, *MigrationsClientGetOptions)` +- Function `*MigrationsClient.NewListByTargetServerPager` parameter(s) have been changed from `(string, string, string, *MigrationsClientListByTargetServerOptions)` to `(string, string, *MigrationsClientListByTargetServerOptions)` +- Function `*MigrationsClient.Update` parameter(s) have been changed from `(context.Context, string, string, string, string, MigrationResourceForPatch, *MigrationsClientUpdateOptions)` to `(context.Context, string, string, string, MigrationResourceForPatch, *MigrationsClientUpdateOptions)` +- Function `*ServerThreatProtectionSettingsClient.BeginCreateOrUpdate` parameter(s) have been changed from `(context.Context, string, string, ThreatProtectionName, ServerThreatProtectionSettingsModel, *ServerThreatProtectionSettingsClientBeginCreateOrUpdateOptions)` to `(context.Context, string, string, ThreatProtectionName, AdvancedThreatProtectionSettingsModel, *ServerThreatProtectionSettingsClientBeginCreateOrUpdateOptions)` +- Function `*ServersClient.BeginUpdate` parameter(s) have been changed from `(context.Context, string, string, ServerForUpdate, *ServersClientBeginUpdateOptions)` to `(context.Context, string, string, ServerForPatch, *ServersClientBeginUpdateOptions)` +- Function `*VirtualEndpointsClient.BeginCreate` parameter(s) have been changed from `(context.Context, string, string, string, VirtualEndpointResource, *VirtualEndpointsClientBeginCreateOptions)` to `(context.Context, string, string, string, VirtualEndpoint, *VirtualEndpointsClientBeginCreateOptions)` +- Type of `AuthConfig.ActiveDirectoryAuth` has been changed from `*ActiveDirectoryAuthEnum` to `*MicrosoftEntraAuth` +- Type of `AuthConfig.PasswordAuth` has been changed from `*PasswordAuthEnum` to `*PasswordBasedAuth` +- Type of `Backup.GeoRedundantBackup` has been changed from `*GeoRedundantBackupEnum` to `*GeographicallyRedundantBackup` +- Type of `DataEncryption.GeoBackupEncryptionKeyStatus` has been changed from `*KeyStatusEnum` to `*EncryptionKeyStatus` +- Type of `DataEncryption.PrimaryEncryptionKeyStatus` has been changed from `*KeyStatusEnum` to `*EncryptionKeyStatus` +- Type of `DataEncryption.Type` has been changed from `*ArmServerKeyType` to `*DataEncryptionType` +- Type of `HighAvailability.State` has been changed from `*ServerHAState` to `*HighAvailabilityState` +- Type of `LtrPreBackupResponse.Properties` has been changed from `*LtrPreBackupResponseProperties` to `*BackupsLongTermRetentionResponseProperties` +- Type of `LtrServerBackupOperationList.Value` has been changed from `[]*LtrServerBackupOperation` to `[]*BackupsLongTermRetentionOperation` +- Type of `MigrationResourceForPatch.Properties` has been changed from `*MigrationResourcePropertiesForPatch` to `*MigrationPropertiesForPatch` +- Type of `MigrationStatus.CurrentSubStateDetails` has been changed from `*MigrationSubStateDetails` to `*MigrationSubstateDetails` +- Type of `Replica.PromoteOption` has been changed from `*ReplicationPromoteOption` to `*ReadReplicaPromoteOption` +- Type of `ServerProperties.Version` has been changed from `*ServerVersion` to `*PostgresMajorVersion` +- Type of `ServerSKUCapability.SupportedHaMode` has been changed from `[]*HaMode` to `[]*HighAvailabilityMode` +- Type of `Storage.Tier` has been changed from `*AzureManagedDiskPerformanceTiers` to `*AzureManagedDiskPerformanceTier` +- `HighAvailabilityModeDisabled` from enum `HighAvailabilityMode` has been removed +- Enum `ActiveDirectoryAuthEnum` has been removed +- Enum `ArmServerKeyType` has been removed +- Enum `AzureManagedDiskPerformanceTiers` has been removed +- Enum `CancelEnum` has been removed +- Enum `CreateModeForUpdate` has been removed +- Enum `FastProvisioningSupportedEnum` has been removed +- Enum `GeoBackupSupportedEnum` has been removed +- Enum `GeoRedundantBackupEnum` has been removed +- Enum `HaMode` has been removed +- Enum `KeyStatusEnum` has been removed +- Enum `LogicalReplicationOnSourceDbEnum` has been removed +- Enum `MigrateRolesEnum` has been removed +- Enum `MigrationDbState` has been removed +- Enum `MigrationSubState` has been removed +- Enum `OnlineResizeSupportedEnum` has been removed +- Enum `Origin` has been removed +- Enum `OverwriteDbsInTargetEnum` has been removed +- Enum `PasswordAuthEnum` has been removed +- Enum `ReplicationPromoteOption` has been removed +- Enum `RestrictedEnum` has been removed +- Enum `ServerHAState` has been removed +- Enum `ServerVersion` has been removed +- Enum `StartDataMigrationEnum` has been removed +- Enum `StorageAutoGrowthSupportedEnum` has been removed +- Enum `TriggerCutoverEnum` has been removed +- Enum `ZoneRedundantHaAndGeoBackupSupportedEnum` has been removed +- Enum `ZoneRedundantHaSupportedEnum` has been removed +- Function `NewAdministratorsClient` has been removed +- Function `*AdministratorsClient.BeginCreate` has been removed +- Function `*AdministratorsClient.BeginDelete` has been removed +- Function `*AdministratorsClient.Get` has been removed +- Function `*AdministratorsClient.NewListByServerPager` has been removed +- Function `NewBackupsClient` has been removed +- Function `*BackupsClient.BeginCreate` has been removed +- Function `*BackupsClient.BeginDelete` has been removed +- Function `*BackupsClient.Get` has been removed +- Function `*BackupsClient.NewListByServerPager` has been removed +- Function `NewCheckNameAvailabilityClient` has been removed +- Function `*CheckNameAvailabilityClient.Execute` has been removed +- Function `NewCheckNameAvailabilityWithLocationClient` has been removed +- Function `*CheckNameAvailabilityWithLocationClient.Execute` has been removed +- Function `*ClientFactory.NewAdministratorsClient` has been removed +- Function `*ClientFactory.NewBackupsClient` has been removed +- Function `*ClientFactory.NewCheckNameAvailabilityClient` has been removed +- Function `*ClientFactory.NewCheckNameAvailabilityWithLocationClient` has been removed +- Function `*ClientFactory.NewFlexibleServerClient` has been removed +- Function `*ClientFactory.NewGetPrivateDNSZoneSuffixClient` has been removed +- Function `*ClientFactory.NewLocationBasedCapabilitiesClient` has been removed +- Function `*ClientFactory.NewLogFilesClient` has been removed +- Function `*ClientFactory.NewLtrBackupOperationsClient` has been removed +- Function `*ClientFactory.NewPostgreSQLServerManagementClient` has been removed +- Function `*ClientFactory.NewPrivateEndpointConnectionClient` has been removed +- Function `*ClientFactory.NewServerCapabilitiesClient` has been removed +- Function `NewFlexibleServerClient` has been removed +- Function `*FlexibleServerClient.BeginStartLtrBackup` has been removed +- Function `*FlexibleServerClient.TriggerLtrPreBackup` has been removed +- Function `NewGetPrivateDNSZoneSuffixClient` has been removed +- Function `*GetPrivateDNSZoneSuffixClient.Execute` has been removed +- Function `NewLocationBasedCapabilitiesClient` has been removed +- Function `*LocationBasedCapabilitiesClient.NewExecutePager` has been removed +- Function `NewLogFilesClient` has been removed +- Function `*LogFilesClient.NewListByServerPager` has been removed +- Function `NewLtrBackupOperationsClient` has been removed +- Function `*LtrBackupOperationsClient.Get` has been removed +- Function `*LtrBackupOperationsClient.NewListByServerPager` has been removed +- Function `*MigrationsClient.Delete` has been removed +- Function `NewPostgreSQLServerManagementClient` has been removed +- Function `*PostgreSQLServerManagementClient.CheckMigrationNameAvailability` has been removed +- Function `NewPrivateEndpointConnectionClient` has been removed +- Function `*PrivateEndpointConnectionClient.BeginDelete` has been removed +- Function `*PrivateEndpointConnectionClient.BeginUpdate` has been removed +- Function `NewServerCapabilitiesClient` has been removed +- Function `*ServerCapabilitiesClient.NewListPager` has been removed +- Function `*ServerThreatProtectionSettingsClient.Get` has been removed +- Function `*ServerThreatProtectionSettingsClient.NewListByServerPager` has been removed +- Function `*ServersClient.BeginCreate` has been removed +- Function `*ServersClient.NewListPager` has been removed +- Function `*VirtualNetworkSubnetUsageClient.Execute` has been removed +- Operation `*OperationsClient.List` has supported pagination, use `*OperationsClient.NewListPager` instead. +- Struct `ActiveDirectoryAdministrator` has been removed +- Struct `ActiveDirectoryAdministratorAdd` has been removed +- Struct `AdministratorListResult` has been removed +- Struct `AdministratorProperties` has been removed +- Struct `AdministratorPropertiesForAdd` has been removed +- Struct `CapabilitiesListResult` has been removed +- Struct `ConfigurationListResult` has been removed +- Struct `DatabaseListResult` has been removed +- Struct `DbMigrationStatus` has been removed +- Struct `FirewallRuleListResult` has been removed +- Struct `FlexibleServerCapability` has been removed +- Struct `FlexibleServerEditionCapability` has been removed +- Struct `LogFile` has been removed +- Struct `LogFileListResult` has been removed +- Struct `LogFileProperties` has been removed +- Struct `LtrBackupRequest` has been removed +- Struct `LtrBackupResponse` has been removed +- Struct `LtrPreBackupResponseProperties` has been removed +- Struct `LtrServerBackupOperation` has been removed +- Struct `MigrationNameAvailabilityResource` has been removed +- Struct `MigrationResource` has been removed +- Struct `MigrationResourceListResult` has been removed +- Struct `MigrationResourceProperties` has been removed +- Struct `MigrationResourcePropertiesForPatch` has been removed +- Struct `MigrationSubStateDetails` has been removed +- Struct `NameAvailability` has been removed +- Struct `OperationListResult` has been removed +- Struct `PrivateEndpointConnectionListResult` has been removed +- Struct `PrivateLinkResourceListResult` has been removed +- Struct `ServerBackup` has been removed +- Struct `ServerBackupListResult` has been removed +- Struct `ServerBackupProperties` has been removed +- Struct `ServerForUpdate` has been removed +- Struct `ServerListResult` has been removed +- Struct `ServerPropertiesForUpdate` has been removed +- Struct `ServerThreatProtectionListResult` has been removed +- Struct `ServerThreatProtectionProperties` has been removed +- Struct `ServerThreatProtectionSettingsModel` has been removed +- Struct `VirtualEndpointResource` has been removed +- Struct `VirtualEndpointsListResult` has been removed +- Struct `VirtualNetworkSubnetUsageResult` has been removed +- Field `ConfigurationListResult` of struct `ConfigurationsClientListByServerResponse` has been removed +- Field `Configuration` of struct `ConfigurationsClientPutResponse` has been removed +- Field `Configuration` of struct `ConfigurationsClientUpdateResponse` has been removed +- Field `Database` of struct `DatabasesClientCreateResponse` has been removed +- Field `DatabaseListResult` of struct `DatabasesClientListByServerResponse` has been removed +- Field `FirewallRule` of struct `FirewallRulesClientCreateOrUpdateResponse` has been removed +- Field `FirewallRuleListResult` of struct `FirewallRulesClientListByServerResponse` has been removed +- Field `MigrationResource` of struct `MigrationsClientCreateResponse` has been removed +- Field `MigrationResource` of struct `MigrationsClientGetResponse` has been removed +- Field `MigrationResourceListResult` of struct `MigrationsClientListByTargetServerResponse` has been removed +- Field `MigrationResource` of struct `MigrationsClientUpdateResponse` has been removed +- Field `PrivateEndpointConnectionListResult` of struct `PrivateEndpointConnectionsClientListByServerResponse` has been removed +- Field `PrivateLinkResourceListResult` of struct `PrivateLinkResourcesClientListByServerResponse` has been removed +- Field `ServerListResult` of struct `ReplicasClientListByServerResponse` has been removed +- Field `ServerThreatProtectionSettingsModel` of struct `ServerThreatProtectionSettingsClientCreateOrUpdateResponse` has been removed +- Field `ServerListResult` of struct `ServersClientListByResourceGroupResponse` has been removed +- Field `Server` of struct `ServersClientUpdateResponse` has been removed +- Field `VirtualEndpointResource` of struct `VirtualEndpointsClientCreateResponse` has been removed +- Field `VirtualEndpointResource` of struct `VirtualEndpointsClientGetResponse` has been removed +- Field `VirtualEndpointsListResult` of struct `VirtualEndpointsClientListByServerResponse` has been removed +- Field `VirtualEndpointResource` of struct `VirtualEndpointsClientUpdateResponse` has been removed + +### Features Added + +- New value `ConfigurationDataTypeSet`, `ConfigurationDataTypeString` added to enum type `ConfigurationDataType` +- New value `ServerStateInaccessible`, `ServerStateProvisioning`, `ServerStateRestarting` added to enum type `ServerState` +- New value `SourceTypeApsaraDBRDS`, `SourceTypeCrunchyPostgreSQL`, `SourceTypeDigitalOceanDroplets`, `SourceTypeDigitalOceanPostgreSQL`, `SourceTypeEDBOracleServer`, `SourceTypeEDBPostgreSQL`, `SourceTypeHerokuPostgreSQL`, `SourceTypeHuaweiCompute`, `SourceTypeHuaweiRDS`, `SourceTypePostgreSQLCosmosDB`, `SourceTypePostgreSQLFlexibleServer`, `SourceTypeSupabasePostgreSQL` added to enum type `SourceType` +- New value `StorageTypeUltraSSDLRS` added to enum type `StorageType` +- New enum type `AzureManagedDiskPerformanceTier` with values `AzureManagedDiskPerformanceTierP1`, `AzureManagedDiskPerformanceTierP10`, `AzureManagedDiskPerformanceTierP15`, `AzureManagedDiskPerformanceTierP2`, `AzureManagedDiskPerformanceTierP20`, `AzureManagedDiskPerformanceTierP3`, `AzureManagedDiskPerformanceTierP30`, `AzureManagedDiskPerformanceTierP4`, `AzureManagedDiskPerformanceTierP40`, `AzureManagedDiskPerformanceTierP50`, `AzureManagedDiskPerformanceTierP6`, `AzureManagedDiskPerformanceTierP60`, `AzureManagedDiskPerformanceTierP70`, `AzureManagedDiskPerformanceTierP80` +- New enum type `BackupType` with values `BackupTypeCustomerOnDemand`, `BackupTypeFull` +- New enum type `Cancel` with values `CancelFalse`, `CancelTrue` +- New enum type `CreateModeForPatch` with values `CreateModeForPatchDefault`, `CreateModeForPatchUpdate` +- New enum type `DataEncryptionType` with values `DataEncryptionTypeAzureKeyVault`, `DataEncryptionTypeSystemManaged` +- New enum type `EncryptionKeyStatus` with values `EncryptionKeyStatusInvalid`, `EncryptionKeyStatusValid` +- New enum type `FastProvisioningSupport` with values `FastProvisioningSupportDisabled`, `FastProvisioningSupportEnabled` +- New enum type `FeatureStatus` with values `FeatureStatusDisabled`, `FeatureStatusEnabled` +- New enum type `GeographicallyRedundantBackup` with values `GeographicallyRedundantBackupDisabled`, `GeographicallyRedundantBackupEnabled` +- New enum type `GeographicallyRedundantBackupSupport` with values `GeographicallyRedundantBackupSupportDisabled`, `GeographicallyRedundantBackupSupportEnabled` +- New enum type `HighAvailabilityState` with values `HighAvailabilityStateCreatingStandby`, `HighAvailabilityStateFailingOver`, `HighAvailabilityStateHealthy`, `HighAvailabilityStateNotEnabled`, `HighAvailabilityStateRemovingStandby`, `HighAvailabilityStateReplicatingData` +- New enum type `LocationRestricted` with values `LocationRestrictedDisabled`, `LocationRestrictedEnabled` +- New enum type `LogicalReplicationOnSourceServer` with values `LogicalReplicationOnSourceServerFalse`, `LogicalReplicationOnSourceServerTrue` +- New enum type `MicrosoftEntraAuth` with values `MicrosoftEntraAuthDisabled`, `MicrosoftEntraAuthEnabled` +- New enum type `MigrateRolesAndPermissions` with values `MigrateRolesAndPermissionsFalse`, `MigrateRolesAndPermissionsTrue` +- New enum type `MigrationDatabaseState` with values `MigrationDatabaseStateCanceled`, `MigrationDatabaseStateCanceling`, `MigrationDatabaseStateFailed`, `MigrationDatabaseStateInProgress`, `MigrationDatabaseStateSucceeded`, `MigrationDatabaseStateWaitingForCutoverTrigger` +- New enum type `MigrationSubstate` with values `MigrationSubstateCancelingRequestedDBMigrations`, `MigrationSubstateCompleted`, `MigrationSubstateCompletingMigration`, `MigrationSubstateMigratingData`, `MigrationSubstatePerformingPreRequisiteSteps`, `MigrationSubstateValidationInProgress`, `MigrationSubstateWaitingForCutoverTrigger`, `MigrationSubstateWaitingForDBsToMigrateSpecification`, `MigrationSubstateWaitingForDataMigrationScheduling`, `MigrationSubstateWaitingForDataMigrationWindow`, `MigrationSubstateWaitingForLogicalReplicationSetupRequestOnSourceDB`, `MigrationSubstateWaitingForTargetDBOverwriteConfirmation` +- New enum type `OnlineStorageResizeSupport` with values `OnlineStorageResizeSupportDisabled`, `OnlineStorageResizeSupportEnabled` +- New enum type `OverwriteDatabasesOnTargetServer` with values `OverwriteDatabasesOnTargetServerFalse`, `OverwriteDatabasesOnTargetServerTrue` +- New enum type `PasswordBasedAuth` with values `PasswordBasedAuthDisabled`, `PasswordBasedAuthEnabled` +- New enum type `PostgresMajorVersion` with values `PostgresMajorVersionEighteen`, `PostgresMajorVersionEleven`, `PostgresMajorVersionFifteen`, `PostgresMajorVersionFourteen`, `PostgresMajorVersionSeventeen`, `PostgresMajorVersionSixteen`, `PostgresMajorVersionThirteen`, `PostgresMajorVersionTwelve` +- New enum type `ReadReplicaPromoteOption` with values `ReadReplicaPromoteOptionForced`, `ReadReplicaPromoteOptionPlanned` +- New enum type `RecommendationTypeEnum` with values `RecommendationTypeEnumAnalyzeTable`, `RecommendationTypeEnumCreateIndex`, `RecommendationTypeEnumDropIndex`, `RecommendationTypeEnumReIndex` +- New enum type `RecommendationTypeParameterEnum` with values `RecommendationTypeParameterEnumAnalyzeTable`, `RecommendationTypeParameterEnumCreateIndex`, `RecommendationTypeParameterEnumDropIndex`, `RecommendationTypeParameterEnumReIndex` +- New enum type `StartDataMigration` with values `StartDataMigrationFalse`, `StartDataMigrationTrue` +- New enum type `StorageAutoGrowthSupport` with values `StorageAutoGrowthSupportDisabled`, `StorageAutoGrowthSupportEnabled` +- New enum type `TriggerCutover` with values `TriggerCutoverFalse`, `TriggerCutoverTrue` +- New enum type `TuningOptionParameterEnum` with values `TuningOptionParameterEnumIndex`, `TuningOptionParameterEnumTable` +- New enum type `ZoneRedundantHighAvailabilityAndGeographicallyRedundantBackupSupport` with values `ZoneRedundantHighAvailabilityAndGeographicallyRedundantBackupSupportDisabled`, `ZoneRedundantHighAvailabilityAndGeographicallyRedundantBackupSupportEnabled` +- New enum type `ZoneRedundantHighAvailabilitySupport` with values `ZoneRedundantHighAvailabilitySupportDisabled`, `ZoneRedundantHighAvailabilitySupportEnabled` +- New function `NewAdministratorsMicrosoftEntraClient(string, azcore.TokenCredential, *arm.ClientOptions) (*AdministratorsMicrosoftEntraClient, error)` +- New function `*AdministratorsMicrosoftEntraClient.BeginCreateOrUpdate(context.Context, string, string, string, AdministratorMicrosoftEntraAdd, *AdministratorsMicrosoftEntraClientBeginCreateOrUpdateOptions) (*runtime.Poller[AdministratorsMicrosoftEntraClientCreateOrUpdateResponse], error)` +- New function `*AdministratorsMicrosoftEntraClient.BeginDelete(context.Context, string, string, string, *AdministratorsMicrosoftEntraClientBeginDeleteOptions) (*runtime.Poller[AdministratorsMicrosoftEntraClientDeleteResponse], error)` +- New function `*AdministratorsMicrosoftEntraClient.Get(context.Context, string, string, string, *AdministratorsMicrosoftEntraClientGetOptions) (AdministratorsMicrosoftEntraClientGetResponse, error)` +- New function `*AdministratorsMicrosoftEntraClient.NewListByServerPager(string, string, *AdministratorsMicrosoftEntraClientListByServerOptions) *runtime.Pager[AdministratorsMicrosoftEntraClientListByServerResponse]` +- New function `NewAdvancedThreatProtectionSettingsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*AdvancedThreatProtectionSettingsClient, error)` +- New function `*AdvancedThreatProtectionSettingsClient.Get(context.Context, string, string, ThreatProtectionName, *AdvancedThreatProtectionSettingsClientGetOptions) (AdvancedThreatProtectionSettingsClientGetResponse, error)` +- New function `*AdvancedThreatProtectionSettingsClient.NewListByServerPager(string, string, *AdvancedThreatProtectionSettingsClientListByServerOptions) *runtime.Pager[AdvancedThreatProtectionSettingsClientListByServerResponse]` +- New function `NewBackupsAutomaticAndOnDemandClient(string, azcore.TokenCredential, *arm.ClientOptions) (*BackupsAutomaticAndOnDemandClient, error)` +- New function `*BackupsAutomaticAndOnDemandClient.BeginCreate(context.Context, string, string, string, *BackupsAutomaticAndOnDemandClientBeginCreateOptions) (*runtime.Poller[BackupsAutomaticAndOnDemandClientCreateResponse], error)` +- New function `*BackupsAutomaticAndOnDemandClient.BeginDelete(context.Context, string, string, string, *BackupsAutomaticAndOnDemandClientBeginDeleteOptions) (*runtime.Poller[BackupsAutomaticAndOnDemandClientDeleteResponse], error)` +- New function `*BackupsAutomaticAndOnDemandClient.Get(context.Context, string, string, string, *BackupsAutomaticAndOnDemandClientGetOptions) (BackupsAutomaticAndOnDemandClientGetResponse, error)` +- New function `*BackupsAutomaticAndOnDemandClient.NewListByServerPager(string, string, *BackupsAutomaticAndOnDemandClientListByServerOptions) *runtime.Pager[BackupsAutomaticAndOnDemandClientListByServerResponse]` +- New function `NewBackupsLongTermRetentionClient(string, azcore.TokenCredential, *arm.ClientOptions) (*BackupsLongTermRetentionClient, error)` +- New function `*BackupsLongTermRetentionClient.CheckPrerequisites(context.Context, string, string, LtrPreBackupRequest, *BackupsLongTermRetentionClientCheckPrerequisitesOptions) (BackupsLongTermRetentionClientCheckPrerequisitesResponse, error)` +- New function `*BackupsLongTermRetentionClient.Get(context.Context, string, string, string, *BackupsLongTermRetentionClientGetOptions) (BackupsLongTermRetentionClientGetResponse, error)` +- New function `*BackupsLongTermRetentionClient.NewListByServerPager(string, string, *BackupsLongTermRetentionClientListByServerOptions) *runtime.Pager[BackupsLongTermRetentionClientListByServerResponse]` +- New function `*BackupsLongTermRetentionClient.BeginStart(context.Context, string, string, BackupsLongTermRetentionRequest, *BackupsLongTermRetentionClientBeginStartOptions) (*runtime.Poller[BackupsLongTermRetentionClientStartResponse], error)` +- New function `NewCapabilitiesByLocationClient(string, azcore.TokenCredential, *arm.ClientOptions) (*CapabilitiesByLocationClient, error)` +- New function `*CapabilitiesByLocationClient.NewListPager(string, *CapabilitiesByLocationClientListOptions) *runtime.Pager[CapabilitiesByLocationClientListResponse]` +- New function `NewCapabilitiesByServerClient(string, azcore.TokenCredential, *arm.ClientOptions) (*CapabilitiesByServerClient, error)` +- New function `*CapabilitiesByServerClient.NewListPager(string, string, *CapabilitiesByServerClientListOptions) *runtime.Pager[CapabilitiesByServerClientListResponse]` +- New function `NewCapturedLogsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*CapturedLogsClient, error)` +- New function `*CapturedLogsClient.NewListByServerPager(string, string, *CapturedLogsClientListByServerOptions) *runtime.Pager[CapturedLogsClientListByServerResponse]` +- New function `*ClientFactory.NewAdministratorsMicrosoftEntraClient() *AdministratorsMicrosoftEntraClient` +- New function `*ClientFactory.NewAdvancedThreatProtectionSettingsClient() *AdvancedThreatProtectionSettingsClient` +- New function `*ClientFactory.NewBackupsAutomaticAndOnDemandClient() *BackupsAutomaticAndOnDemandClient` +- New function `*ClientFactory.NewBackupsLongTermRetentionClient() *BackupsLongTermRetentionClient` +- New function `*ClientFactory.NewCapabilitiesByLocationClient() *CapabilitiesByLocationClient` +- New function `*ClientFactory.NewCapabilitiesByServerClient() *CapabilitiesByServerClient` +- New function `*ClientFactory.NewCapturedLogsClient() *CapturedLogsClient` +- New function `*ClientFactory.NewNameAvailabilityClient() *NameAvailabilityClient` +- New function `*ClientFactory.NewPrivateDNSZoneSuffixClient() *PrivateDNSZoneSuffixClient` +- New function `*ClientFactory.NewQuotaUsagesClient() *QuotaUsagesClient` +- New function `*ClientFactory.NewTuningOptionsClient() *TuningOptionsClient` +- New function `*MigrationsClient.Cancel(context.Context, string, string, string, *MigrationsClientCancelOptions) (MigrationsClientCancelResponse, error)` +- New function `*MigrationsClient.CheckNameAvailability(context.Context, string, string, MigrationNameAvailability, *MigrationsClientCheckNameAvailabilityOptions) (MigrationsClientCheckNameAvailabilityResponse, error)` +- New function `NewPrivateDNSZoneSuffixClient(azcore.TokenCredential, *arm.ClientOptions) (*PrivateDNSZoneSuffixClient, error)` +- New function `*PrivateDNSZoneSuffixClient.Get(context.Context, *PrivateDNSZoneSuffixClientGetOptions) (PrivateDNSZoneSuffixClientGetResponse, error)` +- New function `*PrivateEndpointConnectionsClient.BeginDelete(context.Context, string, string, string, *PrivateEndpointConnectionsClientBeginDeleteOptions) (*runtime.Poller[PrivateEndpointConnectionsClientDeleteResponse], error)` +- New function `*PrivateEndpointConnectionsClient.BeginUpdate(context.Context, string, string, string, PrivateEndpointConnection, *PrivateEndpointConnectionsClientBeginUpdateOptions) (*runtime.Poller[PrivateEndpointConnectionsClientUpdateResponse], error)` +- New function `NewQuotaUsagesClient(string, azcore.TokenCredential, *arm.ClientOptions) (*QuotaUsagesClient, error)` +- New function `*QuotaUsagesClient.NewListPager(string, *QuotaUsagesClientListOptions) *runtime.Pager[QuotaUsagesClientListResponse]` +- New function `*ServersClient.BeginCreateOrUpdate(context.Context, string, string, Server, *ServersClientBeginCreateOrUpdateOptions) (*runtime.Poller[ServersClientCreateOrUpdateResponse], error)` +- New function `*ServersClient.NewListBySubscriptionPager(*ServersClientListBySubscriptionOptions) *runtime.Pager[ServersClientListBySubscriptionResponse]` +- New function `NewTuningOptionsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*TuningOptionsClient, error)` +- New function `*TuningOptionsClient.Get(context.Context, string, string, TuningOptionParameterEnum, *TuningOptionsClientGetOptions) (TuningOptionsClientGetResponse, error)` +- New function `*TuningOptionsClient.NewListByServerPager(string, string, *TuningOptionsClientListByServerOptions) *runtime.Pager[TuningOptionsClientListByServerResponse]` +- New function `*TuningOptionsClient.NewListRecommendationsPager(string, string, TuningOptionParameterEnum, *TuningOptionsClientListRecommendationsOptions) *runtime.Pager[TuningOptionsClientListRecommendationsResponse]` +- New function `*VirtualNetworkSubnetUsageClient.List(context.Context, string, VirtualNetworkSubnetUsageParameter, *VirtualNetworkSubnetUsageClientListOptions) (VirtualNetworkSubnetUsageClientListResponse, error)` +- New function `NewNameAvailabilityClient(string, azcore.TokenCredential, *arm.ClientOptions) (*NameAvailabilityClient, error)` +- New function `*NameAvailabilityClient.CheckGlobally(context.Context, CheckNameAvailabilityRequest, *NameAvailabilityClientCheckGloballyOptions) (NameAvailabilityClientCheckGloballyResponse, error)` +- New function `*NameAvailabilityClient.CheckWithLocation(context.Context, string, CheckNameAvailabilityRequest, *NameAvailabilityClientCheckWithLocationOptions) (NameAvailabilityClientCheckWithLocationResponse, error)` +- New struct `AdminCredentialsForPatch` +- New struct `AdministratorMicrosoftEntra` +- New struct `AdministratorMicrosoftEntraAdd` +- New struct `AdministratorMicrosoftEntraList` +- New struct `AdministratorMicrosoftEntraProperties` +- New struct `AdministratorMicrosoftEntraPropertiesForAdd` +- New struct `AdvancedThreatProtectionSettingsList` +- New struct `AdvancedThreatProtectionSettingsModel` +- New struct `AdvancedThreatProtectionSettingsProperties` +- New struct `AuthConfigForPatch` +- New struct `BackupAutomaticAndOnDemand` +- New struct `BackupAutomaticAndOnDemandList` +- New struct `BackupAutomaticAndOnDemandProperties` +- New struct `BackupForPatch` +- New struct `BackupsLongTermRetentionOperation` +- New struct `BackupsLongTermRetentionRequest` +- New struct `BackupsLongTermRetentionResponse` +- New struct `BackupsLongTermRetentionResponseProperties` +- New struct `Capability` +- New struct `CapabilityList` +- New struct `CapturedLog` +- New struct `CapturedLogList` +- New struct `CapturedLogProperties` +- New struct `Cluster` +- New struct `ConfigurationList` +- New struct `DatabaseList` +- New struct `DatabaseMigrationState` +- New struct `FirewallRuleList` +- New struct `HighAvailabilityForPatch` +- New struct `ImpactRecord` +- New struct `MaintenanceWindowForPatch` +- New struct `Migration` +- New struct `MigrationList` +- New struct `MigrationNameAvailability` +- New struct `MigrationProperties` +- New struct `MigrationPropertiesForPatch` +- New struct `MigrationSecretParametersForPatch` +- New struct `MigrationSubstateDetails` +- New struct `NameAvailabilityModel` +- New struct `NameProperty` +- New struct `ObjectRecommendation` +- New struct `ObjectRecommendationDetails` +- New struct `ObjectRecommendationList` +- New struct `ObjectRecommendationProperties` +- New struct `ObjectRecommendationPropertiesAnalyzedWorkload` +- New struct `ObjectRecommendationPropertiesImplementationDetails` +- New struct `OperationList` +- New struct `PrivateEndpointConnectionList` +- New struct `PrivateLinkResourceList` +- New struct `QuotaUsage` +- New struct `QuotaUsageList` +- New struct `SKUForPatch` +- New struct `ServerEditionCapability` +- New struct `ServerForPatch` +- New struct `ServerList` +- New struct `ServerPropertiesForPatch` +- New struct `SupportedFeature` +- New struct `TuningOptions` +- New struct `TuningOptionsList` +- New struct `VirtualEndpoint` +- New struct `VirtualEndpointsList` +- New struct `VirtualNetworkSubnetUsageModel` +- New anonymous field `ConfigurationList` in struct `ConfigurationsClientListByServerResponse` +- New anonymous field `DatabaseList` in struct `DatabasesClientListByServerResponse` +- New anonymous field `FirewallRuleList` in struct `FirewallRulesClientListByServerResponse` +- New anonymous field `Migration` in struct `MigrationsClientCreateResponse` +- New anonymous field `Migration` in struct `MigrationsClientGetResponse` +- New anonymous field `MigrationList` in struct `MigrationsClientListByTargetServerResponse` +- New anonymous field `Migration` in struct `MigrationsClientUpdateResponse` +- New anonymous field `PrivateEndpointConnectionList` in struct `PrivateEndpointConnectionsClientListByServerResponse` +- New anonymous field `PrivateLinkResourceList` in struct `PrivateLinkResourcesClientListByServerResponse` +- New anonymous field `ServerList` in struct `ReplicasClientListByServerResponse` +- New field `Cluster` in struct `ServerProperties` +- New field `SecurityProfile`, `SupportedFeatures` in struct `ServerSKUCapability` +- New field `SupportedFeatures` in struct `ServerVersionCapability` +- New anonymous field `ServerList` in struct `ServersClientListByResourceGroupResponse` +- New anonymous field `VirtualEndpoint` in struct `VirtualEndpointsClientGetResponse` +- New anonymous field `VirtualEndpointsList` in struct `VirtualEndpointsClientListByServerResponse` + + ## 5.0.0-beta.1 (2025-05-23) ### Breaking Changes diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/README.md b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/README.md index 73be890520e7..6e8f28554779 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/README.md +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/README.md @@ -55,7 +55,7 @@ clientFactory, err := armpostgresqlflexibleservers.NewClientFactory( 0 }, - Fetcher: func(ctx context.Context, page *AdministratorsClientListByServerResponse) (AdministratorsClientListByServerResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "AdministratorsClient.NewListByServerPager") + Fetcher: func(ctx context.Context, page *AdministratorsMicrosoftEntraClientListByServerResponse) (AdministratorsMicrosoftEntraClientListByServerResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "AdministratorsMicrosoftEntraClient.NewListByServerPager") nextLink := "" if page != nil { nextLink = *page.NextLink @@ -299,7 +300,7 @@ func (client *AdministratorsClient) NewListByServerPager(resourceGroupName strin return client.listByServerCreateRequest(ctx, resourceGroupName, serverName, options) }, nil) if err != nil { - return AdministratorsClientListByServerResponse{}, err + return AdministratorsMicrosoftEntraClientListByServerResponse{}, err } return client.listByServerHandleResponse(resp) }, @@ -308,7 +309,7 @@ func (client *AdministratorsClient) NewListByServerPager(resourceGroupName strin } // listByServerCreateRequest creates the ListByServer request. -func (client *AdministratorsClient) listByServerCreateRequest(ctx context.Context, resourceGroupName string, serverName string, _ *AdministratorsClientListByServerOptions) (*policy.Request, error) { +func (client *AdministratorsMicrosoftEntraClient) listByServerCreateRequest(ctx context.Context, resourceGroupName string, serverName string, _ *AdministratorsMicrosoftEntraClientListByServerOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/administrators" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -327,17 +328,17 @@ func (client *AdministratorsClient) listByServerCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-01-01-preview") + reqQP.Set("api-version", "2025-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } // listByServerHandleResponse handles the ListByServer response. -func (client *AdministratorsClient) listByServerHandleResponse(resp *http.Response) (AdministratorsClientListByServerResponse, error) { - result := AdministratorsClientListByServerResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.AdministratorListResult); err != nil { - return AdministratorsClientListByServerResponse{}, err +func (client *AdministratorsMicrosoftEntraClient) listByServerHandleResponse(resp *http.Response) (AdministratorsMicrosoftEntraClientListByServerResponse, error) { + result := AdministratorsMicrosoftEntraClientListByServerResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.AdministratorMicrosoftEntraList); err != nil { + return AdministratorsMicrosoftEntraClientListByServerResponse{}, err } return result, nil } diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/administrators_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/administratorsmicrosoftentra_client_example_test.go similarity index 54% rename from sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/administrators_client_example_test.go rename to sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/administratorsmicrosoftentra_client_example_test.go index 0fcf0a27b92d..a952f25f774b 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/administrators_client_example_test.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/administratorsmicrosoftentra_client_example_test.go @@ -18,8 +18,8 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v5" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b1f4d539964453ce8008e4b069e59885e12ba441/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/AdministratorAdd.json -func ExampleAdministratorsClient_BeginCreate() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/735d21dbd7e1cc446babf58860af4cca757d620d/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/AdministratorsMicrosoftEntraAdd.json +func ExampleAdministratorsMicrosoftEntraClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -29,9 +29,9 @@ func ExampleAdministratorsClient_BeginCreate() { if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewAdministratorsClient().BeginCreate(ctx, "testrg", "testserver", "oooooooo-oooo-oooo-oooo-oooooooooooo", armpostgresqlflexibleservers.ActiveDirectoryAdministratorAdd{ - Properties: &armpostgresqlflexibleservers.AdministratorPropertiesForAdd{ - PrincipalName: to.Ptr("testuser1@microsoft.com"), + poller, err := clientFactory.NewAdministratorsMicrosoftEntraClient().BeginCreateOrUpdate(ctx, "exampleresourcegroup", "exampleserver", "oooooooo-oooo-oooo-oooo-oooooooooooo", armpostgresqlflexibleservers.AdministratorMicrosoftEntraAdd{ + Properties: &armpostgresqlflexibleservers.AdministratorMicrosoftEntraPropertiesForAdd{ + PrincipalName: to.Ptr("exampleuser@contoso.com"), PrincipalType: to.Ptr(armpostgresqlflexibleservers.PrincipalTypeUser), TenantID: to.Ptr("tttttttt-tttt-tttt-tttt-tttttttttttt"), }, @@ -39,28 +39,14 @@ func ExampleAdministratorsClient_BeginCreate() { if err != nil { log.Fatalf("failed to finish the request: %v", err) } - res, err := poller.PollUntilDone(ctx, nil) + _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ActiveDirectoryAdministrator = armpostgresqlflexibleservers.ActiveDirectoryAdministrator{ - // Name: to.Ptr("testuser1@microsoft.com"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/administrators"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/administrators/oooooooo-oooo-oooo-oooo-oooooooooooo"), - // Properties: &armpostgresqlflexibleservers.AdministratorProperties{ - // ObjectID: to.Ptr("oooooooo-oooo-oooo-oooo-oooooooooooo"), - // PrincipalName: to.Ptr("testuser1@microsoft.com"), - // PrincipalType: to.Ptr(armpostgresqlflexibleservers.PrincipalTypeUser), - // TenantID: to.Ptr("tttttttt-tttt-tttt-tttt-tttttttttttt"), - // }, - // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b1f4d539964453ce8008e4b069e59885e12ba441/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/AdministratorDelete.json -func ExampleAdministratorsClient_BeginDelete() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/735d21dbd7e1cc446babf58860af4cca757d620d/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/AdministratorsMicrosoftEntraDelete.json +func ExampleAdministratorsMicrosoftEntraClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -70,7 +56,7 @@ func ExampleAdministratorsClient_BeginDelete() { if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewAdministratorsClient().BeginDelete(ctx, "testrg", "testserver", "oooooooo-oooo-oooo-oooo-oooooooooooo", nil) + poller, err := clientFactory.NewAdministratorsMicrosoftEntraClient().BeginDelete(ctx, "exampleresourcegroup", "exampleserver", "oooooooo-oooo-oooo-oooo-oooooooooooo", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -80,8 +66,8 @@ func ExampleAdministratorsClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b1f4d539964453ce8008e4b069e59885e12ba441/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/AdministratorGet.json -func ExampleAdministratorsClient_Get() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/735d21dbd7e1cc446babf58860af4cca757d620d/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/AdministratorsMicrosoftEntraGet.json +func ExampleAdministratorsMicrosoftEntraClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -91,28 +77,28 @@ func ExampleAdministratorsClient_Get() { if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewAdministratorsClient().Get(ctx, "testrg", "pgtestsvc1", "oooooooo-oooo-oooo-oooo-oooooooooooo", nil) + res, err := clientFactory.NewAdministratorsMicrosoftEntraClient().Get(ctx, "exampleresourcegroup", "exampleserver", "oooooooo-oooo-oooo-oooo-oooooooooooo", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ActiveDirectoryAdministrator = armpostgresqlflexibleservers.ActiveDirectoryAdministrator{ - // Name: to.Ptr("testuser1@microsoft.com"), + // res.AdministratorMicrosoftEntra = armpostgresqlflexibleservers.AdministratorMicrosoftEntra{ + // Name: to.Ptr("exampleuser@contoso.com"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/administrators"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/pgtestsvc1/administrators/oooooooo-oooo-oooo-oooo-oooooooooooo"), - // Properties: &armpostgresqlflexibleservers.AdministratorProperties{ + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/administrators/oooooooo-oooo-oooo-oooo-oooooooooooo"), + // Properties: &armpostgresqlflexibleservers.AdministratorMicrosoftEntraProperties{ // ObjectID: to.Ptr("oooooooo-oooo-oooo-oooo-oooooooooooo"), - // PrincipalName: to.Ptr("testuer1@microsoft.com"), + // PrincipalName: to.Ptr("exampleuser@contoso.com"), // PrincipalType: to.Ptr(armpostgresqlflexibleservers.PrincipalTypeUser), // TenantID: to.Ptr("tttttttt-tttt-tttt-tttt-tttttttttttt"), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b1f4d539964453ce8008e4b069e59885e12ba441/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/AdministratorsListByServer.json -func ExampleAdministratorsClient_NewListByServerPager() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/735d21dbd7e1cc446babf58860af4cca757d620d/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/AdministratorsMicrosoftEntraListByServer.json +func ExampleAdministratorsMicrosoftEntraClient_NewListByServerPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -122,7 +108,7 @@ func ExampleAdministratorsClient_NewListByServerPager() { if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewAdministratorsClient().NewListByServerPager("testrg", "pgtestsvc1", nil) + pager := clientFactory.NewAdministratorsMicrosoftEntraClient().NewListByServerPager("exampleresourcegroup", "exampleserver", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -133,24 +119,24 @@ func ExampleAdministratorsClient_NewListByServerPager() { _ = v } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.AdministratorListResult = armpostgresqlflexibleservers.AdministratorListResult{ - // Value: []*armpostgresqlflexibleservers.ActiveDirectoryAdministrator{ + // page.AdministratorMicrosoftEntraList = armpostgresqlflexibleservers.AdministratorMicrosoftEntraList{ + // Value: []*armpostgresqlflexibleservers.AdministratorMicrosoftEntra{ // { // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/administrators"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/pgtestsvc1/administrators/oooooooo-oooo-oooo-oooo-oooooooooooo"), - // Properties: &armpostgresqlflexibleservers.AdministratorProperties{ + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/administrators/oooooooo-oooo-oooo-oooo-oooooooooooo"), + // Properties: &armpostgresqlflexibleservers.AdministratorMicrosoftEntraProperties{ // ObjectID: to.Ptr("oooooooo-oooo-oooo-oooo-oooooooooooo"), - // PrincipalName: to.Ptr("testuer1@microsoft.com"), + // PrincipalName: to.Ptr("exampleuser@contoso.com"), // PrincipalType: to.Ptr(armpostgresqlflexibleservers.PrincipalTypeUser), // TenantID: to.Ptr("tttttttt-tttt-tttt-tttt-tttttttttttt"), // }, // }, // { // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/administrators"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/pgtestsvc1/administrators/gggggggg-gggg-gggg-gggg-gggggggggggg"), - // Properties: &armpostgresqlflexibleservers.AdministratorProperties{ + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/administrators/gggggggg-gggg-gggg-gggg-gggggggggggg"), + // Properties: &armpostgresqlflexibleservers.AdministratorMicrosoftEntraProperties{ // ObjectID: to.Ptr("gggggggg-gggg-gggg-gggg-gggggggggggg"), - // PrincipalName: to.Ptr("testgroup1@microsoft.com"), + // PrincipalName: to.Ptr("examplegroup@contoso.com"), // PrincipalType: to.Ptr(armpostgresqlflexibleservers.PrincipalTypeGroup), // TenantID: to.Ptr("tttttttt-tttt-tttt-tttt-tttttttttttt"), // }, diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/ltrbackupoperations_client.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/advancedthreatprotectionsettings_client.go similarity index 51% rename from sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/ltrbackupoperations_client.go rename to sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/advancedthreatprotectionsettings_client.go index 476bd697861c..ddc81e55088c 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/ltrbackupoperations_client.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/advancedthreatprotectionsettings_client.go @@ -17,62 +17,63 @@ import ( "strings" ) -// LtrBackupOperationsClient contains the methods for the LtrBackupOperations group. -// Don't use this type directly, use NewLtrBackupOperationsClient() instead. -type LtrBackupOperationsClient struct { +// AdvancedThreatProtectionSettingsClient contains the methods for the AdvancedThreatProtectionSettings group. +// Don't use this type directly, use NewAdvancedThreatProtectionSettingsClient() instead. +type AdvancedThreatProtectionSettingsClient struct { internal *arm.Client subscriptionID string } -// NewLtrBackupOperationsClient creates a new instance of LtrBackupOperationsClient with the specified values. +// NewAdvancedThreatProtectionSettingsClient creates a new instance of AdvancedThreatProtectionSettingsClient with the specified values. // - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewLtrBackupOperationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*LtrBackupOperationsClient, error) { +// - options - Contains optional client configuration. Pass nil to accept the default values. +func NewAdvancedThreatProtectionSettingsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AdvancedThreatProtectionSettingsClient, error) { cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) if err != nil { return nil, err } - client := &LtrBackupOperationsClient{ + client := &AdvancedThreatProtectionSettingsClient{ subscriptionID: subscriptionID, internal: cl, } return client, nil } -// Get - Gets the result of the give long term retention backup operation for the flexible server. +// Get - Gets state of advanced threat protection settings for a server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-01-01-preview +// Generated from API version 2025-08-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. -// - backupName - The name of the backup. -// - options - LtrBackupOperationsClientGetOptions contains the optional parameters for the LtrBackupOperationsClient.Get method. -func (client *LtrBackupOperationsClient) Get(ctx context.Context, resourceGroupName string, serverName string, backupName string, options *LtrBackupOperationsClientGetOptions) (LtrBackupOperationsClientGetResponse, error) { +// - threatProtectionName - Name of the advanced threat protection settings. +// - options - AdvancedThreatProtectionSettingsClientGetOptions contains the optional parameters for the AdvancedThreatProtectionSettingsClient.Get +// method. +func (client *AdvancedThreatProtectionSettingsClient) Get(ctx context.Context, resourceGroupName string, serverName string, threatProtectionName ThreatProtectionName, options *AdvancedThreatProtectionSettingsClientGetOptions) (AdvancedThreatProtectionSettingsClientGetResponse, error) { var err error - const operationName = "LtrBackupOperationsClient.Get" + const operationName = "AdvancedThreatProtectionSettingsClient.Get" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) defer func() { endSpan(err) }() - req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, backupName, options) + req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, threatProtectionName, options) if err != nil { - return LtrBackupOperationsClientGetResponse{}, err + return AdvancedThreatProtectionSettingsClientGetResponse{}, err } httpResp, err := client.internal.Pipeline().Do(req) if err != nil { - return LtrBackupOperationsClientGetResponse{}, err + return AdvancedThreatProtectionSettingsClientGetResponse{}, err } if !runtime.HasStatusCode(httpResp, http.StatusOK) { err = runtime.NewResponseError(httpResp) - return LtrBackupOperationsClientGetResponse{}, err + return AdvancedThreatProtectionSettingsClientGetResponse{}, err } resp, err := client.getHandleResponse(httpResp) return resp, err } // getCreateRequest creates the Get request. -func (client *LtrBackupOperationsClient) getCreateRequest(ctx context.Context, resourceGroupName string, serverName string, backupName string, _ *LtrBackupOperationsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/ltrBackupOperations/{backupName}" +func (client *AdvancedThreatProtectionSettingsClient) getCreateRequest(ctx context.Context, resourceGroupName string, serverName string, threatProtectionName ThreatProtectionName, _ *AdvancedThreatProtectionSettingsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/advancedThreatProtectionSettings/{threatProtectionName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -85,44 +86,44 @@ func (client *LtrBackupOperationsClient) getCreateRequest(ctx context.Context, r return nil, errors.New("parameter serverName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{serverName}", url.PathEscape(serverName)) - if backupName == "" { - return nil, errors.New("parameter backupName cannot be empty") + if threatProtectionName == "" { + return nil, errors.New("parameter threatProtectionName cannot be empty") } - urlPath = strings.ReplaceAll(urlPath, "{backupName}", url.PathEscape(backupName)) + urlPath = strings.ReplaceAll(urlPath, "{threatProtectionName}", url.PathEscape(string(threatProtectionName))) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-01-01-preview") + reqQP.Set("api-version", "2025-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } // getHandleResponse handles the Get response. -func (client *LtrBackupOperationsClient) getHandleResponse(resp *http.Response) (LtrBackupOperationsClientGetResponse, error) { - result := LtrBackupOperationsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.LtrServerBackupOperation); err != nil { - return LtrBackupOperationsClientGetResponse{}, err +func (client *AdvancedThreatProtectionSettingsClient) getHandleResponse(resp *http.Response) (AdvancedThreatProtectionSettingsClientGetResponse, error) { + result := AdvancedThreatProtectionSettingsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.AdvancedThreatProtectionSettingsModel); err != nil { + return AdvancedThreatProtectionSettingsClientGetResponse{}, err } return result, nil } -// NewListByServerPager - Gets the result of the give long term retention backup operations for the flexible server. +// NewListByServerPager - Lists state of advanced threat protection settings for a server. // -// Generated from API version 2025-01-01-preview +// Generated from API version 2025-08-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. -// - options - LtrBackupOperationsClientListByServerOptions contains the optional parameters for the LtrBackupOperationsClient.NewListByServerPager +// - options - AdvancedThreatProtectionSettingsClientListByServerOptions contains the optional parameters for the AdvancedThreatProtectionSettingsClient.NewListByServerPager // method. -func (client *LtrBackupOperationsClient) NewListByServerPager(resourceGroupName string, serverName string, options *LtrBackupOperationsClientListByServerOptions) *runtime.Pager[LtrBackupOperationsClientListByServerResponse] { - return runtime.NewPager(runtime.PagingHandler[LtrBackupOperationsClientListByServerResponse]{ - More: func(page LtrBackupOperationsClientListByServerResponse) bool { +func (client *AdvancedThreatProtectionSettingsClient) NewListByServerPager(resourceGroupName string, serverName string, options *AdvancedThreatProtectionSettingsClientListByServerOptions) *runtime.Pager[AdvancedThreatProtectionSettingsClientListByServerResponse] { + return runtime.NewPager(runtime.PagingHandler[AdvancedThreatProtectionSettingsClientListByServerResponse]{ + More: func(page AdvancedThreatProtectionSettingsClientListByServerResponse) bool { return page.NextLink != nil && len(*page.NextLink) > 0 }, - Fetcher: func(ctx context.Context, page *LtrBackupOperationsClientListByServerResponse) (LtrBackupOperationsClientListByServerResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "LtrBackupOperationsClient.NewListByServerPager") + Fetcher: func(ctx context.Context, page *AdvancedThreatProtectionSettingsClientListByServerResponse) (AdvancedThreatProtectionSettingsClientListByServerResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "AdvancedThreatProtectionSettingsClient.NewListByServerPager") nextLink := "" if page != nil { nextLink = *page.NextLink @@ -131,7 +132,7 @@ func (client *LtrBackupOperationsClient) NewListByServerPager(resourceGroupName return client.listByServerCreateRequest(ctx, resourceGroupName, serverName, options) }, nil) if err != nil { - return LtrBackupOperationsClientListByServerResponse{}, err + return AdvancedThreatProtectionSettingsClientListByServerResponse{}, err } return client.listByServerHandleResponse(resp) }, @@ -140,8 +141,8 @@ func (client *LtrBackupOperationsClient) NewListByServerPager(resourceGroupName } // listByServerCreateRequest creates the ListByServer request. -func (client *LtrBackupOperationsClient) listByServerCreateRequest(ctx context.Context, resourceGroupName string, serverName string, _ *LtrBackupOperationsClientListByServerOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/ltrBackupOperations" +func (client *AdvancedThreatProtectionSettingsClient) listByServerCreateRequest(ctx context.Context, resourceGroupName string, serverName string, _ *AdvancedThreatProtectionSettingsClientListByServerOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/advancedThreatProtectionSettings" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -159,17 +160,17 @@ func (client *LtrBackupOperationsClient) listByServerCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-01-01-preview") + reqQP.Set("api-version", "2025-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } // listByServerHandleResponse handles the ListByServer response. -func (client *LtrBackupOperationsClient) listByServerHandleResponse(resp *http.Response) (LtrBackupOperationsClientListByServerResponse, error) { - result := LtrBackupOperationsClientListByServerResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.LtrServerBackupOperationList); err != nil { - return LtrBackupOperationsClientListByServerResponse{}, err +func (client *AdvancedThreatProtectionSettingsClient) listByServerHandleResponse(resp *http.Response) (AdvancedThreatProtectionSettingsClientListByServerResponse, error) { + result := AdvancedThreatProtectionSettingsClientListByServerResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.AdvancedThreatProtectionSettingsList); err != nil { + return AdvancedThreatProtectionSettingsClientListByServerResponse{}, err } return result, nil } diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/advancedthreatprotectionsettings_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/advancedthreatprotectionsettings_client_example_test.go new file mode 100644 index 000000000000..72ec23dc07fb --- /dev/null +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/advancedthreatprotectionsettings_client_example_test.go @@ -0,0 +1,84 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armpostgresqlflexibleservers_test + +import ( + "context" + "log" + + "github.com/Azure/azure-sdk-for-go/sdk/azidentity" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v5" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/735d21dbd7e1cc446babf58860af4cca757d620d/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/AdvancedThreatProtectionSettingsListByServer.json +func ExampleAdvancedThreatProtectionSettingsClient_NewListByServerPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewAdvancedThreatProtectionSettingsClient().NewListByServerPager("exampleresourcegroup", "exampleserver", nil) + for pager.More() { + page, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range page.Value { + // You could use page here. We use blank identifier for just demo purposes. + _ = v + } + // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // page.AdvancedThreatProtectionSettingsList = armpostgresqlflexibleservers.AdvancedThreatProtectionSettingsList{ + // Value: []*armpostgresqlflexibleservers.AdvancedThreatProtectionSettingsModel{ + // { + // Name: to.Ptr("Default"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/advancedThreatProtectionSettings"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/advancedThreatProtectionSettings/Default"), + // Properties: &armpostgresqlflexibleservers.AdvancedThreatProtectionSettingsProperties{ + // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T18:30:22.123Z"); return t}()), + // State: to.Ptr(armpostgresqlflexibleservers.ThreatProtectionStateEnabled), + // }, + // }}, + // } + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/735d21dbd7e1cc446babf58860af4cca757d620d/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/AdvancedThreatProtectionSettingsGet.json +func ExampleAdvancedThreatProtectionSettingsClient_Get() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewAdvancedThreatProtectionSettingsClient().Get(ctx, "exampleresourcegroup", "exampleserver", armpostgresqlflexibleservers.ThreatProtectionNameDefault, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.AdvancedThreatProtectionSettingsModel = armpostgresqlflexibleservers.AdvancedThreatProtectionSettingsModel{ + // Name: to.Ptr("Default"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/advancedThreatProtectionSettings"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/advancedThreatProtectionSettings/Default"), + // Properties: &armpostgresqlflexibleservers.AdvancedThreatProtectionSettingsProperties{ + // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T18:30:22.123Z"); return t}()), + // State: to.Ptr(armpostgresqlflexibleservers.ThreatProtectionStateEnabled), + // }, + // } +} diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/assets.json b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/assets.json index daadf1571e86..15111906d3e7 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/assets.json +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "go", "TagPrefix": "go/resourcemanager/postgresql/armpostgresqlflexibleservers", - "Tag": "go/resourcemanager/postgresql/armpostgresqlflexibleservers_a07693dad6" + "Tag": "go/resourcemanager/postgresql/armpostgresqlflexibleservers_ba8111a989" } diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/autorest.md b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/autorest.md index fb3c13d7d7ac..a05a25a9244d 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/autorest.md +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/autorest.md @@ -5,10 +5,10 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/b1f4d539964453ce8008e4b069e59885e12ba441/specification/postgresql/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/b1f4d539964453ce8008e4b069e59885e12ba441/specification/postgresql/resource-manager/readme.go.md +- https://github.com/Azure/azure-rest-api-specs/blob/735d21dbd7e1cc446babf58860af4cca757d620d/specification/postgresql/resource-manager/readme.md +- https://github.com/Azure/azure-rest-api-specs/blob/735d21dbd7e1cc446babf58860af4cca757d620d/specification/postgresql/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 5.0.0-beta.1 +module-version: 5.0.0 package-flexibleservers: true -tag: package-flexibleserver-2025-01-01-preview +tag: package-flexibleserver-2025-08-01 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/backups_client.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/backupsautomaticandondemand_client.go similarity index 61% rename from sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/backups_client.go rename to sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/backupsautomaticandondemand_client.go index 484ef33b608b..2ef42f9bfaaa 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/backups_client.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/backupsautomaticandondemand_client.go @@ -17,62 +17,63 @@ import ( "strings" ) -// BackupsClient contains the methods for the Backups group. -// Don't use this type directly, use NewBackupsClient() instead. -type BackupsClient struct { +// BackupsAutomaticAndOnDemandClient contains the methods for the BackupsAutomaticAndOnDemand group. +// Don't use this type directly, use NewBackupsAutomaticAndOnDemandClient() instead. +type BackupsAutomaticAndOnDemandClient struct { internal *arm.Client subscriptionID string } -// NewBackupsClient creates a new instance of BackupsClient with the specified values. +// NewBackupsAutomaticAndOnDemandClient creates a new instance of BackupsAutomaticAndOnDemandClient with the specified values. // - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewBackupsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*BackupsClient, error) { +// - options - Contains optional client configuration. Pass nil to accept the default values. +func NewBackupsAutomaticAndOnDemandClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*BackupsAutomaticAndOnDemandClient, error) { cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) if err != nil { return nil, err } - client := &BackupsClient{ + client := &BackupsAutomaticAndOnDemandClient{ subscriptionID: subscriptionID, internal: cl, } return client, nil } -// BeginCreate - Create a specific backup for PostgreSQL flexible server. +// BeginCreate - Creates an on demand backup of a server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-01-01-preview +// Generated from API version 2025-08-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. -// - backupName - The name of the backup. -// - options - BackupsClientBeginCreateOptions contains the optional parameters for the BackupsClient.BeginCreate method. -func (client *BackupsClient) BeginCreate(ctx context.Context, resourceGroupName string, serverName string, backupName string, options *BackupsClientBeginCreateOptions) (*runtime.Poller[BackupsClientCreateResponse], error) { +// - backupName - Name of the backup. +// - options - BackupsAutomaticAndOnDemandClientBeginCreateOptions contains the optional parameters for the BackupsAutomaticAndOnDemandClient.BeginCreate +// method. +func (client *BackupsAutomaticAndOnDemandClient) BeginCreate(ctx context.Context, resourceGroupName string, serverName string, backupName string, options *BackupsAutomaticAndOnDemandClientBeginCreateOptions) (*runtime.Poller[BackupsAutomaticAndOnDemandClientCreateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.create(ctx, resourceGroupName, serverName, backupName, options) if err != nil { return nil, err } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[BackupsClientCreateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[BackupsAutomaticAndOnDemandClientCreateResponse]{ FinalStateVia: runtime.FinalStateViaAzureAsyncOp, Tracer: client.internal.Tracer(), }) return poller, err } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[BackupsClientCreateResponse]{ + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[BackupsAutomaticAndOnDemandClientCreateResponse]{ Tracer: client.internal.Tracer(), }) } } -// Create - Create a specific backup for PostgreSQL flexible server. +// Create - Creates an on demand backup of a server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-01-01-preview -func (client *BackupsClient) create(ctx context.Context, resourceGroupName string, serverName string, backupName string, options *BackupsClientBeginCreateOptions) (*http.Response, error) { +// Generated from API version 2025-08-01 +func (client *BackupsAutomaticAndOnDemandClient) create(ctx context.Context, resourceGroupName string, serverName string, backupName string, options *BackupsAutomaticAndOnDemandClientBeginCreateOptions) (*http.Response, error) { var err error - const operationName = "BackupsClient.BeginCreate" + const operationName = "BackupsAutomaticAndOnDemandClient.BeginCreate" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) defer func() { endSpan(err) }() @@ -84,7 +85,7 @@ func (client *BackupsClient) create(ctx context.Context, resourceGroupName strin if err != nil { return nil, err } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { + if !runtime.HasStatusCode(httpResp, http.StatusAccepted) { err = runtime.NewResponseError(httpResp) return nil, err } @@ -92,7 +93,7 @@ func (client *BackupsClient) create(ctx context.Context, resourceGroupName strin } // createCreateRequest creates the Create request. -func (client *BackupsClient) createCreateRequest(ctx context.Context, resourceGroupName string, serverName string, backupName string, _ *BackupsClientBeginCreateOptions) (*policy.Request, error) { +func (client *BackupsAutomaticAndOnDemandClient) createCreateRequest(ctx context.Context, resourceGroupName string, serverName string, backupName string, _ *BackupsAutomaticAndOnDemandClientBeginCreateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/backups/{backupName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -115,45 +116,46 @@ func (client *BackupsClient) createCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-01-01-preview") + reqQP.Set("api-version", "2025-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } -// BeginDelete - Deletes a specific backup. +// BeginDelete - Deletes a specific backup, given its name. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-01-01-preview +// Generated from API version 2025-08-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. -// - backupName - The name of the backup. -// - options - BackupsClientBeginDeleteOptions contains the optional parameters for the BackupsClient.BeginDelete method. -func (client *BackupsClient) BeginDelete(ctx context.Context, resourceGroupName string, serverName string, backupName string, options *BackupsClientBeginDeleteOptions) (*runtime.Poller[BackupsClientDeleteResponse], error) { +// - backupName - Name of the backup. +// - options - BackupsAutomaticAndOnDemandClientBeginDeleteOptions contains the optional parameters for the BackupsAutomaticAndOnDemandClient.BeginDelete +// method. +func (client *BackupsAutomaticAndOnDemandClient) BeginDelete(ctx context.Context, resourceGroupName string, serverName string, backupName string, options *BackupsAutomaticAndOnDemandClientBeginDeleteOptions) (*runtime.Poller[BackupsAutomaticAndOnDemandClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.deleteOperation(ctx, resourceGroupName, serverName, backupName, options) if err != nil { return nil, err } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[BackupsClientDeleteResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[BackupsAutomaticAndOnDemandClientDeleteResponse]{ FinalStateVia: runtime.FinalStateViaLocation, Tracer: client.internal.Tracer(), }) return poller, err } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[BackupsClientDeleteResponse]{ + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[BackupsAutomaticAndOnDemandClientDeleteResponse]{ Tracer: client.internal.Tracer(), }) } } -// Delete - Deletes a specific backup. +// Delete - Deletes a specific backup, given its name. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-01-01-preview -func (client *BackupsClient) deleteOperation(ctx context.Context, resourceGroupName string, serverName string, backupName string, options *BackupsClientBeginDeleteOptions) (*http.Response, error) { +// Generated from API version 2025-08-01 +func (client *BackupsAutomaticAndOnDemandClient) deleteOperation(ctx context.Context, resourceGroupName string, serverName string, backupName string, options *BackupsAutomaticAndOnDemandClientBeginDeleteOptions) (*http.Response, error) { var err error - const operationName = "BackupsClient.BeginDelete" + const operationName = "BackupsAutomaticAndOnDemandClient.BeginDelete" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) defer func() { endSpan(err) }() @@ -173,7 +175,7 @@ func (client *BackupsClient) deleteOperation(ctx context.Context, resourceGroupN } // deleteCreateRequest creates the Delete request. -func (client *BackupsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, serverName string, backupName string, _ *BackupsClientBeginDeleteOptions) (*policy.Request, error) { +func (client *BackupsAutomaticAndOnDemandClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, serverName string, backupName string, _ *BackupsAutomaticAndOnDemandClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/backups/{backupName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -196,44 +198,45 @@ func (client *BackupsClient) deleteCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-01-01-preview") + reqQP.Set("api-version", "2025-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } -// Get - Get specific backup for a given server. +// Get - Gets information of an on demand backup, given its name. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-01-01-preview +// Generated from API version 2025-08-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. -// - backupName - The name of the backup. -// - options - BackupsClientGetOptions contains the optional parameters for the BackupsClient.Get method. -func (client *BackupsClient) Get(ctx context.Context, resourceGroupName string, serverName string, backupName string, options *BackupsClientGetOptions) (BackupsClientGetResponse, error) { +// - backupName - Name of the backup. +// - options - BackupsAutomaticAndOnDemandClientGetOptions contains the optional parameters for the BackupsAutomaticAndOnDemandClient.Get +// method. +func (client *BackupsAutomaticAndOnDemandClient) Get(ctx context.Context, resourceGroupName string, serverName string, backupName string, options *BackupsAutomaticAndOnDemandClientGetOptions) (BackupsAutomaticAndOnDemandClientGetResponse, error) { var err error - const operationName = "BackupsClient.Get" + const operationName = "BackupsAutomaticAndOnDemandClient.Get" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) defer func() { endSpan(err) }() req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, backupName, options) if err != nil { - return BackupsClientGetResponse{}, err + return BackupsAutomaticAndOnDemandClientGetResponse{}, err } httpResp, err := client.internal.Pipeline().Do(req) if err != nil { - return BackupsClientGetResponse{}, err + return BackupsAutomaticAndOnDemandClientGetResponse{}, err } if !runtime.HasStatusCode(httpResp, http.StatusOK) { err = runtime.NewResponseError(httpResp) - return BackupsClientGetResponse{}, err + return BackupsAutomaticAndOnDemandClientGetResponse{}, err } resp, err := client.getHandleResponse(httpResp) return resp, err } // getCreateRequest creates the Get request. -func (client *BackupsClient) getCreateRequest(ctx context.Context, resourceGroupName string, serverName string, backupName string, _ *BackupsClientGetOptions) (*policy.Request, error) { +func (client *BackupsAutomaticAndOnDemandClient) getCreateRequest(ctx context.Context, resourceGroupName string, serverName string, backupName string, _ *BackupsAutomaticAndOnDemandClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/backups/{backupName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -256,35 +259,35 @@ func (client *BackupsClient) getCreateRequest(ctx context.Context, resourceGroup return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-01-01-preview") + reqQP.Set("api-version", "2025-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } // getHandleResponse handles the Get response. -func (client *BackupsClient) getHandleResponse(resp *http.Response) (BackupsClientGetResponse, error) { - result := BackupsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ServerBackup); err != nil { - return BackupsClientGetResponse{}, err +func (client *BackupsAutomaticAndOnDemandClient) getHandleResponse(resp *http.Response) (BackupsAutomaticAndOnDemandClientGetResponse, error) { + result := BackupsAutomaticAndOnDemandClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.BackupAutomaticAndOnDemand); err != nil { + return BackupsAutomaticAndOnDemandClientGetResponse{}, err } return result, nil } -// NewListByServerPager - List all the backups for a given server. +// NewListByServerPager - Lists all available backups of a server. // -// Generated from API version 2025-01-01-preview +// Generated from API version 2025-08-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. -// - options - BackupsClientListByServerOptions contains the optional parameters for the BackupsClient.NewListByServerPager +// - options - BackupsAutomaticAndOnDemandClientListByServerOptions contains the optional parameters for the BackupsAutomaticAndOnDemandClient.NewListByServerPager // method. -func (client *BackupsClient) NewListByServerPager(resourceGroupName string, serverName string, options *BackupsClientListByServerOptions) *runtime.Pager[BackupsClientListByServerResponse] { - return runtime.NewPager(runtime.PagingHandler[BackupsClientListByServerResponse]{ - More: func(page BackupsClientListByServerResponse) bool { +func (client *BackupsAutomaticAndOnDemandClient) NewListByServerPager(resourceGroupName string, serverName string, options *BackupsAutomaticAndOnDemandClientListByServerOptions) *runtime.Pager[BackupsAutomaticAndOnDemandClientListByServerResponse] { + return runtime.NewPager(runtime.PagingHandler[BackupsAutomaticAndOnDemandClientListByServerResponse]{ + More: func(page BackupsAutomaticAndOnDemandClientListByServerResponse) bool { return page.NextLink != nil && len(*page.NextLink) > 0 }, - Fetcher: func(ctx context.Context, page *BackupsClientListByServerResponse) (BackupsClientListByServerResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "BackupsClient.NewListByServerPager") + Fetcher: func(ctx context.Context, page *BackupsAutomaticAndOnDemandClientListByServerResponse) (BackupsAutomaticAndOnDemandClientListByServerResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "BackupsAutomaticAndOnDemandClient.NewListByServerPager") nextLink := "" if page != nil { nextLink = *page.NextLink @@ -293,7 +296,7 @@ func (client *BackupsClient) NewListByServerPager(resourceGroupName string, serv return client.listByServerCreateRequest(ctx, resourceGroupName, serverName, options) }, nil) if err != nil { - return BackupsClientListByServerResponse{}, err + return BackupsAutomaticAndOnDemandClientListByServerResponse{}, err } return client.listByServerHandleResponse(resp) }, @@ -302,7 +305,7 @@ func (client *BackupsClient) NewListByServerPager(resourceGroupName string, serv } // listByServerCreateRequest creates the ListByServer request. -func (client *BackupsClient) listByServerCreateRequest(ctx context.Context, resourceGroupName string, serverName string, _ *BackupsClientListByServerOptions) (*policy.Request, error) { +func (client *BackupsAutomaticAndOnDemandClient) listByServerCreateRequest(ctx context.Context, resourceGroupName string, serverName string, _ *BackupsAutomaticAndOnDemandClientListByServerOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/backups" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -321,17 +324,17 @@ func (client *BackupsClient) listByServerCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-01-01-preview") + reqQP.Set("api-version", "2025-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } // listByServerHandleResponse handles the ListByServer response. -func (client *BackupsClient) listByServerHandleResponse(resp *http.Response) (BackupsClientListByServerResponse, error) { - result := BackupsClientListByServerResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ServerBackupListResult); err != nil { - return BackupsClientListByServerResponse{}, err +func (client *BackupsAutomaticAndOnDemandClient) listByServerHandleResponse(resp *http.Response) (BackupsAutomaticAndOnDemandClientListByServerResponse, error) { + result := BackupsAutomaticAndOnDemandClientListByServerResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.BackupAutomaticAndOnDemandList); err != nil { + return BackupsAutomaticAndOnDemandClientListByServerResponse{}, err } return result, nil } diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/backups_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/backupsautomaticandondemand_client_example_test.go similarity index 51% rename from sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/backups_client_example_test.go rename to sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/backupsautomaticandondemand_client_example_test.go index 50ca355e0e68..172e31f923b3 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/backups_client_example_test.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/backupsautomaticandondemand_client_example_test.go @@ -17,8 +17,8 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v5" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b1f4d539964453ce8008e4b069e59885e12ba441/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/BackupCreate.json -func ExampleBackupsClient_BeginCreate() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/735d21dbd7e1cc446babf58860af4cca757d620d/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/BackupsAutomaticAndOnDemandCreate.json +func ExampleBackupsAutomaticAndOnDemandClient_BeginCreate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -28,31 +28,18 @@ func ExampleBackupsClient_BeginCreate() { if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewBackupsClient().BeginCreate(ctx, "TestGroup", "postgresqltestserver", "backup_20250303T160516", nil) + poller, err := clientFactory.NewBackupsAutomaticAndOnDemandClient().BeginCreate(ctx, "exampleresourcegroup", "exampleserver", "ondemandbackup-20250601T183022", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } - res, err := poller.PollUntilDone(ctx, nil) + _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ServerBackup = armpostgresqlflexibleservers.ServerBackup{ - // Name: to.Ptr("backup_20250303T160516"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/backups"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/postgresqltestserver/backups/backup_20250303T160516"), - // Properties: &armpostgresqlflexibleservers.ServerBackupProperties{ - // BackupType: to.Ptr(armpostgresqlflexibleservers.OriginCustomerOnDemand), - // CompletedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-03-03T16:05:19.902Z"); return t}()), - // Source: to.Ptr("Customer Initiated"), - // }, - // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b1f4d539964453ce8008e4b069e59885e12ba441/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/BackupDelete.json -func ExampleBackupsClient_BeginDelete() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/735d21dbd7e1cc446babf58860af4cca757d620d/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/BackupsAutomaticAndOnDemandDelete.json +func ExampleBackupsAutomaticAndOnDemandClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -62,7 +49,7 @@ func ExampleBackupsClient_BeginDelete() { if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewBackupsClient().BeginDelete(ctx, "TestGroup", "testserver", "backup_20250303T160516", nil) + poller, err := clientFactory.NewBackupsAutomaticAndOnDemandClient().BeginDelete(ctx, "exampleresourcegroup", "exampleserver", "ondemandbackup-20250601T183022", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -72,8 +59,8 @@ func ExampleBackupsClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b1f4d539964453ce8008e4b069e59885e12ba441/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/BackupGet.json -func ExampleBackupsClient_Get() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/735d21dbd7e1cc446babf58860af4cca757d620d/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/BackupsAutomaticAndOnDemandGet.json +func ExampleBackupsAutomaticAndOnDemandClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -83,27 +70,27 @@ func ExampleBackupsClient_Get() { if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewBackupsClient().Get(ctx, "TestGroup", "postgresqltestserver", "daily_20250303T160516", nil) + res, err := clientFactory.NewBackupsAutomaticAndOnDemandClient().Get(ctx, "exampleresourcegroup", "exampleserver", "backup_638830782181266873", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ServerBackup = armpostgresqlflexibleservers.ServerBackup{ - // Name: to.Ptr("daily_20250303T160516"), + // res.BackupAutomaticAndOnDemand = armpostgresqlflexibleservers.BackupAutomaticAndOnDemand{ + // Name: to.Ptr("backup_20250601T183022"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/backups"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/postgresqltestserver/backups/daily_20250303T160516"), - // Properties: &armpostgresqlflexibleservers.ServerBackupProperties{ - // BackupType: to.Ptr(armpostgresqlflexibleservers.OriginFull), - // CompletedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-03-03T16:05:19.902Z"); return t}()), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/backups/backup_638830782181266873"), + // Properties: &armpostgresqlflexibleservers.BackupAutomaticAndOnDemandProperties{ + // BackupType: to.Ptr(armpostgresqlflexibleservers.BackupTypeFull), + // CompletedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T14:30:22.123Z"); return t}()), // Source: to.Ptr("Automatic"), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b1f4d539964453ce8008e4b069e59885e12ba441/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/BackupListByServer.json -func ExampleBackupsClient_NewListByServerPager() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/735d21dbd7e1cc446babf58860af4cca757d620d/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/BackupsAutomaticAndOnDemandListByServer.json +func ExampleBackupsAutomaticAndOnDemandClient_NewListByServerPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -113,7 +100,7 @@ func ExampleBackupsClient_NewListByServerPager() { if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewBackupsClient().NewListByServerPager("TestGroup", "postgresqltestserver", nil) + pager := clientFactory.NewBackupsAutomaticAndOnDemandClient().NewListByServerPager("exampleresourcegroup", "exampleserver", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -124,25 +111,25 @@ func ExampleBackupsClient_NewListByServerPager() { _ = v } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ServerBackupListResult = armpostgresqlflexibleservers.ServerBackupListResult{ - // Value: []*armpostgresqlflexibleservers.ServerBackup{ + // page.BackupAutomaticAndOnDemandList = armpostgresqlflexibleservers.BackupAutomaticAndOnDemandList{ + // Value: []*armpostgresqlflexibleservers.BackupAutomaticAndOnDemand{ // { - // Name: to.Ptr("backup_638766209959406043"), + // Name: to.Ptr("backup_638830782181266873"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/backups"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/postgresqltestserver/backups/backup_638766209959406043"), - // Properties: &armpostgresqlflexibleservers.ServerBackupProperties{ - // BackupType: to.Ptr(armpostgresqlflexibleservers.OriginFull), - // CompletedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-03-03T17:49:56.940Z"); return t}()), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/backups/backup_638830782181266873"), + // Properties: &armpostgresqlflexibleservers.BackupAutomaticAndOnDemandProperties{ + // BackupType: to.Ptr(armpostgresqlflexibleservers.BackupTypeFull), + // CompletedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T14:30:22.123Z"); return t}()), // Source: to.Ptr("Automatic"), // }, // }, // { - // Name: to.Ptr("ondemandbackup-03032025-1"), + // Name: to.Ptr("ondemandbackup-20250601T183022"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/backups"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/postgresqltestserver/backups/ondemandbackup-03032025-1"), - // Properties: &armpostgresqlflexibleservers.ServerBackupProperties{ - // BackupType: to.Ptr(armpostgresqlflexibleservers.OriginCustomerOnDemand), - // CompletedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-03-03T20:53:22.446Z"); return t}()), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/backups/ondemandbackup-20250601T183022"), + // Properties: &armpostgresqlflexibleservers.BackupAutomaticAndOnDemandProperties{ + // BackupType: to.Ptr(armpostgresqlflexibleservers.BackupTypeCustomerOnDemand), + // CompletedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T18:30:22.123Z"); return t}()), // Source: to.Ptr("Customer Initiated"), // }, // }}, diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/backupslongtermretention_client.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/backupslongtermretention_client.go new file mode 100644 index 000000000000..2bfc246a1569 --- /dev/null +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/backupslongtermretention_client.go @@ -0,0 +1,329 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armpostgresqlflexibleservers + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// BackupsLongTermRetentionClient contains the methods for the BackupsLongTermRetention group. +// Don't use this type directly, use NewBackupsLongTermRetentionClient() instead. +type BackupsLongTermRetentionClient struct { + internal *arm.Client + subscriptionID string +} + +// NewBackupsLongTermRetentionClient creates a new instance of BackupsLongTermRetentionClient with the specified values. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - Contains optional client configuration. Pass nil to accept the default values. +func NewBackupsLongTermRetentionClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*BackupsLongTermRetentionClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &BackupsLongTermRetentionClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// CheckPrerequisites - Performs all checks required for a long term retention backup operation to succeed. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2025-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serverName - The name of the server. +// - parameters - Request body for operation +// - options - BackupsLongTermRetentionClientCheckPrerequisitesOptions contains the optional parameters for the BackupsLongTermRetentionClient.CheckPrerequisites +// method. +func (client *BackupsLongTermRetentionClient) CheckPrerequisites(ctx context.Context, resourceGroupName string, serverName string, parameters LtrPreBackupRequest, options *BackupsLongTermRetentionClientCheckPrerequisitesOptions) (BackupsLongTermRetentionClientCheckPrerequisitesResponse, error) { + var err error + const operationName = "BackupsLongTermRetentionClient.CheckPrerequisites" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.checkPrerequisitesCreateRequest(ctx, resourceGroupName, serverName, parameters, options) + if err != nil { + return BackupsLongTermRetentionClientCheckPrerequisitesResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return BackupsLongTermRetentionClientCheckPrerequisitesResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return BackupsLongTermRetentionClientCheckPrerequisitesResponse{}, err + } + resp, err := client.checkPrerequisitesHandleResponse(httpResp) + return resp, err +} + +// checkPrerequisitesCreateRequest creates the CheckPrerequisites request. +func (client *BackupsLongTermRetentionClient) checkPrerequisitesCreateRequest(ctx context.Context, resourceGroupName string, serverName string, parameters LtrPreBackupRequest, _ *BackupsLongTermRetentionClientCheckPrerequisitesOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/ltrPreBackup" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serverName == "" { + return nil, errors.New("parameter serverName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serverName}", url.PathEscape(serverName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2025-08-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} + +// checkPrerequisitesHandleResponse handles the CheckPrerequisites response. +func (client *BackupsLongTermRetentionClient) checkPrerequisitesHandleResponse(resp *http.Response) (BackupsLongTermRetentionClientCheckPrerequisitesResponse, error) { + result := BackupsLongTermRetentionClientCheckPrerequisitesResponse{} + if val := resp.Header.Get("x-ms-request-id"); val != "" { + result.XMSRequestID = &val + } + if err := runtime.UnmarshalAsJSON(resp, &result.LtrPreBackupResponse); err != nil { + return BackupsLongTermRetentionClientCheckPrerequisitesResponse{}, err + } + return result, nil +} + +// Get - Gets the results of a long retention backup operation for a server. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2025-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serverName - The name of the server. +// - backupName - The name of the backup. +// - options - BackupsLongTermRetentionClientGetOptions contains the optional parameters for the BackupsLongTermRetentionClient.Get +// method. +func (client *BackupsLongTermRetentionClient) Get(ctx context.Context, resourceGroupName string, serverName string, backupName string, options *BackupsLongTermRetentionClientGetOptions) (BackupsLongTermRetentionClientGetResponse, error) { + var err error + const operationName = "BackupsLongTermRetentionClient.Get" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, backupName, options) + if err != nil { + return BackupsLongTermRetentionClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return BackupsLongTermRetentionClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return BackupsLongTermRetentionClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *BackupsLongTermRetentionClient) getCreateRequest(ctx context.Context, resourceGroupName string, serverName string, backupName string, _ *BackupsLongTermRetentionClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/ltrBackupOperations/{backupName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serverName == "" { + return nil, errors.New("parameter serverName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serverName}", url.PathEscape(serverName)) + if backupName == "" { + return nil, errors.New("parameter backupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{backupName}", url.PathEscape(backupName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2025-08-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *BackupsLongTermRetentionClient) getHandleResponse(resp *http.Response) (BackupsLongTermRetentionClientGetResponse, error) { + result := BackupsLongTermRetentionClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.BackupsLongTermRetentionOperation); err != nil { + return BackupsLongTermRetentionClientGetResponse{}, err + } + return result, nil +} + +// NewListByServerPager - Lists the results of the long term retention backup operations for a server. +// +// Generated from API version 2025-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serverName - The name of the server. +// - options - BackupsLongTermRetentionClientListByServerOptions contains the optional parameters for the BackupsLongTermRetentionClient.NewListByServerPager +// method. +func (client *BackupsLongTermRetentionClient) NewListByServerPager(resourceGroupName string, serverName string, options *BackupsLongTermRetentionClientListByServerOptions) *runtime.Pager[BackupsLongTermRetentionClientListByServerResponse] { + return runtime.NewPager(runtime.PagingHandler[BackupsLongTermRetentionClientListByServerResponse]{ + More: func(page BackupsLongTermRetentionClientListByServerResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *BackupsLongTermRetentionClientListByServerResponse) (BackupsLongTermRetentionClientListByServerResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "BackupsLongTermRetentionClient.NewListByServerPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink + } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listByServerCreateRequest(ctx, resourceGroupName, serverName, options) + }, nil) + if err != nil { + return BackupsLongTermRetentionClientListByServerResponse{}, err + } + return client.listByServerHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listByServerCreateRequest creates the ListByServer request. +func (client *BackupsLongTermRetentionClient) listByServerCreateRequest(ctx context.Context, resourceGroupName string, serverName string, _ *BackupsLongTermRetentionClientListByServerOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/ltrBackupOperations" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serverName == "" { + return nil, errors.New("parameter serverName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serverName}", url.PathEscape(serverName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2025-08-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByServerHandleResponse handles the ListByServer response. +func (client *BackupsLongTermRetentionClient) listByServerHandleResponse(resp *http.Response) (BackupsLongTermRetentionClientListByServerResponse, error) { + result := BackupsLongTermRetentionClientListByServerResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.LtrServerBackupOperationList); err != nil { + return BackupsLongTermRetentionClientListByServerResponse{}, err + } + return result, nil +} + +// BeginStart - Initiates a long term retention backup. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2025-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serverName - The name of the server. +// - parameters - Request body for operation +// - options - BackupsLongTermRetentionClientBeginStartOptions contains the optional parameters for the BackupsLongTermRetentionClient.BeginStart +// method. +func (client *BackupsLongTermRetentionClient) BeginStart(ctx context.Context, resourceGroupName string, serverName string, parameters BackupsLongTermRetentionRequest, options *BackupsLongTermRetentionClientBeginStartOptions) (*runtime.Poller[BackupsLongTermRetentionClientStartResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.start(ctx, resourceGroupName, serverName, parameters, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[BackupsLongTermRetentionClientStartResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[BackupsLongTermRetentionClientStartResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// Start - Initiates a long term retention backup. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2025-08-01 +func (client *BackupsLongTermRetentionClient) start(ctx context.Context, resourceGroupName string, serverName string, parameters BackupsLongTermRetentionRequest, options *BackupsLongTermRetentionClientBeginStartOptions) (*http.Response, error) { + var err error + const operationName = "BackupsLongTermRetentionClient.BeginStart" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.startCreateRequest(ctx, resourceGroupName, serverName, parameters, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// startCreateRequest creates the Start request. +func (client *BackupsLongTermRetentionClient) startCreateRequest(ctx context.Context, resourceGroupName string, serverName string, parameters BackupsLongTermRetentionRequest, _ *BackupsLongTermRetentionClientBeginStartOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/startLtrBackup" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serverName == "" { + return nil, errors.New("parameter serverName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serverName}", url.PathEscape(serverName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2025-08-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/backupslongtermretention_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/backupslongtermretention_client_example_test.go new file mode 100644 index 000000000000..7a854e0b61a0 --- /dev/null +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/backupslongtermretention_client_example_test.go @@ -0,0 +1,169 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armpostgresqlflexibleservers_test + +import ( + "context" + "log" + + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/azidentity" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v5" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/735d21dbd7e1cc446babf58860af4cca757d620d/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/BackupsLongTermRetentionCheckPrerequisites.json +func ExampleBackupsLongTermRetentionClient_CheckPrerequisites() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewBackupsLongTermRetentionClient().CheckPrerequisites(ctx, "exampleresourcegroup", "exampleserver", armpostgresqlflexibleservers.LtrPreBackupRequest{ + BackupSettings: &armpostgresqlflexibleservers.BackupSettings{ + BackupName: to.Ptr("exampleltrbackup"), + }, + }, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.LtrPreBackupResponse = armpostgresqlflexibleservers.LtrPreBackupResponse{ + // Properties: &armpostgresqlflexibleservers.BackupsLongTermRetentionResponseProperties{ + // NumberOfContainers: to.Ptr[int32](1), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/735d21dbd7e1cc446babf58860af4cca757d620d/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/BackupsLongTermRetentionStart.json +func ExampleBackupsLongTermRetentionClient_BeginStart() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewBackupsLongTermRetentionClient().BeginStart(ctx, "exampleresourcegroup", "exampleserver", armpostgresqlflexibleservers.BackupsLongTermRetentionRequest{ + BackupSettings: &armpostgresqlflexibleservers.BackupSettings{ + BackupName: to.Ptr("exampleltrbackup"), + }, + TargetDetails: &armpostgresqlflexibleservers.BackupStoreDetails{ + SasURIList: []*string{ + to.Ptr("sasuri")}, + }, + }, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + res, err := poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.BackupsLongTermRetentionResponse = armpostgresqlflexibleservers.BackupsLongTermRetentionResponse{ + // Properties: &armpostgresqlflexibleservers.LtrBackupOperationResponseProperties{ + // BackupMetadata: to.Ptr("backupmetadata"), + // DataTransferredInBytes: to.Ptr[int64](23), + // DatasourceSizeInBytes: to.Ptr[int64](23), + // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T18:35:22.123Z"); return t}()), + // PercentComplete: to.Ptr[float64](100), + // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T18:30:22.123Z"); return t}()), + // Status: to.Ptr(armpostgresqlflexibleservers.ExecutionStatusRunning), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/735d21dbd7e1cc446babf58860af4cca757d620d/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/BackupsLongTermRetentionGet.json +func ExampleBackupsLongTermRetentionClient_Get() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewBackupsLongTermRetentionClient().Get(ctx, "exampleresourcegroup", "exampleserver", "exampleltrbackup", nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.BackupsLongTermRetentionOperation = armpostgresqlflexibleservers.BackupsLongTermRetentionOperation{ + // Name: to.Ptr("exampleltrbackup"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/ltrbackupOperations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver"), + // Properties: &armpostgresqlflexibleservers.LtrBackupOperationResponseProperties{ + // BackupMetadata: to.Ptr("backupMetadata"), + // BackupName: to.Ptr("exampleltrbackup"), + // DataTransferredInBytes: to.Ptr[int64](9), + // DatasourceSizeInBytes: to.Ptr[int64](21), + // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T18:35:22.123Z"); return t}()), + // PercentComplete: to.Ptr[float64](4), + // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T18:30:22.123Z"); return t}()), + // Status: to.Ptr(armpostgresqlflexibleservers.ExecutionStatusRunning), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/735d21dbd7e1cc446babf58860af4cca757d620d/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/BackupsLongTermRetentionListByServer.json +func ExampleBackupsLongTermRetentionClient_NewListByServerPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewBackupsLongTermRetentionClient().NewListByServerPager("exampleresourcegroup", "exampleserver", nil) + for pager.More() { + page, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range page.Value { + // You could use page here. We use blank identifier for just demo purposes. + _ = v + } + // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // page.LtrServerBackupOperationList = armpostgresqlflexibleservers.LtrServerBackupOperationList{ + // Value: []*armpostgresqlflexibleservers.BackupsLongTermRetentionOperation{ + // { + // Name: to.Ptr("exampleltrbackup"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/ltrbackupOperations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver"), + // Properties: &armpostgresqlflexibleservers.LtrBackupOperationResponseProperties{ + // BackupMetadata: to.Ptr("backupMetadata"), + // BackupName: to.Ptr("exampleltrbackup"), + // DataTransferredInBytes: to.Ptr[int64](9), + // DatasourceSizeInBytes: to.Ptr[int64](21), + // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T18:35:22.123Z"); return t}()), + // PercentComplete: to.Ptr[float64](4), + // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T18:30:22.123Z"); return t}()), + // Status: to.Ptr(armpostgresqlflexibleservers.ExecutionStatusRunning), + // }, + // }}, + // } + } +} diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/capabilitiesbylocation_client.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/capabilitiesbylocation_client.go new file mode 100644 index 000000000000..d5b69c16ac5c --- /dev/null +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/capabilitiesbylocation_client.go @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armpostgresqlflexibleservers + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// CapabilitiesByLocationClient contains the methods for the CapabilitiesByLocation group. +// Don't use this type directly, use NewCapabilitiesByLocationClient() instead. +type CapabilitiesByLocationClient struct { + internal *arm.Client + subscriptionID string +} + +// NewCapabilitiesByLocationClient creates a new instance of CapabilitiesByLocationClient with the specified values. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - Contains optional client configuration. Pass nil to accept the default values. +func NewCapabilitiesByLocationClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*CapabilitiesByLocationClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &CapabilitiesByLocationClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// NewListPager - Lists the capabilities available in a given location for a specific subscription. +// +// Generated from API version 2025-08-01 +// - locationName - The name of the location. +// - options - CapabilitiesByLocationClientListOptions contains the optional parameters for the CapabilitiesByLocationClient.NewListPager +// method. +func (client *CapabilitiesByLocationClient) NewListPager(locationName string, options *CapabilitiesByLocationClientListOptions) *runtime.Pager[CapabilitiesByLocationClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[CapabilitiesByLocationClientListResponse]{ + More: func(page CapabilitiesByLocationClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *CapabilitiesByLocationClientListResponse) (CapabilitiesByLocationClientListResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "CapabilitiesByLocationClient.NewListPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink + } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listCreateRequest(ctx, locationName, options) + }, nil) + if err != nil { + return CapabilitiesByLocationClientListResponse{}, err + } + return client.listHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listCreateRequest creates the List request. +func (client *CapabilitiesByLocationClient) listCreateRequest(ctx context.Context, locationName string, _ *CapabilitiesByLocationClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.DBforPostgreSQL/locations/{locationName}/capabilities" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if locationName == "" { + return nil, errors.New("parameter locationName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{locationName}", url.PathEscape(locationName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2025-08-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *CapabilitiesByLocationClient) listHandleResponse(resp *http.Response) (CapabilitiesByLocationClientListResponse, error) { + result := CapabilitiesByLocationClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.CapabilityList); err != nil { + return CapabilitiesByLocationClientListResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/locationbasedcapabilities_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/capabilitiesbylocation_client_example_test.go similarity index 93% rename from sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/locationbasedcapabilities_client_example_test.go rename to sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/capabilitiesbylocation_client_example_test.go index fcd358dc11a3..c48af53e9b73 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/locationbasedcapabilities_client_example_test.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/capabilitiesbylocation_client_example_test.go @@ -17,8 +17,8 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v5" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b1f4d539964453ce8008e4b069e59885e12ba441/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/CapabilitiesByLocation.json -func ExampleLocationBasedCapabilitiesClient_NewExecutePager() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/735d21dbd7e1cc446babf58860af4cca757d620d/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/CapabilitiesByLocationList.json +func ExampleCapabilitiesByLocationClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -28,7 +28,7 @@ func ExampleLocationBasedCapabilitiesClient_NewExecutePager() { if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewLocationBasedCapabilitiesClient().NewExecutePager("eastus", nil) + pager := clientFactory.NewCapabilitiesByLocationClient().NewListPager("eastus", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -39,14 +39,14 @@ func ExampleLocationBasedCapabilitiesClient_NewExecutePager() { _ = v } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.CapabilitiesListResult = armpostgresqlflexibleservers.CapabilitiesListResult{ - // Value: []*armpostgresqlflexibleservers.FlexibleServerCapability{ + // page.CapabilityList = armpostgresqlflexibleservers.CapabilityList{ + // Value: []*armpostgresqlflexibleservers.Capability{ // { // Name: to.Ptr("FlexibleServerCapabilities"), - // FastProvisioningSupported: to.Ptr(armpostgresqlflexibleservers.FastProvisioningSupportedEnumEnabled), - // GeoBackupSupported: to.Ptr(armpostgresqlflexibleservers.GeoBackupSupportedEnumEnabled), - // OnlineResizeSupported: to.Ptr(armpostgresqlflexibleservers.OnlineResizeSupportedEnumEnabled), - // StorageAutoGrowthSupported: to.Ptr(armpostgresqlflexibleservers.StorageAutoGrowthSupportedEnumEnabled), + // FastProvisioningSupported: to.Ptr(armpostgresqlflexibleservers.FastProvisioningSupportEnabled), + // GeoBackupSupported: to.Ptr(armpostgresqlflexibleservers.GeographicallyRedundantBackupSupportEnabled), + // OnlineResizeSupported: to.Ptr(armpostgresqlflexibleservers.OnlineStorageResizeSupportEnabled), + // StorageAutoGrowthSupported: to.Ptr(armpostgresqlflexibleservers.StorageAutoGrowthSupportEnabled), // SupportedFastProvisioningEditions: []*armpostgresqlflexibleservers.FastProvisioningEditionCapability{ // { // ServerCount: to.Ptr[int32](0), @@ -226,45 +226,45 @@ func ExampleLocationBasedCapabilitiesClient_NewExecutePager() { // SupportedFeatures: []*armpostgresqlflexibleservers.SupportedFeature{ // { // Name: to.Ptr("FastProvisioning"), - // Status: to.Ptr(armpostgresqlflexibleservers.SupportedFeatureStatusEnumEnabled), + // Status: to.Ptr(armpostgresqlflexibleservers.FeatureStatusEnabled), // }, // { // Name: to.Ptr("ZoneRedundantHa"), - // Status: to.Ptr(armpostgresqlflexibleservers.SupportedFeatureStatusEnumEnabled), + // Status: to.Ptr(armpostgresqlflexibleservers.FeatureStatusEnabled), // }, // { // Name: to.Ptr("GeoBackup"), - // Status: to.Ptr(armpostgresqlflexibleservers.SupportedFeatureStatusEnumEnabled), + // Status: to.Ptr(armpostgresqlflexibleservers.FeatureStatusEnabled), // }, // { // Name: to.Ptr("ZoneRedundantHaAndGeoBackup"), - // Status: to.Ptr(armpostgresqlflexibleservers.SupportedFeatureStatusEnumEnabled), + // Status: to.Ptr(armpostgresqlflexibleservers.FeatureStatusEnabled), // }, // { // Name: to.Ptr("StorageAutoGrowth"), - // Status: to.Ptr(armpostgresqlflexibleservers.SupportedFeatureStatusEnumEnabled), + // Status: to.Ptr(armpostgresqlflexibleservers.FeatureStatusEnabled), // }, // { // Name: to.Ptr("OnlineResize"), - // Status: to.Ptr(armpostgresqlflexibleservers.SupportedFeatureStatusEnumEnabled), + // Status: to.Ptr(armpostgresqlflexibleservers.FeatureStatusEnabled), // }, // { // Name: to.Ptr("OfferRestricted"), - // Status: to.Ptr(armpostgresqlflexibleservers.SupportedFeatureStatusEnumDisabled), + // Status: to.Ptr(armpostgresqlflexibleservers.FeatureStatusDisabled), // }, // { // Name: to.Ptr("IndexTuning"), - // Status: to.Ptr(armpostgresqlflexibleservers.SupportedFeatureStatusEnumEnabled), + // Status: to.Ptr(armpostgresqlflexibleservers.FeatureStatusEnabled), // }, // { // Name: to.Ptr("Clusters"), - // Status: to.Ptr(armpostgresqlflexibleservers.SupportedFeatureStatusEnumEnabled), + // Status: to.Ptr(armpostgresqlflexibleservers.FeatureStatusEnabled), // }, // { // Name: to.Ptr("ConfigTuning"), - // Status: to.Ptr(armpostgresqlflexibleservers.SupportedFeatureStatusEnumDisabled), + // Status: to.Ptr(armpostgresqlflexibleservers.FeatureStatusDisabled), // }}, - // SupportedServerEditions: []*armpostgresqlflexibleservers.FlexibleServerEditionCapability{ + // SupportedServerEditions: []*armpostgresqlflexibleservers.ServerEditionCapability{ // { // Name: to.Ptr("Burstable"), // DefaultSKUName: to.Ptr("Standard_B1ms"), @@ -273,9 +273,9 @@ func ExampleLocationBasedCapabilitiesClient_NewExecutePager() { // Name: to.Ptr("Standard_B1ms"), // SupportedFeatures: []*armpostgresqlflexibleservers.SupportedFeature{ // }, - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedHaMode: []*armpostgresqlflexibleservers.HighAvailabilityMode{ + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant)}, // SupportedIops: to.Ptr[int32](640), // SupportedMemoryPerVcoreMb: to.Ptr[int64](2048), // SupportedZones: []*string{ @@ -288,9 +288,9 @@ func ExampleLocationBasedCapabilitiesClient_NewExecutePager() { // Name: to.Ptr("Standard_B2s"), // SupportedFeatures: []*armpostgresqlflexibleservers.SupportedFeature{ // }, - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedHaMode: []*armpostgresqlflexibleservers.HighAvailabilityMode{ + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant)}, // SupportedIops: to.Ptr[int32](1280), // SupportedMemoryPerVcoreMb: to.Ptr[int64](2048), // SupportedZones: []*string{ @@ -303,9 +303,9 @@ func ExampleLocationBasedCapabilitiesClient_NewExecutePager() { // Name: to.Ptr("Standard_B2ms"), // SupportedFeatures: []*armpostgresqlflexibleservers.SupportedFeature{ // }, - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedHaMode: []*armpostgresqlflexibleservers.HighAvailabilityMode{ + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant)}, // SupportedIops: to.Ptr[int32](1920), // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), // SupportedZones: []*string{ @@ -318,9 +318,9 @@ func ExampleLocationBasedCapabilitiesClient_NewExecutePager() { // Name: to.Ptr("Standard_B4ms"), // SupportedFeatures: []*armpostgresqlflexibleservers.SupportedFeature{ // }, - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedHaMode: []*armpostgresqlflexibleservers.HighAvailabilityMode{ + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant)}, // SupportedIops: to.Ptr[int32](2880), // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), // SupportedZones: []*string{ @@ -333,9 +333,9 @@ func ExampleLocationBasedCapabilitiesClient_NewExecutePager() { // Name: to.Ptr("Standard_B8ms"), // SupportedFeatures: []*armpostgresqlflexibleservers.SupportedFeature{ // }, - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedHaMode: []*armpostgresqlflexibleservers.HighAvailabilityMode{ + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant)}, // SupportedIops: to.Ptr[int32](4320), // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), // SupportedZones: []*string{ @@ -348,9 +348,9 @@ func ExampleLocationBasedCapabilitiesClient_NewExecutePager() { // Name: to.Ptr("Standard_B12ms"), // SupportedFeatures: []*armpostgresqlflexibleservers.SupportedFeature{ // }, - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedHaMode: []*armpostgresqlflexibleservers.HighAvailabilityMode{ + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant)}, // SupportedIops: to.Ptr[int32](4320), // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), // SupportedZones: []*string{ @@ -363,9 +363,9 @@ func ExampleLocationBasedCapabilitiesClient_NewExecutePager() { // Name: to.Ptr("Standard_B16ms"), // SupportedFeatures: []*armpostgresqlflexibleservers.SupportedFeature{ // }, - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedHaMode: []*armpostgresqlflexibleservers.HighAvailabilityMode{ + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant)}, // SupportedIops: to.Ptr[int32](4320), // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), // SupportedZones: []*string{ @@ -378,9 +378,9 @@ func ExampleLocationBasedCapabilitiesClient_NewExecutePager() { // Name: to.Ptr("Standard_B20ms"), // SupportedFeatures: []*armpostgresqlflexibleservers.SupportedFeature{ // }, - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedHaMode: []*armpostgresqlflexibleservers.HighAvailabilityMode{ + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant)}, // SupportedIops: to.Ptr[int32](4320), // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), // SupportedZones: []*string{ @@ -667,9 +667,9 @@ func ExampleLocationBasedCapabilitiesClient_NewExecutePager() { // Name: to.Ptr("Standard_D2s_v3"), // SupportedFeatures: []*armpostgresqlflexibleservers.SupportedFeature{ // }, - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedHaMode: []*armpostgresqlflexibleservers.HighAvailabilityMode{ + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant)}, // SupportedIops: to.Ptr[int32](3200), // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), // SupportedZones: []*string{ @@ -682,9 +682,9 @@ func ExampleLocationBasedCapabilitiesClient_NewExecutePager() { // Name: to.Ptr("Standard_D4s_v3"), // SupportedFeatures: []*armpostgresqlflexibleservers.SupportedFeature{ // }, - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedHaMode: []*armpostgresqlflexibleservers.HighAvailabilityMode{ + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant)}, // SupportedIops: to.Ptr[int32](6400), // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), // SupportedZones: []*string{ @@ -697,9 +697,9 @@ func ExampleLocationBasedCapabilitiesClient_NewExecutePager() { // Name: to.Ptr("Standard_D8s_v3"), // SupportedFeatures: []*armpostgresqlflexibleservers.SupportedFeature{ // }, - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedHaMode: []*armpostgresqlflexibleservers.HighAvailabilityMode{ + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant)}, // SupportedIops: to.Ptr[int32](12800), // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), // SupportedZones: []*string{ @@ -712,9 +712,9 @@ func ExampleLocationBasedCapabilitiesClient_NewExecutePager() { // Name: to.Ptr("Standard_D16s_v3"), // SupportedFeatures: []*armpostgresqlflexibleservers.SupportedFeature{ // }, - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedHaMode: []*armpostgresqlflexibleservers.HighAvailabilityMode{ + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant)}, // SupportedIops: to.Ptr[int32](25600), // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), // SupportedZones: []*string{ @@ -727,9 +727,9 @@ func ExampleLocationBasedCapabilitiesClient_NewExecutePager() { // Name: to.Ptr("Standard_D32s_v3"), // SupportedFeatures: []*armpostgresqlflexibleservers.SupportedFeature{ // }, - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedHaMode: []*armpostgresqlflexibleservers.HighAvailabilityMode{ + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant)}, // SupportedIops: to.Ptr[int32](51200), // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), // SupportedZones: []*string{ @@ -742,9 +742,9 @@ func ExampleLocationBasedCapabilitiesClient_NewExecutePager() { // Name: to.Ptr("Standard_D48s_v3"), // SupportedFeatures: []*armpostgresqlflexibleservers.SupportedFeature{ // }, - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedHaMode: []*armpostgresqlflexibleservers.HighAvailabilityMode{ + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant)}, // SupportedIops: to.Ptr[int32](76800), // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), // SupportedZones: []*string{ @@ -757,9 +757,9 @@ func ExampleLocationBasedCapabilitiesClient_NewExecutePager() { // Name: to.Ptr("Standard_D64s_v3"), // SupportedFeatures: []*armpostgresqlflexibleservers.SupportedFeature{ // }, - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedHaMode: []*armpostgresqlflexibleservers.HighAvailabilityMode{ + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant)}, // SupportedIops: to.Ptr[int32](80000), // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), // SupportedZones: []*string{ @@ -772,9 +772,9 @@ func ExampleLocationBasedCapabilitiesClient_NewExecutePager() { // Name: to.Ptr("Standard_D2ds_v4"), // SupportedFeatures: []*armpostgresqlflexibleservers.SupportedFeature{ // }, - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedHaMode: []*armpostgresqlflexibleservers.HighAvailabilityMode{ + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant)}, // SupportedIops: to.Ptr[int32](3200), // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), // SupportedZones: []*string{ @@ -787,9 +787,9 @@ func ExampleLocationBasedCapabilitiesClient_NewExecutePager() { // Name: to.Ptr("Standard_D4ds_v4"), // SupportedFeatures: []*armpostgresqlflexibleservers.SupportedFeature{ // }, - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedHaMode: []*armpostgresqlflexibleservers.HighAvailabilityMode{ + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant)}, // SupportedIops: to.Ptr[int32](6400), // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), // SupportedZones: []*string{ @@ -802,9 +802,9 @@ func ExampleLocationBasedCapabilitiesClient_NewExecutePager() { // Name: to.Ptr("Standard_D8ds_v4"), // SupportedFeatures: []*armpostgresqlflexibleservers.SupportedFeature{ // }, - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedHaMode: []*armpostgresqlflexibleservers.HighAvailabilityMode{ + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant)}, // SupportedIops: to.Ptr[int32](12800), // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), // SupportedZones: []*string{ @@ -817,9 +817,9 @@ func ExampleLocationBasedCapabilitiesClient_NewExecutePager() { // Name: to.Ptr("Standard_D16ds_v4"), // SupportedFeatures: []*armpostgresqlflexibleservers.SupportedFeature{ // }, - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedHaMode: []*armpostgresqlflexibleservers.HighAvailabilityMode{ + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant)}, // SupportedIops: to.Ptr[int32](25600), // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), // SupportedZones: []*string{ @@ -832,9 +832,9 @@ func ExampleLocationBasedCapabilitiesClient_NewExecutePager() { // Name: to.Ptr("Standard_D32ds_v4"), // SupportedFeatures: []*armpostgresqlflexibleservers.SupportedFeature{ // }, - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedHaMode: []*armpostgresqlflexibleservers.HighAvailabilityMode{ + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant)}, // SupportedIops: to.Ptr[int32](51200), // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), // SupportedZones: []*string{ @@ -847,9 +847,9 @@ func ExampleLocationBasedCapabilitiesClient_NewExecutePager() { // Name: to.Ptr("Standard_D48ds_v4"), // SupportedFeatures: []*armpostgresqlflexibleservers.SupportedFeature{ // }, - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedHaMode: []*armpostgresqlflexibleservers.HighAvailabilityMode{ + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant)}, // SupportedIops: to.Ptr[int32](76800), // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), // SupportedZones: []*string{ @@ -862,9 +862,9 @@ func ExampleLocationBasedCapabilitiesClient_NewExecutePager() { // Name: to.Ptr("Standard_D64ds_v4"), // SupportedFeatures: []*armpostgresqlflexibleservers.SupportedFeature{ // }, - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedHaMode: []*armpostgresqlflexibleservers.HighAvailabilityMode{ + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant)}, // SupportedIops: to.Ptr[int32](80000), // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), // SupportedZones: []*string{ @@ -877,9 +877,9 @@ func ExampleLocationBasedCapabilitiesClient_NewExecutePager() { // Name: to.Ptr("Standard_D2ads_v5"), // SupportedFeatures: []*armpostgresqlflexibleservers.SupportedFeature{ // }, - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedHaMode: []*armpostgresqlflexibleservers.HighAvailabilityMode{ + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant)}, // SupportedIops: to.Ptr[int32](3200), // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), // SupportedZones: []*string{ @@ -892,9 +892,9 @@ func ExampleLocationBasedCapabilitiesClient_NewExecutePager() { // Name: to.Ptr("Standard_D4ads_v5"), // SupportedFeatures: []*armpostgresqlflexibleservers.SupportedFeature{ // }, - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedHaMode: []*armpostgresqlflexibleservers.HighAvailabilityMode{ + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant)}, // SupportedIops: to.Ptr[int32](6400), // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), // SupportedZones: []*string{ @@ -907,9 +907,9 @@ func ExampleLocationBasedCapabilitiesClient_NewExecutePager() { // Name: to.Ptr("Standard_D8ads_v5"), // SupportedFeatures: []*armpostgresqlflexibleservers.SupportedFeature{ // }, - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedHaMode: []*armpostgresqlflexibleservers.HighAvailabilityMode{ + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant)}, // SupportedIops: to.Ptr[int32](12800), // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), // SupportedZones: []*string{ @@ -922,9 +922,9 @@ func ExampleLocationBasedCapabilitiesClient_NewExecutePager() { // Name: to.Ptr("Standard_D16ads_v5"), // SupportedFeatures: []*armpostgresqlflexibleservers.SupportedFeature{ // }, - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedHaMode: []*armpostgresqlflexibleservers.HighAvailabilityMode{ + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant)}, // SupportedIops: to.Ptr[int32](25600), // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), // SupportedZones: []*string{ @@ -937,9 +937,9 @@ func ExampleLocationBasedCapabilitiesClient_NewExecutePager() { // Name: to.Ptr("Standard_D32ads_v5"), // SupportedFeatures: []*armpostgresqlflexibleservers.SupportedFeature{ // }, - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedHaMode: []*armpostgresqlflexibleservers.HighAvailabilityMode{ + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant)}, // SupportedIops: to.Ptr[int32](51200), // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), // SupportedZones: []*string{ @@ -952,9 +952,9 @@ func ExampleLocationBasedCapabilitiesClient_NewExecutePager() { // Name: to.Ptr("Standard_D48ads_v5"), // SupportedFeatures: []*armpostgresqlflexibleservers.SupportedFeature{ // }, - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedHaMode: []*armpostgresqlflexibleservers.HighAvailabilityMode{ + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant)}, // SupportedIops: to.Ptr[int32](76800), // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), // SupportedZones: []*string{ @@ -967,9 +967,9 @@ func ExampleLocationBasedCapabilitiesClient_NewExecutePager() { // Name: to.Ptr("Standard_D64ads_v5"), // SupportedFeatures: []*armpostgresqlflexibleservers.SupportedFeature{ // }, - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedHaMode: []*armpostgresqlflexibleservers.HighAvailabilityMode{ + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant)}, // SupportedIops: to.Ptr[int32](80000), // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), // SupportedZones: []*string{ @@ -982,9 +982,9 @@ func ExampleLocationBasedCapabilitiesClient_NewExecutePager() { // Name: to.Ptr("Standard_D96ads_v5"), // SupportedFeatures: []*armpostgresqlflexibleservers.SupportedFeature{ // }, - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedHaMode: []*armpostgresqlflexibleservers.HighAvailabilityMode{ + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant)}, // SupportedIops: to.Ptr[int32](80000), // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), // SupportedZones: []*string{ @@ -997,9 +997,9 @@ func ExampleLocationBasedCapabilitiesClient_NewExecutePager() { // Name: to.Ptr("Standard_D2ds_v5"), // SupportedFeatures: []*armpostgresqlflexibleservers.SupportedFeature{ // }, - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedHaMode: []*armpostgresqlflexibleservers.HighAvailabilityMode{ + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant)}, // SupportedIops: to.Ptr[int32](3750), // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), // SupportedZones: []*string{ @@ -1012,9 +1012,9 @@ func ExampleLocationBasedCapabilitiesClient_NewExecutePager() { // Name: to.Ptr("Standard_D4ds_v5"), // SupportedFeatures: []*armpostgresqlflexibleservers.SupportedFeature{ // }, - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedHaMode: []*armpostgresqlflexibleservers.HighAvailabilityMode{ + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant)}, // SupportedIops: to.Ptr[int32](6400), // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), // SupportedZones: []*string{ @@ -1027,9 +1027,9 @@ func ExampleLocationBasedCapabilitiesClient_NewExecutePager() { // Name: to.Ptr("Standard_D8ds_v5"), // SupportedFeatures: []*armpostgresqlflexibleservers.SupportedFeature{ // }, - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedHaMode: []*armpostgresqlflexibleservers.HighAvailabilityMode{ + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant)}, // SupportedIops: to.Ptr[int32](12800), // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), // SupportedZones: []*string{ @@ -1042,9 +1042,9 @@ func ExampleLocationBasedCapabilitiesClient_NewExecutePager() { // Name: to.Ptr("Standard_D16ds_v5"), // SupportedFeatures: []*armpostgresqlflexibleservers.SupportedFeature{ // }, - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedHaMode: []*armpostgresqlflexibleservers.HighAvailabilityMode{ + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant)}, // SupportedIops: to.Ptr[int32](25600), // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), // SupportedZones: []*string{ @@ -1057,9 +1057,9 @@ func ExampleLocationBasedCapabilitiesClient_NewExecutePager() { // Name: to.Ptr("Standard_D32ds_v5"), // SupportedFeatures: []*armpostgresqlflexibleservers.SupportedFeature{ // }, - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedHaMode: []*armpostgresqlflexibleservers.HighAvailabilityMode{ + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant)}, // SupportedIops: to.Ptr[int32](51200), // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), // SupportedZones: []*string{ @@ -1072,9 +1072,9 @@ func ExampleLocationBasedCapabilitiesClient_NewExecutePager() { // Name: to.Ptr("Standard_D48ds_v5"), // SupportedFeatures: []*armpostgresqlflexibleservers.SupportedFeature{ // }, - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedHaMode: []*armpostgresqlflexibleservers.HighAvailabilityMode{ + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant)}, // SupportedIops: to.Ptr[int32](76800), // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), // SupportedZones: []*string{ @@ -1087,9 +1087,9 @@ func ExampleLocationBasedCapabilitiesClient_NewExecutePager() { // Name: to.Ptr("Standard_D64ds_v5"), // SupportedFeatures: []*armpostgresqlflexibleservers.SupportedFeature{ // }, - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedHaMode: []*armpostgresqlflexibleservers.HighAvailabilityMode{ + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant)}, // SupportedIops: to.Ptr[int32](80000), // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), // SupportedZones: []*string{ @@ -1102,9 +1102,9 @@ func ExampleLocationBasedCapabilitiesClient_NewExecutePager() { // Name: to.Ptr("Standard_D96ds_v5"), // SupportedFeatures: []*armpostgresqlflexibleservers.SupportedFeature{ // }, - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedHaMode: []*armpostgresqlflexibleservers.HighAvailabilityMode{ + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant)}, // SupportedIops: to.Ptr[int32](80000), // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), // SupportedZones: []*string{ @@ -1381,25 +1381,6 @@ func ExampleLocationBasedCapabilitiesClient_NewExecutePager() { // SupportedMaximumThroughput: to.Ptr[int32](1200), // SupportedThroughput: to.Ptr[int32](125), // }}, - // }, - // { - // Name: to.Ptr("UltraDisk"), - // DefaultStorageSizeMb: to.Ptr[int64](65536), - // SupportedStorageMb: []*armpostgresqlflexibleservers.StorageMbCapability{ - // { - // DefaultIopsTier: to.Ptr("None"), - // MaximumStorageSizeMb: to.Ptr[int64](67108864), - // StorageSizeMb: to.Ptr[int64](32768), - // SupportedIops: to.Ptr[int32](4800), - // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("None"), - // Iops: to.Ptr[int32](0), - // }}, - // SupportedMaximumIops: to.Ptr[int32](400000), - // SupportedMaximumThroughput: to.Ptr[int32](10000), - // SupportedThroughput: to.Ptr[int32](1200), - // }}, // }}, // }, // { @@ -1410,9 +1391,9 @@ func ExampleLocationBasedCapabilitiesClient_NewExecutePager() { // Name: to.Ptr("Standard_E2s_v3"), // SupportedFeatures: []*armpostgresqlflexibleservers.SupportedFeature{ // }, - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedHaMode: []*armpostgresqlflexibleservers.HighAvailabilityMode{ + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant)}, // SupportedIops: to.Ptr[int32](3200), // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), // SupportedZones: []*string{ @@ -1425,9 +1406,9 @@ func ExampleLocationBasedCapabilitiesClient_NewExecutePager() { // Name: to.Ptr("Standard_E4s_v3"), // SupportedFeatures: []*armpostgresqlflexibleservers.SupportedFeature{ // }, - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedHaMode: []*armpostgresqlflexibleservers.HighAvailabilityMode{ + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant)}, // SupportedIops: to.Ptr[int32](6400), // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), // SupportedZones: []*string{ @@ -1440,9 +1421,9 @@ func ExampleLocationBasedCapabilitiesClient_NewExecutePager() { // Name: to.Ptr("Standard_E8s_v3"), // SupportedFeatures: []*armpostgresqlflexibleservers.SupportedFeature{ // }, - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedHaMode: []*armpostgresqlflexibleservers.HighAvailabilityMode{ + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant)}, // SupportedIops: to.Ptr[int32](12800), // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), // SupportedZones: []*string{ @@ -1455,9 +1436,9 @@ func ExampleLocationBasedCapabilitiesClient_NewExecutePager() { // Name: to.Ptr("Standard_E16s_v3"), // SupportedFeatures: []*armpostgresqlflexibleservers.SupportedFeature{ // }, - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedHaMode: []*armpostgresqlflexibleservers.HighAvailabilityMode{ + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant)}, // SupportedIops: to.Ptr[int32](25600), // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), // SupportedZones: []*string{ @@ -1470,9 +1451,9 @@ func ExampleLocationBasedCapabilitiesClient_NewExecutePager() { // Name: to.Ptr("Standard_E32s_v3"), // SupportedFeatures: []*armpostgresqlflexibleservers.SupportedFeature{ // }, - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedHaMode: []*armpostgresqlflexibleservers.HighAvailabilityMode{ + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant)}, // SupportedIops: to.Ptr[int32](32000), // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), // SupportedZones: []*string{ @@ -1485,9 +1466,9 @@ func ExampleLocationBasedCapabilitiesClient_NewExecutePager() { // Name: to.Ptr("Standard_E48s_v3"), // SupportedFeatures: []*armpostgresqlflexibleservers.SupportedFeature{ // }, - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedHaMode: []*armpostgresqlflexibleservers.HighAvailabilityMode{ + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant)}, // SupportedIops: to.Ptr[int32](51200), // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), // SupportedZones: []*string{ @@ -1500,9 +1481,9 @@ func ExampleLocationBasedCapabilitiesClient_NewExecutePager() { // Name: to.Ptr("Standard_E64s_v3"), // SupportedFeatures: []*armpostgresqlflexibleservers.SupportedFeature{ // }, - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedHaMode: []*armpostgresqlflexibleservers.HighAvailabilityMode{ + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant)}, // SupportedIops: to.Ptr[int32](76800), // SupportedMemoryPerVcoreMb: to.Ptr[int64](6912), // SupportedZones: []*string{ @@ -1515,9 +1496,9 @@ func ExampleLocationBasedCapabilitiesClient_NewExecutePager() { // Name: to.Ptr("Standard_E2ds_v4"), // SupportedFeatures: []*armpostgresqlflexibleservers.SupportedFeature{ // }, - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedHaMode: []*armpostgresqlflexibleservers.HighAvailabilityMode{ + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant)}, // SupportedIops: to.Ptr[int32](3200), // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), // SupportedZones: []*string{ @@ -1530,9 +1511,9 @@ func ExampleLocationBasedCapabilitiesClient_NewExecutePager() { // Name: to.Ptr("Standard_E4ds_v4"), // SupportedFeatures: []*armpostgresqlflexibleservers.SupportedFeature{ // }, - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedHaMode: []*armpostgresqlflexibleservers.HighAvailabilityMode{ + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant)}, // SupportedIops: to.Ptr[int32](6400), // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), // SupportedZones: []*string{ @@ -1545,9 +1526,9 @@ func ExampleLocationBasedCapabilitiesClient_NewExecutePager() { // Name: to.Ptr("Standard_E8ds_v4"), // SupportedFeatures: []*armpostgresqlflexibleservers.SupportedFeature{ // }, - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedHaMode: []*armpostgresqlflexibleservers.HighAvailabilityMode{ + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant)}, // SupportedIops: to.Ptr[int32](12800), // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), // SupportedZones: []*string{ @@ -1560,9 +1541,9 @@ func ExampleLocationBasedCapabilitiesClient_NewExecutePager() { // Name: to.Ptr("Standard_E16ds_v4"), // SupportedFeatures: []*armpostgresqlflexibleservers.SupportedFeature{ // }, - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedHaMode: []*armpostgresqlflexibleservers.HighAvailabilityMode{ + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant)}, // SupportedIops: to.Ptr[int32](25600), // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), // SupportedZones: []*string{ @@ -1575,9 +1556,9 @@ func ExampleLocationBasedCapabilitiesClient_NewExecutePager() { // Name: to.Ptr("Standard_E20ds_v4"), // SupportedFeatures: []*armpostgresqlflexibleservers.SupportedFeature{ // }, - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedHaMode: []*armpostgresqlflexibleservers.HighAvailabilityMode{ + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant)}, // SupportedIops: to.Ptr[int32](32000), // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), // SupportedZones: []*string{ @@ -1590,9 +1571,9 @@ func ExampleLocationBasedCapabilitiesClient_NewExecutePager() { // Name: to.Ptr("Standard_E32ds_v4"), // SupportedFeatures: []*armpostgresqlflexibleservers.SupportedFeature{ // }, - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedHaMode: []*armpostgresqlflexibleservers.HighAvailabilityMode{ + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant)}, // SupportedIops: to.Ptr[int32](51200), // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), // SupportedZones: []*string{ @@ -1605,9 +1586,9 @@ func ExampleLocationBasedCapabilitiesClient_NewExecutePager() { // Name: to.Ptr("Standard_E48ds_v4"), // SupportedFeatures: []*armpostgresqlflexibleservers.SupportedFeature{ // }, - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedHaMode: []*armpostgresqlflexibleservers.HighAvailabilityMode{ + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant)}, // SupportedIops: to.Ptr[int32](76800), // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), // SupportedZones: []*string{ @@ -1620,9 +1601,9 @@ func ExampleLocationBasedCapabilitiesClient_NewExecutePager() { // Name: to.Ptr("Standard_E64ds_v4"), // SupportedFeatures: []*armpostgresqlflexibleservers.SupportedFeature{ // }, - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedHaMode: []*armpostgresqlflexibleservers.HighAvailabilityMode{ + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant)}, // SupportedIops: to.Ptr[int32](80000), // SupportedMemoryPerVcoreMb: to.Ptr[int64](6912), // SupportedZones: []*string{ @@ -1635,9 +1616,9 @@ func ExampleLocationBasedCapabilitiesClient_NewExecutePager() { // Name: to.Ptr("Standard_E2ads_v5"), // SupportedFeatures: []*armpostgresqlflexibleservers.SupportedFeature{ // }, - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedHaMode: []*armpostgresqlflexibleservers.HighAvailabilityMode{ + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant)}, // SupportedIops: to.Ptr[int32](3750), // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), // SupportedZones: []*string{ @@ -1650,9 +1631,9 @@ func ExampleLocationBasedCapabilitiesClient_NewExecutePager() { // Name: to.Ptr("Standard_E4ads_v5"), // SupportedFeatures: []*armpostgresqlflexibleservers.SupportedFeature{ // }, - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedHaMode: []*armpostgresqlflexibleservers.HighAvailabilityMode{ + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant)}, // SupportedIops: to.Ptr[int32](6400), // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), // SupportedZones: []*string{ @@ -1665,9 +1646,9 @@ func ExampleLocationBasedCapabilitiesClient_NewExecutePager() { // Name: to.Ptr("Standard_E8ads_v5"), // SupportedFeatures: []*armpostgresqlflexibleservers.SupportedFeature{ // }, - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedHaMode: []*armpostgresqlflexibleservers.HighAvailabilityMode{ + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant)}, // SupportedIops: to.Ptr[int32](12800), // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), // SupportedZones: []*string{ @@ -1680,9 +1661,9 @@ func ExampleLocationBasedCapabilitiesClient_NewExecutePager() { // Name: to.Ptr("Standard_E16ads_v5"), // SupportedFeatures: []*armpostgresqlflexibleservers.SupportedFeature{ // }, - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedHaMode: []*armpostgresqlflexibleservers.HighAvailabilityMode{ + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant)}, // SupportedIops: to.Ptr[int32](25600), // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), // SupportedZones: []*string{ @@ -1695,9 +1676,9 @@ func ExampleLocationBasedCapabilitiesClient_NewExecutePager() { // Name: to.Ptr("Standard_E20ads_v5"), // SupportedFeatures: []*armpostgresqlflexibleservers.SupportedFeature{ // }, - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedHaMode: []*armpostgresqlflexibleservers.HighAvailabilityMode{ + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant)}, // SupportedIops: to.Ptr[int32](32000), // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), // SupportedZones: []*string{ @@ -1710,9 +1691,9 @@ func ExampleLocationBasedCapabilitiesClient_NewExecutePager() { // Name: to.Ptr("Standard_E32ads_v5"), // SupportedFeatures: []*armpostgresqlflexibleservers.SupportedFeature{ // }, - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedHaMode: []*armpostgresqlflexibleservers.HighAvailabilityMode{ + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant)}, // SupportedIops: to.Ptr[int32](51200), // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), // SupportedZones: []*string{ @@ -1725,9 +1706,9 @@ func ExampleLocationBasedCapabilitiesClient_NewExecutePager() { // Name: to.Ptr("Standard_E48ads_v5"), // SupportedFeatures: []*armpostgresqlflexibleservers.SupportedFeature{ // }, - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedHaMode: []*armpostgresqlflexibleservers.HighAvailabilityMode{ + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant)}, // SupportedIops: to.Ptr[int32](76800), // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), // SupportedZones: []*string{ @@ -1740,9 +1721,9 @@ func ExampleLocationBasedCapabilitiesClient_NewExecutePager() { // Name: to.Ptr("Standard_E64ads_v5"), // SupportedFeatures: []*armpostgresqlflexibleservers.SupportedFeature{ // }, - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedHaMode: []*armpostgresqlflexibleservers.HighAvailabilityMode{ + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant)}, // SupportedIops: to.Ptr[int32](80000), // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), // SupportedZones: []*string{ @@ -1755,9 +1736,9 @@ func ExampleLocationBasedCapabilitiesClient_NewExecutePager() { // Name: to.Ptr("Standard_E96ads_v5"), // SupportedFeatures: []*armpostgresqlflexibleservers.SupportedFeature{ // }, - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedHaMode: []*armpostgresqlflexibleservers.HighAvailabilityMode{ + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant)}, // SupportedIops: to.Ptr[int32](80000), // SupportedMemoryPerVcoreMb: to.Ptr[int64](7168), // SupportedZones: []*string{ @@ -1770,9 +1751,9 @@ func ExampleLocationBasedCapabilitiesClient_NewExecutePager() { // Name: to.Ptr("Standard_E2ds_v5"), // SupportedFeatures: []*armpostgresqlflexibleservers.SupportedFeature{ // }, - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedHaMode: []*armpostgresqlflexibleservers.HighAvailabilityMode{ + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant)}, // SupportedIops: to.Ptr[int32](3750), // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), // SupportedZones: []*string{ @@ -1785,9 +1766,9 @@ func ExampleLocationBasedCapabilitiesClient_NewExecutePager() { // Name: to.Ptr("Standard_E4ds_v5"), // SupportedFeatures: []*armpostgresqlflexibleservers.SupportedFeature{ // }, - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedHaMode: []*armpostgresqlflexibleservers.HighAvailabilityMode{ + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant)}, // SupportedIops: to.Ptr[int32](6400), // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), // SupportedZones: []*string{ @@ -1800,9 +1781,9 @@ func ExampleLocationBasedCapabilitiesClient_NewExecutePager() { // Name: to.Ptr("Standard_E8ds_v5"), // SupportedFeatures: []*armpostgresqlflexibleservers.SupportedFeature{ // }, - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedHaMode: []*armpostgresqlflexibleservers.HighAvailabilityMode{ + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant)}, // SupportedIops: to.Ptr[int32](12800), // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), // SupportedZones: []*string{ @@ -1815,9 +1796,9 @@ func ExampleLocationBasedCapabilitiesClient_NewExecutePager() { // Name: to.Ptr("Standard_E16ds_v5"), // SupportedFeatures: []*armpostgresqlflexibleservers.SupportedFeature{ // }, - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedHaMode: []*armpostgresqlflexibleservers.HighAvailabilityMode{ + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant)}, // SupportedIops: to.Ptr[int32](25600), // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), // SupportedZones: []*string{ @@ -1830,9 +1811,9 @@ func ExampleLocationBasedCapabilitiesClient_NewExecutePager() { // Name: to.Ptr("Standard_E20ds_v5"), // SupportedFeatures: []*armpostgresqlflexibleservers.SupportedFeature{ // }, - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedHaMode: []*armpostgresqlflexibleservers.HighAvailabilityMode{ + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant)}, // SupportedIops: to.Ptr[int32](32000), // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), // SupportedZones: []*string{ @@ -1845,9 +1826,9 @@ func ExampleLocationBasedCapabilitiesClient_NewExecutePager() { // Name: to.Ptr("Standard_E32ds_v5"), // SupportedFeatures: []*armpostgresqlflexibleservers.SupportedFeature{ // }, - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedHaMode: []*armpostgresqlflexibleservers.HighAvailabilityMode{ + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant)}, // SupportedIops: to.Ptr[int32](51200), // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), // SupportedZones: []*string{ @@ -1860,9 +1841,9 @@ func ExampleLocationBasedCapabilitiesClient_NewExecutePager() { // Name: to.Ptr("Standard_E48ds_v5"), // SupportedFeatures: []*armpostgresqlflexibleservers.SupportedFeature{ // }, - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedHaMode: []*armpostgresqlflexibleservers.HighAvailabilityMode{ + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant)}, // SupportedIops: to.Ptr[int32](76800), // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), // SupportedZones: []*string{ @@ -1875,9 +1856,9 @@ func ExampleLocationBasedCapabilitiesClient_NewExecutePager() { // Name: to.Ptr("Standard_E64ds_v5"), // SupportedFeatures: []*armpostgresqlflexibleservers.SupportedFeature{ // }, - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedHaMode: []*armpostgresqlflexibleservers.HighAvailabilityMode{ + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant)}, // SupportedIops: to.Ptr[int32](80000), // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), // SupportedZones: []*string{ @@ -1890,9 +1871,9 @@ func ExampleLocationBasedCapabilitiesClient_NewExecutePager() { // Name: to.Ptr("Standard_E96ds_v5"), // SupportedFeatures: []*armpostgresqlflexibleservers.SupportedFeature{ // }, - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedHaMode: []*armpostgresqlflexibleservers.HighAvailabilityMode{ + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant)}, // SupportedIops: to.Ptr[int32](80000), // SupportedMemoryPerVcoreMb: to.Ptr[int64](7168), // SupportedZones: []*string{ @@ -2169,25 +2150,6 @@ func ExampleLocationBasedCapabilitiesClient_NewExecutePager() { // SupportedMaximumThroughput: to.Ptr[int32](1200), // SupportedThroughput: to.Ptr[int32](125), // }}, - // }, - // { - // Name: to.Ptr("UltraDisk"), - // DefaultStorageSizeMb: to.Ptr[int64](131072), - // SupportedStorageMb: []*armpostgresqlflexibleservers.StorageMbCapability{ - // { - // DefaultIopsTier: to.Ptr("None"), - // MaximumStorageSizeMb: to.Ptr[int64](67108864), - // StorageSizeMb: to.Ptr[int64](32768), - // SupportedIops: to.Ptr[int32](4800), - // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("None"), - // Iops: to.Ptr[int32](0), - // }}, - // SupportedMaximumIops: to.Ptr[int32](400000), - // SupportedMaximumThroughput: to.Ptr[int32](10000), - // SupportedThroughput: to.Ptr[int32](1200), - // }}, // }}, // }}, // SupportedServerVersions: []*armpostgresqlflexibleservers.ServerVersionCapability{ @@ -2200,7 +2162,9 @@ func ExampleLocationBasedCapabilitiesClient_NewExecutePager() { // to.Ptr("13"), // to.Ptr("14"), // to.Ptr("15"), - // to.Ptr("16")}, + // to.Ptr("16"), + // to.Ptr("17"), + // to.Ptr("18")}, // }, // { // Name: to.Ptr("12"), @@ -2210,7 +2174,9 @@ func ExampleLocationBasedCapabilitiesClient_NewExecutePager() { // to.Ptr("13"), // to.Ptr("14"), // to.Ptr("15"), - // to.Ptr("16")}, + // to.Ptr("16"), + // to.Ptr("17"), + // to.Ptr("18")}, // }, // { // Name: to.Ptr("13"), @@ -2219,7 +2185,9 @@ func ExampleLocationBasedCapabilitiesClient_NewExecutePager() { // SupportedVersionsToUpgrade: []*string{ // to.Ptr("14"), // to.Ptr("15"), - // to.Ptr("16")}, + // to.Ptr("16"), + // to.Ptr("17"), + // to.Ptr("18")}, // }, // { // Name: to.Ptr("14"), @@ -2227,32 +2195,44 @@ func ExampleLocationBasedCapabilitiesClient_NewExecutePager() { // }, // SupportedVersionsToUpgrade: []*string{ // to.Ptr("15"), - // to.Ptr("16")}, + // to.Ptr("16"), + // to.Ptr("17"), + // to.Ptr("18")}, // }, // { // Name: to.Ptr("15"), // SupportedFeatures: []*armpostgresqlflexibleservers.SupportedFeature{ // }, // SupportedVersionsToUpgrade: []*string{ - // to.Ptr("16")}, + // to.Ptr("16"), + // to.Ptr("17"), + // to.Ptr("18")}, // }, // { // Name: to.Ptr("16"), // SupportedFeatures: []*armpostgresqlflexibleservers.SupportedFeature{ // }, // SupportedVersionsToUpgrade: []*string{ + // to.Ptr("17"), + // to.Ptr("18")}, // }, - // }, - // { - // Name: to.Ptr("17"), - // SupportedFeatures: []*armpostgresqlflexibleservers.SupportedFeature{ - // }, - // SupportedVersionsToUpgrade: []*string{ - // }, + // { + // Name: to.Ptr("17"), + // SupportedFeatures: []*armpostgresqlflexibleservers.SupportedFeature{ + // }, + // SupportedVersionsToUpgrade: []*string{ + // to.Ptr("18")}, + // }, + // { + // Name: to.Ptr("18"), + // SupportedFeatures: []*armpostgresqlflexibleservers.SupportedFeature{ + // }, + // SupportedVersionsToUpgrade: []*string{ + // }, + // }}, + // ZoneRedundantHaAndGeoBackupSupported: to.Ptr(armpostgresqlflexibleservers.ZoneRedundantHighAvailabilityAndGeographicallyRedundantBackupSupportEnabled), + // ZoneRedundantHaSupported: to.Ptr(armpostgresqlflexibleservers.ZoneRedundantHighAvailabilitySupportEnabled), // }}, - // ZoneRedundantHaAndGeoBackupSupported: to.Ptr(armpostgresqlflexibleservers.ZoneRedundantHaAndGeoBackupSupportedEnumEnabled), - // ZoneRedundantHaSupported: to.Ptr(armpostgresqlflexibleservers.ZoneRedundantHaSupportedEnumEnabled), - // }}, - // } + // } } } diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/servercapabilities_client.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/capabilitiesbyserver_client.go similarity index 58% rename from sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/servercapabilities_client.go rename to sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/capabilitiesbyserver_client.go index f7d6ce73dd01..d178a3e79f67 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/servercapabilities_client.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/capabilitiesbyserver_client.go @@ -17,43 +17,43 @@ import ( "strings" ) -// ServerCapabilitiesClient contains the methods for the ServerCapabilities group. -// Don't use this type directly, use NewServerCapabilitiesClient() instead. -type ServerCapabilitiesClient struct { +// CapabilitiesByServerClient contains the methods for the CapabilitiesByServer group. +// Don't use this type directly, use NewCapabilitiesByServerClient() instead. +type CapabilitiesByServerClient struct { internal *arm.Client subscriptionID string } -// NewServerCapabilitiesClient creates a new instance of ServerCapabilitiesClient with the specified values. +// NewCapabilitiesByServerClient creates a new instance of CapabilitiesByServerClient with the specified values. // - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewServerCapabilitiesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ServerCapabilitiesClient, error) { +// - options - Contains optional client configuration. Pass nil to accept the default values. +func NewCapabilitiesByServerClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*CapabilitiesByServerClient, error) { cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) if err != nil { return nil, err } - client := &ServerCapabilitiesClient{ + client := &CapabilitiesByServerClient{ subscriptionID: subscriptionID, internal: cl, } return client, nil } -// NewListPager - Get capabilities for a flexible server. +// NewListPager - Lists the capabilities available for a given server. // -// Generated from API version 2025-01-01-preview +// Generated from API version 2025-08-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. -// - options - ServerCapabilitiesClientListOptions contains the optional parameters for the ServerCapabilitiesClient.NewListPager +// - options - CapabilitiesByServerClientListOptions contains the optional parameters for the CapabilitiesByServerClient.NewListPager // method. -func (client *ServerCapabilitiesClient) NewListPager(resourceGroupName string, serverName string, options *ServerCapabilitiesClientListOptions) *runtime.Pager[ServerCapabilitiesClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[ServerCapabilitiesClientListResponse]{ - More: func(page ServerCapabilitiesClientListResponse) bool { +func (client *CapabilitiesByServerClient) NewListPager(resourceGroupName string, serverName string, options *CapabilitiesByServerClientListOptions) *runtime.Pager[CapabilitiesByServerClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[CapabilitiesByServerClientListResponse]{ + More: func(page CapabilitiesByServerClientListResponse) bool { return page.NextLink != nil && len(*page.NextLink) > 0 }, - Fetcher: func(ctx context.Context, page *ServerCapabilitiesClientListResponse) (ServerCapabilitiesClientListResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "ServerCapabilitiesClient.NewListPager") + Fetcher: func(ctx context.Context, page *CapabilitiesByServerClientListResponse) (CapabilitiesByServerClientListResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "CapabilitiesByServerClient.NewListPager") nextLink := "" if page != nil { nextLink = *page.NextLink @@ -62,7 +62,7 @@ func (client *ServerCapabilitiesClient) NewListPager(resourceGroupName string, s return client.listCreateRequest(ctx, resourceGroupName, serverName, options) }, nil) if err != nil { - return ServerCapabilitiesClientListResponse{}, err + return CapabilitiesByServerClientListResponse{}, err } return client.listHandleResponse(resp) }, @@ -71,7 +71,7 @@ func (client *ServerCapabilitiesClient) NewListPager(resourceGroupName string, s } // listCreateRequest creates the List request. -func (client *ServerCapabilitiesClient) listCreateRequest(ctx context.Context, resourceGroupName string, serverName string, _ *ServerCapabilitiesClientListOptions) (*policy.Request, error) { +func (client *CapabilitiesByServerClient) listCreateRequest(ctx context.Context, resourceGroupName string, serverName string, _ *CapabilitiesByServerClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/capabilities" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -90,17 +90,17 @@ func (client *ServerCapabilitiesClient) listCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-01-01-preview") + reqQP.Set("api-version", "2025-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } // listHandleResponse handles the List response. -func (client *ServerCapabilitiesClient) listHandleResponse(resp *http.Response) (ServerCapabilitiesClientListResponse, error) { - result := ServerCapabilitiesClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.CapabilitiesListResult); err != nil { - return ServerCapabilitiesClientListResponse{}, err +func (client *CapabilitiesByServerClient) listHandleResponse(resp *http.Response) (CapabilitiesByServerClientListResponse, error) { + result := CapabilitiesByServerClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.CapabilityList); err != nil { + return CapabilitiesByServerClientListResponse{}, err } return result, nil } diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/servercapabilities_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/capabilitiesbyserver_client_example_test.go similarity index 92% rename from sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/servercapabilities_client_example_test.go rename to sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/capabilitiesbyserver_client_example_test.go index a298045c86ba..6ad88e4af009 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/servercapabilities_client_example_test.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/capabilitiesbyserver_client_example_test.go @@ -17,8 +17,8 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v5" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b1f4d539964453ce8008e4b069e59885e12ba441/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ServerCapabilities.json -func ExampleServerCapabilitiesClient_NewListPager() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/735d21dbd7e1cc446babf58860af4cca757d620d/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/CapabilitiesByServerList.json +func ExampleCapabilitiesByServerClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -28,7 +28,7 @@ func ExampleServerCapabilitiesClient_NewListPager() { if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewServerCapabilitiesClient().NewListPager("testrg", "pgtestsvc4", nil) + pager := clientFactory.NewCapabilitiesByServerClient().NewListPager("exampleresourcegroup", "exampleserver", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -39,15 +39,15 @@ func ExampleServerCapabilitiesClient_NewListPager() { _ = v } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.CapabilitiesListResult = armpostgresqlflexibleservers.CapabilitiesListResult{ - // Value: []*armpostgresqlflexibleservers.FlexibleServerCapability{ + // page.CapabilityList = armpostgresqlflexibleservers.CapabilityList{ + // Value: []*armpostgresqlflexibleservers.Capability{ // { // Name: to.Ptr("FlexibleServerCapabilities"), - // FastProvisioningSupported: to.Ptr(armpostgresqlflexibleservers.FastProvisioningSupportedEnumEnabled), - // GeoBackupSupported: to.Ptr(armpostgresqlflexibleservers.GeoBackupSupportedEnumEnabled), - // OnlineResizeSupported: to.Ptr(armpostgresqlflexibleservers.OnlineResizeSupportedEnumEnabled), - // Restricted: to.Ptr(armpostgresqlflexibleservers.RestrictedEnumDisabled), - // StorageAutoGrowthSupported: to.Ptr(armpostgresqlflexibleservers.StorageAutoGrowthSupportedEnumEnabled), + // FastProvisioningSupported: to.Ptr(armpostgresqlflexibleservers.FastProvisioningSupportEnabled), + // GeoBackupSupported: to.Ptr(armpostgresqlflexibleservers.GeographicallyRedundantBackupSupportEnabled), + // OnlineResizeSupported: to.Ptr(armpostgresqlflexibleservers.OnlineStorageResizeSupportEnabled), + // Restricted: to.Ptr(armpostgresqlflexibleservers.LocationRestrictedDisabled), + // StorageAutoGrowthSupported: to.Ptr(armpostgresqlflexibleservers.StorageAutoGrowthSupportEnabled), // SupportedFastProvisioningEditions: []*armpostgresqlflexibleservers.FastProvisioningEditionCapability{ // { // ServerCount: to.Ptr[int32](0), @@ -227,41 +227,41 @@ func ExampleServerCapabilitiesClient_NewListPager() { // SupportedFeatures: []*armpostgresqlflexibleservers.SupportedFeature{ // { // Name: to.Ptr("FastProvisioning"), - // Status: to.Ptr(armpostgresqlflexibleservers.SupportedFeatureStatusEnumEnabled), + // Status: to.Ptr(armpostgresqlflexibleservers.FeatureStatusEnabled), // }, // { // Name: to.Ptr("ZoneRedundantHa"), - // Status: to.Ptr(armpostgresqlflexibleservers.SupportedFeatureStatusEnumEnabled), + // Status: to.Ptr(armpostgresqlflexibleservers.FeatureStatusEnabled), // }, // { // Name: to.Ptr("GeoBackup"), - // Status: to.Ptr(armpostgresqlflexibleservers.SupportedFeatureStatusEnumEnabled), + // Status: to.Ptr(armpostgresqlflexibleservers.FeatureStatusEnabled), // }, // { // Name: to.Ptr("ZoneRedundantHaAndGeoBackup"), - // Status: to.Ptr(armpostgresqlflexibleservers.SupportedFeatureStatusEnumEnabled), + // Status: to.Ptr(armpostgresqlflexibleservers.FeatureStatusEnabled), // }, // { // Name: to.Ptr("StorageAutoGrowth"), - // Status: to.Ptr(armpostgresqlflexibleservers.SupportedFeatureStatusEnumEnabled), + // Status: to.Ptr(armpostgresqlflexibleservers.FeatureStatusEnabled), // }, // { // Name: to.Ptr("OnlineResize"), - // Status: to.Ptr(armpostgresqlflexibleservers.SupportedFeatureStatusEnumEnabled), + // Status: to.Ptr(armpostgresqlflexibleservers.FeatureStatusEnabled), // }, // { // Name: to.Ptr("OfferRestricted"), - // Status: to.Ptr(armpostgresqlflexibleservers.SupportedFeatureStatusEnumDisabled), + // Status: to.Ptr(armpostgresqlflexibleservers.FeatureStatusDisabled), // }, // { // Name: to.Ptr("IndexTuning"), - // Status: to.Ptr(armpostgresqlflexibleservers.SupportedFeatureStatusEnumEnabled), + // Status: to.Ptr(armpostgresqlflexibleservers.FeatureStatusEnabled), // }, // { // Name: to.Ptr("Clusters"), - // Status: to.Ptr(armpostgresqlflexibleservers.SupportedFeatureStatusEnumEnabled), + // Status: to.Ptr(armpostgresqlflexibleservers.FeatureStatusEnabled), // }}, - // SupportedServerEditions: []*armpostgresqlflexibleservers.FlexibleServerEditionCapability{ + // SupportedServerEditions: []*armpostgresqlflexibleservers.ServerEditionCapability{ // { // Name: to.Ptr("Burstable"), // DefaultSKUName: to.Ptr("Standard_B1ms"), @@ -270,9 +270,9 @@ func ExampleServerCapabilitiesClient_NewListPager() { // Name: to.Ptr("Standard_B1ms"), // SupportedFeatures: []*armpostgresqlflexibleservers.SupportedFeature{ // }, - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedHaMode: []*armpostgresqlflexibleservers.HighAvailabilityMode{ + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant)}, // SupportedIops: to.Ptr[int32](640), // SupportedMemoryPerVcoreMb: to.Ptr[int64](2048), // SupportedZones: []*string{ @@ -285,9 +285,9 @@ func ExampleServerCapabilitiesClient_NewListPager() { // Name: to.Ptr("Standard_B2s"), // SupportedFeatures: []*armpostgresqlflexibleservers.SupportedFeature{ // }, - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedHaMode: []*armpostgresqlflexibleservers.HighAvailabilityMode{ + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant)}, // SupportedIops: to.Ptr[int32](1280), // SupportedMemoryPerVcoreMb: to.Ptr[int64](2048), // SupportedZones: []*string{ @@ -300,9 +300,9 @@ func ExampleServerCapabilitiesClient_NewListPager() { // Name: to.Ptr("Standard_B2ms"), // SupportedFeatures: []*armpostgresqlflexibleservers.SupportedFeature{ // }, - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedHaMode: []*armpostgresqlflexibleservers.HighAvailabilityMode{ + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant)}, // SupportedIops: to.Ptr[int32](1920), // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), // SupportedZones: []*string{ @@ -315,9 +315,9 @@ func ExampleServerCapabilitiesClient_NewListPager() { // Name: to.Ptr("Standard_B4ms"), // SupportedFeatures: []*armpostgresqlflexibleservers.SupportedFeature{ // }, - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedHaMode: []*armpostgresqlflexibleservers.HighAvailabilityMode{ + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant)}, // SupportedIops: to.Ptr[int32](2880), // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), // SupportedZones: []*string{ @@ -330,9 +330,9 @@ func ExampleServerCapabilitiesClient_NewListPager() { // Name: to.Ptr("Standard_B8ms"), // SupportedFeatures: []*armpostgresqlflexibleservers.SupportedFeature{ // }, - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedHaMode: []*armpostgresqlflexibleservers.HighAvailabilityMode{ + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant)}, // SupportedIops: to.Ptr[int32](4320), // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), // SupportedZones: []*string{ @@ -345,9 +345,9 @@ func ExampleServerCapabilitiesClient_NewListPager() { // Name: to.Ptr("Standard_B12ms"), // SupportedFeatures: []*armpostgresqlflexibleservers.SupportedFeature{ // }, - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedHaMode: []*armpostgresqlflexibleservers.HighAvailabilityMode{ + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant)}, // SupportedIops: to.Ptr[int32](4320), // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), // SupportedZones: []*string{ @@ -360,9 +360,9 @@ func ExampleServerCapabilitiesClient_NewListPager() { // Name: to.Ptr("Standard_B16ms"), // SupportedFeatures: []*armpostgresqlflexibleservers.SupportedFeature{ // }, - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedHaMode: []*armpostgresqlflexibleservers.HighAvailabilityMode{ + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant)}, // SupportedIops: to.Ptr[int32](4320), // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), // SupportedZones: []*string{ @@ -375,9 +375,9 @@ func ExampleServerCapabilitiesClient_NewListPager() { // Name: to.Ptr("Standard_B20ms"), // SupportedFeatures: []*armpostgresqlflexibleservers.SupportedFeature{ // }, - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedHaMode: []*armpostgresqlflexibleservers.HighAvailabilityMode{ + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant)}, // SupportedIops: to.Ptr[int32](4320), // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), // SupportedZones: []*string{ @@ -664,9 +664,9 @@ func ExampleServerCapabilitiesClient_NewListPager() { // Name: to.Ptr("Standard_D2s_v3"), // SupportedFeatures: []*armpostgresqlflexibleservers.SupportedFeature{ // }, - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedHaMode: []*armpostgresqlflexibleservers.HighAvailabilityMode{ + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant)}, // SupportedIops: to.Ptr[int32](3200), // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), // SupportedZones: []*string{ @@ -679,9 +679,9 @@ func ExampleServerCapabilitiesClient_NewListPager() { // Name: to.Ptr("Standard_D4ds_v5"), // SupportedFeatures: []*armpostgresqlflexibleservers.SupportedFeature{ // }, - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedHaMode: []*armpostgresqlflexibleservers.HighAvailabilityMode{ + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant)}, // SupportedIops: to.Ptr[int32](6400), // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), // SupportedZones: []*string{ @@ -694,9 +694,9 @@ func ExampleServerCapabilitiesClient_NewListPager() { // Name: to.Ptr("Standard_D8s_v3"), // SupportedFeatures: []*armpostgresqlflexibleservers.SupportedFeature{ // }, - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedHaMode: []*armpostgresqlflexibleservers.HighAvailabilityMode{ + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant)}, // SupportedIops: to.Ptr[int32](12800), // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), // SupportedZones: []*string{ @@ -709,9 +709,9 @@ func ExampleServerCapabilitiesClient_NewListPager() { // Name: to.Ptr("Standard_D16s_v3"), // SupportedFeatures: []*armpostgresqlflexibleservers.SupportedFeature{ // }, - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedHaMode: []*armpostgresqlflexibleservers.HighAvailabilityMode{ + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant)}, // SupportedIops: to.Ptr[int32](25600), // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), // SupportedZones: []*string{ @@ -724,9 +724,9 @@ func ExampleServerCapabilitiesClient_NewListPager() { // Name: to.Ptr("Standard_D32s_v3"), // SupportedFeatures: []*armpostgresqlflexibleservers.SupportedFeature{ // }, - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedHaMode: []*armpostgresqlflexibleservers.HighAvailabilityMode{ + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant)}, // SupportedIops: to.Ptr[int32](51200), // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), // SupportedZones: []*string{ @@ -739,9 +739,9 @@ func ExampleServerCapabilitiesClient_NewListPager() { // Name: to.Ptr("Standard_D48s_v3"), // SupportedFeatures: []*armpostgresqlflexibleservers.SupportedFeature{ // }, - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedHaMode: []*armpostgresqlflexibleservers.HighAvailabilityMode{ + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant)}, // SupportedIops: to.Ptr[int32](76800), // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), // SupportedZones: []*string{ @@ -754,9 +754,9 @@ func ExampleServerCapabilitiesClient_NewListPager() { // Name: to.Ptr("Standard_D64s_v3"), // SupportedFeatures: []*armpostgresqlflexibleservers.SupportedFeature{ // }, - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedHaMode: []*armpostgresqlflexibleservers.HighAvailabilityMode{ + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant)}, // SupportedIops: to.Ptr[int32](80000), // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), // SupportedZones: []*string{ @@ -769,9 +769,9 @@ func ExampleServerCapabilitiesClient_NewListPager() { // Name: to.Ptr("Standard_D2ds_v4"), // SupportedFeatures: []*armpostgresqlflexibleservers.SupportedFeature{ // }, - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedHaMode: []*armpostgresqlflexibleservers.HighAvailabilityMode{ + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant)}, // SupportedIops: to.Ptr[int32](3200), // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), // SupportedZones: []*string{ @@ -784,9 +784,9 @@ func ExampleServerCapabilitiesClient_NewListPager() { // Name: to.Ptr("Standard_D4ds_v4"), // SupportedFeatures: []*armpostgresqlflexibleservers.SupportedFeature{ // }, - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedHaMode: []*armpostgresqlflexibleservers.HighAvailabilityMode{ + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant)}, // SupportedIops: to.Ptr[int32](6400), // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), // SupportedZones: []*string{ @@ -799,9 +799,9 @@ func ExampleServerCapabilitiesClient_NewListPager() { // Name: to.Ptr("Standard_D8ds_v4"), // SupportedFeatures: []*armpostgresqlflexibleservers.SupportedFeature{ // }, - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedHaMode: []*armpostgresqlflexibleservers.HighAvailabilityMode{ + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant)}, // SupportedIops: to.Ptr[int32](12800), // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), // SupportedZones: []*string{ @@ -814,9 +814,9 @@ func ExampleServerCapabilitiesClient_NewListPager() { // Name: to.Ptr("Standard_D16ds_v4"), // SupportedFeatures: []*armpostgresqlflexibleservers.SupportedFeature{ // }, - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedHaMode: []*armpostgresqlflexibleservers.HighAvailabilityMode{ + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant)}, // SupportedIops: to.Ptr[int32](25600), // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), // SupportedZones: []*string{ @@ -829,9 +829,9 @@ func ExampleServerCapabilitiesClient_NewListPager() { // Name: to.Ptr("Standard_D32ds_v4"), // SupportedFeatures: []*armpostgresqlflexibleservers.SupportedFeature{ // }, - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedHaMode: []*armpostgresqlflexibleservers.HighAvailabilityMode{ + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant)}, // SupportedIops: to.Ptr[int32](51200), // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), // SupportedZones: []*string{ @@ -844,9 +844,9 @@ func ExampleServerCapabilitiesClient_NewListPager() { // Name: to.Ptr("Standard_D48ds_v4"), // SupportedFeatures: []*armpostgresqlflexibleservers.SupportedFeature{ // }, - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedHaMode: []*armpostgresqlflexibleservers.HighAvailabilityMode{ + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant)}, // SupportedIops: to.Ptr[int32](76800), // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), // SupportedZones: []*string{ @@ -859,9 +859,9 @@ func ExampleServerCapabilitiesClient_NewListPager() { // Name: to.Ptr("Standard_D64ds_v4"), // SupportedFeatures: []*armpostgresqlflexibleservers.SupportedFeature{ // }, - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedHaMode: []*armpostgresqlflexibleservers.HighAvailabilityMode{ + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant)}, // SupportedIops: to.Ptr[int32](80000), // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), // SupportedZones: []*string{ @@ -874,9 +874,9 @@ func ExampleServerCapabilitiesClient_NewListPager() { // Name: to.Ptr("Standard_D2ds_v5"), // SupportedFeatures: []*armpostgresqlflexibleservers.SupportedFeature{ // }, - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedHaMode: []*armpostgresqlflexibleservers.HighAvailabilityMode{ + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant)}, // SupportedIops: to.Ptr[int32](3750), // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), // SupportedZones: []*string{ @@ -889,9 +889,9 @@ func ExampleServerCapabilitiesClient_NewListPager() { // Name: to.Ptr("Standard_D4ds_v5"), // SupportedFeatures: []*armpostgresqlflexibleservers.SupportedFeature{ // }, - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedHaMode: []*armpostgresqlflexibleservers.HighAvailabilityMode{ + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant)}, // SupportedIops: to.Ptr[int32](6400), // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), // SupportedZones: []*string{ @@ -904,9 +904,9 @@ func ExampleServerCapabilitiesClient_NewListPager() { // Name: to.Ptr("Standard_D8ds_v5"), // SupportedFeatures: []*armpostgresqlflexibleservers.SupportedFeature{ // }, - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedHaMode: []*armpostgresqlflexibleservers.HighAvailabilityMode{ + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant)}, // SupportedIops: to.Ptr[int32](12800), // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), // SupportedZones: []*string{ @@ -919,9 +919,9 @@ func ExampleServerCapabilitiesClient_NewListPager() { // Name: to.Ptr("Standard_D16ds_v5"), // SupportedFeatures: []*armpostgresqlflexibleservers.SupportedFeature{ // }, - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedHaMode: []*armpostgresqlflexibleservers.HighAvailabilityMode{ + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant)}, // SupportedIops: to.Ptr[int32](25600), // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), // SupportedZones: []*string{ @@ -934,9 +934,9 @@ func ExampleServerCapabilitiesClient_NewListPager() { // Name: to.Ptr("Standard_D32ds_v5"), // SupportedFeatures: []*armpostgresqlflexibleservers.SupportedFeature{ // }, - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedHaMode: []*armpostgresqlflexibleservers.HighAvailabilityMode{ + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant)}, // SupportedIops: to.Ptr[int32](51200), // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), // SupportedZones: []*string{ @@ -949,9 +949,9 @@ func ExampleServerCapabilitiesClient_NewListPager() { // Name: to.Ptr("Standard_D48ds_v5"), // SupportedFeatures: []*armpostgresqlflexibleservers.SupportedFeature{ // }, - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedHaMode: []*armpostgresqlflexibleservers.HighAvailabilityMode{ + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant)}, // SupportedIops: to.Ptr[int32](76800), // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), // SupportedZones: []*string{ @@ -964,9 +964,9 @@ func ExampleServerCapabilitiesClient_NewListPager() { // Name: to.Ptr("Standard_D64ds_v5"), // SupportedFeatures: []*armpostgresqlflexibleservers.SupportedFeature{ // }, - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedHaMode: []*armpostgresqlflexibleservers.HighAvailabilityMode{ + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant)}, // SupportedIops: to.Ptr[int32](80000), // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), // SupportedZones: []*string{ @@ -979,9 +979,9 @@ func ExampleServerCapabilitiesClient_NewListPager() { // Name: to.Ptr("Standard_D96ds_v5"), // SupportedFeatures: []*armpostgresqlflexibleservers.SupportedFeature{ // }, - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedHaMode: []*armpostgresqlflexibleservers.HighAvailabilityMode{ + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant)}, // SupportedIops: to.Ptr[int32](80000), // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), // SupportedZones: []*string{ @@ -1258,25 +1258,6 @@ func ExampleServerCapabilitiesClient_NewListPager() { // SupportedMaximumThroughput: to.Ptr[int32](1200), // SupportedThroughput: to.Ptr[int32](125), // }}, - // }, - // { - // Name: to.Ptr("UltraDisk"), - // DefaultStorageSizeMb: to.Ptr[int64](65536), - // SupportedStorageMb: []*armpostgresqlflexibleservers.StorageMbCapability{ - // { - // DefaultIopsTier: to.Ptr("None"), - // MaximumStorageSizeMb: to.Ptr[int64](67108864), - // StorageSizeMb: to.Ptr[int64](32768), - // SupportedIops: to.Ptr[int32](4800), - // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("None"), - // Iops: to.Ptr[int32](0), - // }}, - // SupportedMaximumIops: to.Ptr[int32](400000), - // SupportedMaximumThroughput: to.Ptr[int32](10000), - // SupportedThroughput: to.Ptr[int32](1200), - // }}, // }}, // }, // { @@ -1287,9 +1268,9 @@ func ExampleServerCapabilitiesClient_NewListPager() { // Name: to.Ptr("Standard_E2s_v3"), // SupportedFeatures: []*armpostgresqlflexibleservers.SupportedFeature{ // }, - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedHaMode: []*armpostgresqlflexibleservers.HighAvailabilityMode{ + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant)}, // SupportedIops: to.Ptr[int32](3200), // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), // SupportedZones: []*string{ @@ -1302,9 +1283,9 @@ func ExampleServerCapabilitiesClient_NewListPager() { // Name: to.Ptr("Standard_E4s_v3"), // SupportedFeatures: []*armpostgresqlflexibleservers.SupportedFeature{ // }, - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedHaMode: []*armpostgresqlflexibleservers.HighAvailabilityMode{ + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant)}, // SupportedIops: to.Ptr[int32](6400), // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), // SupportedZones: []*string{ @@ -1317,9 +1298,9 @@ func ExampleServerCapabilitiesClient_NewListPager() { // Name: to.Ptr("Standard_E8s_v3"), // SupportedFeatures: []*armpostgresqlflexibleservers.SupportedFeature{ // }, - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedHaMode: []*armpostgresqlflexibleservers.HighAvailabilityMode{ + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant)}, // SupportedIops: to.Ptr[int32](12800), // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), // SupportedZones: []*string{ @@ -1332,9 +1313,9 @@ func ExampleServerCapabilitiesClient_NewListPager() { // Name: to.Ptr("Standard_E16s_v3"), // SupportedFeatures: []*armpostgresqlflexibleservers.SupportedFeature{ // }, - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedHaMode: []*armpostgresqlflexibleservers.HighAvailabilityMode{ + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant)}, // SupportedIops: to.Ptr[int32](25600), // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), // SupportedZones: []*string{ @@ -1347,9 +1328,9 @@ func ExampleServerCapabilitiesClient_NewListPager() { // Name: to.Ptr("Standard_E32s_v3"), // SupportedFeatures: []*armpostgresqlflexibleservers.SupportedFeature{ // }, - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedHaMode: []*armpostgresqlflexibleservers.HighAvailabilityMode{ + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant)}, // SupportedIops: to.Ptr[int32](32000), // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), // SupportedZones: []*string{ @@ -1362,9 +1343,9 @@ func ExampleServerCapabilitiesClient_NewListPager() { // Name: to.Ptr("Standard_E48s_v3"), // SupportedFeatures: []*armpostgresqlflexibleservers.SupportedFeature{ // }, - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedHaMode: []*armpostgresqlflexibleservers.HighAvailabilityMode{ + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant)}, // SupportedIops: to.Ptr[int32](51200), // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), // SupportedZones: []*string{ @@ -1377,9 +1358,9 @@ func ExampleServerCapabilitiesClient_NewListPager() { // Name: to.Ptr("Standard_E64s_v3"), // SupportedFeatures: []*armpostgresqlflexibleservers.SupportedFeature{ // }, - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedHaMode: []*armpostgresqlflexibleservers.HighAvailabilityMode{ + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant)}, // SupportedIops: to.Ptr[int32](76800), // SupportedMemoryPerVcoreMb: to.Ptr[int64](6912), // SupportedZones: []*string{ @@ -1392,9 +1373,9 @@ func ExampleServerCapabilitiesClient_NewListPager() { // Name: to.Ptr("Standard_E2ds_v4"), // SupportedFeatures: []*armpostgresqlflexibleservers.SupportedFeature{ // }, - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedHaMode: []*armpostgresqlflexibleservers.HighAvailabilityMode{ + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant)}, // SupportedIops: to.Ptr[int32](3200), // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), // SupportedZones: []*string{ @@ -1407,9 +1388,9 @@ func ExampleServerCapabilitiesClient_NewListPager() { // Name: to.Ptr("Standard_E4ds_v4"), // SupportedFeatures: []*armpostgresqlflexibleservers.SupportedFeature{ // }, - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedHaMode: []*armpostgresqlflexibleservers.HighAvailabilityMode{ + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant)}, // SupportedIops: to.Ptr[int32](6400), // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), // SupportedZones: []*string{ @@ -1422,9 +1403,9 @@ func ExampleServerCapabilitiesClient_NewListPager() { // Name: to.Ptr("Standard_E8ds_v4"), // SupportedFeatures: []*armpostgresqlflexibleservers.SupportedFeature{ // }, - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedHaMode: []*armpostgresqlflexibleservers.HighAvailabilityMode{ + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant)}, // SupportedIops: to.Ptr[int32](12800), // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), // SupportedZones: []*string{ @@ -1437,9 +1418,9 @@ func ExampleServerCapabilitiesClient_NewListPager() { // Name: to.Ptr("Standard_E16ds_v4"), // SupportedFeatures: []*armpostgresqlflexibleservers.SupportedFeature{ // }, - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedHaMode: []*armpostgresqlflexibleservers.HighAvailabilityMode{ + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant)}, // SupportedIops: to.Ptr[int32](25600), // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), // SupportedZones: []*string{ @@ -1452,9 +1433,9 @@ func ExampleServerCapabilitiesClient_NewListPager() { // Name: to.Ptr("Standard_E20ds_v4"), // SupportedFeatures: []*armpostgresqlflexibleservers.SupportedFeature{ // }, - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedHaMode: []*armpostgresqlflexibleservers.HighAvailabilityMode{ + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant)}, // SupportedIops: to.Ptr[int32](32000), // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), // SupportedZones: []*string{ @@ -1467,9 +1448,9 @@ func ExampleServerCapabilitiesClient_NewListPager() { // Name: to.Ptr("Standard_E32ds_v4"), // SupportedFeatures: []*armpostgresqlflexibleservers.SupportedFeature{ // }, - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedHaMode: []*armpostgresqlflexibleservers.HighAvailabilityMode{ + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant)}, // SupportedIops: to.Ptr[int32](51200), // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), // SupportedZones: []*string{ @@ -1482,9 +1463,9 @@ func ExampleServerCapabilitiesClient_NewListPager() { // Name: to.Ptr("Standard_E48ds_v4"), // SupportedFeatures: []*armpostgresqlflexibleservers.SupportedFeature{ // }, - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedHaMode: []*armpostgresqlflexibleservers.HighAvailabilityMode{ + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant)}, // SupportedIops: to.Ptr[int32](76800), // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), // SupportedZones: []*string{ @@ -1497,9 +1478,9 @@ func ExampleServerCapabilitiesClient_NewListPager() { // Name: to.Ptr("Standard_E64ds_v4"), // SupportedFeatures: []*armpostgresqlflexibleservers.SupportedFeature{ // }, - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedHaMode: []*armpostgresqlflexibleservers.HighAvailabilityMode{ + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant)}, // SupportedIops: to.Ptr[int32](80000), // SupportedMemoryPerVcoreMb: to.Ptr[int64](6912), // SupportedZones: []*string{ @@ -1512,9 +1493,9 @@ func ExampleServerCapabilitiesClient_NewListPager() { // Name: to.Ptr("Standard_M64"), // SupportedFeatures: []*armpostgresqlflexibleservers.SupportedFeature{ // }, - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedHaMode: []*armpostgresqlflexibleservers.HighAvailabilityMode{ + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant)}, // SupportedIops: to.Ptr[int32](40000), // SupportedMemoryPerVcoreMb: to.Ptr[int64](16384), // SupportedZones: []*string{ @@ -1527,9 +1508,9 @@ func ExampleServerCapabilitiesClient_NewListPager() { // Name: to.Ptr("Standard_M128"), // SupportedFeatures: []*armpostgresqlflexibleservers.SupportedFeature{ // }, - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedHaMode: []*armpostgresqlflexibleservers.HighAvailabilityMode{ + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant)}, // SupportedIops: to.Ptr[int32](80000), // SupportedMemoryPerVcoreMb: to.Ptr[int64](16384), // SupportedZones: []*string{ @@ -1542,9 +1523,9 @@ func ExampleServerCapabilitiesClient_NewListPager() { // Name: to.Ptr("Standard_E2ds_v5"), // SupportedFeatures: []*armpostgresqlflexibleservers.SupportedFeature{ // }, - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedHaMode: []*armpostgresqlflexibleservers.HighAvailabilityMode{ + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant)}, // SupportedIops: to.Ptr[int32](3750), // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), // SupportedZones: []*string{ @@ -1557,9 +1538,9 @@ func ExampleServerCapabilitiesClient_NewListPager() { // Name: to.Ptr("Standard_E4ds_v5"), // SupportedFeatures: []*armpostgresqlflexibleservers.SupportedFeature{ // }, - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedHaMode: []*armpostgresqlflexibleservers.HighAvailabilityMode{ + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant)}, // SupportedIops: to.Ptr[int32](6400), // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), // SupportedZones: []*string{ @@ -1572,9 +1553,9 @@ func ExampleServerCapabilitiesClient_NewListPager() { // Name: to.Ptr("Standard_E8ds_v5"), // SupportedFeatures: []*armpostgresqlflexibleservers.SupportedFeature{ // }, - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedHaMode: []*armpostgresqlflexibleservers.HighAvailabilityMode{ + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant)}, // SupportedIops: to.Ptr[int32](12800), // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), // SupportedZones: []*string{ @@ -1587,9 +1568,9 @@ func ExampleServerCapabilitiesClient_NewListPager() { // Name: to.Ptr("Standard_E16ds_v5"), // SupportedFeatures: []*armpostgresqlflexibleservers.SupportedFeature{ // }, - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedHaMode: []*armpostgresqlflexibleservers.HighAvailabilityMode{ + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant)}, // SupportedIops: to.Ptr[int32](25600), // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), // SupportedZones: []*string{ @@ -1602,9 +1583,9 @@ func ExampleServerCapabilitiesClient_NewListPager() { // Name: to.Ptr("Standard_E20ds_v5"), // SupportedFeatures: []*armpostgresqlflexibleservers.SupportedFeature{ // }, - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedHaMode: []*armpostgresqlflexibleservers.HighAvailabilityMode{ + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant)}, // SupportedIops: to.Ptr[int32](32000), // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), // SupportedZones: []*string{ @@ -1617,9 +1598,9 @@ func ExampleServerCapabilitiesClient_NewListPager() { // Name: to.Ptr("Standard_E32ds_v5"), // SupportedFeatures: []*armpostgresqlflexibleservers.SupportedFeature{ // }, - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedHaMode: []*armpostgresqlflexibleservers.HighAvailabilityMode{ + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant)}, // SupportedIops: to.Ptr[int32](51200), // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), // SupportedZones: []*string{ @@ -1632,9 +1613,9 @@ func ExampleServerCapabilitiesClient_NewListPager() { // Name: to.Ptr("Standard_E48ds_v5"), // SupportedFeatures: []*armpostgresqlflexibleservers.SupportedFeature{ // }, - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedHaMode: []*armpostgresqlflexibleservers.HighAvailabilityMode{ + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant)}, // SupportedIops: to.Ptr[int32](76800), // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), // SupportedZones: []*string{ @@ -1647,9 +1628,9 @@ func ExampleServerCapabilitiesClient_NewListPager() { // Name: to.Ptr("Standard_E64ds_v5"), // SupportedFeatures: []*armpostgresqlflexibleservers.SupportedFeature{ // }, - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedHaMode: []*armpostgresqlflexibleservers.HighAvailabilityMode{ + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant)}, // SupportedIops: to.Ptr[int32](80000), // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), // SupportedZones: []*string{ @@ -1662,9 +1643,9 @@ func ExampleServerCapabilitiesClient_NewListPager() { // Name: to.Ptr("Standard_E96ds_v5"), // SupportedFeatures: []*armpostgresqlflexibleservers.SupportedFeature{ // }, - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedHaMode: []*armpostgresqlflexibleservers.HighAvailabilityMode{ + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant)}, // SupportedIops: to.Ptr[int32](80000), // SupportedMemoryPerVcoreMb: to.Ptr[int64](7168), // SupportedZones: []*string{ @@ -1941,25 +1922,6 @@ func ExampleServerCapabilitiesClient_NewListPager() { // SupportedMaximumThroughput: to.Ptr[int32](1200), // SupportedThroughput: to.Ptr[int32](125), // }}, - // }, - // { - // Name: to.Ptr("UltraDisk"), - // DefaultStorageSizeMb: to.Ptr[int64](131072), - // SupportedStorageMb: []*armpostgresqlflexibleservers.StorageMbCapability{ - // { - // DefaultIopsTier: to.Ptr("None"), - // MaximumStorageSizeMb: to.Ptr[int64](67108864), - // StorageSizeMb: to.Ptr[int64](32768), - // SupportedIops: to.Ptr[int32](4800), - // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("None"), - // Iops: to.Ptr[int32](0), - // }}, - // SupportedMaximumIops: to.Ptr[int32](400000), - // SupportedMaximumThroughput: to.Ptr[int32](10000), - // SupportedThroughput: to.Ptr[int32](1200), - // }}, // }}, // }}, // SupportedServerVersions: []*armpostgresqlflexibleservers.ServerVersionCapability{ @@ -1972,7 +1934,9 @@ func ExampleServerCapabilitiesClient_NewListPager() { // to.Ptr("13"), // to.Ptr("14"), // to.Ptr("15"), - // to.Ptr("16")}, + // to.Ptr("16"), + // to.Ptr("17"), + // to.Ptr("18")}, // }, // { // Name: to.Ptr("12"), @@ -1982,7 +1946,9 @@ func ExampleServerCapabilitiesClient_NewListPager() { // to.Ptr("13"), // to.Ptr("14"), // to.Ptr("15"), - // to.Ptr("16")}, + // to.Ptr("16"), + // to.Ptr("17"), + // to.Ptr("18")}, // }, // { // Name: to.Ptr("13"), @@ -1991,7 +1957,9 @@ func ExampleServerCapabilitiesClient_NewListPager() { // SupportedVersionsToUpgrade: []*string{ // to.Ptr("14"), // to.Ptr("15"), - // to.Ptr("16")}, + // to.Ptr("16"), + // to.Ptr("17"), + // to.Ptr("18")}, // }, // { // Name: to.Ptr("14"), @@ -1999,32 +1967,44 @@ func ExampleServerCapabilitiesClient_NewListPager() { // }, // SupportedVersionsToUpgrade: []*string{ // to.Ptr("15"), - // to.Ptr("16")}, + // to.Ptr("16"), + // to.Ptr("17"), + // to.Ptr("18")}, // }, // { // Name: to.Ptr("15"), // SupportedFeatures: []*armpostgresqlflexibleservers.SupportedFeature{ // }, // SupportedVersionsToUpgrade: []*string{ - // to.Ptr("16")}, + // to.Ptr("16"), + // to.Ptr("17"), + // to.Ptr("18")}, // }, // { // Name: to.Ptr("16"), // SupportedFeatures: []*armpostgresqlflexibleservers.SupportedFeature{ // }, // SupportedVersionsToUpgrade: []*string{ + // to.Ptr("17"), + // to.Ptr("18")}, // }, - // }, - // { - // Name: to.Ptr("17"), - // SupportedFeatures: []*armpostgresqlflexibleservers.SupportedFeature{ - // }, - // SupportedVersionsToUpgrade: []*string{ - // }, + // { + // Name: to.Ptr("17"), + // SupportedFeatures: []*armpostgresqlflexibleservers.SupportedFeature{ + // }, + // SupportedVersionsToUpgrade: []*string{ + // to.Ptr("18")}, + // }, + // { + // Name: to.Ptr("18"), + // SupportedFeatures: []*armpostgresqlflexibleservers.SupportedFeature{ + // }, + // SupportedVersionsToUpgrade: []*string{ + // }, + // }}, + // ZoneRedundantHaAndGeoBackupSupported: to.Ptr(armpostgresqlflexibleservers.ZoneRedundantHighAvailabilityAndGeographicallyRedundantBackupSupportEnabled), + // ZoneRedundantHaSupported: to.Ptr(armpostgresqlflexibleservers.ZoneRedundantHighAvailabilitySupportEnabled), // }}, - // ZoneRedundantHaAndGeoBackupSupported: to.Ptr(armpostgresqlflexibleservers.ZoneRedundantHaAndGeoBackupSupportedEnumEnabled), - // ZoneRedundantHaSupported: to.Ptr(armpostgresqlflexibleservers.ZoneRedundantHaSupportedEnumEnabled), - // }}, - // } + // } } } diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/logfiles_client.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/capturedlogs_client.go similarity index 59% rename from sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/logfiles_client.go rename to sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/capturedlogs_client.go index 2ab70994fac9..7511466d52f5 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/logfiles_client.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/capturedlogs_client.go @@ -17,43 +17,43 @@ import ( "strings" ) -// LogFilesClient contains the methods for the LogFiles group. -// Don't use this type directly, use NewLogFilesClient() instead. -type LogFilesClient struct { +// CapturedLogsClient contains the methods for the CapturedLogs group. +// Don't use this type directly, use NewCapturedLogsClient() instead. +type CapturedLogsClient struct { internal *arm.Client subscriptionID string } -// NewLogFilesClient creates a new instance of LogFilesClient with the specified values. +// NewCapturedLogsClient creates a new instance of CapturedLogsClient with the specified values. // - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewLogFilesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*LogFilesClient, error) { +// - options - Contains optional client configuration. Pass nil to accept the default values. +func NewCapturedLogsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*CapturedLogsClient, error) { cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) if err != nil { return nil, err } - client := &LogFilesClient{ + client := &CapturedLogsClient{ subscriptionID: subscriptionID, internal: cl, } return client, nil } -// NewListByServerPager - List all the server log files in a given server. +// NewListByServerPager - Lists all captured logs for download in a server. // -// Generated from API version 2025-01-01-preview +// Generated from API version 2025-08-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. -// - options - LogFilesClientListByServerOptions contains the optional parameters for the LogFilesClient.NewListByServerPager +// - options - CapturedLogsClientListByServerOptions contains the optional parameters for the CapturedLogsClient.NewListByServerPager // method. -func (client *LogFilesClient) NewListByServerPager(resourceGroupName string, serverName string, options *LogFilesClientListByServerOptions) *runtime.Pager[LogFilesClientListByServerResponse] { - return runtime.NewPager(runtime.PagingHandler[LogFilesClientListByServerResponse]{ - More: func(page LogFilesClientListByServerResponse) bool { +func (client *CapturedLogsClient) NewListByServerPager(resourceGroupName string, serverName string, options *CapturedLogsClientListByServerOptions) *runtime.Pager[CapturedLogsClientListByServerResponse] { + return runtime.NewPager(runtime.PagingHandler[CapturedLogsClientListByServerResponse]{ + More: func(page CapturedLogsClientListByServerResponse) bool { return page.NextLink != nil && len(*page.NextLink) > 0 }, - Fetcher: func(ctx context.Context, page *LogFilesClientListByServerResponse) (LogFilesClientListByServerResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "LogFilesClient.NewListByServerPager") + Fetcher: func(ctx context.Context, page *CapturedLogsClientListByServerResponse) (CapturedLogsClientListByServerResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "CapturedLogsClient.NewListByServerPager") nextLink := "" if page != nil { nextLink = *page.NextLink @@ -62,7 +62,7 @@ func (client *LogFilesClient) NewListByServerPager(resourceGroupName string, ser return client.listByServerCreateRequest(ctx, resourceGroupName, serverName, options) }, nil) if err != nil { - return LogFilesClientListByServerResponse{}, err + return CapturedLogsClientListByServerResponse{}, err } return client.listByServerHandleResponse(resp) }, @@ -71,7 +71,7 @@ func (client *LogFilesClient) NewListByServerPager(resourceGroupName string, ser } // listByServerCreateRequest creates the ListByServer request. -func (client *LogFilesClient) listByServerCreateRequest(ctx context.Context, resourceGroupName string, serverName string, _ *LogFilesClientListByServerOptions) (*policy.Request, error) { +func (client *CapturedLogsClient) listByServerCreateRequest(ctx context.Context, resourceGroupName string, serverName string, _ *CapturedLogsClientListByServerOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/logFiles" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -90,17 +90,17 @@ func (client *LogFilesClient) listByServerCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-01-01-preview") + reqQP.Set("api-version", "2025-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } // listByServerHandleResponse handles the ListByServer response. -func (client *LogFilesClient) listByServerHandleResponse(resp *http.Response) (LogFilesClientListByServerResponse, error) { - result := LogFilesClientListByServerResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.LogFileListResult); err != nil { - return LogFilesClientListByServerResponse{}, err +func (client *CapturedLogsClient) listByServerHandleResponse(resp *http.Response) (CapturedLogsClientListByServerResponse, error) { + result := CapturedLogsClientListByServerResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.CapturedLogList); err != nil { + return CapturedLogsClientListByServerResponse{}, err } return result, nil } diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/logfiles_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/capturedlogs_client_example_test.go similarity index 63% rename from sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/logfiles_client_example_test.go rename to sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/capturedlogs_client_example_test.go index c3d98ce21a44..9a94b2f199be 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/logfiles_client_example_test.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/capturedlogs_client_example_test.go @@ -17,8 +17,8 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v5" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b1f4d539964453ce8008e4b069e59885e12ba441/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/LogFilesListByServer.json -func ExampleLogFilesClient_NewListByServerPager() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/735d21dbd7e1cc446babf58860af4cca757d620d/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/CapturedLogsListByServer.json +func ExampleCapturedLogsClient_NewListByServerPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -28,7 +28,7 @@ func ExampleLogFilesClient_NewListByServerPager() { if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewLogFilesClient().NewListByServerPager("testrg", "postgresqltestsvc1", nil) + pager := clientFactory.NewCapturedLogsClient().NewListByServerPager("exampleresourcegroup", "exampleserver", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -39,18 +39,18 @@ func ExampleLogFilesClient_NewListByServerPager() { _ = v } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.LogFileListResult = armpostgresqlflexibleservers.LogFileListResult{ - // Value: []*armpostgresqlflexibleservers.LogFile{ + // page.CapturedLogList = armpostgresqlflexibleservers.CapturedLogList{ + // Value: []*armpostgresqlflexibleservers.CapturedLog{ // { - // Name: to.Ptr("postgresql-slow-postgresqltestsvc1-2018022823.log"), + // Name: to.Ptr("postgresql-20250601.log"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/logFiles"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/postgresqltestsvc1/logFiles/postgresql-slow-postgresqltestsvc1-2018022823.log"), - // Properties: &armpostgresqlflexibleservers.LogFileProperties{ + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/logFiles/postgresql-20250601.log"), + // Properties: &armpostgresqlflexibleservers.CapturedLogProperties{ // Type: to.Ptr("slowlog"), // CreatedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "1-01-01T00:00:00.000Z"); return t}()), - // LastModifiedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-03-01T06:09:20.000Z"); return t}()), + // LastModifiedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T18:30:00.000Z"); return t}()), // SizeInKb: to.Ptr[int64](1), - // URL: to.Ptr("https://wasd2prodwus1afse42.file.core.windows.net/833c99b2f36c47349e5554b903fe0440/serverlogs/postgresql-slow-postgresqltestsvc1-2018022823.log?sv=2015-04-05&sr=f&se=2018-03-01T07%3A12%3A13Z&sp=r"), + // URL: to.Ptr("https://exampleaccount.file.core.windows.net/833c99b2f36c47349e5554b903fe0440/serverlogs/postgresql-20250601.log?sv=2025-09-01&sr=f&se=2025-06-01T07%3A12%3A13Z&sp=r"), // }, // }}, // } diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/checknameavailability_client.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/checknameavailability_client.go deleted file mode 100644 index b5a3a41dc5c3..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/checknameavailability_client.go +++ /dev/null @@ -1,100 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armpostgresqlflexibleservers - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// CheckNameAvailabilityClient contains the methods for the CheckNameAvailability group. -// Don't use this type directly, use NewCheckNameAvailabilityClient() instead. -type CheckNameAvailabilityClient struct { - internal *arm.Client - subscriptionID string -} - -// NewCheckNameAvailabilityClient creates a new instance of CheckNameAvailabilityClient with the specified values. -// - subscriptionID - The ID of the target subscription. The value must be an UUID. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewCheckNameAvailabilityClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*CheckNameAvailabilityClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &CheckNameAvailabilityClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// Execute - Check the availability of name for resource -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-01-01-preview -// - nameAvailabilityRequest - The required parameters for checking if resource name is available. -// - options - CheckNameAvailabilityClientExecuteOptions contains the optional parameters for the CheckNameAvailabilityClient.Execute -// method. -func (client *CheckNameAvailabilityClient) Execute(ctx context.Context, nameAvailabilityRequest CheckNameAvailabilityRequest, options *CheckNameAvailabilityClientExecuteOptions) (CheckNameAvailabilityClientExecuteResponse, error) { - var err error - const operationName = "CheckNameAvailabilityClient.Execute" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.executeCreateRequest(ctx, nameAvailabilityRequest, options) - if err != nil { - return CheckNameAvailabilityClientExecuteResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return CheckNameAvailabilityClientExecuteResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return CheckNameAvailabilityClientExecuteResponse{}, err - } - resp, err := client.executeHandleResponse(httpResp) - return resp, err -} - -// executeCreateRequest creates the Execute request. -func (client *CheckNameAvailabilityClient) executeCreateRequest(ctx context.Context, nameAvailabilityRequest CheckNameAvailabilityRequest, _ *CheckNameAvailabilityClientExecuteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.DBforPostgreSQL/checkNameAvailability" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-01-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, nameAvailabilityRequest); err != nil { - return nil, err - } - return req, nil -} - -// executeHandleResponse handles the Execute response. -func (client *CheckNameAvailabilityClient) executeHandleResponse(resp *http.Response) (CheckNameAvailabilityClientExecuteResponse, error) { - result := CheckNameAvailabilityClientExecuteResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.NameAvailability); err != nil { - return CheckNameAvailabilityClientExecuteResponse{}, err - } - return result, nil -} diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/checknameavailability_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/checknameavailability_client_example_test.go deleted file mode 100644 index ea2817d6b92d..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/checknameavailability_client_example_test.go +++ /dev/null @@ -1,48 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armpostgresqlflexibleservers_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v5" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b1f4d539964453ce8008e4b069e59885e12ba441/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/CheckNameAvailability.json -func ExampleCheckNameAvailabilityClient_Execute() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewCheckNameAvailabilityClient().Execute(ctx, armpostgresqlflexibleservers.CheckNameAvailabilityRequest{ - Name: to.Ptr("name1"), - Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.NameAvailability = armpostgresqlflexibleservers.NameAvailability{ - // Message: to.Ptr(""), - // NameAvailable: to.Ptr(true), - // Name: to.Ptr("name1"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers"), - // } -} diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/checknameavailabilitywithlocation_client.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/checknameavailabilitywithlocation_client.go deleted file mode 100644 index c085143fcafe..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/checknameavailabilitywithlocation_client.go +++ /dev/null @@ -1,105 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armpostgresqlflexibleservers - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// CheckNameAvailabilityWithLocationClient contains the methods for the CheckNameAvailabilityWithLocation group. -// Don't use this type directly, use NewCheckNameAvailabilityWithLocationClient() instead. -type CheckNameAvailabilityWithLocationClient struct { - internal *arm.Client - subscriptionID string -} - -// NewCheckNameAvailabilityWithLocationClient creates a new instance of CheckNameAvailabilityWithLocationClient with the specified values. -// - subscriptionID - The ID of the target subscription. The value must be an UUID. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewCheckNameAvailabilityWithLocationClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*CheckNameAvailabilityWithLocationClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &CheckNameAvailabilityWithLocationClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// Execute - Check the availability of name for resource -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-01-01-preview -// - locationName - The name of the location. -// - nameAvailabilityRequest - The required parameters for checking if resource name is available. -// - options - CheckNameAvailabilityWithLocationClientExecuteOptions contains the optional parameters for the CheckNameAvailabilityWithLocationClient.Execute -// method. -func (client *CheckNameAvailabilityWithLocationClient) Execute(ctx context.Context, locationName string, nameAvailabilityRequest CheckNameAvailabilityRequest, options *CheckNameAvailabilityWithLocationClientExecuteOptions) (CheckNameAvailabilityWithLocationClientExecuteResponse, error) { - var err error - const operationName = "CheckNameAvailabilityWithLocationClient.Execute" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.executeCreateRequest(ctx, locationName, nameAvailabilityRequest, options) - if err != nil { - return CheckNameAvailabilityWithLocationClientExecuteResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return CheckNameAvailabilityWithLocationClientExecuteResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return CheckNameAvailabilityWithLocationClientExecuteResponse{}, err - } - resp, err := client.executeHandleResponse(httpResp) - return resp, err -} - -// executeCreateRequest creates the Execute request. -func (client *CheckNameAvailabilityWithLocationClient) executeCreateRequest(ctx context.Context, locationName string, nameAvailabilityRequest CheckNameAvailabilityRequest, _ *CheckNameAvailabilityWithLocationClientExecuteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.DBforPostgreSQL/locations/{locationName}/checkNameAvailability" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if locationName == "" { - return nil, errors.New("parameter locationName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{locationName}", url.PathEscape(locationName)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-01-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, nameAvailabilityRequest); err != nil { - return nil, err - } - return req, nil -} - -// executeHandleResponse handles the Execute response. -func (client *CheckNameAvailabilityWithLocationClient) executeHandleResponse(resp *http.Response) (CheckNameAvailabilityWithLocationClientExecuteResponse, error) { - result := CheckNameAvailabilityWithLocationClientExecuteResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.NameAvailability); err != nil { - return CheckNameAvailabilityWithLocationClientExecuteResponse{}, err - } - return result, nil -} diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/checknameavailabilitywithlocation_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/checknameavailabilitywithlocation_client_example_test.go deleted file mode 100644 index 2f86d29b005c..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/checknameavailabilitywithlocation_client_example_test.go +++ /dev/null @@ -1,48 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armpostgresqlflexibleservers_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v5" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b1f4d539964453ce8008e4b069e59885e12ba441/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/CheckNameAvailabilityLocationBased.json -func ExampleCheckNameAvailabilityWithLocationClient_Execute() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewCheckNameAvailabilityWithLocationClient().Execute(ctx, "westus", armpostgresqlflexibleservers.CheckNameAvailabilityRequest{ - Name: to.Ptr("name1"), - Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.NameAvailability = armpostgresqlflexibleservers.NameAvailability{ - // Message: to.Ptr(""), - // NameAvailable: to.Ptr(true), - // Name: to.Ptr("name1"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers"), - // } -} diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/client_factory.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/client_factory.go index 26177f464220..089f61ccbb33 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/client_factory.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/client_factory.go @@ -33,105 +33,99 @@ func NewClientFactory(subscriptionID string, credential azcore.TokenCredential, }, nil } -// NewAdministratorsClient creates a new instance of AdministratorsClient. -func (c *ClientFactory) NewAdministratorsClient() *AdministratorsClient { - return &AdministratorsClient{ +// NewAdministratorsMicrosoftEntraClient creates a new instance of AdministratorsMicrosoftEntraClient. +func (c *ClientFactory) NewAdministratorsMicrosoftEntraClient() *AdministratorsMicrosoftEntraClient { + return &AdministratorsMicrosoftEntraClient{ subscriptionID: c.subscriptionID, internal: c.internal, } } -// NewBackupsClient creates a new instance of BackupsClient. -func (c *ClientFactory) NewBackupsClient() *BackupsClient { - return &BackupsClient{ +// NewAdvancedThreatProtectionSettingsClient creates a new instance of AdvancedThreatProtectionSettingsClient. +func (c *ClientFactory) NewAdvancedThreatProtectionSettingsClient() *AdvancedThreatProtectionSettingsClient { + return &AdvancedThreatProtectionSettingsClient{ subscriptionID: c.subscriptionID, internal: c.internal, } } -// NewCheckNameAvailabilityClient creates a new instance of CheckNameAvailabilityClient. -func (c *ClientFactory) NewCheckNameAvailabilityClient() *CheckNameAvailabilityClient { - return &CheckNameAvailabilityClient{ +// NewBackupsAutomaticAndOnDemandClient creates a new instance of BackupsAutomaticAndOnDemandClient. +func (c *ClientFactory) NewBackupsAutomaticAndOnDemandClient() *BackupsAutomaticAndOnDemandClient { + return &BackupsAutomaticAndOnDemandClient{ subscriptionID: c.subscriptionID, internal: c.internal, } } -// NewCheckNameAvailabilityWithLocationClient creates a new instance of CheckNameAvailabilityWithLocationClient. -func (c *ClientFactory) NewCheckNameAvailabilityWithLocationClient() *CheckNameAvailabilityWithLocationClient { - return &CheckNameAvailabilityWithLocationClient{ +// NewBackupsLongTermRetentionClient creates a new instance of BackupsLongTermRetentionClient. +func (c *ClientFactory) NewBackupsLongTermRetentionClient() *BackupsLongTermRetentionClient { + return &BackupsLongTermRetentionClient{ subscriptionID: c.subscriptionID, internal: c.internal, } } -// NewConfigurationsClient creates a new instance of ConfigurationsClient. -func (c *ClientFactory) NewConfigurationsClient() *ConfigurationsClient { - return &ConfigurationsClient{ +// NewCapabilitiesByLocationClient creates a new instance of CapabilitiesByLocationClient. +func (c *ClientFactory) NewCapabilitiesByLocationClient() *CapabilitiesByLocationClient { + return &CapabilitiesByLocationClient{ subscriptionID: c.subscriptionID, internal: c.internal, } } -// NewDatabasesClient creates a new instance of DatabasesClient. -func (c *ClientFactory) NewDatabasesClient() *DatabasesClient { - return &DatabasesClient{ +// NewCapabilitiesByServerClient creates a new instance of CapabilitiesByServerClient. +func (c *ClientFactory) NewCapabilitiesByServerClient() *CapabilitiesByServerClient { + return &CapabilitiesByServerClient{ subscriptionID: c.subscriptionID, internal: c.internal, } } -// NewFirewallRulesClient creates a new instance of FirewallRulesClient. -func (c *ClientFactory) NewFirewallRulesClient() *FirewallRulesClient { - return &FirewallRulesClient{ +// NewCapturedLogsClient creates a new instance of CapturedLogsClient. +func (c *ClientFactory) NewCapturedLogsClient() *CapturedLogsClient { + return &CapturedLogsClient{ subscriptionID: c.subscriptionID, internal: c.internal, } } -// NewFlexibleServerClient creates a new instance of FlexibleServerClient. -func (c *ClientFactory) NewFlexibleServerClient() *FlexibleServerClient { - return &FlexibleServerClient{ +// NewConfigurationsClient creates a new instance of ConfigurationsClient. +func (c *ClientFactory) NewConfigurationsClient() *ConfigurationsClient { + return &ConfigurationsClient{ subscriptionID: c.subscriptionID, internal: c.internal, } } -// NewGetPrivateDNSZoneSuffixClient creates a new instance of GetPrivateDNSZoneSuffixClient. -func (c *ClientFactory) NewGetPrivateDNSZoneSuffixClient() *GetPrivateDNSZoneSuffixClient { - return &GetPrivateDNSZoneSuffixClient{ - internal: c.internal, - } -} - -// NewLocationBasedCapabilitiesClient creates a new instance of LocationBasedCapabilitiesClient. -func (c *ClientFactory) NewLocationBasedCapabilitiesClient() *LocationBasedCapabilitiesClient { - return &LocationBasedCapabilitiesClient{ +// NewDatabasesClient creates a new instance of DatabasesClient. +func (c *ClientFactory) NewDatabasesClient() *DatabasesClient { + return &DatabasesClient{ subscriptionID: c.subscriptionID, internal: c.internal, } } -// NewLogFilesClient creates a new instance of LogFilesClient. -func (c *ClientFactory) NewLogFilesClient() *LogFilesClient { - return &LogFilesClient{ +// NewFirewallRulesClient creates a new instance of FirewallRulesClient. +func (c *ClientFactory) NewFirewallRulesClient() *FirewallRulesClient { + return &FirewallRulesClient{ subscriptionID: c.subscriptionID, internal: c.internal, } } -// NewLtrBackupOperationsClient creates a new instance of LtrBackupOperationsClient. -func (c *ClientFactory) NewLtrBackupOperationsClient() *LtrBackupOperationsClient { - return &LtrBackupOperationsClient{ +// NewMigrationsClient creates a new instance of MigrationsClient. +func (c *ClientFactory) NewMigrationsClient() *MigrationsClient { + return &MigrationsClient{ subscriptionID: c.subscriptionID, internal: c.internal, } } -// NewMigrationsClient creates a new instance of MigrationsClient. -func (c *ClientFactory) NewMigrationsClient() *MigrationsClient { - return &MigrationsClient{ - internal: c.internal, +// NewNameAvailabilityClient creates a new instance of NameAvailabilityClient. +func (c *ClientFactory) NewNameAvailabilityClient() *NameAvailabilityClient { + return &NameAvailabilityClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, } } @@ -142,21 +136,13 @@ func (c *ClientFactory) NewOperationsClient() *OperationsClient { } } -// NewPostgreSQLManagementClient creates a new instance of PostgreSQLManagementClient. -func (c *ClientFactory) NewPostgreSQLManagementClient() *PostgreSQLManagementClient { - return &PostgreSQLManagementClient{ +// NewPrivateDNSZoneSuffixClient creates a new instance of PrivateDNSZoneSuffixClient. +func (c *ClientFactory) NewPrivateDNSZoneSuffixClient() *PrivateDNSZoneSuffixClient { + return &PrivateDNSZoneSuffixClient{ internal: c.internal, } } -// NewPrivateEndpointConnectionClient creates a new instance of PrivateEndpointConnectionClient. -func (c *ClientFactory) NewPrivateEndpointConnectionClient() *PrivateEndpointConnectionClient { - return &PrivateEndpointConnectionClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, - } -} - // NewPrivateEndpointConnectionsClient creates a new instance of PrivateEndpointConnectionsClient. func (c *ClientFactory) NewPrivateEndpointConnectionsClient() *PrivateEndpointConnectionsClient { return &PrivateEndpointConnectionsClient{ @@ -189,14 +175,6 @@ func (c *ClientFactory) NewReplicasClient() *ReplicasClient { } } -// NewServerCapabilitiesClient creates a new instance of ServerCapabilitiesClient. -func (c *ClientFactory) NewServerCapabilitiesClient() *ServerCapabilitiesClient { - return &ServerCapabilitiesClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, - } -} - // NewServerThreatProtectionSettingsClient creates a new instance of ServerThreatProtectionSettingsClient. func (c *ClientFactory) NewServerThreatProtectionSettingsClient() *ServerThreatProtectionSettingsClient { return &ServerThreatProtectionSettingsClient{ @@ -213,22 +191,6 @@ func (c *ClientFactory) NewServersClient() *ServersClient { } } -// NewTuningConfigurationClient creates a new instance of TuningConfigurationClient. -func (c *ClientFactory) NewTuningConfigurationClient() *TuningConfigurationClient { - return &TuningConfigurationClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, - } -} - -// NewTuningIndexClient creates a new instance of TuningIndexClient. -func (c *ClientFactory) NewTuningIndexClient() *TuningIndexClient { - return &TuningIndexClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, - } -} - // NewTuningOptionsClient creates a new instance of TuningOptionsClient. func (c *ClientFactory) NewTuningOptionsClient() *TuningOptionsClient { return &TuningOptionsClient{ diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/configurations_client.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/configurations_client.go index deae7f14a9a3..aa145e47ff7f 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/configurations_client.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/configurations_client.go @@ -27,7 +27,7 @@ type ConfigurationsClient struct { // NewConfigurationsClient creates a new instance of ConfigurationsClient with the specified values. // - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. +// - options - Contains optional client configuration. Pass nil to accept the default values. func NewConfigurationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ConfigurationsClient, error) { cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) if err != nil { @@ -40,13 +40,13 @@ func NewConfigurationsClient(subscriptionID string, credential azcore.TokenCrede return client, nil } -// Get - Gets information about a configuration of server. +// Get - Gets information about a specific configuration (also known as server parameter) of a server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-01-01-preview +// Generated from API version 2025-08-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. -// - configurationName - The name of the server configuration. +// - configurationName - Name of the configuration (also known as server parameter). // - options - ConfigurationsClientGetOptions contains the optional parameters for the ConfigurationsClient.Get method. func (client *ConfigurationsClient) Get(ctx context.Context, resourceGroupName string, serverName string, configurationName string, options *ConfigurationsClientGetOptions) (ConfigurationsClientGetResponse, error) { var err error @@ -94,7 +94,7 @@ func (client *ConfigurationsClient) getCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-01-01-preview") + reqQP.Set("api-version", "2025-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -109,9 +109,9 @@ func (client *ConfigurationsClient) getHandleResponse(resp *http.Response) (Conf return result, nil } -// NewListByServerPager - List all the configurations in a given server. +// NewListByServerPager - Lists all configurations (also known as server parameters) of a server. // -// Generated from API version 2025-01-01-preview +// Generated from API version 2025-08-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - options - ConfigurationsClientListByServerOptions contains the optional parameters for the ConfigurationsClient.NewListByServerPager @@ -159,7 +159,7 @@ func (client *ConfigurationsClient) listByServerCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-01-01-preview") + reqQP.Set("api-version", "2025-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -168,29 +168,30 @@ func (client *ConfigurationsClient) listByServerCreateRequest(ctx context.Contex // listByServerHandleResponse handles the ListByServer response. func (client *ConfigurationsClient) listByServerHandleResponse(resp *http.Response) (ConfigurationsClientListByServerResponse, error) { result := ConfigurationsClientListByServerResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ConfigurationListResult); err != nil { + if err := runtime.UnmarshalAsJSON(resp, &result.ConfigurationList); err != nil { return ConfigurationsClientListByServerResponse{}, err } return result, nil } -// BeginPut - Updates a configuration of a server. +// BeginPut - Updates, using Put verb, the value assigned to a specific modifiable configuration (also known as server parameter) +// of a server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-01-01-preview +// Generated from API version 2025-08-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. -// - configurationName - The name of the server configuration. -// - parameters - The required parameters for updating a server configuration. +// - configurationName - Name of the configuration (also known as server parameter). +// - parameters - Parameters required to update the value of a specific modifiable configuration (also known as server parameter). // - options - ConfigurationsClientBeginPutOptions contains the optional parameters for the ConfigurationsClient.BeginPut method. -func (client *ConfigurationsClient) BeginPut(ctx context.Context, resourceGroupName string, serverName string, configurationName string, parameters Configuration, options *ConfigurationsClientBeginPutOptions) (*runtime.Poller[ConfigurationsClientPutResponse], error) { +func (client *ConfigurationsClient) BeginPut(ctx context.Context, resourceGroupName string, serverName string, configurationName string, parameters ConfigurationForUpdate, options *ConfigurationsClientBeginPutOptions) (*runtime.Poller[ConfigurationsClientPutResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.put(ctx, resourceGroupName, serverName, configurationName, parameters, options) if err != nil { return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ConfigurationsClientPutResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, Tracer: client.internal.Tracer(), }) return poller, err @@ -201,11 +202,12 @@ func (client *ConfigurationsClient) BeginPut(ctx context.Context, resourceGroupN } } -// Put - Updates a configuration of a server. +// Put - Updates, using Put verb, the value assigned to a specific modifiable configuration (also known as server parameter) +// of a server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-01-01-preview -func (client *ConfigurationsClient) put(ctx context.Context, resourceGroupName string, serverName string, configurationName string, parameters Configuration, options *ConfigurationsClientBeginPutOptions) (*http.Response, error) { +// Generated from API version 2025-08-01 +func (client *ConfigurationsClient) put(ctx context.Context, resourceGroupName string, serverName string, configurationName string, parameters ConfigurationForUpdate, options *ConfigurationsClientBeginPutOptions) (*http.Response, error) { var err error const operationName = "ConfigurationsClient.BeginPut" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) @@ -219,7 +221,7 @@ func (client *ConfigurationsClient) put(ctx context.Context, resourceGroupName s if err != nil { return nil, err } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { + if !runtime.HasStatusCode(httpResp, http.StatusAccepted) { err = runtime.NewResponseError(httpResp) return nil, err } @@ -227,7 +229,7 @@ func (client *ConfigurationsClient) put(ctx context.Context, resourceGroupName s } // putCreateRequest creates the Put request. -func (client *ConfigurationsClient) putCreateRequest(ctx context.Context, resourceGroupName string, serverName string, configurationName string, parameters Configuration, _ *ConfigurationsClientBeginPutOptions) (*policy.Request, error) { +func (client *ConfigurationsClient) putCreateRequest(ctx context.Context, resourceGroupName string, serverName string, configurationName string, parameters ConfigurationForUpdate, _ *ConfigurationsClientBeginPutOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/configurations/{configurationName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -250,7 +252,7 @@ func (client *ConfigurationsClient) putCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-01-01-preview") + reqQP.Set("api-version", "2025-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -259,14 +261,14 @@ func (client *ConfigurationsClient) putCreateRequest(ctx context.Context, resour return req, nil } -// BeginUpdate - Updates a configuration of a server. +// BeginUpdate - Updates the value assigned to a specific modifiable configuration (also known as server parameter) of a server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-01-01-preview +// Generated from API version 2025-08-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. -// - configurationName - The name of the server configuration. -// - parameters - The required parameters for updating a server configuration. +// - configurationName - Name of the configuration (also known as server parameter). +// - parameters - Parameters required to update the value of a specific modifiable configuration (also known as server parameter). // - options - ConfigurationsClientBeginUpdateOptions contains the optional parameters for the ConfigurationsClient.BeginUpdate // method. func (client *ConfigurationsClient) BeginUpdate(ctx context.Context, resourceGroupName string, serverName string, configurationName string, parameters ConfigurationForUpdate, options *ConfigurationsClientBeginUpdateOptions) (*runtime.Poller[ConfigurationsClientUpdateResponse], error) { @@ -287,10 +289,10 @@ func (client *ConfigurationsClient) BeginUpdate(ctx context.Context, resourceGro } } -// Update - Updates a configuration of a server. +// Update - Updates the value assigned to a specific modifiable configuration (also known as server parameter) of a server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-01-01-preview +// Generated from API version 2025-08-01 func (client *ConfigurationsClient) update(ctx context.Context, resourceGroupName string, serverName string, configurationName string, parameters ConfigurationForUpdate, options *ConfigurationsClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "ConfigurationsClient.BeginUpdate" @@ -305,7 +307,7 @@ func (client *ConfigurationsClient) update(ctx context.Context, resourceGroupNam if err != nil { return nil, err } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { + if !runtime.HasStatusCode(httpResp, http.StatusAccepted) { err = runtime.NewResponseError(httpResp) return nil, err } @@ -336,7 +338,7 @@ func (client *ConfigurationsClient) updateCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-01-01-preview") + reqQP.Set("api-version", "2025-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/configurations_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/configurations_client_example_test.go index bcceae1d67a2..2016a24037e8 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/configurations_client_example_test.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/configurations_client_example_test.go @@ -18,7 +18,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v5" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b1f4d539964453ce8008e4b069e59885e12ba441/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ConfigurationListByServer.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/735d21dbd7e1cc446babf58860af4cca757d620d/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/ConfigurationsListByServer.json func ExampleConfigurationsClient_NewListByServerPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -29,7 +29,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewConfigurationsClient().NewListByServerPager("testrg", "testserver", nil) + pager := clientFactory.NewConfigurationsClient().NewListByServerPager("exampleresourcegroup", "exampleserver", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -40,12 +40,12 @@ func ExampleConfigurationsClient_NewListByServerPager() { _ = v } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ConfigurationListResult = armpostgresqlflexibleservers.ConfigurationListResult{ + // page.ConfigurationList = armpostgresqlflexibleservers.ConfigurationList{ // Value: []*armpostgresqlflexibleservers.Configuration{ // { // Name: to.Ptr("allow_in_place_tablespaces"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/allow_in_place_tablespaces"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/allow_in_place_tablespaces"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Allows tablespaces directly inside pg_tblspc, for testing."), // AllowedValues: to.Ptr("on,off"), @@ -62,7 +62,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("allow_system_table_mods"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/allow_system_table_mods"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/allow_system_table_mods"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Allows modifications of the structure of system tables."), // AllowedValues: to.Ptr("on,off"), @@ -79,11 +79,11 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("application_name"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/application_name"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/application_name"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets the application name to be reported in statistics and logs."), // AllowedValues: to.Ptr("[A-Za-z0-9._-]*"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataType("String")), + // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeString), // DefaultValue: to.Ptr(""), // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/libpq-connect.html#LIBPQ-CONNECT-APPLICATION-NAME"), // IsConfigPendingRestart: to.Ptr(false), @@ -96,11 +96,11 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("archive_cleanup_command"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/archive_cleanup_command"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/archive_cleanup_command"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets the shell command that will be executed at every restart point."), // AllowedValues: to.Ptr(".*"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataType("String")), + // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeString), // DefaultValue: to.Ptr(""), // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-wal.html#GUC-ARCHIVE-CLEANUP-COMMAND"), // IsConfigPendingRestart: to.Ptr(false), @@ -113,11 +113,11 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("archive_command"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/archive_command"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/archive_command"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets the shell command that will be called to archive a WAL file."), // AllowedValues: to.Ptr(".*"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataType("String")), + // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeString), // DefaultValue: to.Ptr(""), // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-wal.html#GUC-ARCHIVE-COMMAND"), // IsConfigPendingRestart: to.Ptr(false), @@ -130,7 +130,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("archive_mode"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/archive_mode"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/archive_mode"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Allows archiving of WAL files using archive_command."), // AllowedValues: to.Ptr("always,on,off"), @@ -147,7 +147,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("archive_timeout"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/archive_timeout"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/archive_timeout"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Forces a switch to the next WAL file if a new file has not been started within N seconds."), // AllowedValues: to.Ptr("0-1073741823"), @@ -165,7 +165,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("array_nulls"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/array_nulls"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/array_nulls"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Enables input of NULL (case insensitive) to be considered as NULL value rather than the literal String 'NULL'."), // AllowedValues: to.Ptr("on,off"), @@ -182,7 +182,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("authentication_timeout"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/authentication_timeout"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/authentication_timeout"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets the maximum allowed time to complete client authentication."), // AllowedValues: to.Ptr("1-600"), @@ -200,7 +200,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("auto_explain.log_analyze"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/auto_explain.log_analyze"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/auto_explain.log_analyze"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Use EXPLAIN ANALYZE for plan logging."), // AllowedValues: to.Ptr("on,off"), @@ -217,7 +217,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("auto_explain.log_buffers"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/auto_explain.log_buffers"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/auto_explain.log_buffers"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Log buffers usage."), // AllowedValues: to.Ptr("on,off"), @@ -234,7 +234,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("auto_explain.log_format"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/auto_explain.log_format"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/auto_explain.log_format"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("EXPLAIN format to be used for plan logging."), // AllowedValues: to.Ptr("text,xml,json,yaml"), @@ -251,7 +251,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("auto_explain.log_level"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/auto_explain.log_level"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/auto_explain.log_level"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Log level for the plan."), // AllowedValues: to.Ptr("debug5,debug4,debug3,debug2,debug1,debug,info,notice,warning,log"), @@ -268,7 +268,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("auto_explain.log_min_duration"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/auto_explain.log_min_duration"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/auto_explain.log_min_duration"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets the minimum execution time above which plans will be logged. Zero prints all plans. -1 turns this feature off."), // AllowedValues: to.Ptr("-1-2147483647"), @@ -286,7 +286,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("auto_explain.log_nested_statements"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/auto_explain.log_nested_statements"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/auto_explain.log_nested_statements"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Log nested statements."), // AllowedValues: to.Ptr("on,off"), @@ -303,7 +303,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("auto_explain.log_settings"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/auto_explain.log_settings"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/auto_explain.log_settings"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Log modified configuration parameters affecting query planning."), // AllowedValues: to.Ptr("on,off"), @@ -320,7 +320,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("auto_explain.log_timing"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/auto_explain.log_timing"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/auto_explain.log_timing"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Collect timing data, not just row counts."), // AllowedValues: to.Ptr("on,off"), @@ -337,7 +337,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("auto_explain.log_triggers"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/auto_explain.log_triggers"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/auto_explain.log_triggers"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Include trigger statistics in plans. This has no effect unless log_analyze is also set."), // AllowedValues: to.Ptr("on,off"), @@ -354,7 +354,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("auto_explain.log_verbose"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/auto_explain.log_verbose"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/auto_explain.log_verbose"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Use EXPLAIN VERBOSE for plan logging."), // AllowedValues: to.Ptr("on,off"), @@ -371,7 +371,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("auto_explain.log_wal"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/auto_explain.log_wal"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/auto_explain.log_wal"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Log WAL usage."), // AllowedValues: to.Ptr("on,off"), @@ -388,7 +388,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("auto_explain.sample_rate"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/auto_explain.sample_rate"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/auto_explain.sample_rate"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Fraction of queries to process."), // AllowedValues: to.Ptr("0.0-1.0"), @@ -405,7 +405,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("autovacuum"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/autovacuum"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/autovacuum"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Controls whether the server should run the autovacuum subprocess."), // AllowedValues: to.Ptr("on,off"), @@ -422,7 +422,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("autovacuum_analyze_scale_factor"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/autovacuum_analyze_scale_factor"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/autovacuum_analyze_scale_factor"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Specifies a fraction of the table size to add to autovacuum_vacuum_threshold when deciding whether to trigger a VACUUM."), // AllowedValues: to.Ptr("0-100"), @@ -439,7 +439,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("autovacuum_analyze_threshold"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/autovacuum_analyze_threshold"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/autovacuum_analyze_threshold"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets the minimum number of inserted, updated or deleted tuples needed to trigger an ANALYZE in any one table."), // AllowedValues: to.Ptr("0-2147483647"), @@ -456,7 +456,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("autovacuum_freeze_max_age"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/autovacuum_freeze_max_age"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/autovacuum_freeze_max_age"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Maximum age (in transactions) before triggering autovacuum on a table to prevent transaction ID wraparound."), // AllowedValues: to.Ptr("100000-2000000000"), @@ -473,7 +473,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("autovacuum_max_workers"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/autovacuum_max_workers"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/autovacuum_max_workers"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets the maximum number of simultaneously running autovacuum worker processes."), // AllowedValues: to.Ptr("1-262143"), @@ -490,7 +490,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("autovacuum_multixact_freeze_max_age"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/autovacuum_multixact_freeze_max_age"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/autovacuum_multixact_freeze_max_age"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Maximum age (in multixact) before triggering autovacuum on a table to prevent multixact wraparound."), // AllowedValues: to.Ptr("10000-2000000000"), @@ -507,7 +507,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("autovacuum_naptime"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/autovacuum_naptime"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/autovacuum_naptime"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets minimum delay between autovacuum runs on any given database."), // AllowedValues: to.Ptr("1-2147483"), @@ -525,7 +525,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("autovacuum_vacuum_cost_delay"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/autovacuum_vacuum_cost_delay"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/autovacuum_vacuum_cost_delay"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets cost delay value (milliseconds) that will be used in automatic VACUUM operations."), // AllowedValues: to.Ptr("-1-100"), @@ -543,7 +543,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("autovacuum_vacuum_cost_limit"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/autovacuum_vacuum_cost_limit"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/autovacuum_vacuum_cost_limit"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets cost limit value that will be used in automatic VACUUM operations."), // AllowedValues: to.Ptr("-1-10000"), @@ -560,7 +560,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("autovacuum_vacuum_insert_scale_factor"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/autovacuum_vacuum_insert_scale_factor"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/autovacuum_vacuum_insert_scale_factor"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Specifies a fraction of the table size to add to autovacuum_vacuum_insert_threshold when deciding whether to trigger a VACUUM."), // AllowedValues: to.Ptr("0-100"), @@ -577,7 +577,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("autovacuum_vacuum_insert_threshold"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/autovacuum_vacuum_insert_threshold"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/autovacuum_vacuum_insert_threshold"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Specifies the number of inserted tuples needed to trigger a VACUUM in any one table."), // AllowedValues: to.Ptr("-1-2147483647"), @@ -594,7 +594,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("autovacuum_vacuum_scale_factor"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/autovacuum_vacuum_scale_factor"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/autovacuum_vacuum_scale_factor"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Specifies a fraction of the table size to add to autovacuum_vacuum_threshold when deciding whether to trigger a VACUUM."), // AllowedValues: to.Ptr("0-100"), @@ -611,7 +611,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("autovacuum_vacuum_threshold"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/autovacuum_vacuum_threshold"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/autovacuum_vacuum_threshold"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Specifies the minimum number of updated or deleted tuples needed to trigger a VACUUM in any one table."), // AllowedValues: to.Ptr("0-2147483647"), @@ -628,7 +628,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("autovacuum_work_mem"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/autovacuum_work_mem"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/autovacuum_work_mem"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets the maximum memory to be used by each autovacuum worker process."), // AllowedValues: to.Ptr("-1-2097151"), @@ -646,11 +646,11 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("azure.accepted_password_auth_method"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/azure.accepted_password_auth_method"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/azure.accepted_password_auth_method"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Accepted password authentication method."), // AllowedValues: to.Ptr("md5,scram-sha-256"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataType("Set")), + // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeSet), // DefaultValue: to.Ptr("md5"), // DocumentationLink: to.Ptr("https://go.microsoft.com/fwlink/?linkid=2274147"), // IsConfigPendingRestart: to.Ptr(false), @@ -663,7 +663,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("azure.enable_temp_tablespaces_on_local_ssd"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/azure.enable_temp_tablespaces_on_local_ssd"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/azure.enable_temp_tablespaces_on_local_ssd"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Create temp tablespace on ephemeral disk."), // AllowedValues: to.Ptr("on,off"), @@ -679,11 +679,11 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("azure.extensions"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/azure.extensions"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/azure.extensions"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Specifies which extensions are allowed to be created in the server."), // AllowedValues: to.Ptr(",address_standardizer,address_standardizer_data_us,age,amcheck,anon,azure_ai,azure_storage,bloom,btree_gin,btree_gist,citext,cube,dblink,dict_int,dict_xsyn,earthdistance,fuzzystrmatch,hll,hstore,hypopg,intagg,intarray,isn,lo,login_hook,ltree,oracle_fdw,orafce,pageinspect,pg_buffercache,pg_cron,pg_freespacemap,pg_hint_plan,pg_partman,pg_prewarm,pg_repack,pg_squeeze,pg_stat_statements,pg_trgm,pg_visibility,pgaudit,pgcrypto,pglogical,pgrouting,pgrowlocks,pgstattuple,plpgsql,plv8,postgis,postgis_raster,postgis_sfcgal,postgis_tiger_geocoder,postgis_topology,postgres_fdw,postgres_protobuf,semver,session_variable,sslinfo,tablefunc,tdigest,tds_fdw,timescaledb,topn,tsm_system_rows,tsm_system_time,unaccent,uuid-ossp,vector"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataType("Set")), + // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeSet), // DefaultValue: to.Ptr(""), // DocumentationLink: to.Ptr("https://go.microsoft.com/fwlink/?linkid=2274269"), // IsConfigPendingRestart: to.Ptr(false), @@ -696,7 +696,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("azure.single_to_flex_migration"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/azure.single_to_flex_migration"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/azure.single_to_flex_migration"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Specifies if this is a server created for migrating from Azure Database for PostgreSQL Single Server to Flexible Server."), // AllowedValues: to.Ptr("on,off"), @@ -712,7 +712,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("azure_storage.allow_network_access"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/azure_storage.allow_network_access"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/azure_storage.allow_network_access"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Allow accessing data from blob storage in extension azure_storage."), // AllowedValues: to.Ptr("on,off"), @@ -728,7 +728,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("azure_storage.blob_block_size_mb"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/azure_storage.blob_block_size_mb"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/azure_storage.blob_block_size_mb"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Blob block size in megabytes for blob_put in extension azure_storage."), // AllowedValues: to.Ptr("1-4000"), @@ -746,7 +746,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("azure_storage.public_account_access"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/azure_storage.public_account_access"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/azure_storage.public_account_access"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Allow all users to access data from public storage accounts in extension azure_storage."), // AllowedValues: to.Ptr("on,off"), @@ -762,7 +762,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("backend_flush_after"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/backend_flush_after"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/backend_flush_after"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Number of pages after which previously performed writes are flushed to disk."), // AllowedValues: to.Ptr("0-256"), @@ -780,7 +780,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("backslash_quote"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/backslash_quote"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/backslash_quote"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets whether \"\\'\" is allowed in string literals."), // AllowedValues: to.Ptr("safe_encoding,on,off"), @@ -797,11 +797,11 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("backtrace_functions"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/backtrace_functions"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/backtrace_functions"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Log backtrace for errors in these functions."), // AllowedValues: to.Ptr(".*"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataType("String")), + // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeString), // DefaultValue: to.Ptr(""), // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-developer.html#GUC-BACKTRACE-FUNCTIONS"), // IsConfigPendingRestart: to.Ptr(false), @@ -814,7 +814,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("bgwriter_delay"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/bgwriter_delay"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/bgwriter_delay"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Specifies the delay between activity rounds for the background writer. In each round the writer issues writes for some number of dirty buffers."), // AllowedValues: to.Ptr("10-10000"), @@ -832,7 +832,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("bgwriter_flush_after"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/bgwriter_flush_after"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/bgwriter_flush_after"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Number of pages after which previously performed writes by the background writer are flushed to disk."), // AllowedValues: to.Ptr("0-256"), @@ -850,7 +850,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("bgwriter_lru_maxpages"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/bgwriter_lru_maxpages"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/bgwriter_lru_maxpages"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("In each round, no more than this many buffers will be written by the background writer."), // AllowedValues: to.Ptr("0-1073741823"), @@ -867,7 +867,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("bgwriter_lru_multiplier"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/bgwriter_lru_multiplier"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/bgwriter_lru_multiplier"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("The average recent need of buffers is multiplied by bgwriter_lru_multiplier to arrive at an estimate of the number of buffers that will be needed during the next round."), // AllowedValues: to.Ptr("0-10"), @@ -884,7 +884,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("block_size"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/block_size"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/block_size"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Shows the size of a disk block."), // AllowedValues: to.Ptr("8192-8192"), @@ -901,7 +901,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("bonjour"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/bonjour"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/bonjour"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Enables advertising the server via Bonjour."), // AllowedValues: to.Ptr("on,off"), @@ -918,11 +918,11 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("bonjour_name"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/bonjour_name"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/bonjour_name"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets the Bonjour service name."), // AllowedValues: to.Ptr(".*"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataType("String")), + // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeString), // DefaultValue: to.Ptr(""), // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-connection.html#GUC-BONJOUR-NAME"), // IsConfigPendingRestart: to.Ptr(false), @@ -935,7 +935,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("bytea_output"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/bytea_output"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/bytea_output"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets the output format for values of type bytea. Valid values are hex (the default) and escape (the traditional PostgreSQL format)."), // AllowedValues: to.Ptr("escape,hex"), @@ -952,7 +952,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("check_function_bodies"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/check_function_bodies"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/check_function_bodies"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Checks function bodies during CREATE FUNCTION."), // AllowedValues: to.Ptr("on,off"), @@ -969,7 +969,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("checkpoint_completion_target"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/checkpoint_completion_target"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/checkpoint_completion_target"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Specifies the target of checkpoint completion, as a fraction of total time between checkpoints."), // AllowedValues: to.Ptr("0-1"), @@ -986,7 +986,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("checkpoint_flush_after"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/checkpoint_flush_after"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/checkpoint_flush_after"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Number of pages after which previously performed writes are flushed to disk."), // AllowedValues: to.Ptr("0-256"), @@ -1004,7 +1004,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("checkpoint_timeout"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/checkpoint_timeout"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/checkpoint_timeout"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Maximum time between automatic WAL checkpoints, in seconds. The valid range is between 30 seconds and one day."), // AllowedValues: to.Ptr("30-86400"), @@ -1022,7 +1022,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("checkpoint_warning"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/checkpoint_warning"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/checkpoint_warning"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Writes a warning message if checkpoints caused by the filling of WAL segment more frequently than this."), // AllowedValues: to.Ptr("0-2147483647"), @@ -1040,7 +1040,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("client_encoding"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/client_encoding"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/client_encoding"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets the client-side encoding (character set). The default is to use the database encoding."), // AllowedValues: to.Ptr("BIG5,EUC_CN,EUC_JP,EUC_JIS_2004,EUC_KR,EUC_TW,GB18030,GBK,ISO_8859_5,ISO_8859_6,ISO_8859_7,ISO_8859_8,JOHAB,KOI8R,KOI8U,LATIN1,LATIN2,LATIN3,LATIN4,LATIN5,LATIN6,LATIN7,LATIN8,LATIN9,LATIN10,MULE_INTERNAL,SJIS,SHIFT_JIS_2004,SQL_ASCII,UHC,UTF8,WIN866,WIN874,WIN1250,WIN1251,WIN1252,WIN1253,WIN1254,WIN1255,WIN1256,WIN1257,WIN1258"), @@ -1057,7 +1057,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("client_min_messages"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/client_min_messages"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/client_min_messages"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Controls the message levels that are sent to the client."), // AllowedValues: to.Ptr("debug5,debug4,debug3,debug2,debug1,log,notice,warning,error"), @@ -1074,11 +1074,11 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("cluster_name"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/cluster_name"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/cluster_name"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets the name of the cluster, which is included in the process title."), // AllowedValues: to.Ptr(".*"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataType("String")), + // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeString), // DefaultValue: to.Ptr(""), // IsConfigPendingRestart: to.Ptr(false), // IsDynamicConfig: to.Ptr(false), @@ -1090,7 +1090,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("commit_delay"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/commit_delay"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/commit_delay"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets the delay in microseconds between transaction commit and flushing WAL to disk."), // AllowedValues: to.Ptr("0-100000"), @@ -1108,7 +1108,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("commit_siblings"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/commit_siblings"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/commit_siblings"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets the minimum concurrent open transactions before performing commit_delay."), // AllowedValues: to.Ptr("0-1000"), @@ -1125,11 +1125,11 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("config_file"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/config_file"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/config_file"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets the server's main configuration file."), // AllowedValues: to.Ptr(".*"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataType("String")), + // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeString), // DefaultValue: to.Ptr(""), // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-file-locations.html#GUC-CONFIG-FILE"), // IsConfigPendingRestart: to.Ptr(false), @@ -1142,7 +1142,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("connection_throttle.bucket_limit"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/connection_throttle.bucket_limit"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/connection_throttle.bucket_limit"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Max login tokens per bucket."), // AllowedValues: to.Ptr("1-2147483647"), @@ -1158,7 +1158,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("connection_throttle.enable"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/connection_throttle.enable"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/connection_throttle.enable"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Enables temporary connection throttling per IP for too many login failures."), // AllowedValues: to.Ptr("on,off"), @@ -1174,7 +1174,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("connection_throttle.factor_bias"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/connection_throttle.factor_bias"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/connection_throttle.factor_bias"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("The factor bias for calculating number of tokens for an IP's bucket."), // AllowedValues: to.Ptr("0.0-0.9"), @@ -1190,7 +1190,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("connection_throttle.hash_entries_max"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/connection_throttle.hash_entries_max"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/connection_throttle.hash_entries_max"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Max number of entries in the login failures hash table."), // AllowedValues: to.Ptr("1-2147483647"), @@ -1206,7 +1206,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("connection_throttle.reset_time"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/connection_throttle.reset_time"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/connection_throttle.reset_time"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Time between resetting the login bucket."), // AllowedValues: to.Ptr("1-2147483647"), @@ -1223,7 +1223,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("connection_throttle.restore_factor"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/connection_throttle.restore_factor"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/connection_throttle.restore_factor"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Factor to increase number of tokens by for IPs with low failure rate."), // AllowedValues: to.Ptr("1.0-100.0"), @@ -1239,7 +1239,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("connection_throttle.update_time"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/connection_throttle.update_time"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/connection_throttle.update_time"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Time between updating the login bucket."), // AllowedValues: to.Ptr("1-2147483647"), @@ -1256,7 +1256,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("constraint_exclusion"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/constraint_exclusion"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/constraint_exclusion"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Controls the query planner's use of table constraints to optimize queries."), // AllowedValues: to.Ptr("partition,on,off"), @@ -1273,7 +1273,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("cpu_index_tuple_cost"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/cpu_index_tuple_cost"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/cpu_index_tuple_cost"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets the planner's estimate of the cost of processing each index entry during an index scan."), // AllowedValues: to.Ptr("0-1.79769e+308"), @@ -1290,7 +1290,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("cpu_operator_cost"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/cpu_operator_cost"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/cpu_operator_cost"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets the planner's estimate of the cost of processing each operator or function executed during a query."), // AllowedValues: to.Ptr("0-1.79769e+308"), @@ -1307,7 +1307,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("cpu_tuple_cost"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/cpu_tuple_cost"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/cpu_tuple_cost"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets the planner's estimate of the cost of processing each row during a query."), // AllowedValues: to.Ptr("0-1.79769e+308"), @@ -1324,11 +1324,11 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("cron.database_name"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/cron.database_name"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/cron.database_name"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets the database in which pg_cron metadata is kept."), // AllowedValues: to.Ptr("[A-Za-z0-9_]+"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataType("String")), + // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeString), // DefaultValue: to.Ptr("postgres"), // DocumentationLink: to.Ptr("https://github.com/citusdata/pg_cron"), // IsConfigPendingRestart: to.Ptr(false), @@ -1341,7 +1341,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("cron.log_run"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/cron.log_run"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/cron.log_run"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Log all jobs runs into the job_run_details table."), // AllowedValues: to.Ptr("on,off"), @@ -1358,7 +1358,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("cron.log_statement"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/cron.log_statement"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/cron.log_statement"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Log all cron statements prior to execution."), // AllowedValues: to.Ptr("on,off"), @@ -1375,7 +1375,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("cron.max_running_jobs"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/cron.max_running_jobs"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/cron.max_running_jobs"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets the maximum number of jobs that can run concurrently. This value is limited by max_connections."), // AllowedValues: to.Ptr("0-5000"), @@ -1392,7 +1392,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("cursor_tuple_fraction"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/cursor_tuple_fraction"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/cursor_tuple_fraction"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets the planner's estimate of the fraction of a cursor's rows that will be retrieved."), // AllowedValues: to.Ptr("0-1"), @@ -1409,7 +1409,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("data_checksums"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/data_checksums"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/data_checksums"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Shows whether data checksums are turned on for this cluster."), // AllowedValues: to.Ptr("on,off"), @@ -1426,11 +1426,11 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("data_directory"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/data_directory"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/data_directory"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets the server's data directory."), // AllowedValues: to.Ptr(".*"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataType("String")), + // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeString), // DefaultValue: to.Ptr(""), // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-file-locations.html#GUC-DATA-DIRECTORY"), // IsConfigPendingRestart: to.Ptr(false), @@ -1443,7 +1443,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("data_directory_mode"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/data_directory_mode"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/data_directory_mode"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Mode of the data directory."), // AllowedValues: to.Ptr("0-511"), @@ -1460,7 +1460,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("data_sync_retry"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/data_sync_retry"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/data_sync_retry"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Whether to continue running after a failure to sync data files."), // AllowedValues: to.Ptr("on,off"), @@ -1477,11 +1477,11 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("DateStyle"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/DateStyle"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/DateStyle"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets the display format for date and time values."), // AllowedValues: to.Ptr("(ISO|POSTGRES|SQL|GERMAN)(, (DMY|MDY|YMD))?"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataType("String")), + // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeString), // DefaultValue: to.Ptr("ISO, MDY"), // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-client.html#GUC-DATESTYLE"), // IsConfigPendingRestart: to.Ptr(false), @@ -1494,7 +1494,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("db_user_namespace"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/db_user_namespace"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/db_user_namespace"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Enables per-database user names."), // AllowedValues: to.Ptr("on,off"), @@ -1511,7 +1511,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("deadlock_timeout"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/deadlock_timeout"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/deadlock_timeout"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets the amount of time, in milliseconds, to wait on a lock before checking for deadlock."), // AllowedValues: to.Ptr("1-2147483647"), @@ -1529,7 +1529,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("debug_assertions"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/debug_assertions"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/debug_assertions"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Shows whether the running server has assertion checks enabled."), // AllowedValues: to.Ptr("on,off"), @@ -1545,7 +1545,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("debug_pretty_print"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/debug_pretty_print"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/debug_pretty_print"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Indents parse and plan tree displays."), // AllowedValues: to.Ptr("on,off"), @@ -1562,7 +1562,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("debug_print_parse"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/debug_print_parse"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/debug_print_parse"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Logs each query's parse tree."), // AllowedValues: to.Ptr("on,off"), @@ -1579,7 +1579,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("debug_print_plan"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/debug_print_plan"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/debug_print_plan"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Logs each query's execution plan."), // AllowedValues: to.Ptr("on,off"), @@ -1596,7 +1596,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("debug_print_rewritten"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/debug_print_rewritten"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/debug_print_rewritten"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Logs each query's rewritten parse tree."), // AllowedValues: to.Ptr("on,off"), @@ -1613,7 +1613,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("default_statistics_target"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/default_statistics_target"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/default_statistics_target"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets the default statistics target for table columns without a column-specific target."), // AllowedValues: to.Ptr("1-10000"), @@ -1630,11 +1630,11 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("default_table_access_method"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/default_table_access_method"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/default_table_access_method"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets the default table access method for new tables."), // AllowedValues: to.Ptr(".*"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataType("String")), + // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeString), // DefaultValue: to.Ptr("heap"), // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-client.html#GUC-DEFAULT-TABLE-ACCESS-METHOD"), // IsConfigPendingRestart: to.Ptr(false), @@ -1647,11 +1647,11 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("default_tablespace"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/default_tablespace"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/default_tablespace"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets the default tablespace to create tables and indexes in."), // AllowedValues: to.Ptr("[A-Za-z._]*"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataType("String")), + // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeString), // DefaultValue: to.Ptr(""), // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-client.html#GUC-DEFAULT-TABLESPACE"), // IsConfigPendingRestart: to.Ptr(false), @@ -1664,11 +1664,11 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("default_text_search_config"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/default_text_search_config"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/default_text_search_config"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Selects the text search configuration that is used by those variants of the text search functions that do not have an explicit argument specifying it."), // AllowedValues: to.Ptr("[A-Za-z._]+"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataType("String")), + // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeString), // DefaultValue: to.Ptr("pg_catalog.english"), // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-client.html#GUC-DEFAULT-TEXT-SEARCH-CONFIG"), // IsConfigPendingRestart: to.Ptr(false), @@ -1681,7 +1681,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("default_transaction_deferrable"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/default_transaction_deferrable"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/default_transaction_deferrable"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("This parameter controls the default deferrable status of each new transaction. It has no effect on read-write transactions or those operating at isolation levels lower than serializable."), // AllowedValues: to.Ptr("on,off"), @@ -1698,7 +1698,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("default_transaction_isolation"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/default_transaction_isolation"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/default_transaction_isolation"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("This parameter controls the default isolation level of each new transaction. The default is 'read committed'."), // AllowedValues: to.Ptr("serializable,repeatable read,read committed,read uncommitted"), @@ -1715,7 +1715,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("default_transaction_read_only"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/default_transaction_read_only"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/default_transaction_read_only"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets the default read-only status of each new transaction."), // AllowedValues: to.Ptr("on,off"), @@ -1732,11 +1732,11 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("dynamic_library_path"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/dynamic_library_path"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/dynamic_library_path"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets the path for dynamically loadable modules."), // AllowedValues: to.Ptr(".*"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataType("String")), + // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeString), // DefaultValue: to.Ptr("$libdir"), // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-client.html#GUC-DYNAMIC-LIBRARY-PATH"), // IsConfigPendingRestart: to.Ptr(false), @@ -1749,7 +1749,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("dynamic_shared_memory_type"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/dynamic_shared_memory_type"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/dynamic_shared_memory_type"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Selects the dynamic shared memory implementation used."), // AllowedValues: to.Ptr("posix,sysv,mmap"), @@ -1766,7 +1766,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("effective_cache_size"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/effective_cache_size"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/effective_cache_size"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets the planner's assumption about the size of the disk cache."), // AllowedValues: to.Ptr("1-2147483647"), @@ -1784,7 +1784,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("effective_io_concurrency"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/effective_io_concurrency"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/effective_io_concurrency"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets the number of concurrent disk I/O operations that PostgreSQL expects can be executed simultaneously."), // AllowedValues: to.Ptr("0-1000"), @@ -1801,7 +1801,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("enable_bitmapscan"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/enable_bitmapscan"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/enable_bitmapscan"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Enables the planner's use of bitmap-scan plans."), // AllowedValues: to.Ptr("on,off"), @@ -1818,7 +1818,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("enable_gathermerge"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/enable_gathermerge"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/enable_gathermerge"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Enables the planner's use of gather merge plans."), // AllowedValues: to.Ptr("on,off"), @@ -1835,7 +1835,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("enable_hashagg"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/enable_hashagg"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/enable_hashagg"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Enables the planner's use of hashed aggregation plans."), // AllowedValues: to.Ptr("on,off"), @@ -1852,7 +1852,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("enable_hashjoin"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/enable_hashjoin"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/enable_hashjoin"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Enables the planner's use of hash join plans."), // AllowedValues: to.Ptr("on,off"), @@ -1869,7 +1869,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("enable_incremental_sort"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/enable_incremental_sort"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/enable_incremental_sort"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Enables the planner's use of incremental sort steps."), // AllowedValues: to.Ptr("on,off"), @@ -1886,7 +1886,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("enable_indexonlyscan"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/enable_indexonlyscan"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/enable_indexonlyscan"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Enables the planner's use of index-only-scan plans."), // AllowedValues: to.Ptr("on,off"), @@ -1903,7 +1903,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("enable_indexscan"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/enable_indexscan"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/enable_indexscan"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Enables the planner's use of index-scan plans."), // AllowedValues: to.Ptr("on,off"), @@ -1920,7 +1920,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("enable_material"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/enable_material"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/enable_material"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Enables the planner's use of materialization."), // AllowedValues: to.Ptr("on,off"), @@ -1937,7 +1937,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("enable_mergejoin"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/enable_mergejoin"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/enable_mergejoin"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Enables the planner's use of merge join plans."), // AllowedValues: to.Ptr("on,off"), @@ -1954,7 +1954,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("enable_nestloop"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/enable_nestloop"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/enable_nestloop"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Enables the planner's use of nested loop join plans."), // AllowedValues: to.Ptr("on,off"), @@ -1971,7 +1971,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("enable_parallel_append"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/enable_parallel_append"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/enable_parallel_append"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Enables the planner's use of parallel append plans."), // AllowedValues: to.Ptr("on,off"), @@ -1988,7 +1988,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("enable_parallel_hash"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/enable_parallel_hash"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/enable_parallel_hash"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Enables the planner's use of parallel hash plans."), // AllowedValues: to.Ptr("on,off"), @@ -2005,7 +2005,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("enable_partition_pruning"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/enable_partition_pruning"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/enable_partition_pruning"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Enables plan-time and run-time partition pruning."), // AllowedValues: to.Ptr("on,off"), @@ -2022,7 +2022,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("enable_partitionwise_aggregate"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/enable_partitionwise_aggregate"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/enable_partitionwise_aggregate"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Enables or disables the query planner's use of partitionwise grouping or aggregation, which allows grouping or aggregation on a partitioned tables performed separately for each partition."), // AllowedValues: to.Ptr("on,off"), @@ -2039,7 +2039,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("enable_partitionwise_join"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/enable_partitionwise_join"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/enable_partitionwise_join"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Enables or disables the query planner's use of partitionwise join, which allows a join between partitioned tables to be performed by joining the matching partitions."), // AllowedValues: to.Ptr("on,off"), @@ -2056,7 +2056,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("enable_seqscan"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/enable_seqscan"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/enable_seqscan"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Enables the planner's use of sequential-scan plans."), // AllowedValues: to.Ptr("on,off"), @@ -2073,7 +2073,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("enable_sort"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/enable_sort"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/enable_sort"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Enables the planner's use of explicit sort steps."), // AllowedValues: to.Ptr("on,off"), @@ -2090,7 +2090,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("enable_tidscan"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/enable_tidscan"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/enable_tidscan"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Enables the planner's use of TID scan plans."), // AllowedValues: to.Ptr("on,off"), @@ -2107,7 +2107,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("escape_string_warning"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/escape_string_warning"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/escape_string_warning"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Warns about backslash escapes in ordinary string literals."), // AllowedValues: to.Ptr("on,off"), @@ -2124,11 +2124,11 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("event_source"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/event_source"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/event_source"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets the application name used to identify PostgreSQL messages in the event log."), // AllowedValues: to.Ptr(".*"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataType("String")), + // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeString), // DefaultValue: to.Ptr("PostgreSQL"), // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-logging.html#GUC-EVENT-SOURCE"), // IsConfigPendingRestart: to.Ptr(false), @@ -2141,7 +2141,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("exit_on_error"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/exit_on_error"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/exit_on_error"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Terminates session on any error."), // AllowedValues: to.Ptr("on,off"), @@ -2158,11 +2158,11 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("external_pid_file"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/external_pid_file"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/external_pid_file"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Writes the postmaster PID to the specified file."), // AllowedValues: to.Ptr(".*"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataType("String")), + // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeString), // DefaultValue: to.Ptr(""), // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-file-locations.html#GUC-EXTERNAL-PID-FILE"), // IsConfigPendingRestart: to.Ptr(false), @@ -2175,7 +2175,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("extra_float_digits"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/extra_float_digits"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/extra_float_digits"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets the number of digits displayed for floating-point values."), // AllowedValues: to.Ptr("-15-3"), @@ -2192,7 +2192,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("force_parallel_mode"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/force_parallel_mode"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/force_parallel_mode"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Forces use of parallel query facilities."), // AllowedValues: to.Ptr("off,on,regress"), @@ -2209,7 +2209,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("from_collapse_limit"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/from_collapse_limit"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/from_collapse_limit"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("The planner will merge sub-queries into upper queries upto this limit in FROM clause. Smaller values reduce planning time but might yield inferior query plans."), // AllowedValues: to.Ptr("1-2147483647"), @@ -2226,7 +2226,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("fsync"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/fsync"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/fsync"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Forces synchronization of updates to disk."), // AllowedValues: to.Ptr("on,off"), @@ -2243,7 +2243,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("full_page_writes"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/full_page_writes"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/full_page_writes"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Writes full pages to WAL when first modified after a checkpoint."), // AllowedValues: to.Ptr("on,off"), @@ -2260,7 +2260,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("geqo"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/geqo"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/geqo"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Enables genetic query optimization."), // AllowedValues: to.Ptr("on,off"), @@ -2277,7 +2277,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("geqo_effort"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/geqo_effort"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/geqo_effort"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("GEQO: effort is used to set the default for other GEQO parameters."), // AllowedValues: to.Ptr("1-10"), @@ -2294,7 +2294,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("geqo_generations"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/geqo_generations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/geqo_generations"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("GEQO: number of iterations of the algorithm."), // AllowedValues: to.Ptr("0-2147483647"), @@ -2311,7 +2311,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("geqo_pool_size"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/geqo_pool_size"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/geqo_pool_size"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("GEQO: number of individuals in the population."), // AllowedValues: to.Ptr("0-2147483647"), @@ -2328,7 +2328,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("geqo_seed"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/geqo_seed"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/geqo_seed"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("GEQO: seed for random path selection."), // AllowedValues: to.Ptr("0-1"), @@ -2345,7 +2345,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("geqo_selection_bias"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/geqo_selection_bias"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/geqo_selection_bias"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("GEQO: selective pressure within the population."), // AllowedValues: to.Ptr("1.5-2"), @@ -2362,7 +2362,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("geqo_threshold"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/geqo_threshold"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/geqo_threshold"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets the threshold of FROM items beyond which GEQO is used."), // AllowedValues: to.Ptr("2-2147483647"), @@ -2379,7 +2379,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("gin_fuzzy_search_limit"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/gin_fuzzy_search_limit"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/gin_fuzzy_search_limit"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets the maximum allowed result for exact search by GIN."), // AllowedValues: to.Ptr("0-2147483647"), @@ -2396,7 +2396,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("gin_pending_list_limit"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/gin_pending_list_limit"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/gin_pending_list_limit"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets the maximum size of the pending list for GIN index."), // AllowedValues: to.Ptr("64-2097151"), @@ -2414,7 +2414,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("hash_mem_multiplier"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/hash_mem_multiplier"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/hash_mem_multiplier"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Multiple of work_mem to use for hash tables."), // AllowedValues: to.Ptr("1-1000"), @@ -2431,11 +2431,11 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("hba_file"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/hba_file"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/hba_file"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets the server's \"hba\" configuration file."), // AllowedValues: to.Ptr(".*"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataType("String")), + // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeString), // DefaultValue: to.Ptr(""), // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-file-locations.html#GUC-HBA-FILE"), // IsConfigPendingRestart: to.Ptr(false), @@ -2448,7 +2448,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("hot_standby"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/hot_standby"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/hot_standby"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Allows connections and queries during recovery."), // AllowedValues: to.Ptr("on,off"), @@ -2465,7 +2465,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("hot_standby_feedback"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/hot_standby_feedback"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/hot_standby_feedback"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Enables/disables the option whether hot standby needs to send feedback to the primary or upstream standby about queries currently executing on the standby."), // AllowedValues: to.Ptr("on,off"), @@ -2482,7 +2482,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("huge_pages"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/huge_pages"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/huge_pages"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Enables/disables the use of huge memory pages. This setting is not applicable to servers having less than 4 vCores."), // AllowedValues: to.Ptr("on,off,try"), @@ -2499,11 +2499,11 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("ident_file"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/ident_file"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/ident_file"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets the server's \"ident\" configuration file."), // AllowedValues: to.Ptr(".*"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataType("String")), + // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeString), // DefaultValue: to.Ptr(""), // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-file-locations.html#GUC-IDENT-FILE"), // IsConfigPendingRestart: to.Ptr(false), @@ -2516,7 +2516,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("idle_in_transaction_session_timeout"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/idle_in_transaction_session_timeout"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/idle_in_transaction_session_timeout"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets the maximum allowed duration of any idling transaction."), // AllowedValues: to.Ptr("0-2147483647"), @@ -2534,7 +2534,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("ignore_checksum_failure"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/ignore_checksum_failure"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/ignore_checksum_failure"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Continues processing after a checksum failure."), // AllowedValues: to.Ptr("on,off"), @@ -2551,7 +2551,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("ignore_invalid_pages"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/ignore_invalid_pages"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/ignore_invalid_pages"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Continues recovery after an invalid pages failure."), // AllowedValues: to.Ptr("on,off"), @@ -2568,7 +2568,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("ignore_system_indexes"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/ignore_system_indexes"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/ignore_system_indexes"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Disables reading from system indexes."), // AllowedValues: to.Ptr("on,off"), @@ -2585,7 +2585,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("index_tuning.analysis_interval"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/index_tuning.analysis_interval"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/index_tuning.analysis_interval"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets the frequency at which each index optimization session is triggered when index_tuning.mode is set to 'REPORT'."), // AllowedValues: to.Ptr("60-10080"), @@ -2603,7 +2603,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("index_tuning.max_columns_per_index"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/index_tuning.max_columns_per_index"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/index_tuning.max_columns_per_index"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Maximum number of columns that can be part of the index key for any recommended index."), // AllowedValues: to.Ptr("1-10"), @@ -2620,7 +2620,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("index_tuning.max_index_count"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/index_tuning.max_index_count"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/index_tuning.max_index_count"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Maximum number of indexes that can be recommended for each database during one optimization session."), // AllowedValues: to.Ptr("1-25"), @@ -2637,7 +2637,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("index_tuning.max_indexes_per_table"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/index_tuning.max_indexes_per_table"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/index_tuning.max_indexes_per_table"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Maximum number of indexes that can be recommended for each table."), // AllowedValues: to.Ptr("1-25"), @@ -2654,7 +2654,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("index_tuning.max_queries_per_database"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/index_tuning.max_queries_per_database"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/index_tuning.max_queries_per_database"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Number of slowest queries per database for which indexes can be recommended."), // AllowedValues: to.Ptr("5-100"), @@ -2671,7 +2671,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("index_tuning.max_regression_factor"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/index_tuning.max_regression_factor"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/index_tuning.max_regression_factor"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Acceptable regression introduced by a recommended index on any of the queries analyzed during one optimization session."), // AllowedValues: to.Ptr("0.05-0.2"), @@ -2689,7 +2689,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("index_tuning.max_total_size_factor"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/index_tuning.max_total_size_factor"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/index_tuning.max_total_size_factor"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Maximum total size, in percentage of total disk space, that all recommended indexes for any given database can use."), // AllowedValues: to.Ptr("0-1.0"), @@ -2707,7 +2707,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("index_tuning.min_improvement_factor"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/index_tuning.min_improvement_factor"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/index_tuning.min_improvement_factor"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Cost improvement that a recommended index must provide to at least one of the queries analyzed during one optimization session."), // AllowedValues: to.Ptr("0-20.0"), @@ -2725,7 +2725,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("index_tuning.mode"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/index_tuning.mode"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/index_tuning.mode"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Configures index optimization as disabled ('OFF') or enabled to only emit recommendation. Requires Query Store to be enabled by setting pg_qs.query_capture_mode to 'TOP' or 'ALL'."), // AllowedValues: to.Ptr("off,report"), @@ -2742,7 +2742,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("index_tuning.unused_dml_per_table"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/index_tuning.unused_dml_per_table"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/index_tuning.unused_dml_per_table"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Minimum number of daily average DML operations affecting the table, so that their unused indexes are considered for dropping."), // AllowedValues: to.Ptr("0-9999999"), @@ -2759,7 +2759,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("index_tuning.unused_min_period"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/index_tuning.unused_min_period"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/index_tuning.unused_min_period"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Minimum number of days the index has not been used, based on system statistics, so that it is considered for dropping."), // AllowedValues: to.Ptr("30-720"), @@ -2777,7 +2777,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("index_tuning.unused_reads_per_table"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/index_tuning.unused_reads_per_table"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/index_tuning.unused_reads_per_table"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Minimum number of daily average read operations affecting the table, so that their unused indexes are considered for dropping."), // AllowedValues: to.Ptr("0-9999999"), @@ -2794,7 +2794,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("integer_datetimes"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/integer_datetimes"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/integer_datetimes"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Datetimes are integer based."), // AllowedValues: to.Ptr("on,off"), @@ -2811,7 +2811,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("intelligent_tuning"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/intelligent_tuning"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/intelligent_tuning"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Enables intelligent tuning"), // AllowedValues: to.Ptr("on,off"), @@ -2828,11 +2828,11 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("intelligent_tuning.metric_targets"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/intelligent_tuning.metric_targets"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/intelligent_tuning.metric_targets"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Specifies which metrics will be adjusted by intelligent tuning."), // AllowedValues: to.Ptr("none,Storage-checkpoint_completion_target,Storage-min_wal_size,Storage-max_wal_size,Storage-bgwriter_delay,tuning-autovacuum,all"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataType("Set")), + // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeSet), // DefaultValue: to.Ptr("none"), // DocumentationLink: to.Ptr("https://go.microsoft.com/fwlink/?linkid=2274150"), // IsConfigPendingRestart: to.Ptr(false), @@ -2845,7 +2845,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("IntervalStyle"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/IntervalStyle"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/IntervalStyle"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets the display format for interval values."), // AllowedValues: to.Ptr("postgres,postgres_verbose,sql_standard,iso_8601"), @@ -2862,7 +2862,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("jit"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/jit"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/jit"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Determines whether JIT compilation may be used by PostgreSQL."), // AllowedValues: to.Ptr("on, off"), @@ -2879,7 +2879,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("jit_above_cost"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/jit_above_cost"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/jit_above_cost"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets the query cost above which JIT compilation is activated, if enabled."), // AllowedValues: to.Ptr("-1-2147483647"), @@ -2896,7 +2896,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("jit_debugging_support"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/jit_debugging_support"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/jit_debugging_support"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Register JIT compiled function with debugger."), // AllowedValues: to.Ptr("on,off"), @@ -2913,7 +2913,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("jit_dump_bitcode"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/jit_dump_bitcode"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/jit_dump_bitcode"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Write out LLVM bitcode to facilitate JIT debugging."), // AllowedValues: to.Ptr("on,off"), @@ -2930,7 +2930,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("jit_expressions"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/jit_expressions"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/jit_expressions"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Allow JIT compilation of expressions."), // AllowedValues: to.Ptr("on,off"), @@ -2947,7 +2947,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("jit_inline_above_cost"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/jit_inline_above_cost"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/jit_inline_above_cost"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets the query cost above which JIT compilation attempts to inline functions and operators."), // AllowedValues: to.Ptr("-1-2147483647"), @@ -2964,7 +2964,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("jit_optimize_above_cost"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/jit_optimize_above_cost"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/jit_optimize_above_cost"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets the query cost above which JIT compilation applies expensive optimizations."), // AllowedValues: to.Ptr("-1-2147483647"), @@ -2981,7 +2981,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("jit_profiling_support"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/jit_profiling_support"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/jit_profiling_support"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Register JIT compiled function with perf profiler."), // AllowedValues: to.Ptr("on,off"), @@ -2998,11 +2998,11 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("jit_provider"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/jit_provider"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/jit_provider"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("JIT provider to use."), // AllowedValues: to.Ptr(".*"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataType("String")), + // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeString), // DefaultValue: to.Ptr("llvmjit"), // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-client.html#GUC-JIT-PROVIDER"), // IsConfigPendingRestart: to.Ptr(false), @@ -3015,7 +3015,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("jit_tuple_deforming"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/jit_tuple_deforming"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/jit_tuple_deforming"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Allow JIT compilation of tuple deforming."), // AllowedValues: to.Ptr("on,off"), @@ -3032,7 +3032,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("join_collapse_limit"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/join_collapse_limit"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/join_collapse_limit"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets the FROM-list size beyond which JOIN constructs are not flattened."), // AllowedValues: to.Ptr("1-2147483647"), @@ -3049,7 +3049,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("krb_caseins_users"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/krb_caseins_users"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/krb_caseins_users"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets whether Kerberos and GSSAPI user names should be treated as case-insensitive."), // AllowedValues: to.Ptr("on,off"), @@ -3066,11 +3066,11 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("krb_server_keyfile"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/krb_server_keyfile"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/krb_server_keyfile"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets the location of the Kerberos server key file."), // AllowedValues: to.Ptr(".*"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataType("String")), + // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeString), // DefaultValue: to.Ptr(""), // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-connection.html#GUC-KRB-SERVER-KEYFILE"), // IsConfigPendingRestart: to.Ptr(false), @@ -3083,11 +3083,11 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("lc_collate"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/lc_collate"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/lc_collate"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Shows the collation order locale."), // AllowedValues: to.Ptr(".*"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataType("String")), + // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeString), // DefaultValue: to.Ptr("C"), // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/locale.html"), // IsConfigPendingRestart: to.Ptr(false), @@ -3100,11 +3100,11 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("lc_ctype"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/lc_ctype"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/lc_ctype"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Shows the character classification and case conversion locale."), // AllowedValues: to.Ptr(".*"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataType("String")), + // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeString), // DefaultValue: to.Ptr("C"), // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/locale.html"), // IsConfigPendingRestart: to.Ptr(false), @@ -3117,11 +3117,11 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("lc_messages"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/lc_messages"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/lc_messages"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets the language in which messages are displayed."), // AllowedValues: to.Ptr(".*"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataType("String")), + // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeString), // DefaultValue: to.Ptr(""), // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-client.html#GUC-LC-MESSAGES"), // IsConfigPendingRestart: to.Ptr(false), @@ -3134,11 +3134,11 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("lc_monetary"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/lc_monetary"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/lc_monetary"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets the locale for formatting monetary amounts."), // AllowedValues: to.Ptr("[A-Za-z0-9._ -]+"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataType("String")), + // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeString), // DefaultValue: to.Ptr("en_US.utf-8"), // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-client.html#GUC-LC-MONETARY"), // IsConfigPendingRestart: to.Ptr(false), @@ -3151,11 +3151,11 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("lc_numeric"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/lc_numeric"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/lc_numeric"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets the locale for formatting numbers."), // AllowedValues: to.Ptr("[A-Za-z0-9._ -]+"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataType("String")), + // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeString), // DefaultValue: to.Ptr("en_US.utf-8"), // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-client.html#GUC-LC-NUMERIC"), // IsConfigPendingRestart: to.Ptr(false), @@ -3168,11 +3168,11 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("lc_time"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/lc_time"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/lc_time"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets the locale for formatting date and time values."), // AllowedValues: to.Ptr(".*"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataType("String")), + // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeString), // DefaultValue: to.Ptr("C"), // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-client.html#GUC-LC-TIME"), // IsConfigPendingRestart: to.Ptr(false), @@ -3185,11 +3185,11 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("listen_addresses"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/listen_addresses"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/listen_addresses"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets the host name or IP address(es) to listen to."), // AllowedValues: to.Ptr(".*"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataType("String")), + // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeString), // DefaultValue: to.Ptr("localhost"), // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-connection.html#GUC-LISTEN-ADDRESSES"), // IsConfigPendingRestart: to.Ptr(false), @@ -3202,7 +3202,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("lo_compat_privileges"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/lo_compat_privileges"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/lo_compat_privileges"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Enables backward compatibility mode for privilege checks on large objects."), // AllowedValues: to.Ptr("on,off"), @@ -3219,11 +3219,11 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("local_preload_libraries"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/local_preload_libraries"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/local_preload_libraries"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Lists unprivileged shared libraries to preload into each backend."), // AllowedValues: to.Ptr(".*"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataType("String")), + // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeString), // DefaultValue: to.Ptr(""), // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-client.html#GUC-LOCAL-PRELOAD-LIBRARIES"), // IsConfigPendingRestart: to.Ptr(false), @@ -3236,7 +3236,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("lock_timeout"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/lock_timeout"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/lock_timeout"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets the maximum allowed duration (in milliseconds) of any wait for a lock. 0 turns this off."), // AllowedValues: to.Ptr("0-2147483647"), @@ -3254,7 +3254,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("log_autovacuum_min_duration"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/log_autovacuum_min_duration"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/log_autovacuum_min_duration"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets the minimum execution time above which autovacuum actions will be logged."), // AllowedValues: to.Ptr("-1-2147483647"), @@ -3272,7 +3272,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("log_checkpoints"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/log_checkpoints"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/log_checkpoints"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Logs each checkpoint."), // AllowedValues: to.Ptr("on,off"), @@ -3289,7 +3289,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("log_connections"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/log_connections"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/log_connections"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Causes each attempted connection to the server to be logged, as well as successful completion of client authentication."), // AllowedValues: to.Ptr("on,off"), @@ -3306,7 +3306,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("log_destination"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/log_destination"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/log_destination"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets the destination for server log output."), // AllowedValues: to.Ptr("stderr,csvlog"), @@ -3323,11 +3323,11 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("log_directory"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/log_directory"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/log_directory"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets the destination directory for log files."), // AllowedValues: to.Ptr(".*"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataType("String")), + // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeString), // DefaultValue: to.Ptr("log"), // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-logging.html#GUC-LOG-DIRECTORY"), // IsConfigPendingRestart: to.Ptr(false), @@ -3340,7 +3340,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("log_disconnections"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/log_disconnections"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/log_disconnections"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Logs end of a session, including duration."), // AllowedValues: to.Ptr("on,off"), @@ -3357,7 +3357,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("log_duration"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/log_duration"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/log_duration"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Logs the duration of each completed SQL statement."), // AllowedValues: to.Ptr("on,off"), @@ -3374,7 +3374,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("log_error_verbosity"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/log_error_verbosity"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/log_error_verbosity"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Controls the amount of detail written in the server log for each message that is logged."), // AllowedValues: to.Ptr("terse,default,verbose"), @@ -3391,7 +3391,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("log_executor_stats"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/log_executor_stats"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/log_executor_stats"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Writes executor performance statistics to the server log."), // AllowedValues: to.Ptr("on,off"), @@ -3408,7 +3408,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("log_file_mode"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/log_file_mode"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/log_file_mode"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets the file permissions for log files."), // AllowedValues: to.Ptr("0-511"), @@ -3425,11 +3425,11 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("log_filename"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/log_filename"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/log_filename"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets the file name pattern for log files."), // AllowedValues: to.Ptr(".*"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataType("String")), + // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeString), // DefaultValue: to.Ptr("postgresql-%Y-%m-%d_%H%M%S.log"), // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-logging.html#GUC-LOG-FILENAME"), // IsConfigPendingRestart: to.Ptr(false), @@ -3442,7 +3442,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("log_hostname"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/log_hostname"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/log_hostname"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Logs the host name in the connection logs."), // AllowedValues: to.Ptr("on,off"), @@ -3459,11 +3459,11 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("log_line_prefix"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/log_line_prefix"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/log_line_prefix"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets the printf-style string that is output at the beginning of each log line."), // AllowedValues: to.Ptr("[^']*"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataType("String")), + // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeString), // DefaultValue: to.Ptr("%t-%c-"), // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-logging.html#GUC-LOG-LINE-PREFIX"), // IsConfigPendingRestart: to.Ptr(false), @@ -3476,7 +3476,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("log_lock_waits"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/log_lock_waits"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/log_lock_waits"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Controls whether a log message is produced when a session waits longer than deadlock_timeout to acquire a lock."), // AllowedValues: to.Ptr("on,off"), @@ -3493,7 +3493,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("log_min_duration_sample"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/log_min_duration_sample"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/log_min_duration_sample"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets the minimum execution time above which a sample of statements will be logged. Sampling is determined by log_statement_sample_rate."), // AllowedValues: to.Ptr("-1-2147483647"), @@ -3511,7 +3511,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("log_min_duration_statement"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/log_min_duration_statement"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/log_min_duration_statement"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets the minimum execution time (in milliseconds) above which statements will be logged. -1 disables logging statement durations."), // AllowedValues: to.Ptr("-1-2147483647"), @@ -3529,7 +3529,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("log_min_error_statement"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/log_min_error_statement"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/log_min_error_statement"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Causes all statements generating error at or above this level to be logged."), // AllowedValues: to.Ptr("debug5,debug4,debug3,debug2,debug1,info,notice,warning,error,log,fatal,panic"), @@ -3546,7 +3546,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("log_min_messages"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/log_min_messages"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/log_min_messages"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Controls which message levels are written to the server log."), // AllowedValues: to.Ptr("debug5,debug4,debug3,debug2,debug1,info,notice,warning,error,log,fatal,panic"), @@ -3563,7 +3563,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("log_parameter_max_length"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/log_parameter_max_length"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/log_parameter_max_length"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("When logging statements, limit logged parameter values to first N bytes."), // AllowedValues: to.Ptr("-1-1073741823"), @@ -3581,7 +3581,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("log_parameter_max_length_on_error"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/log_parameter_max_length_on_error"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/log_parameter_max_length_on_error"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("When reporting an error, limit logged parameter values to first N bytes."), // AllowedValues: to.Ptr("-1-1073741823"), @@ -3599,7 +3599,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("log_parser_stats"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/log_parser_stats"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/log_parser_stats"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Writes parser performance statistics to the server log."), // AllowedValues: to.Ptr("on,off"), @@ -3616,7 +3616,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("log_planner_stats"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/log_planner_stats"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/log_planner_stats"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Writes planner performance statistics to the server log."), // AllowedValues: to.Ptr("on,off"), @@ -3633,7 +3633,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("log_replication_commands"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/log_replication_commands"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/log_replication_commands"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Logs each replication command."), // AllowedValues: to.Ptr("on,off"), @@ -3650,7 +3650,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("log_rotation_age"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/log_rotation_age"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/log_rotation_age"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Automatic log file rotation will occur after N minutes."), // AllowedValues: to.Ptr("0-35791394"), @@ -3668,7 +3668,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("log_rotation_size"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/log_rotation_size"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/log_rotation_size"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Automatic log file rotation will occur after N kilobytes."), // AllowedValues: to.Ptr("0-2097151"), @@ -3686,7 +3686,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("log_statement"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/log_statement"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/log_statement"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets the type of statements logged."), // AllowedValues: to.Ptr("none,ddl,mod,all"), @@ -3703,7 +3703,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("log_statement_sample_rate"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/log_statement_sample_rate"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/log_statement_sample_rate"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Fraction of statements exceeding log_min_duration_sample to be logged."), // AllowedValues: to.Ptr("0-1"), @@ -3720,7 +3720,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("log_statement_stats"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/log_statement_stats"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/log_statement_stats"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("For each query, writes cumulative performance statistics to the server log."), // AllowedValues: to.Ptr("on,off"), @@ -3737,7 +3737,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("log_temp_files"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/log_temp_files"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/log_temp_files"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Logs the use of temporary files larger than this number of kilobytes."), // AllowedValues: to.Ptr("-1-2147483647"), @@ -3755,11 +3755,11 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("log_timezone"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/log_timezone"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/log_timezone"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets the time zone to use in log messages."), // AllowedValues: to.Ptr(".*"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataType("String")), + // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeString), // DefaultValue: to.Ptr("GMT"), // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-logging.html#GUC-LOG-TIMEZONE"), // IsConfigPendingRestart: to.Ptr(false), @@ -3772,7 +3772,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("log_transaction_sample_rate"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/log_transaction_sample_rate"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/log_transaction_sample_rate"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Set the fraction of transactions to log for new transactions."), // AllowedValues: to.Ptr("0-1"), @@ -3789,7 +3789,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("log_truncate_on_rotation"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/log_truncate_on_rotation"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/log_truncate_on_rotation"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Truncate existing log files of same name during log rotation."), // AllowedValues: to.Ptr("on,off"), @@ -3806,7 +3806,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("logfiles.download_enable"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/logfiles.download_enable"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/logfiles.download_enable"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Enables or disables server logs functionality."), // AllowedValues: to.Ptr("on,off"), @@ -3823,7 +3823,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("logfiles.retention_days"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/logfiles.retention_days"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/logfiles.retention_days"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets the retention period window in days for server logs - after this time data will be deleted."), // AllowedValues: to.Ptr("1-7"), @@ -3840,7 +3840,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("logging_collector"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/logging_collector"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/logging_collector"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Start a subprocess to capture stderr output and/or csvlogs into log files."), // AllowedValues: to.Ptr("on,off"), @@ -3857,7 +3857,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("logical_decoding_work_mem"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/logical_decoding_work_mem"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/logical_decoding_work_mem"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets the maximum memory to be used for logical decoding."), // AllowedValues: to.Ptr("64-2147483647"), @@ -3875,7 +3875,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("maintenance_io_concurrency"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/maintenance_io_concurrency"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/maintenance_io_concurrency"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("A variant of effective_io_concurrency that is used for maintenance work."), // AllowedValues: to.Ptr("0-1000"), @@ -3892,7 +3892,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("maintenance_work_mem"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/maintenance_work_mem"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/maintenance_work_mem"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets the maximum memory to be used for maintenance operations such as VACUUM, Create Index."), // AllowedValues: to.Ptr("1024-2097151"), @@ -3910,7 +3910,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("max_connections"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/max_connections"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/max_connections"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets the maximum number of concurrent connections to the database server."), // AllowedValues: to.Ptr("25-5000"), @@ -3927,7 +3927,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("max_files_per_process"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/max_files_per_process"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/max_files_per_process"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets the maximum number of simultaneously open files for each server process."), // AllowedValues: to.Ptr("64-2147483647"), @@ -3944,7 +3944,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("max_function_args"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/max_function_args"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/max_function_args"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Shows the maximum number of function arguments."), // AllowedValues: to.Ptr("100-100"), @@ -3961,7 +3961,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("max_identifier_length"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/max_identifier_length"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/max_identifier_length"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Shows the maximum identifier length."), // AllowedValues: to.Ptr("63-63"), @@ -3978,7 +3978,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("max_index_keys"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/max_index_keys"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/max_index_keys"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Shows the maximum number of index keys."), // AllowedValues: to.Ptr("32-32"), @@ -3995,7 +3995,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("max_locks_per_transaction"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/max_locks_per_transaction"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/max_locks_per_transaction"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets the maximum number of locks can be taken per transaction. When running a replica server, you must set this parameter to the same or higher value than on the master server."), // AllowedValues: to.Ptr("10-8388608"), @@ -4012,7 +4012,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("max_logical_replication_workers"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/max_logical_replication_workers"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/max_logical_replication_workers"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Specifies maximum number of logical replication workers. This includes both apply workers and table synchronization workers."), // AllowedValues: to.Ptr("0-262143"), @@ -4029,7 +4029,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("max_parallel_maintenance_workers"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/max_parallel_maintenance_workers"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/max_parallel_maintenance_workers"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets the maximum number of parallel processes per maintenance operation."), // AllowedValues: to.Ptr("0-64"), @@ -4046,7 +4046,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("max_parallel_workers"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/max_parallel_workers"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/max_parallel_workers"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets the maximum number of workers than can be supported for parallel operations."), // AllowedValues: to.Ptr("0-1024"), @@ -4063,7 +4063,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("max_parallel_workers_per_gather"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/max_parallel_workers_per_gather"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/max_parallel_workers_per_gather"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets the maximum number of parallel processes per executor node."), // AllowedValues: to.Ptr("0-1024"), @@ -4080,7 +4080,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("max_pred_locks_per_page"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/max_pred_locks_per_page"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/max_pred_locks_per_page"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets the maximum number of predicate-locked tuples per page."), // AllowedValues: to.Ptr("0-2147483647"), @@ -4097,7 +4097,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("max_pred_locks_per_relation"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/max_pred_locks_per_relation"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/max_pred_locks_per_relation"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets the maximum number of predicate-locked pages and tuples per relation."), // AllowedValues: to.Ptr("-2147483648-2147483647"), @@ -4114,7 +4114,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("max_pred_locks_per_transaction"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/max_pred_locks_per_transaction"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/max_pred_locks_per_transaction"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets the maximum number of predicate locks per transaction."), // AllowedValues: to.Ptr("10-2147483647"), @@ -4131,7 +4131,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("max_prepared_transactions"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/max_prepared_transactions"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/max_prepared_transactions"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets the maximum number of simultaneously prepared transactions. When running a replica server, you must set this parameter to the same or higher value than on the primary server."), // AllowedValues: to.Ptr("0-262143"), @@ -4148,7 +4148,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("max_replication_slots"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/max_replication_slots"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/max_replication_slots"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Specifies the maximum number of replication slots that the server can support."), // AllowedValues: to.Ptr("2-262143"), @@ -4165,7 +4165,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("max_slot_wal_keep_size"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/max_slot_wal_keep_size"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/max_slot_wal_keep_size"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets the maximum WAL size that can be reserved by replication slots."), // AllowedValues: to.Ptr("-1-2147483647"), @@ -4183,7 +4183,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("max_stack_depth"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/max_stack_depth"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/max_stack_depth"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets the maximum stack depth, in kilobytes."), // AllowedValues: to.Ptr("100-2147483647"), @@ -4201,7 +4201,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("max_standby_archive_delay"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/max_standby_archive_delay"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/max_standby_archive_delay"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets the maximum delay before canceling queries that conflict when a hot standby server is processing archived WAL data."), // AllowedValues: to.Ptr("-1-2147483647"), @@ -4219,7 +4219,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("max_standby_streaming_delay"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/max_standby_streaming_delay"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/max_standby_streaming_delay"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets the maximum delay before canceling queries that conflict when a hot standby server is processing streamed WAL data."), // AllowedValues: to.Ptr("-1-2147483647"), @@ -4237,7 +4237,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("max_sync_workers_per_subscription"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/max_sync_workers_per_subscription"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/max_sync_workers_per_subscription"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Maximum number of table synchronization workers per subscription."), // AllowedValues: to.Ptr("0-262143"), @@ -4254,7 +4254,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("max_wal_senders"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/max_wal_senders"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/max_wal_senders"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets the maximum number of simultaneously running WAL sender processes."), // AllowedValues: to.Ptr("5-100"), @@ -4271,7 +4271,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("max_wal_size"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/max_wal_size"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/max_wal_size"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Maximum size to let the WAL grow before triggering automatic checkpoint."), // AllowedValues: to.Ptr("32-65536"), @@ -4289,7 +4289,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("max_worker_processes"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/max_worker_processes"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/max_worker_processes"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets the maximum number of background processes that the system can support."), // AllowedValues: to.Ptr("0-262143"), @@ -4306,7 +4306,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("metrics.autovacuum_diagnostics"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/metrics.autovacuum_diagnostics"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/metrics.autovacuum_diagnostics"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Enables metrics collection for all table statistics within a database"), // AllowedValues: to.Ptr("on,off"), @@ -4323,7 +4323,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("metrics.collector_database_activity"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/metrics.collector_database_activity"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/metrics.collector_database_activity"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Enables metrics collection for database and activity statistics"), // AllowedValues: to.Ptr("on,off"), @@ -4340,7 +4340,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("metrics.pgbouncer_diagnostics"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/metrics.pgbouncer_diagnostics"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/metrics.pgbouncer_diagnostics"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Enables metrics collection for PgBouncer."), // AllowedValues: to.Ptr("on,off"), @@ -4357,7 +4357,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("min_parallel_index_scan_size"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/min_parallel_index_scan_size"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/min_parallel_index_scan_size"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets the minimum amount of index data for a parallel scan."), // AllowedValues: to.Ptr("0-715827882"), @@ -4375,7 +4375,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("min_parallel_table_scan_size"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/min_parallel_table_scan_size"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/min_parallel_table_scan_size"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets the minimum amount of table data that must be scanned for a parallel scan to be considered."), // AllowedValues: to.Ptr("0-715827882"), @@ -4393,7 +4393,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("min_wal_size"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/min_wal_size"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/min_wal_size"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets the minimum size to shrink the WAL to."), // AllowedValues: to.Ptr("32-2097151"), @@ -4411,7 +4411,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("parallel_leader_participation"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/parallel_leader_participation"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/parallel_leader_participation"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Controls whether Gather and Gather Merge also run subplans."), // AllowedValues: to.Ptr("on,off"), @@ -4427,7 +4427,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("parallel_setup_cost"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/parallel_setup_cost"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/parallel_setup_cost"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets the planner's estimate of the cost of starting up worker processes for parallel query."), // AllowedValues: to.Ptr("0-1.79769e+308"), @@ -4444,7 +4444,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("parallel_tuple_cost"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/parallel_tuple_cost"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/parallel_tuple_cost"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets the planner's estimate of the cost of passing each tuple (row) from worker to master backend."), // AllowedValues: to.Ptr("0-1.79769e+308"), @@ -4461,7 +4461,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("password_encryption"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/password_encryption"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/password_encryption"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Determines the algorithm to use to encrypt the password."), // AllowedValues: to.Ptr("md5,scram-sha-256"), @@ -4478,7 +4478,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("pg_partman_bgw.analyze"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/pg_partman_bgw.analyze"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/pg_partman_bgw.analyze"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Same purpose as the p_analyze argument to run_maintenance()."), // AllowedValues: to.Ptr("on,off"), @@ -4495,11 +4495,11 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("pg_partman_bgw.dbname"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/pg_partman_bgw.dbname"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/pg_partman_bgw.dbname"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Required. The database(s) that run_maintenance() will run on. If more than one, use a comma separated list. If not set, BGW will do nothing."), // AllowedValues: to.Ptr("[A-Za-z0-9_,-]*"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataType("String")), + // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeString), // DefaultValue: to.Ptr(""), // DocumentationLink: to.Ptr("https://github.com/pgpartman/pg_partman"), // IsConfigPendingRestart: to.Ptr(false), @@ -4512,7 +4512,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("pg_partman_bgw.interval"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/pg_partman_bgw.interval"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/pg_partman_bgw.interval"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Number of seconds between calls to run_maintenance()."), // AllowedValues: to.Ptr("1-315360000"), @@ -4530,7 +4530,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("pg_partman_bgw.jobmon"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/pg_partman_bgw.jobmon"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/pg_partman_bgw.jobmon"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Same purpose as the p_jobmon argument to run_maintenance()."), // AllowedValues: to.Ptr("on,off"), @@ -4547,11 +4547,11 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("pg_partman_bgw.role"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/pg_partman_bgw.role"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/pg_partman_bgw.role"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("The role that run_maintenance() will run as. Default is postgres. Only a single role name is allowed."), // AllowedValues: to.Ptr("[A-Za-z\\._]*"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataType("String")), + // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeString), // DefaultValue: to.Ptr(""), // DocumentationLink: to.Ptr("https://github.com/pgpartman/pg_partman"), // IsConfigPendingRestart: to.Ptr(false), @@ -4564,7 +4564,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("pg_qs.interval_length_minutes"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/pg_qs.interval_length_minutes"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/pg_qs.interval_length_minutes"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets the query_store capture interval in minutes for pg_qs - this is the frequency of data persistence."), // AllowedValues: to.Ptr("1-30"), @@ -4582,7 +4582,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("pg_qs.is_enabled_fs"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/pg_qs.is_enabled_fs"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/pg_qs.is_enabled_fs"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Internal Use Only: This parameter is used as a feature override switch. If it shows as off, Query Store will be disabled despite the value set for pg_qs.query_capture_mode."), // AllowedValues: to.Ptr("on,off"), @@ -4599,7 +4599,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("pg_qs.max_plan_size"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/pg_qs.max_plan_size"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/pg_qs.max_plan_size"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets the maximum number of bytes that will be saved for query plan text for pg_qs; longer plans will be truncated."), // AllowedValues: to.Ptr("100-10000"), @@ -4617,7 +4617,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("pg_qs.max_query_text_length"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/pg_qs.max_query_text_length"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/pg_qs.max_query_text_length"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets the maximum query text length that will be saved; longer queries will be truncated."), // AllowedValues: to.Ptr("100-10000"), @@ -4635,7 +4635,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("pg_qs.parameters_capture_mode"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/pg_qs.parameters_capture_mode"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/pg_qs.parameters_capture_mode"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Whether and when to capture query positional parameters."), // AllowedValues: to.Ptr("capture_parameterless_only,capture_first_sample"), @@ -4652,7 +4652,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("pg_qs.query_capture_mode"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/pg_qs.query_capture_mode"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/pg_qs.query_capture_mode"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets query capture mode for query store. None disables any capturing."), // AllowedValues: to.Ptr("top,all,none"), @@ -4669,7 +4669,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("pg_qs.retention_period_in_days"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/pg_qs.retention_period_in_days"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/pg_qs.retention_period_in_days"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets the retention period window in days for pg_qs - after this time data will be deleted."), // AllowedValues: to.Ptr("1-30"), @@ -4686,7 +4686,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("pg_qs.store_query_plans"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/pg_qs.store_query_plans"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/pg_qs.store_query_plans"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Turns saving query plans on or off for pg_qs "), // AllowedValues: to.Ptr("on,off"), @@ -4703,7 +4703,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("pg_qs.track_utility"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/pg_qs.track_utility"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/pg_qs.track_utility"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Selects whether utility commands are tracked by pg_qs."), // AllowedValues: to.Ptr("on,off"), @@ -4720,7 +4720,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("pg_stat_statements.max"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/pg_stat_statements.max"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/pg_stat_statements.max"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets the maximum number of statements tracked by pg_stat_statements."), // AllowedValues: to.Ptr("100-2147483647"), @@ -4737,7 +4737,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("pg_stat_statements.save"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/pg_stat_statements.save"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/pg_stat_statements.save"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Save pg_stat_statements statistics across server shutdowns."), // AllowedValues: to.Ptr("on,off"), @@ -4754,7 +4754,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("pg_stat_statements.track"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/pg_stat_statements.track"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/pg_stat_statements.track"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Controls which statements are counted by pg_stat_statements."), // AllowedValues: to.Ptr("top,all,none"), @@ -4771,7 +4771,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("pg_stat_statements.track_utility"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/pg_stat_statements.track_utility"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/pg_stat_statements.track_utility"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Selects whether utility commands are tracked by pg_stat_statements."), // AllowedValues: to.Ptr("on,off"), @@ -4788,11 +4788,11 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("pgaudit.log"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/pgaudit.log"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/pgaudit.log"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Specifies which classes of statements will be logged by session audit logging."), // AllowedValues: to.Ptr("none,read,write,function,role,ddl,misc,all"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataType("Set")), + // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeSet), // DefaultValue: to.Ptr("none"), // DocumentationLink: to.Ptr("https://github.com/pgaudit/pgaudit/blob/master/README.md"), // IsConfigPendingRestart: to.Ptr(false), @@ -4805,7 +4805,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("pgaudit.log_catalog"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/pgaudit.log_catalog"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/pgaudit.log_catalog"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Specifies that session logging should be enabled in the case where all relations in a statement are in pg_catalog."), // AllowedValues: to.Ptr("on,off"), @@ -4822,7 +4822,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("pgaudit.log_client"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/pgaudit.log_client"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/pgaudit.log_client"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Specifies whether audit messages should be visible to client."), // AllowedValues: to.Ptr("on,off"), @@ -4839,7 +4839,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("pgaudit.log_level"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/pgaudit.log_level"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/pgaudit.log_level"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Specifies the log level that will be used for log entries."), // AllowedValues: to.Ptr(",debug5,debug4,debug3,debug2,debug1,info,notice,warning,log"), @@ -4856,7 +4856,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("pgaudit.log_parameter"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/pgaudit.log_parameter"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/pgaudit.log_parameter"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Specifies that audit logging should include the parameters that were passed with the statement."), // AllowedValues: to.Ptr("on,off"), @@ -4873,7 +4873,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("pgaudit.log_relation"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/pgaudit.log_relation"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/pgaudit.log_relation"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Specifies whether session audit logging should create a separate log entry for each relation referenced in a SELECT or DML statement."), // AllowedValues: to.Ptr("on,off"), @@ -4890,7 +4890,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("pgaudit.log_statement_once"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/pgaudit.log_statement_once"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/pgaudit.log_statement_once"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Specifies whether logging will include the statement text and parameters with the first log entry for a statement/substatement combination or with every entry."), // AllowedValues: to.Ptr("on,off"), @@ -4907,11 +4907,11 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("pgaudit.role"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/pgaudit.role"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/pgaudit.role"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Specifies the master role to use for object audit logging."), // AllowedValues: to.Ptr("[A-Za-z\\._]*"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataType("String")), + // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeString), // DefaultValue: to.Ptr(""), // DocumentationLink: to.Ptr("https://github.com/pgaudit/pgaudit/blob/master/README.md"), // IsConfigPendingRestart: to.Ptr(false), @@ -4924,7 +4924,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("pgbouncer.enabled"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/pgbouncer.enabled"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/pgbouncer.enabled"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Denotes if pgBouncer service is enabled."), // AllowedValues: to.Ptr("true, false"), @@ -4941,7 +4941,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("pglogical.batch_inserts"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/pglogical.batch_inserts"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/pglogical.batch_inserts"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Tells PGLogical to use batch insert mechanism if possible."), // AllowedValues: to.Ptr("on,off"), @@ -4958,7 +4958,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("pglogical.conflict_log_level"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/pglogical.conflict_log_level"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/pglogical.conflict_log_level"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets the log level for reporting detected conflicts when the pglogical.conflict_resolution is set to anything else than error."), // AllowedValues: to.Ptr("debug5,debug4,debug3,debug2,debug1,info,notice,warning,error,log,fatal,panic"), @@ -4975,7 +4975,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("pglogical.conflict_resolution"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/pglogical.conflict_resolution"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/pglogical.conflict_resolution"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets the resolution method for any detected conflicts between local data and incoming changes."), // AllowedValues: to.Ptr("error,apply_remote,keep_local,last_update_wins,first_update_wins"), @@ -4992,7 +4992,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("pglogical.use_spi"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/pglogical.use_spi"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/pglogical.use_spi"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Tells PGLogical to use SPI interface to form actual SQL (INSERT, UPDATE, DELETE) statements to apply incoming changes instead of using internal low level interface."), // AllowedValues: to.Ptr("on,off"), @@ -5009,7 +5009,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("pgms_stats.is_enabled_fs"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/pgms_stats.is_enabled_fs"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/pgms_stats.is_enabled_fs"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Internal Use Only: This parameter is used as a feature override switch."), // AllowedValues: to.Ptr("on,off"), @@ -5025,7 +5025,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("pgms_wait_sampling.history_period"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/pgms_wait_sampling.history_period"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/pgms_wait_sampling.history_period"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Set the frequency, in milliseconds, at which wait events are sampled."), // AllowedValues: to.Ptr("1-600000"), @@ -5043,7 +5043,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("pgms_wait_sampling.is_enabled_fs"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/pgms_wait_sampling.is_enabled_fs"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/pgms_wait_sampling.is_enabled_fs"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Internal Use Only: This parameter is used as a feature override switch. If it shows as off, wait sampling will be disabled despite the value set for pgms_wait_sampling.query_capture_mode."), // AllowedValues: to.Ptr("on,off"), @@ -5060,7 +5060,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("pgms_wait_sampling.query_capture_mode"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/pgms_wait_sampling.query_capture_mode"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/pgms_wait_sampling.query_capture_mode"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Selects which statements are tracked by the pgms_wait_sampling extension."), // AllowedValues: to.Ptr("all,none"), @@ -5077,7 +5077,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("plan_cache_mode"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/plan_cache_mode"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/plan_cache_mode"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Controls the planner's selection of custom or generic plan."), // AllowedValues: to.Ptr("auto,force_generic_plan,force_custom_plan"), @@ -5094,7 +5094,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("port"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/port"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/port"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets the TCP port the server listens on."), // AllowedValues: to.Ptr("1-65535"), @@ -5111,7 +5111,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("post_auth_delay"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/post_auth_delay"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/post_auth_delay"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Waits N seconds on connection startup after authentication."), // AllowedValues: to.Ptr("0-2147"), @@ -5129,7 +5129,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("postgis.gdal_enabled_drivers"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/postgis.gdal_enabled_drivers"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/postgis.gdal_enabled_drivers"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Controls postgis GDAL enabled driver settings."), // AllowedValues: to.Ptr("DISABLE_ALL,ENABLE_ALL"), @@ -5146,7 +5146,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("pre_auth_delay"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/pre_auth_delay"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/pre_auth_delay"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Waits N seconds on connection startup before authentication."), // AllowedValues: to.Ptr("0-60"), @@ -5164,11 +5164,11 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("primary_conninfo"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/primary_conninfo"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/primary_conninfo"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets the connection string to be used to connect to the sending server."), // AllowedValues: to.Ptr(".*"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataType("String")), + // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeString), // DefaultValue: to.Ptr(""), // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-replication.html#GUC-PRIMARY-CONNINFO"), // IsConfigPendingRestart: to.Ptr(false), @@ -5181,11 +5181,11 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("primary_slot_name"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/primary_slot_name"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/primary_slot_name"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets the name of the replication slot to use on the sending server."), // AllowedValues: to.Ptr(".*"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataType("String")), + // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeString), // DefaultValue: to.Ptr(""), // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-replication.html#GUC-PRIMARY-SLOT-NAME"), // IsConfigPendingRestart: to.Ptr(false), @@ -5198,11 +5198,11 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("promote_trigger_file"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/promote_trigger_file"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/promote_trigger_file"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Specifies a file name whose presence ends recovery in the standby."), // AllowedValues: to.Ptr(".*"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataType("String")), + // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeString), // DefaultValue: to.Ptr(""), // IsConfigPendingRestart: to.Ptr(false), // IsDynamicConfig: to.Ptr(true), @@ -5214,7 +5214,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("quote_all_identifiers"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/quote_all_identifiers"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/quote_all_identifiers"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("When generating SQL fragments, quotes all identifiers."), // AllowedValues: to.Ptr("on,off"), @@ -5231,7 +5231,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("random_page_cost"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/random_page_cost"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/random_page_cost"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets the planner's estimate of the cost of a nonsequentially fetched disk page."), // AllowedValues: to.Ptr("0-1.79769e+308"), @@ -5248,11 +5248,11 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("recovery_end_command"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/recovery_end_command"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/recovery_end_command"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets the shell command that will be executed once at the end of recovery."), // AllowedValues: to.Ptr(".*"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataType("String")), + // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeString), // DefaultValue: to.Ptr(""), // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-wal.html#GUC-RECOVERY-END-COMMAND"), // IsConfigPendingRestart: to.Ptr(false), @@ -5265,7 +5265,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("recovery_min_apply_delay"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/recovery_min_apply_delay"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/recovery_min_apply_delay"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets the minimum delay for applying changes during recovery."), // AllowedValues: to.Ptr("0-2147483647"), @@ -5283,11 +5283,11 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("recovery_target"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/recovery_target"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/recovery_target"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Set to \"immediate\" to end recovery as soon as a consistent state is reached."), // AllowedValues: to.Ptr(".*"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataType("String")), + // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeString), // DefaultValue: to.Ptr(""), // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-wal.html#GUC-RECOVERY-TARGET"), // IsConfigPendingRestart: to.Ptr(false), @@ -5300,7 +5300,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("recovery_target_action"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/recovery_target_action"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/recovery_target_action"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets the action to perform upon reaching the recovery target."), // AllowedValues: to.Ptr("pause,promote,shutdown"), @@ -5317,7 +5317,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("recovery_target_inclusive"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/recovery_target_inclusive"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/recovery_target_inclusive"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets whether to include or exclude transaction with recovery target."), // AllowedValues: to.Ptr("on,off"), @@ -5334,11 +5334,11 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("recovery_target_lsn"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/recovery_target_lsn"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/recovery_target_lsn"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets the LSN of the write-ahead log location up to which recovery will proceed."), // AllowedValues: to.Ptr(".*"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataType("String")), + // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeString), // DefaultValue: to.Ptr(""), // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-wal.html#GUC-RECOVERY-TARGET-LSN"), // IsConfigPendingRestart: to.Ptr(false), @@ -5351,11 +5351,11 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("recovery_target_name"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/recovery_target_name"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/recovery_target_name"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets the named restore point up to which recovery will proceed."), // AllowedValues: to.Ptr(".*"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataType("String")), + // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeString), // DefaultValue: to.Ptr(""), // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-wal.html#GUC-RECOVERY-TARGET-NAME"), // IsConfigPendingRestart: to.Ptr(false), @@ -5368,11 +5368,11 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("recovery_target_time"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/recovery_target_time"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/recovery_target_time"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets the time stamp up to which recovery will proceed."), // AllowedValues: to.Ptr(".*"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataType("String")), + // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeString), // DefaultValue: to.Ptr(""), // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-wal.html#GUC-RECOVERY-TARGET-TIME"), // IsConfigPendingRestart: to.Ptr(false), @@ -5385,11 +5385,11 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("recovery_target_timeline"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/recovery_target_timeline"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/recovery_target_timeline"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Specifies the timeline to recover into."), // AllowedValues: to.Ptr(".*"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataType("String")), + // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeString), // DefaultValue: to.Ptr("latest"), // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-wal.html#GUC-RECOVERY-TARGET-TIMELINE"), // IsConfigPendingRestart: to.Ptr(false), @@ -5402,11 +5402,11 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("recovery_target_xid"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/recovery_target_xid"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/recovery_target_xid"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets the transaction ID up to which recovery will proceed."), // AllowedValues: to.Ptr(".*"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataType("String")), + // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeString), // DefaultValue: to.Ptr(""), // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-wal.html#GUC-RECOVERY-TARGET-XID"), // IsConfigPendingRestart: to.Ptr(false), @@ -5419,7 +5419,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("require_secure_transport"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/require_secure_transport"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/require_secure_transport"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Whether client connections to the server are required to use some form of secure transport."), // AllowedValues: to.Ptr("on,off"), @@ -5436,7 +5436,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("reserved_connections"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/reserved_connections"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/reserved_connections"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets the number of connections slots reserved for replication users and super users."), // AllowedValues: to.Ptr("0-262143"), @@ -5452,7 +5452,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("restart_after_crash"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/restart_after_crash"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/restart_after_crash"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Reinitialize server after backend crash."), // AllowedValues: to.Ptr("on,off"), @@ -5469,11 +5469,11 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("restore_command"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/restore_command"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/restore_command"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets the shell command that will be called to retrieve an archived WAL file."), // AllowedValues: to.Ptr(".*"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataType("String")), + // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeString), // DefaultValue: to.Ptr(""), // IsConfigPendingRestart: to.Ptr(false), // IsDynamicConfig: to.Ptr(true), @@ -5485,7 +5485,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("row_security"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/row_security"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/row_security"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Enables row security."), // AllowedValues: to.Ptr("on,off"), @@ -5501,11 +5501,11 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("search_path"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/search_path"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/search_path"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets the schema search order for names that are not schema-qualified."), // AllowedValues: to.Ptr("[A-Za-z0-9.\"$,_ -]+"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataType("String")), + // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeString), // DefaultValue: to.Ptr("\"$user\", public"), // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-client.html#GUC-SEARCH-PATH"), // IsConfigPendingRestart: to.Ptr(false), @@ -5518,7 +5518,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("segment_size"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/segment_size"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/segment_size"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Shows the number of pages per disk file."), // AllowedValues: to.Ptr("131072-131072"), @@ -5536,7 +5536,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("seq_page_cost"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/seq_page_cost"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/seq_page_cost"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets the planner's estimate of the cost of a sequentially fetched disk page."), // AllowedValues: to.Ptr("0-1.79769e+308"), @@ -5553,11 +5553,11 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("server_encoding"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/server_encoding"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/server_encoding"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets the server (database) character set encoding."), // AllowedValues: to.Ptr(".*"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataType("String")), + // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeString), // DefaultValue: to.Ptr("SQL_ASCII"), // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-preset.html#GUC-SERVER-ENCODING"), // IsConfigPendingRestart: to.Ptr(false), @@ -5570,11 +5570,11 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("server_version"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/server_version"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/server_version"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Shows the server version."), // AllowedValues: to.Ptr(".*"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataType("String")), + // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeString), // DefaultValue: to.Ptr("13.11"), // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-preset.html#GUC-SERVER-VERSION"), // IsConfigPendingRestart: to.Ptr(false), @@ -5587,7 +5587,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("server_version_num"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/server_version_num"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/server_version_num"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Shows the server version as an integer."), // AllowedValues: to.Ptr("130011-130011"), @@ -5604,11 +5604,11 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("session_preload_libraries"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/session_preload_libraries"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/session_preload_libraries"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Lists shared libraries to preload into each backend."), // AllowedValues: to.Ptr(",login_hook"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataType("Set")), + // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeSet), // DefaultValue: to.Ptr(""), // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-client.html#GUC-SESSION-PRELOAD-LIBRARIES"), // IsConfigPendingRestart: to.Ptr(false), @@ -5621,7 +5621,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("session_replication_role"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/session_replication_role"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/session_replication_role"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Controls firing of replication-related triggers and rules for the current session."), // AllowedValues: to.Ptr("origin,replica,local"), @@ -5638,7 +5638,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("shared_buffers"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/shared_buffers"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/shared_buffers"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets the number of shared memory buffers used by the server. Unit is 8kb. Allowed values are inside the range of 10% - 75% of available memory."), // AllowedValues: to.Ptr("16-1073741823"), @@ -5656,7 +5656,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("shared_memory_type"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/shared_memory_type"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/shared_memory_type"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Selects the shared memory implementation used for the main shared memory region."), // AllowedValues: to.Ptr("sysv,mmap"), @@ -5673,11 +5673,11 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("shared_preload_libraries"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/shared_preload_libraries"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/shared_preload_libraries"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets which shared libraries are preloaded at server start."), // AllowedValues: to.Ptr(",age,anon,auto_explain,azure_storage,pg_cron,pg_failover_slots,pg_hint_plan,pg_partman_bgw,pg_prewarm,pg_squeeze,pg_stat_statements,pgaudit,pglogical,timescaledb,wal2json"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataType("Set")), + // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeSet), // DefaultValue: to.Ptr("pg_cron,pg_stat_statements"), // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-client.html#GUC-SHARED-PRELOAD-LIBRARIES"), // IsConfigPendingRestart: to.Ptr(false), @@ -5690,7 +5690,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("ssl"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/ssl"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/ssl"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Enables SSL connections."), // AllowedValues: to.Ptr("on,off"), @@ -5707,11 +5707,11 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("ssl_ca_file"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/ssl_ca_file"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/ssl_ca_file"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Location of the SSL certificate authority file."), // AllowedValues: to.Ptr(".*"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataType("String")), + // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeString), // DefaultValue: to.Ptr(""), // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-connection.html#GUC-SSL-CA-FILE"), // IsConfigPendingRestart: to.Ptr(false), @@ -5724,11 +5724,11 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("ssl_cert_file"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/ssl_cert_file"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/ssl_cert_file"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Location of the SSL server certificate file."), // AllowedValues: to.Ptr(".*"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataType("String")), + // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeString), // DefaultValue: to.Ptr("server.crt"), // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-connection.html#GUC-SSL-CERT-FILE"), // IsConfigPendingRestart: to.Ptr(false), @@ -5741,11 +5741,11 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("ssl_ciphers"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/ssl_ciphers"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/ssl_ciphers"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets the list of allowed SSL ciphers."), // AllowedValues: to.Ptr(".*"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataType("String")), + // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeString), // DefaultValue: to.Ptr("HIGH:MEDIUM:+3DES:!aNULL"), // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-connection.html#GUC-SSL-CIPHERS"), // IsConfigPendingRestart: to.Ptr(false), @@ -5758,11 +5758,11 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("ssl_crl_file"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/ssl_crl_file"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/ssl_crl_file"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Location of the SSL certificate revocation list file."), // AllowedValues: to.Ptr(".*"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataType("String")), + // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeString), // DefaultValue: to.Ptr(""), // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-connection.html#GUC-SSL-CRL-FILE"), // IsConfigPendingRestart: to.Ptr(false), @@ -5775,11 +5775,11 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("ssl_dh_params_file"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/ssl_dh_params_file"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/ssl_dh_params_file"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Location of the SSL DH parameters file."), // AllowedValues: to.Ptr(".*"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataType("String")), + // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeString), // DefaultValue: to.Ptr(""), // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-connection.html#GUC-SSL-DH-PARAMS-FILE"), // IsConfigPendingRestart: to.Ptr(false), @@ -5792,11 +5792,11 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("ssl_ecdh_curve"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/ssl_ecdh_curve"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/ssl_ecdh_curve"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets the curve to use for ECDH."), // AllowedValues: to.Ptr(".*"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataType("String")), + // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeString), // DefaultValue: to.Ptr("prime256v1"), // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-connection.html#GUC-SSL-ECDH-CURVE"), // IsConfigPendingRestart: to.Ptr(false), @@ -5809,11 +5809,11 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("ssl_key_file"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/ssl_key_file"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/ssl_key_file"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Location of the SSL server private key file."), // AllowedValues: to.Ptr(".*"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataType("String")), + // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeString), // DefaultValue: to.Ptr("server.key"), // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-connection.html#GUC-SSL-KEY-FILE"), // IsConfigPendingRestart: to.Ptr(false), @@ -5826,11 +5826,11 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("ssl_library"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/ssl_library"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/ssl_library"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Name of the SSL library."), // AllowedValues: to.Ptr(".*"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataType("String")), + // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeString), // DefaultValue: to.Ptr("OpenSSL"), // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-preset.html#GUC-SSL-LIBRARY"), // IsConfigPendingRestart: to.Ptr(false), @@ -5843,7 +5843,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("ssl_max_protocol_version"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/ssl_max_protocol_version"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/ssl_max_protocol_version"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets the maximum SSL/TLS protocol version to use."), // AllowedValues: to.Ptr(",TLSv1.2,TLSv1.3"), @@ -5860,7 +5860,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("ssl_min_protocol_version"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/ssl_min_protocol_version"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/ssl_min_protocol_version"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets the minimum SSL/TLS protocol version to use."), // AllowedValues: to.Ptr("TLSv1.2,TLSv1.3"), @@ -5877,11 +5877,11 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("ssl_passphrase_command"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/ssl_passphrase_command"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/ssl_passphrase_command"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Command to obtain passphrases for SSL."), // AllowedValues: to.Ptr(".*"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataType("String")), + // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeString), // DefaultValue: to.Ptr(""), // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-connection.html#GUC-SSL-PASSPHRASE-COMMAND"), // IsConfigPendingRestart: to.Ptr(false), @@ -5894,7 +5894,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("ssl_passphrase_command_supports_reload"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/ssl_passphrase_command_supports_reload"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/ssl_passphrase_command_supports_reload"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Also use ssl_passphrase_command during server reload."), // AllowedValues: to.Ptr("on,off"), @@ -5911,7 +5911,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("ssl_prefer_server_ciphers"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/ssl_prefer_server_ciphers"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/ssl_prefer_server_ciphers"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Give priority to server ciphersuite order."), // AllowedValues: to.Ptr("on,off"), @@ -5928,7 +5928,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("standard_conforming_strings"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/standard_conforming_strings"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/standard_conforming_strings"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Causes '...' strings to treat backslashes literally."), // AllowedValues: to.Ptr("on,off"), @@ -5945,7 +5945,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("statement_timeout"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/statement_timeout"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/statement_timeout"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets the maximum allowed duration (in milliseconds) of any statement. 0 turns this off."), // AllowedValues: to.Ptr("0-2147483647"), @@ -5963,11 +5963,11 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("stats_temp_directory"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/stats_temp_directory"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/stats_temp_directory"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Writes temporary statistics files to the specified directory."), // AllowedValues: to.Ptr(".*"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataType("String")), + // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeString), // DefaultValue: to.Ptr("pg_stat_tmp"), // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-statistics.html#GUC-STATS-TEMP-DIRECTORY"), // IsConfigPendingRestart: to.Ptr(false), @@ -5980,7 +5980,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("superuser_reserved_connections"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/superuser_reserved_connections"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/superuser_reserved_connections"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets the number of connection slots reserved for superusers."), // AllowedValues: to.Ptr("0-262143"), @@ -5997,7 +5997,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("synchronize_seqscans"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/synchronize_seqscans"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/synchronize_seqscans"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Enables synchronized sequential scans."), // AllowedValues: to.Ptr("on,off"), @@ -6014,7 +6014,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("synchronous_commit"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/synchronous_commit"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/synchronous_commit"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets the current transaction's synchronization level."), // AllowedValues: to.Ptr("local,remote_write,on,off"), @@ -6031,11 +6031,11 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("synchronous_standby_names"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/synchronous_standby_names"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/synchronous_standby_names"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Number of synchronous standbys and list of names of potential synchronous ones."), // AllowedValues: to.Ptr(".*"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataType("String")), + // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeString), // DefaultValue: to.Ptr(""), // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-replication.html#GUC-SYNCHRONOUS-STANDBY-NAMES"), // IsConfigPendingRestart: to.Ptr(false), @@ -6048,7 +6048,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("syslog_facility"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/syslog_facility"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/syslog_facility"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets the syslog \"facility\" to be used when syslog enabled."), // AllowedValues: to.Ptr("local0,local1,local2,local3,local4,local5,local6,local7"), @@ -6065,11 +6065,11 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("syslog_ident"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/syslog_ident"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/syslog_ident"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets the program name used to identify PostgreSQL messages in syslog."), // AllowedValues: to.Ptr(".*"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataType("String")), + // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeString), // DefaultValue: to.Ptr("postgres"), // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-logging.html#GUC-SYSLOG-IDENT"), // IsConfigPendingRestart: to.Ptr(false), @@ -6082,7 +6082,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("syslog_sequence_numbers"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/syslog_sequence_numbers"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/syslog_sequence_numbers"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Add sequence number to syslog messages to avoid duplicate suppression."), // AllowedValues: to.Ptr("on,off"), @@ -6099,7 +6099,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("syslog_split_messages"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/syslog_split_messages"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/syslog_split_messages"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Split messages sent to syslog by lines and to fit into 1024 bytes."), // AllowedValues: to.Ptr("on,off"), @@ -6116,7 +6116,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("tcp_keepalives_count"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/tcp_keepalives_count"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/tcp_keepalives_count"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Specifies the number of TCP keepalives that can be lost before the server's connection to the client is considered dead."), // AllowedValues: to.Ptr("0-2147483647"), @@ -6133,7 +6133,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("tcp_keepalives_idle"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/tcp_keepalives_idle"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/tcp_keepalives_idle"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Specifies the number of seconds of inactivity after which TCP should send a keepalive message to the client."), // AllowedValues: to.Ptr("0-2147483647"), @@ -6151,7 +6151,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("tcp_keepalives_interval"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/tcp_keepalives_interval"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/tcp_keepalives_interval"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Specifies the number of seconds after which a TCP keepalive message that is not acknowledged by the client should be retransmitted."), // AllowedValues: to.Ptr("0-2147483647"), @@ -6169,7 +6169,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("tcp_user_timeout"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/tcp_user_timeout"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/tcp_user_timeout"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Specifies the amount of time that transmitted data may remain unacknowledged before the TCP connection is forcibly closed."), // AllowedValues: to.Ptr("0-2147483647"), @@ -6187,7 +6187,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("temp_buffers"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/temp_buffers"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/temp_buffers"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets the maximum number of temporary buffers used by each database session."), // AllowedValues: to.Ptr("100-1073741823"), @@ -6205,7 +6205,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("temp_file_limit"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/temp_file_limit"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/temp_file_limit"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Limits the total size of all temporary files used by each process."), // AllowedValues: to.Ptr("-1-2147483647"), @@ -6223,11 +6223,11 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("temp_tablespaces"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/temp_tablespaces"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/temp_tablespaces"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets the default tablespace(s) to use for temporary tables and sort files if not specified in the CREATE command."), // AllowedValues: to.Ptr("[A-Za-z._]*"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataType("String")), + // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeString), // DefaultValue: to.Ptr(""), // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-client.html#GUC-TEMP-TABLESPACES"), // IsConfigPendingRestart: to.Ptr(false), @@ -6240,11 +6240,11 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("TimeZone"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/TimeZone"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/TimeZone"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets the time zone for displaying and interpreting time stamps."), // AllowedValues: to.Ptr("[A-Za-z0-9/+_-]+"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataType("String")), + // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeString), // DefaultValue: to.Ptr("UTC"), // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-client.html#GUC-TIMEZONE"), // IsConfigPendingRestart: to.Ptr(false), @@ -6257,11 +6257,11 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("timezone_abbreviations"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/timezone_abbreviations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/timezone_abbreviations"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Selects a file of time zone abbreviations."), // AllowedValues: to.Ptr(".*"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataType("String")), + // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeString), // DefaultValue: to.Ptr(""), // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-client.html#GUC-TIMEZONE-ABBREVIATIONS"), // IsConfigPendingRestart: to.Ptr(false), @@ -6274,7 +6274,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("trace_notify"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/trace_notify"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/trace_notify"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Generates debugging output for LISTEN and NOTIFY."), // AllowedValues: to.Ptr("on,off"), @@ -6291,7 +6291,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("trace_recovery_messages"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/trace_recovery_messages"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/trace_recovery_messages"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Enables logging of recovery-related debugging information."), // AllowedValues: to.Ptr("debug5,debug4,debug3,debug2,debug1,log,notice,warning,error"), @@ -6308,7 +6308,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("trace_sort"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/trace_sort"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/trace_sort"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Emit information about resource usage in sorting."), // AllowedValues: to.Ptr("on,off"), @@ -6325,7 +6325,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("track_activities"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/track_activities"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/track_activities"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Collects information about executing commands for each session."), // AllowedValues: to.Ptr("on,off"), @@ -6342,7 +6342,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("track_activity_query_size"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/track_activity_query_size"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/track_activity_query_size"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets the amount of memory reserved for pg_stat_activity.query, in bytes."), // AllowedValues: to.Ptr("100-102400"), @@ -6360,7 +6360,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("track_commit_timestamp"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/track_commit_timestamp"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/track_commit_timestamp"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Collects transaction commit time."), // AllowedValues: to.Ptr("on,off"), @@ -6377,7 +6377,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("track_counts"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/track_counts"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/track_counts"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Enables collection of statistics on database activity"), // AllowedValues: to.Ptr("on,off"), @@ -6394,7 +6394,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("track_functions"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/track_functions"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/track_functions"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Enables tracking of function call counts and time used."), // AllowedValues: to.Ptr("none,pl,all"), @@ -6411,7 +6411,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("track_io_timing"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/track_io_timing"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/track_io_timing"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Enables timing of database I/O calls."), // AllowedValues: to.Ptr("on,off"), @@ -6428,7 +6428,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("transaction_deferrable"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/transaction_deferrable"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/transaction_deferrable"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Whether to defer a read-only serializable transaction until it can be executed with no possible serialization failures."), // AllowedValues: to.Ptr("on,off"), @@ -6445,7 +6445,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("transaction_isolation"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/transaction_isolation"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/transaction_isolation"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets the current transaction's isolation level."), // AllowedValues: to.Ptr("serializable,repeatable read,read committed,read uncommitted"), @@ -6462,7 +6462,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("transaction_read_only"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/transaction_read_only"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/transaction_read_only"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets the current transaction's read-only status."), // AllowedValues: to.Ptr("on,off"), @@ -6479,7 +6479,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("transform_null_equals"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/transform_null_equals"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/transform_null_equals"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("When on, expressions of the form expr = NULL (or NULL = expr) are treated as expr IS NULL, that is, they return true if expr evaluates to the null value, and false otherwise."), // AllowedValues: to.Ptr("on,off"), @@ -6496,11 +6496,11 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("unix_socket_directories"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/unix_socket_directories"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/unix_socket_directories"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets the directories where Unix-domain sockets will be created."), // AllowedValues: to.Ptr(".*"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataType("String")), + // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeString), // DefaultValue: to.Ptr("/tmp"), // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-connection.html#GUC-UNIX-SOCKET-DIRECTORIES"), // IsConfigPendingRestart: to.Ptr(false), @@ -6513,11 +6513,11 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("unix_socket_group"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/unix_socket_group"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/unix_socket_group"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets the owning group of the Unix-domain socket."), // AllowedValues: to.Ptr(".*"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataType("String")), + // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeString), // DefaultValue: to.Ptr(""), // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-connection.html#GUC-UNIX-SOCKET-GROUP"), // IsConfigPendingRestart: to.Ptr(false), @@ -6530,7 +6530,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("unix_socket_permissions"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/unix_socket_permissions"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/unix_socket_permissions"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets the access permissions of the Unix-domain socket."), // AllowedValues: to.Ptr("0-511"), @@ -6547,7 +6547,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("update_process_title"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/update_process_title"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/update_process_title"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Updates the process title to show the active SQL command."), // AllowedValues: to.Ptr("on,off"), @@ -6564,7 +6564,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("vacuum_cleanup_index_scale_factor"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/vacuum_cleanup_index_scale_factor"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/vacuum_cleanup_index_scale_factor"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Number of tuple inserts prior to index cleanup as a fraction of reltuples."), // AllowedValues: to.Ptr("0-1e+10"), @@ -6580,7 +6580,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("vacuum_cost_delay"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/vacuum_cost_delay"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/vacuum_cost_delay"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("the amount of time (in milliseconds) that the vacuum process will sleep when the cost limit has been exceeded."), // AllowedValues: to.Ptr("0-100"), @@ -6598,7 +6598,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("vacuum_cost_limit"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/vacuum_cost_limit"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/vacuum_cost_limit"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("The accumulated cost that will cause the vacuuming process to sleep."), // AllowedValues: to.Ptr("1-10000"), @@ -6615,7 +6615,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("vacuum_cost_page_dirty"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/vacuum_cost_page_dirty"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/vacuum_cost_page_dirty"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("The estimated cost charged when vacuum modifies a block that was previously clean."), // AllowedValues: to.Ptr("0-10000"), @@ -6632,7 +6632,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("vacuum_cost_page_hit"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/vacuum_cost_page_hit"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/vacuum_cost_page_hit"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("The estimated cost for vacuuming a buffer found in the shared buffer cache."), // AllowedValues: to.Ptr("0-10000"), @@ -6649,7 +6649,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("vacuum_cost_page_miss"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/vacuum_cost_page_miss"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/vacuum_cost_page_miss"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("The estimated cost for vacuuming a buffer that must be read from disk."), // AllowedValues: to.Ptr("0-10000"), @@ -6666,7 +6666,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("vacuum_defer_cleanup_age"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/vacuum_defer_cleanup_age"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/vacuum_defer_cleanup_age"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Specifies the number of transactions by which VACUUM and HOT updates will defer cleanup of dead row versions."), // AllowedValues: to.Ptr("0-1000000"), @@ -6683,7 +6683,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("vacuum_freeze_min_age"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/vacuum_freeze_min_age"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/vacuum_freeze_min_age"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Specifies the cutoff age (in transactions) that VACUUM should use to decide whether to freeze row versions while scanning a table."), // AllowedValues: to.Ptr("0-1000000000"), @@ -6700,7 +6700,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("vacuum_freeze_table_age"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/vacuum_freeze_table_age"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/vacuum_freeze_table_age"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Age at which VACUUM should scan whole table to freeze tuples."), // AllowedValues: to.Ptr("0-2000000000"), @@ -6717,7 +6717,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("vacuum_multixact_freeze_min_age"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/vacuum_multixact_freeze_min_age"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/vacuum_multixact_freeze_min_age"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Specifies the cutoff age (in multixacts) that VACUUM should use to decide whether to replace multixact IDs with a newer transaction ID or multixact ID while scanning a table."), // AllowedValues: to.Ptr("0-1000000000"), @@ -6734,7 +6734,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("vacuum_multixact_freeze_table_age"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/vacuum_multixact_freeze_table_age"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/vacuum_multixact_freeze_table_age"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("VACUUM performs a full table scan to freeze rows if the table has reached the age specified by this setting."), // AllowedValues: to.Ptr("0-2000000000"), @@ -6751,7 +6751,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("wal_block_size"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/wal_block_size"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/wal_block_size"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Shows the block size in the write ahead log."), // AllowedValues: to.Ptr("8192-8192"), @@ -6768,7 +6768,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("wal_buffers"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/wal_buffers"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/wal_buffers"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets the number of disk-page buffers in shared memory for WAL. Unit is 8kb."), // AllowedValues: to.Ptr("-1-262143"), @@ -6786,7 +6786,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("wal_compression"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/wal_compression"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/wal_compression"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Compresses full-page writes written in WAL file."), // AllowedValues: to.Ptr("on,off"), @@ -6803,11 +6803,11 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("wal_consistency_checking"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/wal_consistency_checking"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/wal_consistency_checking"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets the WAL resource managers for which WAL consistency checks are done."), // AllowedValues: to.Ptr(".*"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataType("String")), + // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeString), // DefaultValue: to.Ptr(""), // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-developer.html#GUC-WAL-CONSISTENCY-CHECKING"), // IsConfigPendingRestart: to.Ptr(false), @@ -6820,7 +6820,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("wal_init_zero"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/wal_init_zero"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/wal_init_zero"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Writes zeroes to new WAL files before first use."), // AllowedValues: to.Ptr("on,off"), @@ -6837,7 +6837,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("wal_keep_size"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/wal_keep_size"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/wal_keep_size"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets the size of WAL files held for standby servers."), // AllowedValues: to.Ptr("0-2147483647"), @@ -6855,7 +6855,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("wal_level"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/wal_level"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/wal_level"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("It determines how much information is written to the WAL."), // AllowedValues: to.Ptr("replica,logical"), @@ -6872,7 +6872,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("wal_log_hints"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/wal_log_hints"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/wal_log_hints"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Writes full pages to WAL when first modified after a checkpoint, even for a non-critical modification."), // AllowedValues: to.Ptr("on,off"), @@ -6889,7 +6889,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("wal_receiver_create_temp_slot"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/wal_receiver_create_temp_slot"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/wal_receiver_create_temp_slot"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets whether a WAL receiver should create a temporary replication slot if no permanent slot is configured."), // AllowedValues: to.Ptr("on,off"), @@ -6906,7 +6906,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("wal_receiver_status_interval"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/wal_receiver_status_interval"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/wal_receiver_status_interval"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets the maximum interval between WAL receiver status reports to the primary."), // AllowedValues: to.Ptr("0-2147483"), @@ -6924,7 +6924,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("wal_receiver_timeout"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/wal_receiver_timeout"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/wal_receiver_timeout"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets the maximum wait time to receive data from the sending server."), // AllowedValues: to.Ptr("0-2147483647"), @@ -6942,7 +6942,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("wal_recycle"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/wal_recycle"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/wal_recycle"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Recycles WAL files by renaming them."), // AllowedValues: to.Ptr("on,off"), @@ -6959,7 +6959,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("wal_retrieve_retry_interval"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/wal_retrieve_retry_interval"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/wal_retrieve_retry_interval"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets the time to wait before retrying to retrieve WAL after a failed attempt."), // AllowedValues: to.Ptr("1-2147483647"), @@ -6977,7 +6977,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("wal_segment_size"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/wal_segment_size"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/wal_segment_size"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Shows the size of write ahead log segments."), // AllowedValues: to.Ptr("1048576-1073741824"), @@ -6995,7 +6995,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("wal_sender_timeout"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/wal_sender_timeout"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/wal_sender_timeout"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets the maximum time to wait for WAL replication."), // AllowedValues: to.Ptr("0-2147483647"), @@ -7013,7 +7013,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("wal_skip_threshold"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/wal_skip_threshold"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/wal_skip_threshold"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Size of new file to fsync instead of writing WAL."), // AllowedValues: to.Ptr("0-2147483647"), @@ -7031,7 +7031,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("wal_sync_method"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/wal_sync_method"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/wal_sync_method"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Selects the method used for forcing WAL updates to disk."), // AllowedValues: to.Ptr("fsync,fdatasync,open_sync,open_datasync"), @@ -7048,7 +7048,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("wal_writer_delay"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/wal_writer_delay"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/wal_writer_delay"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Time interval between WAL flushes performed by the WAL writer."), // AllowedValues: to.Ptr("1-10000"), @@ -7066,7 +7066,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("wal_writer_flush_after"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/wal_writer_flush_after"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/wal_writer_flush_after"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Amount of WAL written out by WAL writer that triggers a flush."), // AllowedValues: to.Ptr("0-2147483647"), @@ -7084,7 +7084,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("work_mem"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/work_mem"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/work_mem"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets the amount of memory to be used by internal sort operations and hash tables before writing to temporary disk files."), // AllowedValues: to.Ptr("4096-2097151"), @@ -7102,7 +7102,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("xmlbinary"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/xmlbinary"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/xmlbinary"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets how binary values are to be encoded in XML."), // AllowedValues: to.Ptr("base64,hex"), @@ -7119,7 +7119,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("xmloption"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/xmloption"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/xmloption"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Sets whether XML data in implicit parsing and serialization operations is to be considered as documents or content fragments."), // AllowedValues: to.Ptr("content,document"), @@ -7136,7 +7136,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { // { // Name: to.Ptr("zero_damaged_pages"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/zero_damaged_pages"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/zero_damaged_pages"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Continues processing past damaged page headers."), // AllowedValues: to.Ptr("on,off"), @@ -7154,7 +7154,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b1f4d539964453ce8008e4b069e59885e12ba441/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ConfigurationGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/735d21dbd7e1cc446babf58860af4cca757d620d/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/ConfigurationsGet.json func ExampleConfigurationsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -7165,7 +7165,7 @@ func ExampleConfigurationsClient_Get() { if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewConfigurationsClient().Get(ctx, "testrg", "testserver", "array_nulls", nil) + res, err := clientFactory.NewConfigurationsClient().Get(ctx, "exampleresourcegroup", "exampleserver", "array_nulls", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -7175,7 +7175,7 @@ func ExampleConfigurationsClient_Get() { // res.Configuration = armpostgresqlflexibleservers.Configuration{ // Name: to.Ptr("array_nulls"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/array_nulls"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/array_nulls"), // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ // Description: to.Ptr("Enables input of NULL (case insensitive) to be considered as NULL value rather than the literal String 'NULL'."), // AllowedValues: to.Ptr("on,off"), @@ -7191,7 +7191,7 @@ func ExampleConfigurationsClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b1f4d539964453ce8008e4b069e59885e12ba441/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ConfigurationUpdate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/735d21dbd7e1cc446babf58860af4cca757d620d/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/ConfigurationsUpdate.json func ExampleConfigurationsClient_BeginUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -7202,7 +7202,7 @@ func ExampleConfigurationsClient_BeginUpdate() { if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewConfigurationsClient().BeginUpdate(ctx, "testrg", "testserver", "constraint_exclusion", armpostgresqlflexibleservers.ConfigurationForUpdate{ + poller, err := clientFactory.NewConfigurationsClient().BeginUpdate(ctx, "exampleresourcegroup", "exampleserver", "constraint_exclusion", armpostgresqlflexibleservers.ConfigurationForUpdate{ Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ Source: to.Ptr("user-override"), Value: to.Ptr("on"), @@ -7211,33 +7211,13 @@ func ExampleConfigurationsClient_BeginUpdate() { if err != nil { log.Fatalf("failed to finish the request: %v", err) } - res, err := poller.PollUntilDone(ctx, nil) + _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Configuration = armpostgresqlflexibleservers.Configuration{ - // Name: to.Ptr("constraint_exclusion"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/constraint_exclusion"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Controls the query planner's use of table constraints to optimize queries."), - // AllowedValues: to.Ptr("partition,on,off"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeEnumeration), - // DefaultValue: to.Ptr("partition"), - // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-query.html#GUC-CONSTRAINT-EXCLUSION"), - // IsConfigPendingRestart: to.Ptr(false), - // IsDynamicConfig: to.Ptr(true), - // IsReadOnly: to.Ptr(false), - // Source: to.Ptr("user-override"), - // Value: to.Ptr("on"), - // }, - // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b1f4d539964453ce8008e4b069e59885e12ba441/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ConfigurationUpdate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/735d21dbd7e1cc446babf58860af4cca757d620d/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/ConfigurationsUpdateUsingPut.json func ExampleConfigurationsClient_BeginPut() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -7248,7 +7228,7 @@ func ExampleConfigurationsClient_BeginPut() { if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewConfigurationsClient().BeginPut(ctx, "testrg", "testserver", "constraint_exclusion", armpostgresqlflexibleservers.Configuration{ + poller, err := clientFactory.NewConfigurationsClient().BeginPut(ctx, "exampleresourcegroup", "exampleserver", "constraint_exclusion", armpostgresqlflexibleservers.ConfigurationForUpdate{ Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ Source: to.Ptr("user-override"), Value: to.Ptr("on"), @@ -7257,28 +7237,8 @@ func ExampleConfigurationsClient_BeginPut() { if err != nil { log.Fatalf("failed to finish the request: %v", err) } - res, err := poller.PollUntilDone(ctx, nil) + _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Configuration = armpostgresqlflexibleservers.Configuration{ - // Name: to.Ptr("constraint_exclusion"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/constraint_exclusion"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Controls the query planner's use of table constraints to optimize queries."), - // AllowedValues: to.Ptr("partition,on,off"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeEnumeration), - // DefaultValue: to.Ptr("partition"), - // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-query.html#GUC-CONSTRAINT-EXCLUSION"), - // IsConfigPendingRestart: to.Ptr(false), - // IsDynamicConfig: to.Ptr(true), - // IsReadOnly: to.Ptr(false), - // Source: to.Ptr("user-override"), - // Value: to.Ptr("on"), - // }, - // } } diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/constants.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/constants.go index 74cddca71f86..47be7b401208 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/constants.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/constants.go @@ -5,96 +5,96 @@ package armpostgresqlflexibleservers -const ( - moduleName = "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers" - moduleVersion = "v5.0.0-beta.1" -) - -// ActiveDirectoryAuthEnum - If Enabled, Microsoft Entra authentication is enabled. -type ActiveDirectoryAuthEnum string - -const ( - ActiveDirectoryAuthEnumDisabled ActiveDirectoryAuthEnum = "Disabled" - ActiveDirectoryAuthEnumEnabled ActiveDirectoryAuthEnum = "Enabled" -) - -// PossibleActiveDirectoryAuthEnumValues returns the possible values for the ActiveDirectoryAuthEnum const type. -func PossibleActiveDirectoryAuthEnumValues() []ActiveDirectoryAuthEnum { - return []ActiveDirectoryAuthEnum{ - ActiveDirectoryAuthEnumDisabled, - ActiveDirectoryAuthEnumEnabled, - } -} - -// ArmServerKeyType - Data encryption type to depict if it is System Managed vs Azure Key vault. -type ArmServerKeyType string - -const ( - ArmServerKeyTypeAzureKeyVault ArmServerKeyType = "AzureKeyVault" - ArmServerKeyTypeSystemManaged ArmServerKeyType = "SystemManaged" -) - -// PossibleArmServerKeyTypeValues returns the possible values for the ArmServerKeyType const type. -func PossibleArmServerKeyTypeValues() []ArmServerKeyType { - return []ArmServerKeyType{ - ArmServerKeyTypeAzureKeyVault, - ArmServerKeyTypeSystemManaged, +// AzureManagedDiskPerformanceTier - Storage tier of a server. +type AzureManagedDiskPerformanceTier string + +const ( + // AzureManagedDiskPerformanceTierP1 - Entry-level SSD for minimal IOPS, ideal for light development or testing workloads. + AzureManagedDiskPerformanceTierP1 AzureManagedDiskPerformanceTier = "P1" + // AzureManagedDiskPerformanceTierP10 - Popular choice for general-purpose production workloads with scalable performance. + AzureManagedDiskPerformanceTierP10 AzureManagedDiskPerformanceTier = "P10" + // AzureManagedDiskPerformanceTierP15 - High IOPS tier for demanding apps with frequent read/write operations. + AzureManagedDiskPerformanceTierP15 AzureManagedDiskPerformanceTier = "P15" + // AzureManagedDiskPerformanceTierP2 - Slightly higher IOPS for small-scale applications needing consistent low latency. + AzureManagedDiskPerformanceTierP2 AzureManagedDiskPerformanceTier = "P2" + // AzureManagedDiskPerformanceTierP20 - Entry point for high-performance Solid State Disks (SSDs), suitable for small-scale + // I/O-intensive workloads. + AzureManagedDiskPerformanceTierP20 AzureManagedDiskPerformanceTier = "P20" + // AzureManagedDiskPerformanceTierP3 - Balanced performance for basic production workloads with moderate throughput. + AzureManagedDiskPerformanceTierP3 AzureManagedDiskPerformanceTier = "P3" + // AzureManagedDiskPerformanceTierP30 - Balanced tier for moderate throughput and latency-sensitive applications. + AzureManagedDiskPerformanceTierP30 AzureManagedDiskPerformanceTier = "P30" + // AzureManagedDiskPerformanceTierP4 - Enhanced IOPS for growing apps with predictable performance needs. + AzureManagedDiskPerformanceTierP4 AzureManagedDiskPerformanceTier = "P4" + // AzureManagedDiskPerformanceTierP40 - Enhanced performance for growing production workloads with consistent IOPS demands. + AzureManagedDiskPerformanceTierP40 AzureManagedDiskPerformanceTier = "P40" + // AzureManagedDiskPerformanceTierP50 - Optimized for enterprise-grade applications needing sustained high throughput. + AzureManagedDiskPerformanceTierP50 AzureManagedDiskPerformanceTier = "P50" + // AzureManagedDiskPerformanceTierP6 - Mid-tier SSD for steady workloads requiring reliable throughput and latency. + AzureManagedDiskPerformanceTierP6 AzureManagedDiskPerformanceTier = "P6" + // AzureManagedDiskPerformanceTierP60 - High-capacity tier for large databases and analytics workloads with elevated IOPS. + AzureManagedDiskPerformanceTierP60 AzureManagedDiskPerformanceTier = "P60" + // AzureManagedDiskPerformanceTierP70 - Designed for mission-critical systems requiring ultra-low latency and high concurrency. + AzureManagedDiskPerformanceTierP70 AzureManagedDiskPerformanceTier = "P70" + // AzureManagedDiskPerformanceTierP80 - Top-tier SSD for maximum IOPS and throughput, ideal for the most demanding workloads. + AzureManagedDiskPerformanceTierP80 AzureManagedDiskPerformanceTier = "P80" +) + +// PossibleAzureManagedDiskPerformanceTierValues returns the possible values for the AzureManagedDiskPerformanceTier const type. +func PossibleAzureManagedDiskPerformanceTierValues() []AzureManagedDiskPerformanceTier { + return []AzureManagedDiskPerformanceTier{ + AzureManagedDiskPerformanceTierP1, + AzureManagedDiskPerformanceTierP10, + AzureManagedDiskPerformanceTierP15, + AzureManagedDiskPerformanceTierP2, + AzureManagedDiskPerformanceTierP20, + AzureManagedDiskPerformanceTierP3, + AzureManagedDiskPerformanceTierP30, + AzureManagedDiskPerformanceTierP4, + AzureManagedDiskPerformanceTierP40, + AzureManagedDiskPerformanceTierP50, + AzureManagedDiskPerformanceTierP6, + AzureManagedDiskPerformanceTierP60, + AzureManagedDiskPerformanceTierP70, + AzureManagedDiskPerformanceTierP80, } } -// AzureManagedDiskPerformanceTiers - Name of storage tier for IOPS. -type AzureManagedDiskPerformanceTiers string +// BackupType - Type of backup. +type BackupType string const ( - AzureManagedDiskPerformanceTiersP1 AzureManagedDiskPerformanceTiers = "P1" - AzureManagedDiskPerformanceTiersP10 AzureManagedDiskPerformanceTiers = "P10" - AzureManagedDiskPerformanceTiersP15 AzureManagedDiskPerformanceTiers = "P15" - AzureManagedDiskPerformanceTiersP2 AzureManagedDiskPerformanceTiers = "P2" - AzureManagedDiskPerformanceTiersP20 AzureManagedDiskPerformanceTiers = "P20" - AzureManagedDiskPerformanceTiersP3 AzureManagedDiskPerformanceTiers = "P3" - AzureManagedDiskPerformanceTiersP30 AzureManagedDiskPerformanceTiers = "P30" - AzureManagedDiskPerformanceTiersP4 AzureManagedDiskPerformanceTiers = "P4" - AzureManagedDiskPerformanceTiersP40 AzureManagedDiskPerformanceTiers = "P40" - AzureManagedDiskPerformanceTiersP50 AzureManagedDiskPerformanceTiers = "P50" - AzureManagedDiskPerformanceTiersP6 AzureManagedDiskPerformanceTiers = "P6" - AzureManagedDiskPerformanceTiersP60 AzureManagedDiskPerformanceTiers = "P60" - AzureManagedDiskPerformanceTiersP70 AzureManagedDiskPerformanceTiers = "P70" - AzureManagedDiskPerformanceTiersP80 AzureManagedDiskPerformanceTiers = "P80" + // BackupTypeCustomerOnDemand - A full backup triggered by the customer. These backups are retained for a period of time as + // defined by the backup retention policy, and they can also be deleted by the customer. + BackupTypeCustomerOnDemand BackupType = "Customer On-Demand" + // BackupTypeFull - A full backup taken automatically by the service. These backups are retained for a period of time as defined + // by the backup retention policy, and they cannot be deleted by the customer. + BackupTypeFull BackupType = "Full" ) -// PossibleAzureManagedDiskPerformanceTiersValues returns the possible values for the AzureManagedDiskPerformanceTiers const type. -func PossibleAzureManagedDiskPerformanceTiersValues() []AzureManagedDiskPerformanceTiers { - return []AzureManagedDiskPerformanceTiers{ - AzureManagedDiskPerformanceTiersP1, - AzureManagedDiskPerformanceTiersP10, - AzureManagedDiskPerformanceTiersP15, - AzureManagedDiskPerformanceTiersP2, - AzureManagedDiskPerformanceTiersP20, - AzureManagedDiskPerformanceTiersP3, - AzureManagedDiskPerformanceTiersP30, - AzureManagedDiskPerformanceTiersP4, - AzureManagedDiskPerformanceTiersP40, - AzureManagedDiskPerformanceTiersP50, - AzureManagedDiskPerformanceTiersP6, - AzureManagedDiskPerformanceTiersP60, - AzureManagedDiskPerformanceTiersP70, - AzureManagedDiskPerformanceTiersP80, +// PossibleBackupTypeValues returns the possible values for the BackupType const type. +func PossibleBackupTypeValues() []BackupType { + return []BackupType{ + BackupTypeCustomerOnDemand, + BackupTypeFull, } } -// CancelEnum - To trigger cancel for entire migration we need to send this flag as True -type CancelEnum string +// Cancel - Indicates if cancel must be triggered for the entire migration. +type Cancel string const ( - CancelEnumFalse CancelEnum = "False" - CancelEnumTrue CancelEnum = "True" + // CancelFalse - Cancel must not be triggered for the entire migration. + CancelFalse Cancel = "False" + // CancelTrue - Cancel must be triggered for the entire migration. + CancelTrue Cancel = "True" ) -// PossibleCancelEnumValues returns the possible values for the CancelEnum const type. -func PossibleCancelEnumValues() []CancelEnum { - return []CancelEnum{ - CancelEnumFalse, - CancelEnumTrue, +// PossibleCancelValues returns the possible values for the Cancel const type. +func PossibleCancelValues() []Cancel { + return []Cancel{ + CancelFalse, + CancelTrue, } } @@ -134,14 +134,22 @@ func PossibleCheckNameAvailabilityReasonValues() []CheckNameAvailabilityReason { } } -// ConfigurationDataType - Data type of the configuration. +// ConfigurationDataType - Data type of the configuration (also known as server parameter). type ConfigurationDataType string const ( - ConfigurationDataTypeBoolean ConfigurationDataType = "Boolean" + // ConfigurationDataTypeBoolean - A boolean value. + ConfigurationDataTypeBoolean ConfigurationDataType = "Boolean" + // ConfigurationDataTypeEnumeration - An enumeration value. ConfigurationDataTypeEnumeration ConfigurationDataType = "Enumeration" - ConfigurationDataTypeInteger ConfigurationDataType = "Integer" - ConfigurationDataTypeNumeric ConfigurationDataType = "Numeric" + // ConfigurationDataTypeInteger - An integer value. + ConfigurationDataTypeInteger ConfigurationDataType = "Integer" + // ConfigurationDataTypeNumeric - A numeric value. + ConfigurationDataTypeNumeric ConfigurationDataType = "Numeric" + // ConfigurationDataTypeSet - A set of values. + ConfigurationDataTypeSet ConfigurationDataType = "Set" + // ConfigurationDataTypeString - A string value. + ConfigurationDataTypeString ConfigurationDataType = "String" ) // PossibleConfigurationDataTypeValues returns the possible values for the ConfigurationDataType const type. @@ -151,20 +159,36 @@ func PossibleConfigurationDataTypeValues() []ConfigurationDataType { ConfigurationDataTypeEnumeration, ConfigurationDataTypeInteger, ConfigurationDataTypeNumeric, + ConfigurationDataTypeSet, + ConfigurationDataTypeString, } } -// CreateMode - The mode to create a new PostgreSQL server. +// CreateMode - Creation mode of a new server. type CreateMode string const ( - CreateModeCreate CreateMode = "Create" - CreateModeDefault CreateMode = "Default" - CreateModeGeoRestore CreateMode = "GeoRestore" + // CreateModeCreate - Operation creates a new server. + CreateModeCreate CreateMode = "Create" + // CreateModeDefault - If the operation is triggered on a non-existing server, it's equivalent to 'Create'. If the operation + // is triggered on an existing server, it's equivalent to 'Update'. + CreateModeDefault CreateMode = "Default" + // CreateModeGeoRestore - Operation restores an existing backup of an existing server, on the paired region of the existing + // server. This operation creates a new server on the paired region of the existing server, and then restores on it the backup + // of an existing server at a specific point in time, in a different region. This operation is only supported on existing + // servers that were created with geographically redundant backups enabled. + CreateModeGeoRestore CreateMode = "GeoRestore" + // CreateModePointInTimeRestore - Operation restores an existing backup of an existing server. This operation creates a new + // server, and then restores on it the backup of an existing server at a specific point in time. CreateModePointInTimeRestore CreateMode = "PointInTimeRestore" - CreateModeReplica CreateMode = "Replica" - CreateModeReviveDropped CreateMode = "ReviveDropped" - CreateModeUpdate CreateMode = "Update" + // CreateModeReplica - Operation creates a replica of an existing server. This operation creates a new server, restores a + // base backup of the existing server (referred to as primary), and configures physical replication to asynchronously stream + // all changes which are recorded in the transaction log of the primary. + CreateModeReplica CreateMode = "Replica" + // CreateModeReviveDropped - Operation creates a new server, initialized with the backup of a server that was recently deleted. + CreateModeReviveDropped CreateMode = "ReviveDropped" + // CreateModeUpdate - Operation updates an existing server. + CreateModeUpdate CreateMode = "Update" ) // PossibleCreateModeValues returns the possible values for the CreateMode const type. @@ -180,19 +204,21 @@ func PossibleCreateModeValues() []CreateMode { } } -// CreateModeForUpdate - The mode to update a new PostgreSQL server. -type CreateModeForUpdate string +// CreateModeForPatch - Update mode of an existing server. +type CreateModeForPatch string const ( - CreateModeForUpdateDefault CreateModeForUpdate = "Default" - CreateModeForUpdateUpdate CreateModeForUpdate = "Update" + // CreateModeForPatchDefault - It's equivalent to 'Update'. + CreateModeForPatchDefault CreateModeForPatch = "Default" + // CreateModeForPatchUpdate - Operation updates an existing server. + CreateModeForPatchUpdate CreateModeForPatch = "Update" ) -// PossibleCreateModeForUpdateValues returns the possible values for the CreateModeForUpdate const type. -func PossibleCreateModeForUpdateValues() []CreateModeForUpdate { - return []CreateModeForUpdate{ - CreateModeForUpdateDefault, - CreateModeForUpdateUpdate, +// PossibleCreateModeForPatchValues returns the possible values for the CreateModeForPatch const type. +func PossibleCreateModeForPatchValues() []CreateModeForPatch { + return []CreateModeForPatch{ + CreateModeForPatchDefault, + CreateModeForPatchUpdate, } } @@ -216,13 +242,57 @@ func PossibleCreatedByTypeValues() []CreatedByType { } } +// DataEncryptionType - Data encryption type used by a server. +type DataEncryptionType string + +const ( + // DataEncryptionTypeAzureKeyVault - Encryption using customer managed keys stored in Azure Key Vault for enhanced control + // and security. + DataEncryptionTypeAzureKeyVault DataEncryptionType = "AzureKeyVault" + // DataEncryptionTypeSystemManaged - Encryption managed by Azure using platform managed keys for simplicity and compliance. + DataEncryptionTypeSystemManaged DataEncryptionType = "SystemManaged" +) + +// PossibleDataEncryptionTypeValues returns the possible values for the DataEncryptionType const type. +func PossibleDataEncryptionTypeValues() []DataEncryptionType { + return []DataEncryptionType{ + DataEncryptionTypeAzureKeyVault, + DataEncryptionTypeSystemManaged, + } +} + +// EncryptionKeyStatus - Status of key used by a server configured with data encryption based on customer managed key, to +// encrypt the primary storage associated to the server. +type EncryptionKeyStatus string + +const ( + // EncryptionKeyStatusInvalid - Key is invalid and cannot be used for encryption. Possible causes include key deletion, permission + // changes, key being disabled, key type not supported, or current date being outside of validity period associated to the + // key. + EncryptionKeyStatusInvalid EncryptionKeyStatus = "Invalid" + // EncryptionKeyStatusValid - Key is valid and can be used for encryption. + EncryptionKeyStatusValid EncryptionKeyStatus = "Valid" +) + +// PossibleEncryptionKeyStatusValues returns the possible values for the EncryptionKeyStatus const type. +func PossibleEncryptionKeyStatusValues() []EncryptionKeyStatus { + return []EncryptionKeyStatus{ + EncryptionKeyStatusInvalid, + EncryptionKeyStatusValid, + } +} + // ExecutionStatus - Service-set extensible enum indicating the status of operation type ExecutionStatus string const ( + // ExecutionStatusCancelled - The operation was cancelled. ExecutionStatusCancelled ExecutionStatus = "Cancelled" - ExecutionStatusFailed ExecutionStatus = "Failed" - ExecutionStatusRunning ExecutionStatus = "Running" + // ExecutionStatusFailed - The operation failed. + ExecutionStatusFailed ExecutionStatus = "Failed" + // ExecutionStatusRunning - The operation is currently running. + ExecutionStatusRunning ExecutionStatus = "Running" + // ExecutionStatusSucceeded - The operation succeeded. ExecutionStatusSucceeded ExecutionStatus = "Succeeded" ) @@ -240,9 +310,16 @@ func PossibleExecutionStatusValues() []ExecutionStatus { type FailoverMode string const ( - FailoverModeForcedFailover FailoverMode = "ForcedFailover" - FailoverModeForcedSwitchover FailoverMode = "ForcedSwitchover" - FailoverModePlannedFailover FailoverMode = "PlannedFailover" + // FailoverModeForcedFailover - Kills the primary database process first, then triggers the failover. This is more aggressive + // and used when the primary is unresponsive or in an unhealthy state. + FailoverModeForcedFailover FailoverMode = "ForcedFailover" + // FailoverModeForcedSwitchover - Kills the primary database process and then triggers a switch over with role swapping. + FailoverModeForcedSwitchover FailoverMode = "ForcedSwitchover" + // FailoverModePlannedFailover - Triggers a failover from primary to standby without killing the primary database process + // first. This is a graceful failover that attempts to preserve data consistency. + FailoverModePlannedFailover FailoverMode = "PlannedFailover" + // FailoverModePlannedSwitchover - Similar to 'PlannedFailover' but prefers a switch over operation where roles are swapped + // between primary and standby. FailoverModePlannedSwitchover FailoverMode = "PlannedSwitchover" ) @@ -256,100 +333,144 @@ func PossibleFailoverModeValues() []FailoverMode { } } -// FastProvisioningSupportedEnum - Gets a value indicating whether fast provisioning is 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". -type FastProvisioningSupportedEnum string +// FastProvisioningSupport - Indicates if fast provisioning is supported. 'Enabled' means fast provisioning is supported. +// 'Disabled' stands for fast provisioning is not supported. Will be deprecated in the future. Look to +// Supported Features for 'FastProvisioning'. +type FastProvisioningSupport string const ( - FastProvisioningSupportedEnumDisabled FastProvisioningSupportedEnum = "Disabled" - FastProvisioningSupportedEnumEnabled FastProvisioningSupportedEnum = "Enabled" + // FastProvisioningSupportDisabled - Fast provisioning is not supported. + FastProvisioningSupportDisabled FastProvisioningSupport = "Disabled" + // FastProvisioningSupportEnabled - Fast provisioning is supported. + FastProvisioningSupportEnabled FastProvisioningSupport = "Enabled" ) -// PossibleFastProvisioningSupportedEnumValues returns the possible values for the FastProvisioningSupportedEnum const type. -func PossibleFastProvisioningSupportedEnumValues() []FastProvisioningSupportedEnum { - return []FastProvisioningSupportedEnum{ - FastProvisioningSupportedEnumDisabled, - FastProvisioningSupportedEnumEnabled, +// PossibleFastProvisioningSupportValues returns the possible values for the FastProvisioningSupport const type. +func PossibleFastProvisioningSupportValues() []FastProvisioningSupport { + return []FastProvisioningSupport{ + FastProvisioningSupportDisabled, + FastProvisioningSupportEnabled, } } -// GeoBackupSupportedEnum - Determines if geo-backup is supported in this region. "Enabled" means geo-backup is supported. -// "Disabled" stands for geo-back is not supported. Will be deprecated in future, please look to Supported -// Features for "GeoBackup". -type GeoBackupSupportedEnum string +// FeatureStatus - Status of the feature. Indicates if the feature is enabled or not. +type FeatureStatus string const ( - GeoBackupSupportedEnumDisabled GeoBackupSupportedEnum = "Disabled" - GeoBackupSupportedEnumEnabled GeoBackupSupportedEnum = "Enabled" + // FeatureStatusDisabled - Feature is disabled. + FeatureStatusDisabled FeatureStatus = "Disabled" + // FeatureStatusEnabled - Feature is enabled. + FeatureStatusEnabled FeatureStatus = "Enabled" ) -// PossibleGeoBackupSupportedEnumValues returns the possible values for the GeoBackupSupportedEnum const type. -func PossibleGeoBackupSupportedEnumValues() []GeoBackupSupportedEnum { - return []GeoBackupSupportedEnum{ - GeoBackupSupportedEnumDisabled, - GeoBackupSupportedEnumEnabled, +// PossibleFeatureStatusValues returns the possible values for the FeatureStatus const type. +func PossibleFeatureStatusValues() []FeatureStatus { + return []FeatureStatus{ + FeatureStatusDisabled, + FeatureStatusEnabled, } } -// GeoRedundantBackupEnum - A value indicating whether Geo-Redundant backup is enabled on the server. -type GeoRedundantBackupEnum string +// GeographicallyRedundantBackup - Indicates if the server is configured to create geographically redundant backups. +type GeographicallyRedundantBackup string const ( - GeoRedundantBackupEnumDisabled GeoRedundantBackupEnum = "Disabled" - GeoRedundantBackupEnumEnabled GeoRedundantBackupEnum = "Enabled" + // GeographicallyRedundantBackupDisabled - Server is not configured to create geographically redundant backups. + GeographicallyRedundantBackupDisabled GeographicallyRedundantBackup = "Disabled" + // GeographicallyRedundantBackupEnabled - Server is configured to create geographically redundant backups. + GeographicallyRedundantBackupEnabled GeographicallyRedundantBackup = "Enabled" ) -// PossibleGeoRedundantBackupEnumValues returns the possible values for the GeoRedundantBackupEnum const type. -func PossibleGeoRedundantBackupEnumValues() []GeoRedundantBackupEnum { - return []GeoRedundantBackupEnum{ - GeoRedundantBackupEnumDisabled, - GeoRedundantBackupEnumEnabled, +// PossibleGeographicallyRedundantBackupValues returns the possible values for the GeographicallyRedundantBackup const type. +func PossibleGeographicallyRedundantBackupValues() []GeographicallyRedundantBackup { + return []GeographicallyRedundantBackup{ + GeographicallyRedundantBackupDisabled, + GeographicallyRedundantBackupEnabled, } } -// HaMode - HA mode supported for a server. -type HaMode string +// GeographicallyRedundantBackupSupport - Indicates if geographically redundant backups are supported in this location. 'Enabled' +// means geographically redundant backups are supported. 'Disabled' stands for geographically redundant backup is +// not supported. Will be deprecated in the future. Look to Supported Features for 'GeoBackup'. +type GeographicallyRedundantBackupSupport string const ( - HaModeSameZone HaMode = "SameZone" - HaModeZoneRedundant HaMode = "ZoneRedundant" + // GeographicallyRedundantBackupSupportDisabled - Geographically redundant backups are not supported. + GeographicallyRedundantBackupSupportDisabled GeographicallyRedundantBackupSupport = "Disabled" + // GeographicallyRedundantBackupSupportEnabled - Geographically redundant backups are supported. + GeographicallyRedundantBackupSupportEnabled GeographicallyRedundantBackupSupport = "Enabled" ) -// PossibleHaModeValues returns the possible values for the HaMode const type. -func PossibleHaModeValues() []HaMode { - return []HaMode{ - HaModeSameZone, - HaModeZoneRedundant, +// PossibleGeographicallyRedundantBackupSupportValues returns the possible values for the GeographicallyRedundantBackupSupport const type. +func PossibleGeographicallyRedundantBackupSupportValues() []GeographicallyRedundantBackupSupport { + return []GeographicallyRedundantBackupSupport{ + GeographicallyRedundantBackupSupportDisabled, + GeographicallyRedundantBackupSupportEnabled, } } -// HighAvailabilityMode - The HA mode for the server. +// HighAvailabilityMode - Modes of high availability supported for this compute. type HighAvailabilityMode string const ( - HighAvailabilityModeDisabled HighAvailabilityMode = "Disabled" - HighAvailabilityModeSameZone HighAvailabilityMode = "SameZone" + // HighAvailabilityModeSameZone - High availability is enabled for the server, with standby server in the same availability + // zone as the primary. + HighAvailabilityModeSameZone HighAvailabilityMode = "SameZone" + // HighAvailabilityModeZoneRedundant - High availability is enabled for the server, with standby server in a different availability + // zone than that of the primary. HighAvailabilityModeZoneRedundant HighAvailabilityMode = "ZoneRedundant" ) // PossibleHighAvailabilityModeValues returns the possible values for the HighAvailabilityMode const type. func PossibleHighAvailabilityModeValues() []HighAvailabilityMode { return []HighAvailabilityMode{ - HighAvailabilityModeDisabled, HighAvailabilityModeSameZone, HighAvailabilityModeZoneRedundant, } } -// IdentityType - the types of identities associated with this resource +// HighAvailabilityState - Possible states of the standby server created when high availability is set to SameZone or ZoneRedundant. +type HighAvailabilityState string + +const ( + // HighAvailabilityStateCreatingStandby - Standby server is being created. + HighAvailabilityStateCreatingStandby HighAvailabilityState = "CreatingStandby" + // HighAvailabilityStateFailingOver - Failover operation to the standby server is in progress. + HighAvailabilityStateFailingOver HighAvailabilityState = "FailingOver" + // HighAvailabilityStateHealthy - Standby server is healthy and ready to take over in case of a failover. + HighAvailabilityStateHealthy HighAvailabilityState = "Healthy" + // HighAvailabilityStateNotEnabled - High availability is not enabled for the server. + HighAvailabilityStateNotEnabled HighAvailabilityState = "NotEnabled" + // HighAvailabilityStateRemovingStandby - Standby server is being removed. + HighAvailabilityStateRemovingStandby HighAvailabilityState = "RemovingStandby" + // HighAvailabilityStateReplicatingData - Data is being replicated to the standby server. + HighAvailabilityStateReplicatingData HighAvailabilityState = "ReplicatingData" +) + +// PossibleHighAvailabilityStateValues returns the possible values for the HighAvailabilityState const type. +func PossibleHighAvailabilityStateValues() []HighAvailabilityState { + return []HighAvailabilityState{ + HighAvailabilityStateCreatingStandby, + HighAvailabilityStateFailingOver, + HighAvailabilityStateHealthy, + HighAvailabilityStateNotEnabled, + HighAvailabilityStateRemovingStandby, + HighAvailabilityStateReplicatingData, + } +} + +// IdentityType - Types of identities associated with a server. type IdentityType string const ( - IdentityTypeNone IdentityType = "None" - IdentityTypeSystemAssigned IdentityType = "SystemAssigned" + // IdentityTypeNone - No managed identity is assigned to the server. + IdentityTypeNone IdentityType = "None" + // IdentityTypeSystemAssigned - Azure automatically creates and manages the identity associated to the lifecycle of the server. + IdentityTypeSystemAssigned IdentityType = "SystemAssigned" + // IdentityTypeSystemAssignedUserAssigned - Both system-assigned and user-assigned identities are assigned to the server. IdentityTypeSystemAssignedUserAssigned IdentityType = "SystemAssigned,UserAssigned" - IdentityTypeUserAssigned IdentityType = "UserAssigned" + // IdentityTypeUserAssigned - One or more managed identities provided by the user are assigned to the server. + IdentityTypeUserAssigned IdentityType = "UserAssigned" ) // PossibleIdentityTypeValues returns the possible values for the IdentityType const type. @@ -362,83 +483,117 @@ func PossibleIdentityTypeValues() []IdentityType { } } -// KeyStatusEnum - Primary encryption key status for Data encryption enabled server. -type KeyStatusEnum string +// LocationRestricted - Indicates if this location is restricted. 'Enabled' means location is restricted. 'Disabled' stands +// for location is not restricted. Will be deprecated in the future. Look to Supported Features for +// 'Restricted'. +type LocationRestricted string const ( - KeyStatusEnumInvalid KeyStatusEnum = "Invalid" - KeyStatusEnumValid KeyStatusEnum = "Valid" + // LocationRestrictedDisabled - Location is not restricted. + LocationRestrictedDisabled LocationRestricted = "Disabled" + // LocationRestrictedEnabled - Location is restricted. + LocationRestrictedEnabled LocationRestricted = "Enabled" ) -// PossibleKeyStatusEnumValues returns the possible values for the KeyStatusEnum const type. -func PossibleKeyStatusEnumValues() []KeyStatusEnum { - return []KeyStatusEnum{ - KeyStatusEnumInvalid, - KeyStatusEnumValid, +// PossibleLocationRestrictedValues returns the possible values for the LocationRestricted const type. +func PossibleLocationRestrictedValues() []LocationRestricted { + return []LocationRestricted{ + LocationRestrictedDisabled, + LocationRestrictedEnabled, } } -// LogicalReplicationOnSourceDbEnum - Indicates whether to setup LogicalReplicationOnSourceDb, if needed -type LogicalReplicationOnSourceDbEnum string +// LogicalReplicationOnSourceServer - Indicates whether to setup logical replication on source server, if needed. +type LogicalReplicationOnSourceServer string const ( - LogicalReplicationOnSourceDbEnumFalse LogicalReplicationOnSourceDbEnum = "False" - LogicalReplicationOnSourceDbEnumTrue LogicalReplicationOnSourceDbEnum = "True" + // LogicalReplicationOnSourceServerFalse - Logical replication will not be set up on the source server. + LogicalReplicationOnSourceServerFalse LogicalReplicationOnSourceServer = "False" + // LogicalReplicationOnSourceServerTrue - Logical replication will be set up on the source server. + LogicalReplicationOnSourceServerTrue LogicalReplicationOnSourceServer = "True" ) -// PossibleLogicalReplicationOnSourceDbEnumValues returns the possible values for the LogicalReplicationOnSourceDbEnum const type. -func PossibleLogicalReplicationOnSourceDbEnumValues() []LogicalReplicationOnSourceDbEnum { - return []LogicalReplicationOnSourceDbEnum{ - LogicalReplicationOnSourceDbEnumFalse, - LogicalReplicationOnSourceDbEnumTrue, +// PossibleLogicalReplicationOnSourceServerValues returns the possible values for the LogicalReplicationOnSourceServer const type. +func PossibleLogicalReplicationOnSourceServerValues() []LogicalReplicationOnSourceServer { + return []LogicalReplicationOnSourceServer{ + LogicalReplicationOnSourceServerFalse, + LogicalReplicationOnSourceServerTrue, } } -// MigrateRolesEnum - To migrate roles and permissions we need to send this flag as True -type MigrateRolesEnum string +// MicrosoftEntraAuth - Indicates if the server supports Microsoft Entra authentication. +type MicrosoftEntraAuth string const ( - MigrateRolesEnumFalse MigrateRolesEnum = "False" - MigrateRolesEnumTrue MigrateRolesEnum = "True" + // MicrosoftEntraAuthDisabled - Server doesn't support Microsoft Entra authentication. + MicrosoftEntraAuthDisabled MicrosoftEntraAuth = "Disabled" + // MicrosoftEntraAuthEnabled - Server supports Microsoft Entra authentication. + MicrosoftEntraAuthEnabled MicrosoftEntraAuth = "Enabled" ) -// PossibleMigrateRolesEnumValues returns the possible values for the MigrateRolesEnum const type. -func PossibleMigrateRolesEnumValues() []MigrateRolesEnum { - return []MigrateRolesEnum{ - MigrateRolesEnumFalse, - MigrateRolesEnumTrue, +// PossibleMicrosoftEntraAuthValues returns the possible values for the MicrosoftEntraAuth const type. +func PossibleMicrosoftEntraAuthValues() []MicrosoftEntraAuth { + return []MicrosoftEntraAuth{ + MicrosoftEntraAuthDisabled, + MicrosoftEntraAuthEnabled, } } -// MigrationDbState - Migration db state of an individual database -type MigrationDbState string +// MigrateRolesAndPermissions - Indicates if roles and permissions must be migrated. +type MigrateRolesAndPermissions string const ( - MigrationDbStateCanceled MigrationDbState = "Canceled" - MigrationDbStateCanceling MigrationDbState = "Canceling" - MigrationDbStateFailed MigrationDbState = "Failed" - MigrationDbStateInProgress MigrationDbState = "InProgress" - MigrationDbStateSucceeded MigrationDbState = "Succeeded" - MigrationDbStateWaitingForCutoverTrigger MigrationDbState = "WaitingForCutoverTrigger" + // MigrateRolesAndPermissionsFalse - Roles and permissions will not be migrated. + MigrateRolesAndPermissionsFalse MigrateRolesAndPermissions = "False" + // MigrateRolesAndPermissionsTrue - Roles and permissions will be migrated. + MigrateRolesAndPermissionsTrue MigrateRolesAndPermissions = "True" ) -// PossibleMigrationDbStateValues returns the possible values for the MigrationDbState const type. -func PossibleMigrationDbStateValues() []MigrationDbState { - return []MigrationDbState{ - MigrationDbStateCanceled, - MigrationDbStateCanceling, - MigrationDbStateFailed, - MigrationDbStateInProgress, - MigrationDbStateSucceeded, - MigrationDbStateWaitingForCutoverTrigger, +// PossibleMigrateRolesAndPermissionsValues returns the possible values for the MigrateRolesAndPermissions const type. +func PossibleMigrateRolesAndPermissionsValues() []MigrateRolesAndPermissions { + return []MigrateRolesAndPermissions{ + MigrateRolesAndPermissionsFalse, + MigrateRolesAndPermissionsTrue, + } +} + +// MigrationDatabaseState - Migration state of a database. +type MigrationDatabaseState string + +const ( + // MigrationDatabaseStateCanceled - Migration has been canceled for the database. + MigrationDatabaseStateCanceled MigrationDatabaseState = "Canceled" + // MigrationDatabaseStateCanceling - Migration is canceling for the database. + MigrationDatabaseStateCanceling MigrationDatabaseState = "Canceling" + // MigrationDatabaseStateFailed - Migration has failed for the database. + MigrationDatabaseStateFailed MigrationDatabaseState = "Failed" + // MigrationDatabaseStateInProgress - Migration is in progress for the database. + MigrationDatabaseStateInProgress MigrationDatabaseState = "InProgress" + // MigrationDatabaseStateSucceeded - Migration has succeeded for the database. + MigrationDatabaseStateSucceeded MigrationDatabaseState = "Succeeded" + // MigrationDatabaseStateWaitingForCutoverTrigger - Migration is waiting for cutover trigger for the database. + MigrationDatabaseStateWaitingForCutoverTrigger MigrationDatabaseState = "WaitingForCutoverTrigger" +) + +// PossibleMigrationDatabaseStateValues returns the possible values for the MigrationDatabaseState const type. +func PossibleMigrationDatabaseStateValues() []MigrationDatabaseState { + return []MigrationDatabaseState{ + MigrationDatabaseStateCanceled, + MigrationDatabaseStateCanceling, + MigrationDatabaseStateFailed, + MigrationDatabaseStateInProgress, + MigrationDatabaseStateSucceeded, + MigrationDatabaseStateWaitingForCutoverTrigger, } } type MigrationListFilter string const ( + // MigrationListFilterActive - Only active (in-progress) migrations. MigrationListFilterActive MigrationListFilter = "Active" - MigrationListFilterAll MigrationListFilter = "All" + // MigrationListFilterAll - All migrations. + MigrationListFilterAll MigrationListFilter = "All" ) // PossibleMigrationListFilterValues returns the possible values for the MigrationListFilter const type. @@ -449,12 +604,14 @@ func PossibleMigrationListFilterValues() []MigrationListFilter { } } -// MigrationMode - There are two types of migration modes Online and Offline +// MigrationMode - Mode used to perform the migration: Online or Offline. type MigrationMode string const ( + // MigrationModeOffline - Offline migration mode. MigrationModeOffline MigrationMode = "Offline" - MigrationModeOnline MigrationMode = "Online" + // MigrationModeOnline - Online migration mode. + MigrationModeOnline MigrationMode = "Online" ) // PossibleMigrationModeValues returns the possible values for the MigrationMode const type. @@ -469,8 +626,10 @@ func PossibleMigrationModeValues() []MigrationMode { type MigrationNameAvailabilityReason string const ( + // MigrationNameAvailabilityReasonAlreadyExists - Migration name already exists. MigrationNameAvailabilityReasonAlreadyExists MigrationNameAvailabilityReason = "AlreadyExists" - MigrationNameAvailabilityReasonInvalid MigrationNameAvailabilityReason = "Invalid" + // MigrationNameAvailabilityReasonInvalid - Migration name is invalid. + MigrationNameAvailabilityReasonInvalid MigrationNameAvailabilityReason = "Invalid" ) // PossibleMigrationNameAvailabilityReasonValues returns the possible values for the MigrationNameAvailabilityReason const type. @@ -481,12 +640,15 @@ func PossibleMigrationNameAvailabilityReasonValues() []MigrationNameAvailability } } -// MigrationOption - Supported types of migration request include Validate, Migrate and ValidateAndMigrate +// MigrationOption - Supported option for a migration type MigrationOption string const ( - MigrationOptionMigrate MigrationOption = "Migrate" - MigrationOptionValidate MigrationOption = "Validate" + // MigrationOptionMigrate - Perform the migration. + MigrationOptionMigrate MigrationOption = "Migrate" + // MigrationOptionValidate - Validate the migration without performing it. + MigrationOptionValidate MigrationOption = "Validate" + // MigrationOptionValidateAndMigrate - Validate and perform the migration. MigrationOptionValidateAndMigrate MigrationOption = "ValidateAndMigrate" ) @@ -499,16 +661,23 @@ func PossibleMigrationOptionValues() []MigrationOption { } } -// MigrationState - Migration state. +// MigrationState - State of migration. type MigrationState string const ( - MigrationStateCanceled MigrationState = "Canceled" - MigrationStateCleaningUp MigrationState = "CleaningUp" - MigrationStateFailed MigrationState = "Failed" - MigrationStateInProgress MigrationState = "InProgress" - MigrationStateSucceeded MigrationState = "Succeeded" - MigrationStateValidationFailed MigrationState = "ValidationFailed" + // MigrationStateCanceled - Migration has been canceled. + MigrationStateCanceled MigrationState = "Canceled" + // MigrationStateCleaningUp - Migration is cleaning up resources. + MigrationStateCleaningUp MigrationState = "CleaningUp" + // MigrationStateFailed - Migration has failed. + MigrationStateFailed MigrationState = "Failed" + // MigrationStateInProgress - Migration is in progress. + MigrationStateInProgress MigrationState = "InProgress" + // MigrationStateSucceeded - Migration has succeeded. + MigrationStateSucceeded MigrationState = "Succeeded" + // MigrationStateValidationFailed - Validation for migration has failed. + MigrationStateValidationFailed MigrationState = "ValidationFailed" + // MigrationStateWaitingForUserAction - Migration is waiting for user action. MigrationStateWaitingForUserAction MigrationState = "WaitingForUserAction" ) @@ -525,67 +694,88 @@ func PossibleMigrationStateValues() []MigrationState { } } -// MigrationSubState - Migration sub state. -type MigrationSubState string - -const ( - MigrationSubStateCancelingRequestedDBMigrations MigrationSubState = "CancelingRequestedDBMigrations" - MigrationSubStateCompleted MigrationSubState = "Completed" - MigrationSubStateCompletingMigration MigrationSubState = "CompletingMigration" - MigrationSubStateMigratingData MigrationSubState = "MigratingData" - MigrationSubStatePerformingPreRequisiteSteps MigrationSubState = "PerformingPreRequisiteSteps" - MigrationSubStateValidationInProgress MigrationSubState = "ValidationInProgress" - MigrationSubStateWaitingForCutoverTrigger MigrationSubState = "WaitingForCutoverTrigger" - MigrationSubStateWaitingForDBsToMigrateSpecification MigrationSubState = "WaitingForDBsToMigrateSpecification" - MigrationSubStateWaitingForDataMigrationScheduling MigrationSubState = "WaitingForDataMigrationScheduling" - MigrationSubStateWaitingForDataMigrationWindow MigrationSubState = "WaitingForDataMigrationWindow" - MigrationSubStateWaitingForLogicalReplicationSetupRequestOnSourceDB MigrationSubState = "WaitingForLogicalReplicationSetupRequestOnSourceDB" - MigrationSubStateWaitingForTargetDBOverwriteConfirmation MigrationSubState = "WaitingForTargetDBOverwriteConfirmation" -) - -// PossibleMigrationSubStateValues returns the possible values for the MigrationSubState const type. -func PossibleMigrationSubStateValues() []MigrationSubState { - return []MigrationSubState{ - MigrationSubStateCancelingRequestedDBMigrations, - MigrationSubStateCompleted, - MigrationSubStateCompletingMigration, - MigrationSubStateMigratingData, - MigrationSubStatePerformingPreRequisiteSteps, - MigrationSubStateValidationInProgress, - MigrationSubStateWaitingForCutoverTrigger, - MigrationSubStateWaitingForDBsToMigrateSpecification, - MigrationSubStateWaitingForDataMigrationScheduling, - MigrationSubStateWaitingForDataMigrationWindow, - MigrationSubStateWaitingForLogicalReplicationSetupRequestOnSourceDB, - MigrationSubStateWaitingForTargetDBOverwriteConfirmation, +// MigrationSubstate - Substate of migration. +type MigrationSubstate string + +const ( + // MigrationSubstateCancelingRequestedDBMigrations - Canceling requested database migrations. + MigrationSubstateCancelingRequestedDBMigrations MigrationSubstate = "CancelingRequestedDBMigrations" + // MigrationSubstateCompleted - Migration completed. + MigrationSubstateCompleted MigrationSubstate = "Completed" + // MigrationSubstateCompletingMigration - Completing migration. + MigrationSubstateCompletingMigration MigrationSubstate = "CompletingMigration" + // MigrationSubstateMigratingData - Migrating data. + MigrationSubstateMigratingData MigrationSubstate = "MigratingData" + // MigrationSubstatePerformingPreRequisiteSteps - Performing pre-requisite steps for migration. + MigrationSubstatePerformingPreRequisiteSteps MigrationSubstate = "PerformingPreRequisiteSteps" + // MigrationSubstateValidationInProgress - Validation in progress. + MigrationSubstateValidationInProgress MigrationSubstate = "ValidationInProgress" + // MigrationSubstateWaitingForCutoverTrigger - Waiting for cutover trigger. + MigrationSubstateWaitingForCutoverTrigger MigrationSubstate = "WaitingForCutoverTrigger" + // MigrationSubstateWaitingForDBsToMigrateSpecification - Waiting for databases to migrate specification. + MigrationSubstateWaitingForDBsToMigrateSpecification MigrationSubstate = "WaitingForDBsToMigrateSpecification" + // MigrationSubstateWaitingForDataMigrationScheduling - Waiting for data migration scheduling. + MigrationSubstateWaitingForDataMigrationScheduling MigrationSubstate = "WaitingForDataMigrationScheduling" + // MigrationSubstateWaitingForDataMigrationWindow - Waiting for data migration window. + MigrationSubstateWaitingForDataMigrationWindow MigrationSubstate = "WaitingForDataMigrationWindow" + // MigrationSubstateWaitingForLogicalReplicationSetupRequestOnSourceDB - Waiting for logical replication setup request on + // source database. + MigrationSubstateWaitingForLogicalReplicationSetupRequestOnSourceDB MigrationSubstate = "WaitingForLogicalReplicationSetupRequestOnSourceDB" + // MigrationSubstateWaitingForTargetDBOverwriteConfirmation - Waiting for target database overwrite confirmation. + MigrationSubstateWaitingForTargetDBOverwriteConfirmation MigrationSubstate = "WaitingForTargetDBOverwriteConfirmation" +) + +// PossibleMigrationSubstateValues returns the possible values for the MigrationSubstate const type. +func PossibleMigrationSubstateValues() []MigrationSubstate { + return []MigrationSubstate{ + MigrationSubstateCancelingRequestedDBMigrations, + MigrationSubstateCompleted, + MigrationSubstateCompletingMigration, + MigrationSubstateMigratingData, + MigrationSubstatePerformingPreRequisiteSteps, + MigrationSubstateValidationInProgress, + MigrationSubstateWaitingForCutoverTrigger, + MigrationSubstateWaitingForDBsToMigrateSpecification, + MigrationSubstateWaitingForDataMigrationScheduling, + MigrationSubstateWaitingForDataMigrationWindow, + MigrationSubstateWaitingForLogicalReplicationSetupRequestOnSourceDB, + MigrationSubstateWaitingForTargetDBOverwriteConfirmation, } } -// OnlineResizeSupportedEnum - 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. Will be deprecated in future, please look to Supported Features for "OnlineResize". -type OnlineResizeSupportedEnum string +// OnlineStorageResizeSupport - Indicates if resizing the storage, without interrupting the operation of the database engine, +// is supported in this location for the given subscription. 'Enabled' means resizing the storage without +// interrupting the operation of the database engine is supported. 'Disabled' means resizing the storage without interrupting +// the operation of the database engine is not supported. Will be deprecated in +// the future. Look to Supported Features for 'OnlineResize'. +type OnlineStorageResizeSupport string const ( - OnlineResizeSupportedEnumDisabled OnlineResizeSupportedEnum = "Disabled" - OnlineResizeSupportedEnumEnabled OnlineResizeSupportedEnum = "Enabled" + // OnlineStorageResizeSupportDisabled - Resizing the storage without interrupting the operation of the database engine is + // not supported. + OnlineStorageResizeSupportDisabled OnlineStorageResizeSupport = "Disabled" + // OnlineStorageResizeSupportEnabled - Resizing the storage without interrupting the operation of the database engine is supported. + OnlineStorageResizeSupportEnabled OnlineStorageResizeSupport = "Enabled" ) -// PossibleOnlineResizeSupportedEnumValues returns the possible values for the OnlineResizeSupportedEnum const type. -func PossibleOnlineResizeSupportedEnumValues() []OnlineResizeSupportedEnum { - return []OnlineResizeSupportedEnum{ - OnlineResizeSupportedEnumDisabled, - OnlineResizeSupportedEnumEnabled, +// PossibleOnlineStorageResizeSupportValues returns the possible values for the OnlineStorageResizeSupport const type. +func PossibleOnlineStorageResizeSupportValues() []OnlineStorageResizeSupport { + return []OnlineStorageResizeSupport{ + OnlineStorageResizeSupportDisabled, + OnlineStorageResizeSupportEnabled, } } -// OperationOrigin - The intended executor of the operation. +// OperationOrigin - Intended executor of the operation. type OperationOrigin string const ( + // OperationOriginNotSpecified - The origin is not specified. OperationOriginNotSpecified OperationOrigin = "NotSpecified" - OperationOriginSystem OperationOrigin = "system" - OperationOriginUser OperationOrigin = "user" + // OperationOriginSystem - The operation is initiated by the system. + OperationOriginSystem OperationOrigin = "system" + // OperationOriginUser - The operation is initiated by a user. + OperationOriginUser OperationOrigin = "user" ) // PossibleOperationOriginValues returns the possible values for the OperationOrigin const type. @@ -597,64 +787,92 @@ func PossibleOperationOriginValues() []OperationOrigin { } } -// Origin - Backup type. -type Origin string +// OverwriteDatabasesOnTargetServer - Indicates if databases on the target server can be overwritten when already present. +// If set to 'False', when the migration workflow detects that the database already exists on the target server, it +// will wait for a confirmation. +type OverwriteDatabasesOnTargetServer string const ( - OriginCustomerOnDemand Origin = "Customer On-Demand" - OriginFull Origin = "Full" + // OverwriteDatabasesOnTargetServerFalse - Databases on the target server cannot be overwritten when already present. + OverwriteDatabasesOnTargetServerFalse OverwriteDatabasesOnTargetServer = "False" + // OverwriteDatabasesOnTargetServerTrue - Databases on the target server can be overwritten when already present. + OverwriteDatabasesOnTargetServerTrue OverwriteDatabasesOnTargetServer = "True" ) -// PossibleOriginValues returns the possible values for the Origin const type. -func PossibleOriginValues() []Origin { - return []Origin{ - OriginCustomerOnDemand, - OriginFull, +// PossibleOverwriteDatabasesOnTargetServerValues returns the possible values for the OverwriteDatabasesOnTargetServer const type. +func PossibleOverwriteDatabasesOnTargetServerValues() []OverwriteDatabasesOnTargetServer { + return []OverwriteDatabasesOnTargetServer{ + OverwriteDatabasesOnTargetServerFalse, + OverwriteDatabasesOnTargetServerTrue, } } -// OverwriteDbsInTargetEnum - Indicates whether the databases on the target server can be overwritten, if already present. -// If set to False, the migration workflow will wait for a confirmation, if it detects that the database -// already exists. -type OverwriteDbsInTargetEnum string +// PasswordBasedAuth - Indicates if the server supports password based authentication. +type PasswordBasedAuth string const ( - OverwriteDbsInTargetEnumFalse OverwriteDbsInTargetEnum = "False" - OverwriteDbsInTargetEnumTrue OverwriteDbsInTargetEnum = "True" + // PasswordBasedAuthDisabled - Server doesn't support password based authentication. + PasswordBasedAuthDisabled PasswordBasedAuth = "Disabled" + // PasswordBasedAuthEnabled - Server supports password based authentication. + PasswordBasedAuthEnabled PasswordBasedAuth = "Enabled" ) -// PossibleOverwriteDbsInTargetEnumValues returns the possible values for the OverwriteDbsInTargetEnum const type. -func PossibleOverwriteDbsInTargetEnumValues() []OverwriteDbsInTargetEnum { - return []OverwriteDbsInTargetEnum{ - OverwriteDbsInTargetEnumFalse, - OverwriteDbsInTargetEnumTrue, +// PossiblePasswordBasedAuthValues returns the possible values for the PasswordBasedAuth const type. +func PossiblePasswordBasedAuthValues() []PasswordBasedAuth { + return []PasswordBasedAuth{ + PasswordBasedAuthDisabled, + PasswordBasedAuthEnabled, } } -// PasswordAuthEnum - If Enabled, Password authentication is enabled. -type PasswordAuthEnum string - -const ( - PasswordAuthEnumDisabled PasswordAuthEnum = "Disabled" - PasswordAuthEnumEnabled PasswordAuthEnum = "Enabled" -) - -// PossiblePasswordAuthEnumValues returns the possible values for the PasswordAuthEnum const type. -func PossiblePasswordAuthEnumValues() []PasswordAuthEnum { - return []PasswordAuthEnum{ - PasswordAuthEnumDisabled, - PasswordAuthEnumEnabled, +// PostgresMajorVersion - Major version of PostgreSQL database engine. +type PostgresMajorVersion string + +const ( + // PostgresMajorVersionEighteen - PostgreSQL 18. + PostgresMajorVersionEighteen PostgresMajorVersion = "18" + // PostgresMajorVersionEleven - PostgreSQL 11. + PostgresMajorVersionEleven PostgresMajorVersion = "11" + // PostgresMajorVersionFifteen - PostgreSQL 15. + PostgresMajorVersionFifteen PostgresMajorVersion = "15" + // PostgresMajorVersionFourteen - PostgreSQL 14. + PostgresMajorVersionFourteen PostgresMajorVersion = "14" + // PostgresMajorVersionSeventeen - PostgreSQL 17. + PostgresMajorVersionSeventeen PostgresMajorVersion = "17" + // PostgresMajorVersionSixteen - PostgreSQL 16. + PostgresMajorVersionSixteen PostgresMajorVersion = "16" + // PostgresMajorVersionThirteen - PostgreSQL 13. + PostgresMajorVersionThirteen PostgresMajorVersion = "13" + // PostgresMajorVersionTwelve - PostgreSQL 12. + PostgresMajorVersionTwelve PostgresMajorVersion = "12" +) + +// PossiblePostgresMajorVersionValues returns the possible values for the PostgresMajorVersion const type. +func PossiblePostgresMajorVersionValues() []PostgresMajorVersion { + return []PostgresMajorVersion{ + PostgresMajorVersionEighteen, + PostgresMajorVersionEleven, + PostgresMajorVersionFifteen, + PostgresMajorVersionFourteen, + PostgresMajorVersionSeventeen, + PostgresMajorVersionSixteen, + PostgresMajorVersionThirteen, + PostgresMajorVersionTwelve, } } -// PrincipalType - The principal type used to represent the type of Microsoft Entra Administrator. +// PrincipalType - Type of Microsoft Entra principal to which the server administrator is associated. type PrincipalType string const ( - PrincipalTypeGroup PrincipalType = "Group" + // PrincipalTypeGroup - A Microsoft Entra group. + PrincipalTypeGroup PrincipalType = "Group" + // PrincipalTypeServicePrincipal - A Microsoft Entra service principal, typically representing an application or service identity PrincipalTypeServicePrincipal PrincipalType = "ServicePrincipal" - PrincipalTypeUnknown PrincipalType = "Unknown" - PrincipalTypeUser PrincipalType = "User" + // PrincipalTypeUnknown - The principal type is not known or not specified. + PrincipalTypeUnknown PrincipalType = "Unknown" + // PrincipalTypeUser - A Microsoft Entra user. + PrincipalTypeUser PrincipalType = "User" ) // PossiblePrincipalTypeValues returns the possible values for the PrincipalType const type. @@ -705,12 +923,16 @@ func PossiblePrivateEndpointServiceConnectionStatusValues() []PrivateEndpointSer } } -// ReadReplicaPromoteMode - Sets the promote mode for a replica server. This is a write only property. +// ReadReplicaPromoteMode - Type of operation to apply on the read replica. This property is write only. Standalone means +// that the read replica will be promoted to a standalone server, and will become a completely independent +// entity from the replication set. Switchover means that the read replica will roles with the primary server. type ReadReplicaPromoteMode string const ( - ReadReplicaPromoteModeStandalone ReadReplicaPromoteMode = "standalone" - ReadReplicaPromoteModeSwitchover ReadReplicaPromoteMode = "switchover" + // ReadReplicaPromoteModeStandalone - Read replica will become an independent server. + ReadReplicaPromoteModeStandalone ReadReplicaPromoteMode = "Standalone" + // ReadReplicaPromoteModeSwitchover - Read replica will swap roles with primary server. + ReadReplicaPromoteModeSwitchover ReadReplicaPromoteMode = "Switchover" ) // PossibleReadReplicaPromoteModeValues returns the possible values for the ReadReplicaPromoteMode const type. @@ -721,18 +943,24 @@ func PossibleReadReplicaPromoteModeValues() []ReadReplicaPromoteMode { } } -type RecommendationType string +// ReadReplicaPromoteOption - Data synchronization option to use when processing the operation specified in the promoteMode +// property. This property is write only. +type ReadReplicaPromoteOption string const ( - RecommendationTypeCreateIndex RecommendationType = "CreateIndex" - RecommendationTypeDropIndex RecommendationType = "DropIndex" + // ReadReplicaPromoteOptionForced - The operation will not wait for data in the read replica to be synchronized with its source + // server, before it initiates the operation. + ReadReplicaPromoteOptionForced ReadReplicaPromoteOption = "Forced" + // ReadReplicaPromoteOptionPlanned - The operation will wait for data in the read replica to be fully synchronized with its + // source server, before it initiates the operation. + ReadReplicaPromoteOptionPlanned ReadReplicaPromoteOption = "Planned" ) -// PossibleRecommendationTypeValues returns the possible values for the RecommendationType const type. -func PossibleRecommendationTypeValues() []RecommendationType { - return []RecommendationType{ - RecommendationTypeCreateIndex, - RecommendationTypeDropIndex, +// PossibleReadReplicaPromoteOptionValues returns the possible values for the ReadReplicaPromoteOption const type. +func PossibleReadReplicaPromoteOptionValues() []ReadReplicaPromoteOption { + return []ReadReplicaPromoteOption{ + ReadReplicaPromoteOptionForced, + ReadReplicaPromoteOptionPlanned, } } @@ -740,44 +968,54 @@ func PossibleRecommendationTypeValues() []RecommendationType { type RecommendationTypeEnum string const ( - RecommendationTypeEnumCreateIndex RecommendationTypeEnum = "CreateIndex" - RecommendationTypeEnumDropIndex RecommendationTypeEnum = "DropIndex" - RecommendationTypeEnumReIndex RecommendationTypeEnum = "ReIndex" + RecommendationTypeEnumAnalyzeTable RecommendationTypeEnum = "AnalyzeTable" + RecommendationTypeEnumCreateIndex RecommendationTypeEnum = "CreateIndex" + RecommendationTypeEnumDropIndex RecommendationTypeEnum = "DropIndex" + RecommendationTypeEnumReIndex RecommendationTypeEnum = "ReIndex" ) // PossibleRecommendationTypeEnumValues returns the possible values for the RecommendationTypeEnum const type. func PossibleRecommendationTypeEnumValues() []RecommendationTypeEnum { return []RecommendationTypeEnum{ + RecommendationTypeEnumAnalyzeTable, RecommendationTypeEnumCreateIndex, RecommendationTypeEnumDropIndex, RecommendationTypeEnumReIndex, } } -// ReplicationPromoteOption - Sets the promote options for a replica server. This is a write only property. -type ReplicationPromoteOption string +type RecommendationTypeParameterEnum string const ( - ReplicationPromoteOptionForced ReplicationPromoteOption = "forced" - ReplicationPromoteOptionPlanned ReplicationPromoteOption = "planned" + RecommendationTypeParameterEnumAnalyzeTable RecommendationTypeParameterEnum = "AnalyzeTable" + RecommendationTypeParameterEnumCreateIndex RecommendationTypeParameterEnum = "CreateIndex" + RecommendationTypeParameterEnumDropIndex RecommendationTypeParameterEnum = "DropIndex" + RecommendationTypeParameterEnumReIndex RecommendationTypeParameterEnum = "ReIndex" ) -// PossibleReplicationPromoteOptionValues returns the possible values for the ReplicationPromoteOption const type. -func PossibleReplicationPromoteOptionValues() []ReplicationPromoteOption { - return []ReplicationPromoteOption{ - ReplicationPromoteOptionForced, - ReplicationPromoteOptionPlanned, +// PossibleRecommendationTypeParameterEnumValues returns the possible values for the RecommendationTypeParameterEnum const type. +func PossibleRecommendationTypeParameterEnumValues() []RecommendationTypeParameterEnum { + return []RecommendationTypeParameterEnum{ + RecommendationTypeParameterEnumAnalyzeTable, + RecommendationTypeParameterEnumCreateIndex, + RecommendationTypeParameterEnumDropIndex, + RecommendationTypeParameterEnumReIndex, } } -// ReplicationRole - Used to indicate role of the server in replication set. +// ReplicationRole - Role of the server in a replication set. type ReplicationRole string const ( - ReplicationRoleAsyncReplica ReplicationRole = "AsyncReplica" + // ReplicationRoleAsyncReplica - Receives data asynchronously from a primary server within the same region. + ReplicationRoleAsyncReplica ReplicationRole = "AsyncReplica" + // ReplicationRoleGeoAsyncReplica - Receives data asynchronously from a primary server in a different region for geographical + // redundancy. ReplicationRoleGeoAsyncReplica ReplicationRole = "GeoAsyncReplica" - ReplicationRoleNone ReplicationRole = "None" - ReplicationRolePrimary ReplicationRole = "Primary" + // ReplicationRoleNone - No replication role assigned; the server operates independently. + ReplicationRoleNone ReplicationRole = "None" + // ReplicationRolePrimary - Acts as the source server for replication to one or more replicas. + ReplicationRolePrimary ReplicationRole = "Primary" ) // PossibleReplicationRoleValues returns the possible values for the ReplicationRole const type. @@ -790,17 +1028,25 @@ func PossibleReplicationRoleValues() []ReplicationRole { } } -// ReplicationState - Gets the replication state of a replica server. This property is returned only for replicas api call. -// Supported values are Active, Catchup, Provisioning, Updating, Broken, Reconfiguring +// ReplicationState - Indicates the replication state of a read replica. This property is returned only when the target server +// is a read replica. Possible values are Active, Broken, Catchup, Provisioning, Reconfiguring, +// and Updating type ReplicationState string const ( - ReplicationStateActive ReplicationState = "Active" - ReplicationStateBroken ReplicationState = "Broken" - ReplicationStateCatchup ReplicationState = "Catchup" - ReplicationStateProvisioning ReplicationState = "Provisioning" + // ReplicationStateActive - Read replica is fully synchronized and actively replicating data from the primary server. + ReplicationStateActive ReplicationState = "Active" + // ReplicationStateBroken - Replication has failed or been interrupted. + ReplicationStateBroken ReplicationState = "Broken" + // ReplicationStateCatchup - Read replica is behind the primary server and is currently catching up with pending changes. + ReplicationStateCatchup ReplicationState = "Catchup" + // ReplicationStateProvisioning - Read replica is being created and is in process of getting initialized. + ReplicationStateProvisioning ReplicationState = "Provisioning" + // ReplicationStateReconfiguring - Read replica is being reconfigured, possibly due to changes in source or settings. ReplicationStateReconfiguring ReplicationState = "Reconfiguring" - ReplicationStateUpdating ReplicationState = "Updating" + // ReplicationStateUpdating - Read replica is undergoing some changes it can be changing compute size of promoting it to primary + // server. + ReplicationStateUpdating ReplicationState = "Updating" ) // PossibleReplicationStateValues returns the possible values for the ReplicationState const type. @@ -815,25 +1061,7 @@ func PossibleReplicationStateValues() []ReplicationState { } } -// RestrictedEnum - A value indicating whether this region is restricted. "Enabled" means region is restricted. "Disabled" -// stands for region is not restricted. Will be deprecated in future, please look to Supported -// Features for "Restricted". -type RestrictedEnum string - -const ( - RestrictedEnumDisabled RestrictedEnum = "Disabled" - RestrictedEnumEnabled RestrictedEnum = "Enabled" -) - -// PossibleRestrictedEnumValues returns the possible values for the RestrictedEnum const type. -func PossibleRestrictedEnumValues() []RestrictedEnum { - return []RestrictedEnum{ - RestrictedEnumDisabled, - RestrictedEnumEnabled, - } -} - -// SKUTier - The tier of the particular SKU, e.g. Burstable. +// SKUTier - Tier of the compute assigned to a server. type SKUTier string const ( @@ -851,14 +1079,19 @@ func PossibleSKUTierValues() []SKUTier { } } -// SSLMode - Supported SSL modes for migration. VerifyFull is the recommended SSL mode for Single server migration. Prefer, -// Require are recommended SSL modes for other source types +// SSLMode - SSL mode used by a migration. Default SSL mode for 'PostgreSQLSingleServer' is 'VerifyFull'. Default SSL mode +// for other source types is 'Prefer'. type SSLMode string const ( - SSLModePrefer SSLMode = "Prefer" - SSLModeRequire SSLMode = "Require" - SSLModeVerifyCA SSLMode = "VerifyCA" + // SSLModePrefer - Prefer SSL connection. If the server does not support SSL, the connection will be established without SSL. + SSLModePrefer SSLMode = "Prefer" + // SSLModeRequire - Require SSL connection. If the server does not support SSL, the connection will fail. + SSLModeRequire SSLMode = "Require" + // SSLModeVerifyCA - Require SSL connection and verify the server certificate against the CA certificate. + SSLModeVerifyCA SSLMode = "VerifyCA" + // SSLModeVerifyFull - Require SSL connection, verify the server certificate against the CA certificate, and verify that the + // server hostname matches the certificate. SSLModeVerifyFull SSLMode = "VerifyFull" ) @@ -872,36 +1105,18 @@ func PossibleSSLModeValues() []SSLMode { } } -// ServerHAState - A state of a HA server that is visible to user. -type ServerHAState string - -const ( - ServerHAStateCreatingStandby ServerHAState = "CreatingStandby" - ServerHAStateFailingOver ServerHAState = "FailingOver" - ServerHAStateHealthy ServerHAState = "Healthy" - ServerHAStateNotEnabled ServerHAState = "NotEnabled" - ServerHAStateRemovingStandby ServerHAState = "RemovingStandby" - ServerHAStateReplicatingData ServerHAState = "ReplicatingData" -) - -// PossibleServerHAStateValues returns the possible values for the ServerHAState const type. -func PossibleServerHAStateValues() []ServerHAState { - return []ServerHAState{ - ServerHAStateCreatingStandby, - ServerHAStateFailingOver, - ServerHAStateHealthy, - ServerHAStateNotEnabled, - ServerHAStateRemovingStandby, - ServerHAStateReplicatingData, - } -} - -// ServerPublicNetworkAccessState - public network access is enabled or not +// ServerPublicNetworkAccessState - Indicates if public network access is enabled or not. This is only supported for servers +// that are not integrated into a virtual network which is owned and provided by customer when server is deployed. type ServerPublicNetworkAccessState string const ( + // ServerPublicNetworkAccessStateDisabled - Public network access is disabled. This means the server cannot be accessed from + // the public internet, but only via private endpoints. ServerPublicNetworkAccessStateDisabled ServerPublicNetworkAccessState = "Disabled" - ServerPublicNetworkAccessStateEnabled ServerPublicNetworkAccessState = "Enabled" + // ServerPublicNetworkAccessStateEnabled - Public network access is enabled. This allows the server to be accessed from the + // public internet, provided the necessary firewall rule that allows incoming traffic originating from the connecting client + // is in place. This is compatible with the use of private endpoints to connect to this server. + ServerPublicNetworkAccessStateEnabled ServerPublicNetworkAccessState = "Enabled" ) // PossibleServerPublicNetworkAccessStateValues returns the possible values for the ServerPublicNetworkAccessState const type. @@ -912,20 +1127,38 @@ func PossibleServerPublicNetworkAccessStateValues() []ServerPublicNetworkAccessS } } -// ServerState - A state of a server that is visible to user. +// ServerState - Possible states of a server. type ServerState string const ( - ServerStateDisabled ServerState = "Disabled" - ServerStateDropping ServerState = "Dropping" + // ServerStateDisabled - Server is disabled. Typical reasons include: the subscription on which the server is deployed is + // explicitly disabled or canceled by the administrator, the spending limit has been reached, or the bill is past due. May + // also happen when the server is being moved to another resource group or subscription. + ServerStateDisabled ServerState = "Disabled" + // ServerStateDropping - Server is being deleted. + ServerStateDropping ServerState = "Dropping" + // ServerStateInaccessible - Server isn't accessible, because the key provided to encrypt and decrypt the data is in invalid + // state. ServerStateInaccessible ServerState = "Inaccessible" + // ServerStateProvisioning - Server is in the process of being created. ServerStateProvisioning ServerState = "Provisioning" - ServerStateReady ServerState = "Ready" - ServerStateRestarting ServerState = "Restarting" - ServerStateStarting ServerState = "Starting" - ServerStateStopped ServerState = "Stopped" - ServerStateStopping ServerState = "Stopping" - ServerStateUpdating ServerState = "Updating" + // ServerStateReady - Server is healthy and not undergoing any operations at the management or control plane level. This doesn't + // mean that the server is fully operational at the data plane level. + ServerStateReady ServerState = "Ready" + // ServerStateRestarting - PostgreSQL database engine is being restarted. + ServerStateRestarting ServerState = "Restarting" + // ServerStateStarting - PostgreSQL database engine is being restarted. + ServerStateStarting ServerState = "Starting" + // ServerStateStopped - Compute resources associated with the server are being stopped and deallocated. + ServerStateStopped ServerState = "Stopped" + // ServerStateStopping - Compute resources associated with the server are being stopped and deallocated. If the server has + // high availability enabled, the compute resources of the standby server are also stopped and deallocated. + ServerStateStopping ServerState = "Stopping" + // ServerStateUpdating - Server is undergoing some changes which may or may not impact the availability of the PostgreSQL + // database engine. For example, the compute resources of the server are being scaled up or down, which may cause temporary + // unavailability of the database engine. Or, for example, a firewall rule is being added or removed, which doesn't cause + // any unavailability of the database engine. + ServerStateUpdating ServerState = "Updating" ) // PossibleServerStateValues returns the possible values for the ServerState const type. @@ -944,63 +1177,61 @@ func PossibleServerStateValues() []ServerState { } } -// ServerVersion - The version of a server. -type ServerVersion string - -const ( - ServerVersionEleven ServerVersion = "11" - ServerVersionFifteen ServerVersion = "15" - ServerVersionFourteen ServerVersion = "14" - ServerVersionSeventeen ServerVersion = "17" - ServerVersionSixteen ServerVersion = "16" - ServerVersionThirteen ServerVersion = "13" - ServerVersionTwelve ServerVersion = "12" -) - -// PossibleServerVersionValues returns the possible values for the ServerVersion const type. -func PossibleServerVersionValues() []ServerVersion { - return []ServerVersion{ - ServerVersionEleven, - ServerVersionFifteen, - ServerVersionFourteen, - ServerVersionSeventeen, - ServerVersionSixteen, - ServerVersionThirteen, - ServerVersionTwelve, - } -} - -// SourceType - Migration source server type : OnPremises, AWS, GCP, AzureVM, PostgreSQLSingleServer, AWSRDS, AWSAURORA, AWSEC2, -// GCPCloudSQL, GCPAlloyDB, GCPCompute, EDB, EDBOracleServer, EDBPostgreSQL, -// PostgreSQLFlexibleServer, PostgreSQLCosmosDB, HuaweiRDS, HuaweiCompute, HerokuPostgreSQL, CrunchyPostgreSQL, ApsaraDBRDS, -// DigitalOceanDroplets, DigitalOceanPostgreSQL, or Supabase_PostgreSQL +// SourceType - Source server type used for the migration: ApsaraDBRDS, AWS, AWSAURORA, AWSEC2, AWSRDS, AzureVM, CrunchyPostgreSQL, +// DigitalOceanDroplets, DigitalOceanPostgreSQL, EDB, EDBOracleServer, EDBPostgreSQL, +// GCP, GCPAlloyDB, GCPCloudSQL, GCPCompute, HerokuPostgreSQL, HuaweiCompute, HuaweiRDS, OnPremises, PostgreSQLCosmosDB, PostgreSQLFlexibleServer, +// PostgreSQLSingleServer, or Supabase_PostgreSQL type SourceType string const ( - SourceTypeAWS SourceType = "AWS" - SourceTypeAWSAURORA SourceType = "AWS_AURORA" - SourceTypeAWSEC2 SourceType = "AWS_EC2" - SourceTypeAWSRDS SourceType = "AWS_RDS" - SourceTypeApsaraDBRDS SourceType = "ApsaraDB_RDS" - SourceTypeAzureVM SourceType = "AzureVM" - SourceTypeCrunchyPostgreSQL SourceType = "Crunchy_PostgreSQL" - SourceTypeDigitalOceanDroplets SourceType = "Digital_Ocean_Droplets" - SourceTypeDigitalOceanPostgreSQL SourceType = "Digital_Ocean_PostgreSQL" - SourceTypeEDB SourceType = "EDB" - SourceTypeEDBOracleServer SourceType = "EDB_Oracle_Server" - SourceTypeEDBPostgreSQL SourceType = "EDB_PostgreSQL" - SourceTypeGCP SourceType = "GCP" - SourceTypeGCPAlloyDB SourceType = "GCP_AlloyDB" - SourceTypeGCPCloudSQL SourceType = "GCP_CloudSQL" - SourceTypeGCPCompute SourceType = "GCP_Compute" - SourceTypeHerokuPostgreSQL SourceType = "Heroku_PostgreSQL" - SourceTypeHuaweiCompute SourceType = "Huawei_Compute" - SourceTypeHuaweiRDS SourceType = "Huawei_RDS" - SourceTypeOnPremises SourceType = "OnPremises" - SourceTypePostgreSQLCosmosDB SourceType = "PostgreSQLCosmosDB" + // SourceTypeAWS - Amazon Web Services PostgreSQL server. + SourceTypeAWS SourceType = "AWS" + // SourceTypeAWSAURORA - Amazon Aurora for PostgreSQL. + SourceTypeAWSAURORA SourceType = "AWS_AURORA" + // SourceTypeAWSEC2 - Amazon EC2 for PostgreSQL. + SourceTypeAWSEC2 SourceType = "AWS_EC2" + // SourceTypeAWSRDS - Amazon RDS for PostgreSQL. + SourceTypeAWSRDS SourceType = "AWS_RDS" + // SourceTypeApsaraDBRDS - ApsaraDB RDS for PostgreSQL + SourceTypeApsaraDBRDS SourceType = "ApsaraDB_RDS" + // SourceTypeAzureVM - Azure Virtual Machine PostgreSQL server. + SourceTypeAzureVM SourceType = "AzureVM" + // SourceTypeCrunchyPostgreSQL - Crunchy PostgreSQL + SourceTypeCrunchyPostgreSQL SourceType = "Crunchy_PostgreSQL" + // SourceTypeDigitalOceanDroplets - Digital Ocean Droplets for PostgreSQL + SourceTypeDigitalOceanDroplets SourceType = "Digital_Ocean_Droplets" + // SourceTypeDigitalOceanPostgreSQL - Digital Ocean PostgreSQL + SourceTypeDigitalOceanPostgreSQL SourceType = "Digital_Ocean_PostgreSQL" + // SourceTypeEDB - EnterpriseDB PostgreSQL server. + SourceTypeEDB SourceType = "EDB" + // SourceTypeEDBOracleServer - EnterpriseDB Oracle Server. + SourceTypeEDBOracleServer SourceType = "EDB_Oracle_Server" + // SourceTypeEDBPostgreSQL - EnterpriseDB PostgreSQL server. + SourceTypeEDBPostgreSQL SourceType = "EDB_PostgreSQL" + // SourceTypeGCP - Google Cloud Platform PostgreSQL server. + SourceTypeGCP SourceType = "GCP" + // SourceTypeGCPAlloyDB - Google Cloud AlloyDB for PostgreSQL. + SourceTypeGCPAlloyDB SourceType = "GCP_AlloyDB" + // SourceTypeGCPCloudSQL - Google Cloud SQL for PostgreSQL. + SourceTypeGCPCloudSQL SourceType = "GCP_CloudSQL" + // SourceTypeGCPCompute - Google Compute Engine for PostgreSQL. + SourceTypeGCPCompute SourceType = "GCP_Compute" + // SourceTypeHerokuPostgreSQL - Heroku PostgreSQL + SourceTypeHerokuPostgreSQL SourceType = "Heroku_PostgreSQL" + // SourceTypeHuaweiCompute - Huawei Compute for PostgreSQL + SourceTypeHuaweiCompute SourceType = "Huawei_Compute" + // SourceTypeHuaweiRDS - Huawei RDS for PostgreSQL + SourceTypeHuaweiRDS SourceType = "Huawei_RDS" + // SourceTypeOnPremises - On-premises PostgreSQL server. + SourceTypeOnPremises SourceType = "OnPremises" + // SourceTypePostgreSQLCosmosDB - .NET Cosmos DB for PostgreSQL + SourceTypePostgreSQLCosmosDB SourceType = "PostgreSQLCosmosDB" + // SourceTypePostgreSQLFlexibleServer - Azure Database for PostgreSQL flexible server. SourceTypePostgreSQLFlexibleServer SourceType = "PostgreSQLFlexibleServer" - SourceTypePostgreSQLSingleServer SourceType = "PostgreSQLSingleServer" - SourceTypeSupabasePostgreSQL SourceType = "Supabase_PostgreSQL" + // SourceTypePostgreSQLSingleServer - Azure Database for PostgreSQL single server. + SourceTypePostgreSQLSingleServer SourceType = "PostgreSQLSingleServer" + // SourceTypeSupabasePostgreSQL - Supabase PostgreSQL + SourceTypeSupabasePostgreSQL SourceType = "Supabase_PostgreSQL" ) // PossibleSourceTypeValues returns the possible values for the SourceType const type. @@ -1033,28 +1264,34 @@ func PossibleSourceTypeValues() []SourceType { } } -// StartDataMigrationEnum - Indicates whether the data migration should start right away -type StartDataMigrationEnum string +// StartDataMigration - Indicates if data migration must start right away. +type StartDataMigration string const ( - StartDataMigrationEnumFalse StartDataMigrationEnum = "False" - StartDataMigrationEnumTrue StartDataMigrationEnum = "True" + // StartDataMigrationFalse - Data migration must not start right away. + StartDataMigrationFalse StartDataMigration = "False" + // StartDataMigrationTrue - Data migration must start right away. + StartDataMigrationTrue StartDataMigration = "True" ) -// PossibleStartDataMigrationEnumValues returns the possible values for the StartDataMigrationEnum const type. -func PossibleStartDataMigrationEnumValues() []StartDataMigrationEnum { - return []StartDataMigrationEnum{ - StartDataMigrationEnumFalse, - StartDataMigrationEnumTrue, +// PossibleStartDataMigrationValues returns the possible values for the StartDataMigration const type. +func PossibleStartDataMigrationValues() []StartDataMigration { + return []StartDataMigration{ + StartDataMigrationFalse, + StartDataMigrationTrue, } } -// StorageAutoGrow - Flag to enable / disable Storage Auto grow for flexible server. +// StorageAutoGrow - Flag to enable or disable the automatic growth of storage size of a server when available space is nearing +// zero and conditions allow for automatically growing storage size. type StorageAutoGrow string const ( + // StorageAutoGrowDisabled - Server should not automatically grow storage size when available space is nearing zero. StorageAutoGrowDisabled StorageAutoGrow = "Disabled" - StorageAutoGrowEnabled StorageAutoGrow = "Enabled" + // StorageAutoGrowEnabled - Server should automatically grow storage size when available space is nearing zero and conditions + // allow for automatically growing storage size. + StorageAutoGrowEnabled StorageAutoGrow = "Enabled" ) // PossibleStorageAutoGrowValues returns the possible values for the StorageAutoGrow const type. @@ -1065,32 +1302,39 @@ func PossibleStorageAutoGrowValues() []StorageAutoGrow { } } -// StorageAutoGrowthSupportedEnum - 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". -type StorageAutoGrowthSupportedEnum string +// StorageAutoGrowthSupport - Indicates if storage autogrow is supported in this location. 'Enabled' means storage autogrow +// is supported. 'Disabled' stands for storage autogrow is not supported. Will be deprecated in the future. +// Look to Supported Features for 'StorageAutoGrowth'. +type StorageAutoGrowthSupport string const ( - StorageAutoGrowthSupportedEnumDisabled StorageAutoGrowthSupportedEnum = "Disabled" - StorageAutoGrowthSupportedEnumEnabled StorageAutoGrowthSupportedEnum = "Enabled" + // StorageAutoGrowthSupportDisabled - Storage autogrow is not supported. + StorageAutoGrowthSupportDisabled StorageAutoGrowthSupport = "Disabled" + // StorageAutoGrowthSupportEnabled - Storage autogrow is supported. + StorageAutoGrowthSupportEnabled StorageAutoGrowthSupport = "Enabled" ) -// PossibleStorageAutoGrowthSupportedEnumValues returns the possible values for the StorageAutoGrowthSupportedEnum const type. -func PossibleStorageAutoGrowthSupportedEnumValues() []StorageAutoGrowthSupportedEnum { - return []StorageAutoGrowthSupportedEnum{ - StorageAutoGrowthSupportedEnumDisabled, - StorageAutoGrowthSupportedEnumEnabled, +// PossibleStorageAutoGrowthSupportValues returns the possible values for the StorageAutoGrowthSupport const type. +func PossibleStorageAutoGrowthSupportValues() []StorageAutoGrowthSupport { + return []StorageAutoGrowthSupport{ + StorageAutoGrowthSupportDisabled, + StorageAutoGrowthSupportEnabled, } } -// StorageType - Storage type for the server. Allowed values are PremiumLRS, PremiumV2LRS, and UltraSSDLRS. Default is PremiumLRS -// if not specified +// StorageType - Type of storage assigned to a server. Allowed values are PremiumLRS, PremiumV2LRS, or UltraSSDLRS. If not +// specified, it defaults to PremiumLRS. type StorageType string const ( - StorageTypePremiumLRS StorageType = "Premium_LRS" + // StorageTypePremiumLRS - Standard Solid State Disk (SSD) backed storage offering consistent performance for general purpose + // workloads. + StorageTypePremiumLRS StorageType = "Premium_LRS" + // StorageTypePremiumV2LRS - Next generation Solid State Disk (SSD) storage with improved scalability and performance for + // demanding enterprise workloads. StorageTypePremiumV2LRS StorageType = "PremiumV2_LRS" - StorageTypeUltraSSDLRS StorageType = "UltraSSD_LRS" + // StorageTypeUltraSSDLRS - High-end Solid State Disk (SSD) storage designed for extreme IOPS and latency-sensitive applications. + StorageTypeUltraSSDLRS StorageType = "UltraSSD_LRS" ) // PossibleStorageTypeValues returns the possible values for the StorageType const type. @@ -1102,25 +1346,10 @@ func PossibleStorageTypeValues() []StorageType { } } -// SupportedFeatureStatusEnum - Status of feature -type SupportedFeatureStatusEnum string - -const ( - SupportedFeatureStatusEnumDisabled SupportedFeatureStatusEnum = "Disabled" - SupportedFeatureStatusEnumEnabled SupportedFeatureStatusEnum = "Enabled" -) - -// PossibleSupportedFeatureStatusEnumValues returns the possible values for the SupportedFeatureStatusEnum const type. -func PossibleSupportedFeatureStatusEnumValues() []SupportedFeatureStatusEnum { - return []SupportedFeatureStatusEnum{ - SupportedFeatureStatusEnumDisabled, - SupportedFeatureStatusEnumEnabled, - } -} - type ThreatProtectionName string const ( + // ThreatProtectionNameDefault - Default advanced threat protection settings. ThreatProtectionNameDefault ThreatProtectionName = "Default" ) @@ -1131,13 +1360,15 @@ func PossibleThreatProtectionNameValues() []ThreatProtectionName { } } -// ThreatProtectionState - Specifies the state of the Threat Protection, whether it is enabled or disabled or a state has -// not been applied yet on the specific server. +// ThreatProtectionState - Specifies the state of the advanced threat protection, whether it is enabled, disabled, or a state +// has not been applied yet on the server. type ThreatProtectionState string const ( + // ThreatProtectionStateDisabled - Advanced threat protection is disabled. ThreatProtectionStateDisabled ThreatProtectionState = "Disabled" - ThreatProtectionStateEnabled ThreatProtectionState = "Enabled" + // ThreatProtectionStateEnabled - Advanced threat protection is enabled. + ThreatProtectionStateEnabled ThreatProtectionState = "Enabled" ) // PossibleThreatProtectionStateValues returns the possible values for the ThreatProtectionState const type. @@ -1148,44 +1379,49 @@ func PossibleThreatProtectionStateValues() []ThreatProtectionState { } } -// TriggerCutoverEnum - To trigger cutover for entire migration we need to send this flag as True -type TriggerCutoverEnum string +// TriggerCutover - Indicates if cutover must be triggered for the entire migration. +type TriggerCutover string const ( - TriggerCutoverEnumFalse TriggerCutoverEnum = "False" - TriggerCutoverEnumTrue TriggerCutoverEnum = "True" + // TriggerCutoverFalse - Cutover must not be triggered for the entire migration. + TriggerCutoverFalse TriggerCutover = "False" + // TriggerCutoverTrue - Cutover must be triggered for the entire migration. + TriggerCutoverTrue TriggerCutover = "True" ) -// PossibleTriggerCutoverEnumValues returns the possible values for the TriggerCutoverEnum const type. -func PossibleTriggerCutoverEnumValues() []TriggerCutoverEnum { - return []TriggerCutoverEnum{ - TriggerCutoverEnumFalse, - TriggerCutoverEnumTrue, +// PossibleTriggerCutoverValues returns the possible values for the TriggerCutover const type. +func PossibleTriggerCutoverValues() []TriggerCutover { + return []TriggerCutover{ + TriggerCutoverFalse, + TriggerCutoverTrue, } } -type TuningOptionEnum string +type TuningOptionParameterEnum string const ( - TuningOptionEnumConfiguration TuningOptionEnum = "configuration" - TuningOptionEnumIndex TuningOptionEnum = "index" + TuningOptionParameterEnumIndex TuningOptionParameterEnum = "index" + TuningOptionParameterEnumTable TuningOptionParameterEnum = "table" ) -// PossibleTuningOptionEnumValues returns the possible values for the TuningOptionEnum const type. -func PossibleTuningOptionEnumValues() []TuningOptionEnum { - return []TuningOptionEnum{ - TuningOptionEnumConfiguration, - TuningOptionEnumIndex, +// PossibleTuningOptionParameterEnumValues returns the possible values for the TuningOptionParameterEnum const type. +func PossibleTuningOptionParameterEnumValues() []TuningOptionParameterEnum { + return []TuningOptionParameterEnum{ + TuningOptionParameterEnumIndex, + TuningOptionParameterEnumTable, } } -// ValidationState - Validation status for migration +// ValidationState - Validation status for migration. type ValidationState string const ( - ValidationStateFailed ValidationState = "Failed" + // ValidationStateFailed - Validation has failed. + ValidationStateFailed ValidationState = "Failed" + // ValidationStateSucceeded - Validation has succeeded. ValidationStateSucceeded ValidationState = "Succeeded" - ValidationStateWarning ValidationState = "Warning" + // ValidationStateWarning - Validation has succeeded with warnings. + ValidationStateWarning ValidationState = "Warning" ) // PossibleValidationStateValues returns the possible values for the ValidationState const type. @@ -1197,10 +1433,11 @@ func PossibleValidationStateValues() []ValidationState { } } -// VirtualEndpointType - The endpoint type for the virtual endpoint. +// VirtualEndpointType - Type of endpoint for the virtual endpoints. type VirtualEndpointType string const ( + // VirtualEndpointTypeReadWrite - Read-write endpoint. VirtualEndpointTypeReadWrite VirtualEndpointType = "ReadWrite" ) @@ -1211,38 +1448,47 @@ func PossibleVirtualEndpointTypeValues() []VirtualEndpointType { } } -// ZoneRedundantHaAndGeoBackupSupportedEnum - 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". -type ZoneRedundantHaAndGeoBackupSupportedEnum string +// ZoneRedundantHighAvailabilityAndGeographicallyRedundantBackupSupport - Indicates if high availability with zone redundancy +// is supported in conjunction with geographically redundant backups in this location. 'Enabled' means high availability with +// zone redundancy is +// supported in conjunction with geographically redundant backups is supported. 'Disabled' stands for high availability with +// zone redundancy is supported in conjunction with geographically redundant +// backups is not supported. Will be deprecated in the future. Look to Supported Features for 'ZoneRedundantHaAndGeoBackup'. +type ZoneRedundantHighAvailabilityAndGeographicallyRedundantBackupSupport string const ( - ZoneRedundantHaAndGeoBackupSupportedEnumDisabled ZoneRedundantHaAndGeoBackupSupportedEnum = "Disabled" - ZoneRedundantHaAndGeoBackupSupportedEnumEnabled ZoneRedundantHaAndGeoBackupSupportedEnum = "Enabled" + // ZoneRedundantHighAvailabilityAndGeographicallyRedundantBackupSupportDisabled - High availability with zone redundancy is + // not supported in conjunction with geographically redundant backups. + ZoneRedundantHighAvailabilityAndGeographicallyRedundantBackupSupportDisabled ZoneRedundantHighAvailabilityAndGeographicallyRedundantBackupSupport = "Disabled" + // ZoneRedundantHighAvailabilityAndGeographicallyRedundantBackupSupportEnabled - High availability with zone redundancy is + // supported in conjunction with geographically redundant backups. + ZoneRedundantHighAvailabilityAndGeographicallyRedundantBackupSupportEnabled ZoneRedundantHighAvailabilityAndGeographicallyRedundantBackupSupport = "Enabled" ) -// PossibleZoneRedundantHaAndGeoBackupSupportedEnumValues returns the possible values for the ZoneRedundantHaAndGeoBackupSupportedEnum const type. -func PossibleZoneRedundantHaAndGeoBackupSupportedEnumValues() []ZoneRedundantHaAndGeoBackupSupportedEnum { - return []ZoneRedundantHaAndGeoBackupSupportedEnum{ - ZoneRedundantHaAndGeoBackupSupportedEnumDisabled, - ZoneRedundantHaAndGeoBackupSupportedEnumEnabled, +// PossibleZoneRedundantHighAvailabilityAndGeographicallyRedundantBackupSupportValues returns the possible values for the ZoneRedundantHighAvailabilityAndGeographicallyRedundantBackupSupport const type. +func PossibleZoneRedundantHighAvailabilityAndGeographicallyRedundantBackupSupportValues() []ZoneRedundantHighAvailabilityAndGeographicallyRedundantBackupSupport { + return []ZoneRedundantHighAvailabilityAndGeographicallyRedundantBackupSupport{ + ZoneRedundantHighAvailabilityAndGeographicallyRedundantBackupSupportDisabled, + ZoneRedundantHighAvailabilityAndGeographicallyRedundantBackupSupportEnabled, } } -// ZoneRedundantHaSupportedEnum - 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". -type ZoneRedundantHaSupportedEnum string +// ZoneRedundantHighAvailabilitySupport - Indicates if high availability with zone redundancy is supported in this location. +// 'Enabled' means high availability with zone redundancy is supported. 'Disabled' stands for high availability with +// zone redundancy is not supported. Will be deprecated in the future. Look to Supported Features for 'ZoneRedundantHa'. +type ZoneRedundantHighAvailabilitySupport string const ( - ZoneRedundantHaSupportedEnumDisabled ZoneRedundantHaSupportedEnum = "Disabled" - ZoneRedundantHaSupportedEnumEnabled ZoneRedundantHaSupportedEnum = "Enabled" + // ZoneRedundantHighAvailabilitySupportDisabled - High availability with zone redundancy is not supported. + ZoneRedundantHighAvailabilitySupportDisabled ZoneRedundantHighAvailabilitySupport = "Disabled" + // ZoneRedundantHighAvailabilitySupportEnabled - High availability with zone redundancy is supported. + ZoneRedundantHighAvailabilitySupportEnabled ZoneRedundantHighAvailabilitySupport = "Enabled" ) -// PossibleZoneRedundantHaSupportedEnumValues returns the possible values for the ZoneRedundantHaSupportedEnum const type. -func PossibleZoneRedundantHaSupportedEnumValues() []ZoneRedundantHaSupportedEnum { - return []ZoneRedundantHaSupportedEnum{ - ZoneRedundantHaSupportedEnumDisabled, - ZoneRedundantHaSupportedEnumEnabled, +// PossibleZoneRedundantHighAvailabilitySupportValues returns the possible values for the ZoneRedundantHighAvailabilitySupport const type. +func PossibleZoneRedundantHighAvailabilitySupportValues() []ZoneRedundantHighAvailabilitySupport { + return []ZoneRedundantHighAvailabilitySupport{ + ZoneRedundantHighAvailabilitySupportDisabled, + ZoneRedundantHighAvailabilitySupportEnabled, } } diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/databases_client.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/databases_client.go index 53ae4ecf9495..d289a52f33d2 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/databases_client.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/databases_client.go @@ -27,7 +27,7 @@ type DatabasesClient struct { // NewDatabasesClient creates a new instance of DatabasesClient with the specified values. // - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. +// - options - Contains optional client configuration. Pass nil to accept the default values. func NewDatabasesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DatabasesClient, error) { cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) if err != nil { @@ -40,14 +40,15 @@ func NewDatabasesClient(subscriptionID string, credential azcore.TokenCredential return client, nil } -// BeginCreate - Creates a new database or updates an existing database. +// BeginCreate - Creates a new database. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-01-01-preview +// Generated from API version 2025-08-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. -// - databaseName - The name of the database. -// - parameters - The required parameters for creating or updating a database. +// - databaseName - Name of the database (case-sensitive). Exact database names can be retrieved by getting the list of all +// existing databases in a server. +// - parameters - Parameters required to create a new database. // - options - DatabasesClientBeginCreateOptions contains the optional parameters for the DatabasesClient.BeginCreate method. func (client *DatabasesClient) BeginCreate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters Database, options *DatabasesClientBeginCreateOptions) (*runtime.Poller[DatabasesClientCreateResponse], error) { if options == nil || options.ResumeToken == "" { @@ -67,10 +68,10 @@ func (client *DatabasesClient) BeginCreate(ctx context.Context, resourceGroupNam } } -// Create - Creates a new database or updates an existing database. +// Create - Creates a new database. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-01-01-preview +// Generated from API version 2025-08-01 func (client *DatabasesClient) create(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters Database, options *DatabasesClientBeginCreateOptions) (*http.Response, error) { var err error const operationName = "DatabasesClient.BeginCreate" @@ -85,7 +86,7 @@ func (client *DatabasesClient) create(ctx context.Context, resourceGroupName str if err != nil { return nil, err } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { + if !runtime.HasStatusCode(httpResp, http.StatusAccepted) { err = runtime.NewResponseError(httpResp) return nil, err } @@ -116,7 +117,7 @@ func (client *DatabasesClient) createCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-01-01-preview") + reqQP.Set("api-version", "2025-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -125,13 +126,14 @@ func (client *DatabasesClient) createCreateRequest(ctx context.Context, resource return req, nil } -// BeginDelete - Deletes a database. +// BeginDelete - Deletes an existing database. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-01-01-preview +// Generated from API version 2025-08-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. -// - databaseName - The name of the database. +// - databaseName - Name of the database (case-sensitive). Exact database names can be retrieved by getting the list of all +// existing databases in a server. // - options - DatabasesClientBeginDeleteOptions contains the optional parameters for the DatabasesClient.BeginDelete method. func (client *DatabasesClient) BeginDelete(ctx context.Context, resourceGroupName string, serverName string, databaseName string, options *DatabasesClientBeginDeleteOptions) (*runtime.Poller[DatabasesClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { @@ -151,10 +153,10 @@ func (client *DatabasesClient) BeginDelete(ctx context.Context, resourceGroupNam } } -// Delete - Deletes a database. +// Delete - Deletes an existing database. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-01-01-preview +// Generated from API version 2025-08-01 func (client *DatabasesClient) deleteOperation(ctx context.Context, resourceGroupName string, serverName string, databaseName string, options *DatabasesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "DatabasesClient.BeginDelete" @@ -169,7 +171,7 @@ func (client *DatabasesClient) deleteOperation(ctx context.Context, resourceGrou if err != nil { return nil, err } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + if !runtime.HasStatusCode(httpResp, http.StatusAccepted, http.StatusNoContent) { err = runtime.NewResponseError(httpResp) return nil, err } @@ -200,19 +202,20 @@ func (client *DatabasesClient) deleteCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-01-01-preview") + reqQP.Set("api-version", "2025-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } -// Get - Gets information about a database. +// Get - Gets information about an existing database. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-01-01-preview +// Generated from API version 2025-08-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. -// - databaseName - The name of the database. +// - databaseName - Name of the database (case-sensitive). Exact database names can be retrieved by getting the list of all +// existing databases in a server. // - options - DatabasesClientGetOptions contains the optional parameters for the DatabasesClient.Get method. func (client *DatabasesClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string, options *DatabasesClientGetOptions) (DatabasesClientGetResponse, error) { var err error @@ -260,7 +263,7 @@ func (client *DatabasesClient) getCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-01-01-preview") + reqQP.Set("api-version", "2025-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -275,9 +278,9 @@ func (client *DatabasesClient) getHandleResponse(resp *http.Response) (Databases return result, nil } -// NewListByServerPager - List all the databases in a given server. +// NewListByServerPager - Lists all databases in a server. // -// Generated from API version 2025-01-01-preview +// Generated from API version 2025-08-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - options - DatabasesClientListByServerOptions contains the optional parameters for the DatabasesClient.NewListByServerPager @@ -325,7 +328,7 @@ func (client *DatabasesClient) listByServerCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-01-01-preview") + reqQP.Set("api-version", "2025-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -334,7 +337,7 @@ func (client *DatabasesClient) listByServerCreateRequest(ctx context.Context, re // listByServerHandleResponse handles the ListByServer response. func (client *DatabasesClient) listByServerHandleResponse(resp *http.Response) (DatabasesClientListByServerResponse, error) { result := DatabasesClientListByServerResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.DatabaseListResult); err != nil { + if err := runtime.UnmarshalAsJSON(resp, &result.DatabaseList); err != nil { return DatabasesClientListByServerResponse{}, err } return result, nil diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/databases_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/databases_client_example_test.go index 26292426ab88..72b6a6e66818 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/databases_client_example_test.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/databases_client_example_test.go @@ -18,7 +18,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v5" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b1f4d539964453ce8008e4b069e59885e12ba441/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/DatabaseCreate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/735d21dbd7e1cc446babf58860af4cca757d620d/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/DatabasesCreate.json func ExampleDatabasesClient_BeginCreate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -29,7 +29,7 @@ func ExampleDatabasesClient_BeginCreate() { if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewDatabasesClient().BeginCreate(ctx, "TestGroup", "testserver", "db1", armpostgresqlflexibleservers.Database{ + poller, err := clientFactory.NewDatabasesClient().BeginCreate(ctx, "exampleresourcegroup", "exampleserver", "exampledatabase", armpostgresqlflexibleservers.Database{ Properties: &armpostgresqlflexibleservers.DatabaseProperties{ Charset: to.Ptr("utf8"), Collation: to.Ptr("en_US.utf8"), @@ -38,25 +38,13 @@ func ExampleDatabasesClient_BeginCreate() { if err != nil { log.Fatalf("failed to finish the request: %v", err) } - res, err := poller.PollUntilDone(ctx, nil) + _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Database = armpostgresqlflexibleservers.Database{ - // Name: to.Ptr("db1"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/databases"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/databases/db1"), - // Properties: &armpostgresqlflexibleservers.DatabaseProperties{ - // Charset: to.Ptr("utf8"), - // Collation: to.Ptr("en_US.utf8"), - // }, - // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b1f4d539964453ce8008e4b069e59885e12ba441/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/DatabaseDelete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/735d21dbd7e1cc446babf58860af4cca757d620d/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/DatabasesDelete.json func ExampleDatabasesClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -67,7 +55,7 @@ func ExampleDatabasesClient_BeginDelete() { if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewDatabasesClient().BeginDelete(ctx, "TestGroup", "testserver", "db1", nil) + poller, err := clientFactory.NewDatabasesClient().BeginDelete(ctx, "exampleresourcegroup", "exampleserver", "exampledatabase", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -77,7 +65,7 @@ func ExampleDatabasesClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b1f4d539964453ce8008e4b069e59885e12ba441/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/DatabaseGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/735d21dbd7e1cc446babf58860af4cca757d620d/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/DatabasesGet.json func ExampleDatabasesClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -88,7 +76,7 @@ func ExampleDatabasesClient_Get() { if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewDatabasesClient().Get(ctx, "TestGroup", "testserver", "db1", nil) + res, err := clientFactory.NewDatabasesClient().Get(ctx, "exampleresourcegroup", "exampleserver", "exampledatabase", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -96,9 +84,9 @@ func ExampleDatabasesClient_Get() { _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.Database = armpostgresqlflexibleservers.Database{ - // Name: to.Ptr("db1"), + // Name: to.Ptr("exampledatabase"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/databases"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/databases/db1"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/databases/exampledatabase"), // Properties: &armpostgresqlflexibleservers.DatabaseProperties{ // Charset: to.Ptr("utf8"), // Collation: to.Ptr("en_US.utf8"), @@ -106,7 +94,7 @@ func ExampleDatabasesClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b1f4d539964453ce8008e4b069e59885e12ba441/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/DatabasesListByServer.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/735d21dbd7e1cc446babf58860af4cca757d620d/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/DatabasesListByServer.json func ExampleDatabasesClient_NewListByServerPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -117,7 +105,7 @@ func ExampleDatabasesClient_NewListByServerPager() { if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewDatabasesClient().NewListByServerPager("TestGroup", "testserver", nil) + pager := clientFactory.NewDatabasesClient().NewListByServerPager("exampleresourcegroup", "exampleserver", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -128,21 +116,21 @@ func ExampleDatabasesClient_NewListByServerPager() { _ = v } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.DatabaseListResult = armpostgresqlflexibleservers.DatabaseListResult{ + // page.DatabaseList = armpostgresqlflexibleservers.DatabaseList{ // Value: []*armpostgresqlflexibleservers.Database{ // { - // Name: to.Ptr("db1"), + // Name: to.Ptr("exampledatabase1"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/databases"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/databases/db1"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/databases/exampledatabase1"), // Properties: &armpostgresqlflexibleservers.DatabaseProperties{ // Charset: to.Ptr("utf8"), // Collation: to.Ptr("en_US.utf8"), // }, // }, // { - // Name: to.Ptr("db2"), + // Name: to.Ptr("exampledatabase2"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/databases"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/databases/db2"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/databases/exampledatabase2"), // Properties: &armpostgresqlflexibleservers.DatabaseProperties{ // Charset: to.Ptr("utf8"), // Collation: to.Ptr("en_US.utf8"), diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/administrators_server.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/administratorsmicrosoftentra_server.go similarity index 62% rename from sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/administrators_server.go rename to sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/administratorsmicrosoftentra_server.go index dc2c1647ad2a..4f88982d37bf 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/administrators_server.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/administratorsmicrosoftentra_server.go @@ -19,48 +19,48 @@ import ( "regexp" ) -// AdministratorsServer is a fake server for instances of the armpostgresqlflexibleservers.AdministratorsClient type. -type AdministratorsServer struct { - // BeginCreate is the fake for method AdministratorsClient.BeginCreate - // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated, http.StatusAccepted - BeginCreate func(ctx context.Context, resourceGroupName string, serverName string, objectID string, parameters armpostgresqlflexibleservers.ActiveDirectoryAdministratorAdd, options *armpostgresqlflexibleservers.AdministratorsClientBeginCreateOptions) (resp azfake.PollerResponder[armpostgresqlflexibleservers.AdministratorsClientCreateResponse], errResp azfake.ErrorResponder) +// AdministratorsMicrosoftEntraServer is a fake server for instances of the armpostgresqlflexibleservers.AdministratorsMicrosoftEntraClient type. +type AdministratorsMicrosoftEntraServer struct { + // BeginCreateOrUpdate is the fake for method AdministratorsMicrosoftEntraClient.BeginCreateOrUpdate + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent + BeginCreateOrUpdate func(ctx context.Context, resourceGroupName string, serverName string, objectID string, parameters armpostgresqlflexibleservers.AdministratorMicrosoftEntraAdd, options *armpostgresqlflexibleservers.AdministratorsMicrosoftEntraClientBeginCreateOrUpdateOptions) (resp azfake.PollerResponder[armpostgresqlflexibleservers.AdministratorsMicrosoftEntraClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) - // BeginDelete is the fake for method AdministratorsClient.BeginDelete + // BeginDelete is the fake for method AdministratorsMicrosoftEntraClient.BeginDelete // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent - BeginDelete func(ctx context.Context, resourceGroupName string, serverName string, objectID string, options *armpostgresqlflexibleservers.AdministratorsClientBeginDeleteOptions) (resp azfake.PollerResponder[armpostgresqlflexibleservers.AdministratorsClientDeleteResponse], errResp azfake.ErrorResponder) + BeginDelete func(ctx context.Context, resourceGroupName string, serverName string, objectID string, options *armpostgresqlflexibleservers.AdministratorsMicrosoftEntraClientBeginDeleteOptions) (resp azfake.PollerResponder[armpostgresqlflexibleservers.AdministratorsMicrosoftEntraClientDeleteResponse], errResp azfake.ErrorResponder) - // Get is the fake for method AdministratorsClient.Get + // Get is the fake for method AdministratorsMicrosoftEntraClient.Get // HTTP status codes to indicate success: http.StatusOK - Get func(ctx context.Context, resourceGroupName string, serverName string, objectID string, options *armpostgresqlflexibleservers.AdministratorsClientGetOptions) (resp azfake.Responder[armpostgresqlflexibleservers.AdministratorsClientGetResponse], errResp azfake.ErrorResponder) + Get func(ctx context.Context, resourceGroupName string, serverName string, objectID string, options *armpostgresqlflexibleservers.AdministratorsMicrosoftEntraClientGetOptions) (resp azfake.Responder[armpostgresqlflexibleservers.AdministratorsMicrosoftEntraClientGetResponse], errResp azfake.ErrorResponder) - // NewListByServerPager is the fake for method AdministratorsClient.NewListByServerPager + // NewListByServerPager is the fake for method AdministratorsMicrosoftEntraClient.NewListByServerPager // HTTP status codes to indicate success: http.StatusOK - NewListByServerPager func(resourceGroupName string, serverName string, options *armpostgresqlflexibleservers.AdministratorsClientListByServerOptions) (resp azfake.PagerResponder[armpostgresqlflexibleservers.AdministratorsClientListByServerResponse]) + NewListByServerPager func(resourceGroupName string, serverName string, options *armpostgresqlflexibleservers.AdministratorsMicrosoftEntraClientListByServerOptions) (resp azfake.PagerResponder[armpostgresqlflexibleservers.AdministratorsMicrosoftEntraClientListByServerResponse]) } -// NewAdministratorsServerTransport creates a new instance of AdministratorsServerTransport with the provided implementation. -// The returned AdministratorsServerTransport instance is connected to an instance of armpostgresqlflexibleservers.AdministratorsClient via the +// NewAdministratorsMicrosoftEntraServerTransport creates a new instance of AdministratorsMicrosoftEntraServerTransport with the provided implementation. +// The returned AdministratorsMicrosoftEntraServerTransport instance is connected to an instance of armpostgresqlflexibleservers.AdministratorsMicrosoftEntraClient via the // azcore.ClientOptions.Transporter field in the client's constructor parameters. -func NewAdministratorsServerTransport(srv *AdministratorsServer) *AdministratorsServerTransport { - return &AdministratorsServerTransport{ +func NewAdministratorsMicrosoftEntraServerTransport(srv *AdministratorsMicrosoftEntraServer) *AdministratorsMicrosoftEntraServerTransport { + return &AdministratorsMicrosoftEntraServerTransport{ srv: srv, - beginCreate: newTracker[azfake.PollerResponder[armpostgresqlflexibleservers.AdministratorsClientCreateResponse]](), - beginDelete: newTracker[azfake.PollerResponder[armpostgresqlflexibleservers.AdministratorsClientDeleteResponse]](), - newListByServerPager: newTracker[azfake.PagerResponder[armpostgresqlflexibleservers.AdministratorsClientListByServerResponse]](), + beginCreateOrUpdate: newTracker[azfake.PollerResponder[armpostgresqlflexibleservers.AdministratorsMicrosoftEntraClientCreateOrUpdateResponse]](), + beginDelete: newTracker[azfake.PollerResponder[armpostgresqlflexibleservers.AdministratorsMicrosoftEntraClientDeleteResponse]](), + newListByServerPager: newTracker[azfake.PagerResponder[armpostgresqlflexibleservers.AdministratorsMicrosoftEntraClientListByServerResponse]](), } } -// AdministratorsServerTransport connects instances of armpostgresqlflexibleservers.AdministratorsClient to instances of AdministratorsServer. -// Don't use this type directly, use NewAdministratorsServerTransport instead. -type AdministratorsServerTransport struct { - srv *AdministratorsServer - beginCreate *tracker[azfake.PollerResponder[armpostgresqlflexibleservers.AdministratorsClientCreateResponse]] - beginDelete *tracker[azfake.PollerResponder[armpostgresqlflexibleservers.AdministratorsClientDeleteResponse]] - newListByServerPager *tracker[azfake.PagerResponder[armpostgresqlflexibleservers.AdministratorsClientListByServerResponse]] +// AdministratorsMicrosoftEntraServerTransport connects instances of armpostgresqlflexibleservers.AdministratorsMicrosoftEntraClient to instances of AdministratorsMicrosoftEntraServer. +// Don't use this type directly, use NewAdministratorsMicrosoftEntraServerTransport instead. +type AdministratorsMicrosoftEntraServerTransport struct { + srv *AdministratorsMicrosoftEntraServer + beginCreateOrUpdate *tracker[azfake.PollerResponder[armpostgresqlflexibleservers.AdministratorsMicrosoftEntraClientCreateOrUpdateResponse]] + beginDelete *tracker[azfake.PollerResponder[armpostgresqlflexibleservers.AdministratorsMicrosoftEntraClientDeleteResponse]] + newListByServerPager *tracker[azfake.PagerResponder[armpostgresqlflexibleservers.AdministratorsMicrosoftEntraClientListByServerResponse]] } -// Do implements the policy.Transporter interface for AdministratorsServerTransport. -func (a *AdministratorsServerTransport) Do(req *http.Request) (*http.Response, error) { +// Do implements the policy.Transporter interface for AdministratorsMicrosoftEntraServerTransport. +func (a *AdministratorsMicrosoftEntraServerTransport) Do(req *http.Request) (*http.Response, error) { rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) method, ok := rawMethod.(string) if !ok { @@ -70,25 +70,25 @@ func (a *AdministratorsServerTransport) Do(req *http.Request) (*http.Response, e return a.dispatchToMethodFake(req, method) } -func (a *AdministratorsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { +func (a *AdministratorsMicrosoftEntraServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { resultChan := make(chan result) defer close(resultChan) go func() { var intercepted bool var res result - if administratorsServerTransportInterceptor != nil { - res.resp, res.err, intercepted = administratorsServerTransportInterceptor.Do(req) + if administratorsMicrosoftEntraServerTransportInterceptor != nil { + res.resp, res.err, intercepted = administratorsMicrosoftEntraServerTransportInterceptor.Do(req) } if !intercepted { switch method { - case "AdministratorsClient.BeginCreate": - res.resp, res.err = a.dispatchBeginCreate(req) - case "AdministratorsClient.BeginDelete": + case "AdministratorsMicrosoftEntraClient.BeginCreateOrUpdate": + res.resp, res.err = a.dispatchBeginCreateOrUpdate(req) + case "AdministratorsMicrosoftEntraClient.BeginDelete": res.resp, res.err = a.dispatchBeginDelete(req) - case "AdministratorsClient.Get": + case "AdministratorsMicrosoftEntraClient.Get": res.resp, res.err = a.dispatchGet(req) - case "AdministratorsClient.NewListByServerPager": + case "AdministratorsMicrosoftEntraClient.NewListByServerPager": res.resp, res.err = a.dispatchNewListByServerPager(req) default: res.err = fmt.Errorf("unhandled API %s", method) @@ -109,19 +109,19 @@ func (a *AdministratorsServerTransport) dispatchToMethodFake(req *http.Request, } } -func (a *AdministratorsServerTransport) dispatchBeginCreate(req *http.Request) (*http.Response, error) { - if a.srv.BeginCreate == nil { - return nil, &nonRetriableError{errors.New("fake for method BeginCreate not implemented")} +func (a *AdministratorsMicrosoftEntraServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { + if a.srv.BeginCreateOrUpdate == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginCreateOrUpdate not implemented")} } - beginCreate := a.beginCreate.get(req) - if beginCreate == nil { + beginCreateOrUpdate := a.beginCreateOrUpdate.get(req) + if beginCreateOrUpdate == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/administrators/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { + if len(matches) < 5 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } - body, err := server.UnmarshalRequestAsJSON[armpostgresqlflexibleservers.ActiveDirectoryAdministratorAdd](req) + body, err := server.UnmarshalRequestAsJSON[armpostgresqlflexibleservers.AdministratorMicrosoftEntraAdd](req) if err != nil { return nil, err } @@ -137,31 +137,31 @@ func (a *AdministratorsServerTransport) dispatchBeginCreate(req *http.Request) ( if err != nil { return nil, err } - respr, errRespr := a.srv.BeginCreate(req.Context(), resourceGroupNameParam, serverNameParam, objectIDParam, body, nil) + respr, errRespr := a.srv.BeginCreateOrUpdate(req.Context(), resourceGroupNameParam, serverNameParam, objectIDParam, body, nil) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } - beginCreate = &respr - a.beginCreate.add(req, beginCreate) + beginCreateOrUpdate = &respr + a.beginCreateOrUpdate.add(req, beginCreateOrUpdate) } - resp, err := server.PollerResponderNext(beginCreate, req) + resp, err := server.PollerResponderNext(beginCreateOrUpdate, req) if err != nil { return nil, err } - if !contains([]int{http.StatusOK, http.StatusCreated, http.StatusAccepted}, resp.StatusCode) { - a.beginCreate.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated, http.StatusAccepted", resp.StatusCode)} + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + a.beginCreateOrUpdate.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } - if !server.PollerResponderMore(beginCreate) { - a.beginCreate.remove(req) + if !server.PollerResponderMore(beginCreateOrUpdate) { + a.beginCreateOrUpdate.remove(req) } return resp, nil } -func (a *AdministratorsServerTransport) dispatchBeginDelete(req *http.Request) (*http.Response, error) { +func (a *AdministratorsMicrosoftEntraServerTransport) dispatchBeginDelete(req *http.Request) (*http.Response, error) { if a.srv.BeginDelete == nil { return nil, &nonRetriableError{errors.New("fake for method BeginDelete not implemented")} } @@ -170,7 +170,7 @@ func (a *AdministratorsServerTransport) dispatchBeginDelete(req *http.Request) ( const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/administrators/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { + if len(matches) < 5 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -209,14 +209,14 @@ func (a *AdministratorsServerTransport) dispatchBeginDelete(req *http.Request) ( return resp, nil } -func (a *AdministratorsServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { +func (a *AdministratorsMicrosoftEntraServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { if a.srv.Get == nil { return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} } const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/administrators/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { + if len(matches) < 5 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -239,14 +239,14 @@ func (a *AdministratorsServerTransport) dispatchGet(req *http.Request) (*http.Re if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } - resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).ActiveDirectoryAdministrator, req) + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).AdministratorMicrosoftEntra, req) if err != nil { return nil, err } return resp, nil } -func (a *AdministratorsServerTransport) dispatchNewListByServerPager(req *http.Request) (*http.Response, error) { +func (a *AdministratorsMicrosoftEntraServerTransport) dispatchNewListByServerPager(req *http.Request) (*http.Response, error) { if a.srv.NewListByServerPager == nil { return nil, &nonRetriableError{errors.New("fake for method NewListByServerPager not implemented")} } @@ -255,7 +255,7 @@ func (a *AdministratorsServerTransport) dispatchNewListByServerPager(req *http.R const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/administrators` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { + if len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -269,7 +269,7 @@ func (a *AdministratorsServerTransport) dispatchNewListByServerPager(req *http.R resp := a.srv.NewListByServerPager(resourceGroupNameParam, serverNameParam, nil) newListByServerPager = &resp a.newListByServerPager.add(req, newListByServerPager) - server.PagerResponderInjectNextLinks(newListByServerPager, req, func(page *armpostgresqlflexibleservers.AdministratorsClientListByServerResponse, createLink func() string) { + server.PagerResponderInjectNextLinks(newListByServerPager, req, func(page *armpostgresqlflexibleservers.AdministratorsMicrosoftEntraClientListByServerResponse, createLink func() string) { page.NextLink = to.Ptr(createLink()) }) } @@ -287,8 +287,8 @@ func (a *AdministratorsServerTransport) dispatchNewListByServerPager(req *http.R return resp, nil } -// set this to conditionally intercept incoming requests to AdministratorsServerTransport -var administratorsServerTransportInterceptor interface { +// set this to conditionally intercept incoming requests to AdministratorsMicrosoftEntraServerTransport +var administratorsMicrosoftEntraServerTransportInterceptor interface { // Do returns true if the server transport should use the returned response/error Do(*http.Request) (*http.Response, error, bool) } diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/advancedthreatprotectionsettings_server.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/advancedthreatprotectionsettings_server.go new file mode 100644 index 000000000000..8b6cb2455b40 --- /dev/null +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/advancedthreatprotectionsettings_server.go @@ -0,0 +1,184 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package fake + +import ( + "context" + "errors" + "fmt" + azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v5" + "net/http" + "net/url" + "regexp" +) + +// AdvancedThreatProtectionSettingsServer is a fake server for instances of the armpostgresqlflexibleservers.AdvancedThreatProtectionSettingsClient type. +type AdvancedThreatProtectionSettingsServer struct { + // Get is the fake for method AdvancedThreatProtectionSettingsClient.Get + // HTTP status codes to indicate success: http.StatusOK + Get func(ctx context.Context, resourceGroupName string, serverName string, threatProtectionName armpostgresqlflexibleservers.ThreatProtectionName, options *armpostgresqlflexibleservers.AdvancedThreatProtectionSettingsClientGetOptions) (resp azfake.Responder[armpostgresqlflexibleservers.AdvancedThreatProtectionSettingsClientGetResponse], errResp azfake.ErrorResponder) + + // NewListByServerPager is the fake for method AdvancedThreatProtectionSettingsClient.NewListByServerPager + // HTTP status codes to indicate success: http.StatusOK + NewListByServerPager func(resourceGroupName string, serverName string, options *armpostgresqlflexibleservers.AdvancedThreatProtectionSettingsClientListByServerOptions) (resp azfake.PagerResponder[armpostgresqlflexibleservers.AdvancedThreatProtectionSettingsClientListByServerResponse]) +} + +// NewAdvancedThreatProtectionSettingsServerTransport creates a new instance of AdvancedThreatProtectionSettingsServerTransport with the provided implementation. +// The returned AdvancedThreatProtectionSettingsServerTransport instance is connected to an instance of armpostgresqlflexibleservers.AdvancedThreatProtectionSettingsClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewAdvancedThreatProtectionSettingsServerTransport(srv *AdvancedThreatProtectionSettingsServer) *AdvancedThreatProtectionSettingsServerTransport { + return &AdvancedThreatProtectionSettingsServerTransport{ + srv: srv, + newListByServerPager: newTracker[azfake.PagerResponder[armpostgresqlflexibleservers.AdvancedThreatProtectionSettingsClientListByServerResponse]](), + } +} + +// AdvancedThreatProtectionSettingsServerTransport connects instances of armpostgresqlflexibleservers.AdvancedThreatProtectionSettingsClient to instances of AdvancedThreatProtectionSettingsServer. +// Don't use this type directly, use NewAdvancedThreatProtectionSettingsServerTransport instead. +type AdvancedThreatProtectionSettingsServerTransport struct { + srv *AdvancedThreatProtectionSettingsServer + newListByServerPager *tracker[azfake.PagerResponder[armpostgresqlflexibleservers.AdvancedThreatProtectionSettingsClientListByServerResponse]] +} + +// Do implements the policy.Transporter interface for AdvancedThreatProtectionSettingsServerTransport. +func (a *AdvancedThreatProtectionSettingsServerTransport) Do(req *http.Request) (*http.Response, error) { + rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) + method, ok := rawMethod.(string) + if !ok { + return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} + } + + return a.dispatchToMethodFake(req, method) +} + +func (a *AdvancedThreatProtectionSettingsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) + + go func() { + var intercepted bool + var res result + if advancedThreatProtectionSettingsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = advancedThreatProtectionSettingsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "AdvancedThreatProtectionSettingsClient.Get": + res.resp, res.err = a.dispatchGet(req) + case "AdvancedThreatProtectionSettingsClient.NewListByServerPager": + res.resp, res.err = a.dispatchNewListByServerPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } + + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } +} + +func (a *AdvancedThreatProtectionSettingsServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { + if a.srv.Get == nil { + return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/advancedThreatProtectionSettings/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if len(matches) < 5 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + serverNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("serverName")]) + if err != nil { + return nil, err + } + threatProtectionNameParam, err := parseWithCast(matches[regex.SubexpIndex("threatProtectionName")], func(v string) (armpostgresqlflexibleservers.ThreatProtectionName, error) { + p, unescapeErr := url.PathUnescape(v) + if unescapeErr != nil { + return "", unescapeErr + } + return armpostgresqlflexibleservers.ThreatProtectionName(p), nil + }) + if err != nil { + return nil, err + } + respr, errRespr := a.srv.Get(req.Context(), resourceGroupNameParam, serverNameParam, threatProtectionNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).AdvancedThreatProtectionSettingsModel, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (a *AdvancedThreatProtectionSettingsServerTransport) dispatchNewListByServerPager(req *http.Request) (*http.Response, error) { + if a.srv.NewListByServerPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListByServerPager not implemented")} + } + newListByServerPager := a.newListByServerPager.get(req) + if newListByServerPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/advancedThreatProtectionSettings` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + serverNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("serverName")]) + if err != nil { + return nil, err + } + resp := a.srv.NewListByServerPager(resourceGroupNameParam, serverNameParam, nil) + newListByServerPager = &resp + a.newListByServerPager.add(req, newListByServerPager) + server.PagerResponderInjectNextLinks(newListByServerPager, req, func(page *armpostgresqlflexibleservers.AdvancedThreatProtectionSettingsClientListByServerResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListByServerPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + a.newListByServerPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListByServerPager) { + a.newListByServerPager.remove(req) + } + return resp, nil +} + +// set this to conditionally intercept incoming requests to AdvancedThreatProtectionSettingsServerTransport +var advancedThreatProtectionSettingsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/backups_server.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/backupsautomaticandondemand_server.go similarity index 68% rename from sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/backups_server.go rename to sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/backupsautomaticandondemand_server.go index 11555e297a8e..e15ae0cab57d 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/backups_server.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/backupsautomaticandondemand_server.go @@ -19,48 +19,48 @@ import ( "regexp" ) -// BackupsServer is a fake server for instances of the armpostgresqlflexibleservers.BackupsClient type. -type BackupsServer struct { - // BeginCreate is the fake for method BackupsClient.BeginCreate - // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated, http.StatusAccepted - BeginCreate func(ctx context.Context, resourceGroupName string, serverName string, backupName string, options *armpostgresqlflexibleservers.BackupsClientBeginCreateOptions) (resp azfake.PollerResponder[armpostgresqlflexibleservers.BackupsClientCreateResponse], errResp azfake.ErrorResponder) +// BackupsAutomaticAndOnDemandServer is a fake server for instances of the armpostgresqlflexibleservers.BackupsAutomaticAndOnDemandClient type. +type BackupsAutomaticAndOnDemandServer struct { + // BeginCreate is the fake for method BackupsAutomaticAndOnDemandClient.BeginCreate + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent + BeginCreate func(ctx context.Context, resourceGroupName string, serverName string, backupName string, options *armpostgresqlflexibleservers.BackupsAutomaticAndOnDemandClientBeginCreateOptions) (resp azfake.PollerResponder[armpostgresqlflexibleservers.BackupsAutomaticAndOnDemandClientCreateResponse], errResp azfake.ErrorResponder) - // BeginDelete is the fake for method BackupsClient.BeginDelete + // BeginDelete is the fake for method BackupsAutomaticAndOnDemandClient.BeginDelete // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent - BeginDelete func(ctx context.Context, resourceGroupName string, serverName string, backupName string, options *armpostgresqlflexibleservers.BackupsClientBeginDeleteOptions) (resp azfake.PollerResponder[armpostgresqlflexibleservers.BackupsClientDeleteResponse], errResp azfake.ErrorResponder) + BeginDelete func(ctx context.Context, resourceGroupName string, serverName string, backupName string, options *armpostgresqlflexibleservers.BackupsAutomaticAndOnDemandClientBeginDeleteOptions) (resp azfake.PollerResponder[armpostgresqlflexibleservers.BackupsAutomaticAndOnDemandClientDeleteResponse], errResp azfake.ErrorResponder) - // Get is the fake for method BackupsClient.Get + // Get is the fake for method BackupsAutomaticAndOnDemandClient.Get // HTTP status codes to indicate success: http.StatusOK - Get func(ctx context.Context, resourceGroupName string, serverName string, backupName string, options *armpostgresqlflexibleservers.BackupsClientGetOptions) (resp azfake.Responder[armpostgresqlflexibleservers.BackupsClientGetResponse], errResp azfake.ErrorResponder) + Get func(ctx context.Context, resourceGroupName string, serverName string, backupName string, options *armpostgresqlflexibleservers.BackupsAutomaticAndOnDemandClientGetOptions) (resp azfake.Responder[armpostgresqlflexibleservers.BackupsAutomaticAndOnDemandClientGetResponse], errResp azfake.ErrorResponder) - // NewListByServerPager is the fake for method BackupsClient.NewListByServerPager + // NewListByServerPager is the fake for method BackupsAutomaticAndOnDemandClient.NewListByServerPager // HTTP status codes to indicate success: http.StatusOK - NewListByServerPager func(resourceGroupName string, serverName string, options *armpostgresqlflexibleservers.BackupsClientListByServerOptions) (resp azfake.PagerResponder[armpostgresqlflexibleservers.BackupsClientListByServerResponse]) + NewListByServerPager func(resourceGroupName string, serverName string, options *armpostgresqlflexibleservers.BackupsAutomaticAndOnDemandClientListByServerOptions) (resp azfake.PagerResponder[armpostgresqlflexibleservers.BackupsAutomaticAndOnDemandClientListByServerResponse]) } -// NewBackupsServerTransport creates a new instance of BackupsServerTransport with the provided implementation. -// The returned BackupsServerTransport instance is connected to an instance of armpostgresqlflexibleservers.BackupsClient via the +// NewBackupsAutomaticAndOnDemandServerTransport creates a new instance of BackupsAutomaticAndOnDemandServerTransport with the provided implementation. +// The returned BackupsAutomaticAndOnDemandServerTransport instance is connected to an instance of armpostgresqlflexibleservers.BackupsAutomaticAndOnDemandClient via the // azcore.ClientOptions.Transporter field in the client's constructor parameters. -func NewBackupsServerTransport(srv *BackupsServer) *BackupsServerTransport { - return &BackupsServerTransport{ +func NewBackupsAutomaticAndOnDemandServerTransport(srv *BackupsAutomaticAndOnDemandServer) *BackupsAutomaticAndOnDemandServerTransport { + return &BackupsAutomaticAndOnDemandServerTransport{ srv: srv, - beginCreate: newTracker[azfake.PollerResponder[armpostgresqlflexibleservers.BackupsClientCreateResponse]](), - beginDelete: newTracker[azfake.PollerResponder[armpostgresqlflexibleservers.BackupsClientDeleteResponse]](), - newListByServerPager: newTracker[azfake.PagerResponder[armpostgresqlflexibleservers.BackupsClientListByServerResponse]](), + beginCreate: newTracker[azfake.PollerResponder[armpostgresqlflexibleservers.BackupsAutomaticAndOnDemandClientCreateResponse]](), + beginDelete: newTracker[azfake.PollerResponder[armpostgresqlflexibleservers.BackupsAutomaticAndOnDemandClientDeleteResponse]](), + newListByServerPager: newTracker[azfake.PagerResponder[armpostgresqlflexibleservers.BackupsAutomaticAndOnDemandClientListByServerResponse]](), } } -// BackupsServerTransport connects instances of armpostgresqlflexibleservers.BackupsClient to instances of BackupsServer. -// Don't use this type directly, use NewBackupsServerTransport instead. -type BackupsServerTransport struct { - srv *BackupsServer - beginCreate *tracker[azfake.PollerResponder[armpostgresqlflexibleservers.BackupsClientCreateResponse]] - beginDelete *tracker[azfake.PollerResponder[armpostgresqlflexibleservers.BackupsClientDeleteResponse]] - newListByServerPager *tracker[azfake.PagerResponder[armpostgresqlflexibleservers.BackupsClientListByServerResponse]] +// BackupsAutomaticAndOnDemandServerTransport connects instances of armpostgresqlflexibleservers.BackupsAutomaticAndOnDemandClient to instances of BackupsAutomaticAndOnDemandServer. +// Don't use this type directly, use NewBackupsAutomaticAndOnDemandServerTransport instead. +type BackupsAutomaticAndOnDemandServerTransport struct { + srv *BackupsAutomaticAndOnDemandServer + beginCreate *tracker[azfake.PollerResponder[armpostgresqlflexibleservers.BackupsAutomaticAndOnDemandClientCreateResponse]] + beginDelete *tracker[azfake.PollerResponder[armpostgresqlflexibleservers.BackupsAutomaticAndOnDemandClientDeleteResponse]] + newListByServerPager *tracker[azfake.PagerResponder[armpostgresqlflexibleservers.BackupsAutomaticAndOnDemandClientListByServerResponse]] } -// Do implements the policy.Transporter interface for BackupsServerTransport. -func (b *BackupsServerTransport) Do(req *http.Request) (*http.Response, error) { +// Do implements the policy.Transporter interface for BackupsAutomaticAndOnDemandServerTransport. +func (b *BackupsAutomaticAndOnDemandServerTransport) Do(req *http.Request) (*http.Response, error) { rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) method, ok := rawMethod.(string) if !ok { @@ -70,25 +70,25 @@ func (b *BackupsServerTransport) Do(req *http.Request) (*http.Response, error) { return b.dispatchToMethodFake(req, method) } -func (b *BackupsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { +func (b *BackupsAutomaticAndOnDemandServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { resultChan := make(chan result) defer close(resultChan) go func() { var intercepted bool var res result - if backupsServerTransportInterceptor != nil { - res.resp, res.err, intercepted = backupsServerTransportInterceptor.Do(req) + if backupsAutomaticAndOnDemandServerTransportInterceptor != nil { + res.resp, res.err, intercepted = backupsAutomaticAndOnDemandServerTransportInterceptor.Do(req) } if !intercepted { switch method { - case "BackupsClient.BeginCreate": + case "BackupsAutomaticAndOnDemandClient.BeginCreate": res.resp, res.err = b.dispatchBeginCreate(req) - case "BackupsClient.BeginDelete": + case "BackupsAutomaticAndOnDemandClient.BeginDelete": res.resp, res.err = b.dispatchBeginDelete(req) - case "BackupsClient.Get": + case "BackupsAutomaticAndOnDemandClient.Get": res.resp, res.err = b.dispatchGet(req) - case "BackupsClient.NewListByServerPager": + case "BackupsAutomaticAndOnDemandClient.NewListByServerPager": res.resp, res.err = b.dispatchNewListByServerPager(req) default: res.err = fmt.Errorf("unhandled API %s", method) @@ -109,7 +109,7 @@ func (b *BackupsServerTransport) dispatchToMethodFake(req *http.Request, method } } -func (b *BackupsServerTransport) dispatchBeginCreate(req *http.Request) (*http.Response, error) { +func (b *BackupsAutomaticAndOnDemandServerTransport) dispatchBeginCreate(req *http.Request) (*http.Response, error) { if b.srv.BeginCreate == nil { return nil, &nonRetriableError{errors.New("fake for method BeginCreate not implemented")} } @@ -118,7 +118,7 @@ func (b *BackupsServerTransport) dispatchBeginCreate(req *http.Request) (*http.R const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/backups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { + if len(matches) < 5 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -146,9 +146,9 @@ func (b *BackupsServerTransport) dispatchBeginCreate(req *http.Request) (*http.R return nil, err } - if !contains([]int{http.StatusOK, http.StatusCreated, http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { b.beginCreate.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated, http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginCreate) { b.beginCreate.remove(req) @@ -157,7 +157,7 @@ func (b *BackupsServerTransport) dispatchBeginCreate(req *http.Request) (*http.R return resp, nil } -func (b *BackupsServerTransport) dispatchBeginDelete(req *http.Request) (*http.Response, error) { +func (b *BackupsAutomaticAndOnDemandServerTransport) dispatchBeginDelete(req *http.Request) (*http.Response, error) { if b.srv.BeginDelete == nil { return nil, &nonRetriableError{errors.New("fake for method BeginDelete not implemented")} } @@ -166,7 +166,7 @@ func (b *BackupsServerTransport) dispatchBeginDelete(req *http.Request) (*http.R const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/backups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { + if len(matches) < 5 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -205,14 +205,14 @@ func (b *BackupsServerTransport) dispatchBeginDelete(req *http.Request) (*http.R return resp, nil } -func (b *BackupsServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { +func (b *BackupsAutomaticAndOnDemandServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { if b.srv.Get == nil { return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} } const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/backups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { + if len(matches) < 5 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -235,14 +235,14 @@ func (b *BackupsServerTransport) dispatchGet(req *http.Request) (*http.Response, if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } - resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).ServerBackup, req) + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).BackupAutomaticAndOnDemand, req) if err != nil { return nil, err } return resp, nil } -func (b *BackupsServerTransport) dispatchNewListByServerPager(req *http.Request) (*http.Response, error) { +func (b *BackupsAutomaticAndOnDemandServerTransport) dispatchNewListByServerPager(req *http.Request) (*http.Response, error) { if b.srv.NewListByServerPager == nil { return nil, &nonRetriableError{errors.New("fake for method NewListByServerPager not implemented")} } @@ -251,7 +251,7 @@ func (b *BackupsServerTransport) dispatchNewListByServerPager(req *http.Request) const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/backups` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { + if len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -265,7 +265,7 @@ func (b *BackupsServerTransport) dispatchNewListByServerPager(req *http.Request) resp := b.srv.NewListByServerPager(resourceGroupNameParam, serverNameParam, nil) newListByServerPager = &resp b.newListByServerPager.add(req, newListByServerPager) - server.PagerResponderInjectNextLinks(newListByServerPager, req, func(page *armpostgresqlflexibleservers.BackupsClientListByServerResponse, createLink func() string) { + server.PagerResponderInjectNextLinks(newListByServerPager, req, func(page *armpostgresqlflexibleservers.BackupsAutomaticAndOnDemandClientListByServerResponse, createLink func() string) { page.NextLink = to.Ptr(createLink()) }) } @@ -283,8 +283,8 @@ func (b *BackupsServerTransport) dispatchNewListByServerPager(req *http.Request) return resp, nil } -// set this to conditionally intercept incoming requests to BackupsServerTransport -var backupsServerTransportInterceptor interface { +// set this to conditionally intercept incoming requests to BackupsAutomaticAndOnDemandServerTransport +var backupsAutomaticAndOnDemandServerTransportInterceptor interface { // Do returns true if the server transport should use the returned response/error Do(*http.Request) (*http.Response, error, bool) } diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/backupslongtermretention_server.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/backupslongtermretention_server.go new file mode 100644 index 000000000000..737e2f2d5b31 --- /dev/null +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/backupslongtermretention_server.go @@ -0,0 +1,280 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package fake + +import ( + "context" + "errors" + "fmt" + azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v5" + "net/http" + "net/url" + "regexp" +) + +// BackupsLongTermRetentionServer is a fake server for instances of the armpostgresqlflexibleservers.BackupsLongTermRetentionClient type. +type BackupsLongTermRetentionServer struct { + // CheckPrerequisites is the fake for method BackupsLongTermRetentionClient.CheckPrerequisites + // HTTP status codes to indicate success: http.StatusOK + CheckPrerequisites func(ctx context.Context, resourceGroupName string, serverName string, parameters armpostgresqlflexibleservers.LtrPreBackupRequest, options *armpostgresqlflexibleservers.BackupsLongTermRetentionClientCheckPrerequisitesOptions) (resp azfake.Responder[armpostgresqlflexibleservers.BackupsLongTermRetentionClientCheckPrerequisitesResponse], errResp azfake.ErrorResponder) + + // Get is the fake for method BackupsLongTermRetentionClient.Get + // HTTP status codes to indicate success: http.StatusOK + Get func(ctx context.Context, resourceGroupName string, serverName string, backupName string, options *armpostgresqlflexibleservers.BackupsLongTermRetentionClientGetOptions) (resp azfake.Responder[armpostgresqlflexibleservers.BackupsLongTermRetentionClientGetResponse], errResp azfake.ErrorResponder) + + // NewListByServerPager is the fake for method BackupsLongTermRetentionClient.NewListByServerPager + // HTTP status codes to indicate success: http.StatusOK + NewListByServerPager func(resourceGroupName string, serverName string, options *armpostgresqlflexibleservers.BackupsLongTermRetentionClientListByServerOptions) (resp azfake.PagerResponder[armpostgresqlflexibleservers.BackupsLongTermRetentionClientListByServerResponse]) + + // BeginStart is the fake for method BackupsLongTermRetentionClient.BeginStart + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + BeginStart func(ctx context.Context, resourceGroupName string, serverName string, parameters armpostgresqlflexibleservers.BackupsLongTermRetentionRequest, options *armpostgresqlflexibleservers.BackupsLongTermRetentionClientBeginStartOptions) (resp azfake.PollerResponder[armpostgresqlflexibleservers.BackupsLongTermRetentionClientStartResponse], errResp azfake.ErrorResponder) +} + +// NewBackupsLongTermRetentionServerTransport creates a new instance of BackupsLongTermRetentionServerTransport with the provided implementation. +// The returned BackupsLongTermRetentionServerTransport instance is connected to an instance of armpostgresqlflexibleservers.BackupsLongTermRetentionClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewBackupsLongTermRetentionServerTransport(srv *BackupsLongTermRetentionServer) *BackupsLongTermRetentionServerTransport { + return &BackupsLongTermRetentionServerTransport{ + srv: srv, + newListByServerPager: newTracker[azfake.PagerResponder[armpostgresqlflexibleservers.BackupsLongTermRetentionClientListByServerResponse]](), + beginStart: newTracker[azfake.PollerResponder[armpostgresqlflexibleservers.BackupsLongTermRetentionClientStartResponse]](), + } +} + +// BackupsLongTermRetentionServerTransport connects instances of armpostgresqlflexibleservers.BackupsLongTermRetentionClient to instances of BackupsLongTermRetentionServer. +// Don't use this type directly, use NewBackupsLongTermRetentionServerTransport instead. +type BackupsLongTermRetentionServerTransport struct { + srv *BackupsLongTermRetentionServer + newListByServerPager *tracker[azfake.PagerResponder[armpostgresqlflexibleservers.BackupsLongTermRetentionClientListByServerResponse]] + beginStart *tracker[azfake.PollerResponder[armpostgresqlflexibleservers.BackupsLongTermRetentionClientStartResponse]] +} + +// Do implements the policy.Transporter interface for BackupsLongTermRetentionServerTransport. +func (b *BackupsLongTermRetentionServerTransport) Do(req *http.Request) (*http.Response, error) { + rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) + method, ok := rawMethod.(string) + if !ok { + return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} + } + + return b.dispatchToMethodFake(req, method) +} + +func (b *BackupsLongTermRetentionServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) + + go func() { + var intercepted bool + var res result + if backupsLongTermRetentionServerTransportInterceptor != nil { + res.resp, res.err, intercepted = backupsLongTermRetentionServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "BackupsLongTermRetentionClient.CheckPrerequisites": + res.resp, res.err = b.dispatchCheckPrerequisites(req) + case "BackupsLongTermRetentionClient.Get": + res.resp, res.err = b.dispatchGet(req) + case "BackupsLongTermRetentionClient.NewListByServerPager": + res.resp, res.err = b.dispatchNewListByServerPager(req) + case "BackupsLongTermRetentionClient.BeginStart": + res.resp, res.err = b.dispatchBeginStart(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } + + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } +} + +func (b *BackupsLongTermRetentionServerTransport) dispatchCheckPrerequisites(req *http.Request) (*http.Response, error) { + if b.srv.CheckPrerequisites == nil { + return nil, &nonRetriableError{errors.New("fake for method CheckPrerequisites not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/ltrPreBackup` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armpostgresqlflexibleservers.LtrPreBackupRequest](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + serverNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("serverName")]) + if err != nil { + return nil, err + } + respr, errRespr := b.srv.CheckPrerequisites(req.Context(), resourceGroupNameParam, serverNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).LtrPreBackupResponse, req) + if err != nil { + return nil, err + } + if val := server.GetResponse(respr).XMSRequestID; val != nil { + resp.Header.Set("x-ms-request-id", *val) + } + return resp, nil +} + +func (b *BackupsLongTermRetentionServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { + if b.srv.Get == nil { + return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/ltrBackupOperations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if len(matches) < 5 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + serverNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("serverName")]) + if err != nil { + return nil, err + } + backupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("backupName")]) + if err != nil { + return nil, err + } + respr, errRespr := b.srv.Get(req.Context(), resourceGroupNameParam, serverNameParam, backupNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).BackupsLongTermRetentionOperation, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (b *BackupsLongTermRetentionServerTransport) dispatchNewListByServerPager(req *http.Request) (*http.Response, error) { + if b.srv.NewListByServerPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListByServerPager not implemented")} + } + newListByServerPager := b.newListByServerPager.get(req) + if newListByServerPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/ltrBackupOperations` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + serverNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("serverName")]) + if err != nil { + return nil, err + } + resp := b.srv.NewListByServerPager(resourceGroupNameParam, serverNameParam, nil) + newListByServerPager = &resp + b.newListByServerPager.add(req, newListByServerPager) + server.PagerResponderInjectNextLinks(newListByServerPager, req, func(page *armpostgresqlflexibleservers.BackupsLongTermRetentionClientListByServerResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListByServerPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + b.newListByServerPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListByServerPager) { + b.newListByServerPager.remove(req) + } + return resp, nil +} + +func (b *BackupsLongTermRetentionServerTransport) dispatchBeginStart(req *http.Request) (*http.Response, error) { + if b.srv.BeginStart == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginStart not implemented")} + } + beginStart := b.beginStart.get(req) + if beginStart == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/startLtrBackup` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armpostgresqlflexibleservers.BackupsLongTermRetentionRequest](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + serverNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("serverName")]) + if err != nil { + return nil, err + } + respr, errRespr := b.srv.BeginStart(req.Context(), resourceGroupNameParam, serverNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginStart = &respr + b.beginStart.add(req, beginStart) + } + + resp, err := server.PollerResponderNext(beginStart, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + b.beginStart.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + } + if !server.PollerResponderMore(beginStart) { + b.beginStart.remove(req) + } + + return resp, nil +} + +// set this to conditionally intercept incoming requests to BackupsLongTermRetentionServerTransport +var backupsLongTermRetentionServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/capabilitiesbylocation_server.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/capabilitiesbylocation_server.go new file mode 100644 index 000000000000..470cb7495581 --- /dev/null +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/capabilitiesbylocation_server.go @@ -0,0 +1,130 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package fake + +import ( + "errors" + "fmt" + azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v5" + "net/http" + "net/url" + "regexp" +) + +// CapabilitiesByLocationServer is a fake server for instances of the armpostgresqlflexibleservers.CapabilitiesByLocationClient type. +type CapabilitiesByLocationServer struct { + // NewListPager is the fake for method CapabilitiesByLocationClient.NewListPager + // HTTP status codes to indicate success: http.StatusOK + NewListPager func(locationName string, options *armpostgresqlflexibleservers.CapabilitiesByLocationClientListOptions) (resp azfake.PagerResponder[armpostgresqlflexibleservers.CapabilitiesByLocationClientListResponse]) +} + +// NewCapabilitiesByLocationServerTransport creates a new instance of CapabilitiesByLocationServerTransport with the provided implementation. +// The returned CapabilitiesByLocationServerTransport instance is connected to an instance of armpostgresqlflexibleservers.CapabilitiesByLocationClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewCapabilitiesByLocationServerTransport(srv *CapabilitiesByLocationServer) *CapabilitiesByLocationServerTransport { + return &CapabilitiesByLocationServerTransport{ + srv: srv, + newListPager: newTracker[azfake.PagerResponder[armpostgresqlflexibleservers.CapabilitiesByLocationClientListResponse]](), + } +} + +// CapabilitiesByLocationServerTransport connects instances of armpostgresqlflexibleservers.CapabilitiesByLocationClient to instances of CapabilitiesByLocationServer. +// Don't use this type directly, use NewCapabilitiesByLocationServerTransport instead. +type CapabilitiesByLocationServerTransport struct { + srv *CapabilitiesByLocationServer + newListPager *tracker[azfake.PagerResponder[armpostgresqlflexibleservers.CapabilitiesByLocationClientListResponse]] +} + +// Do implements the policy.Transporter interface for CapabilitiesByLocationServerTransport. +func (c *CapabilitiesByLocationServerTransport) Do(req *http.Request) (*http.Response, error) { + rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) + method, ok := rawMethod.(string) + if !ok { + return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} + } + + return c.dispatchToMethodFake(req, method) +} + +func (c *CapabilitiesByLocationServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) + + go func() { + var intercepted bool + var res result + if capabilitiesByLocationServerTransportInterceptor != nil { + res.resp, res.err, intercepted = capabilitiesByLocationServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "CapabilitiesByLocationClient.NewListPager": + res.resp, res.err = c.dispatchNewListPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } + + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } +} + +func (c *CapabilitiesByLocationServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { + if c.srv.NewListPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} + } + newListPager := c.newListPager.get(req) + if newListPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/locations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/capabilities` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + locationNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("locationName")]) + if err != nil { + return nil, err + } + resp := c.srv.NewListPager(locationNameParam, nil) + newListPager = &resp + c.newListPager.add(req, newListPager) + server.PagerResponderInjectNextLinks(newListPager, req, func(page *armpostgresqlflexibleservers.CapabilitiesByLocationClientListResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + c.newListPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListPager) { + c.newListPager.remove(req) + } + return resp, nil +} + +// set this to conditionally intercept incoming requests to CapabilitiesByLocationServerTransport +var capabilitiesByLocationServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/servercapabilities_server.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/capabilitiesbyserver_server.go similarity index 55% rename from sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/servercapabilities_server.go rename to sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/capabilitiesbyserver_server.go index c32e2f8af470..4659df19a54d 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/servercapabilities_server.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/capabilitiesbyserver_server.go @@ -18,55 +18,55 @@ import ( "regexp" ) -// ServerCapabilitiesServer is a fake server for instances of the armpostgresqlflexibleservers.ServerCapabilitiesClient type. -type ServerCapabilitiesServer struct { - // NewListPager is the fake for method ServerCapabilitiesClient.NewListPager +// CapabilitiesByServerServer is a fake server for instances of the armpostgresqlflexibleservers.CapabilitiesByServerClient type. +type CapabilitiesByServerServer struct { + // NewListPager is the fake for method CapabilitiesByServerClient.NewListPager // HTTP status codes to indicate success: http.StatusOK - NewListPager func(resourceGroupName string, serverName string, options *armpostgresqlflexibleservers.ServerCapabilitiesClientListOptions) (resp azfake.PagerResponder[armpostgresqlflexibleservers.ServerCapabilitiesClientListResponse]) + NewListPager func(resourceGroupName string, serverName string, options *armpostgresqlflexibleservers.CapabilitiesByServerClientListOptions) (resp azfake.PagerResponder[armpostgresqlflexibleservers.CapabilitiesByServerClientListResponse]) } -// NewServerCapabilitiesServerTransport creates a new instance of ServerCapabilitiesServerTransport with the provided implementation. -// The returned ServerCapabilitiesServerTransport instance is connected to an instance of armpostgresqlflexibleservers.ServerCapabilitiesClient via the +// NewCapabilitiesByServerServerTransport creates a new instance of CapabilitiesByServerServerTransport with the provided implementation. +// The returned CapabilitiesByServerServerTransport instance is connected to an instance of armpostgresqlflexibleservers.CapabilitiesByServerClient via the // azcore.ClientOptions.Transporter field in the client's constructor parameters. -func NewServerCapabilitiesServerTransport(srv *ServerCapabilitiesServer) *ServerCapabilitiesServerTransport { - return &ServerCapabilitiesServerTransport{ +func NewCapabilitiesByServerServerTransport(srv *CapabilitiesByServerServer) *CapabilitiesByServerServerTransport { + return &CapabilitiesByServerServerTransport{ srv: srv, - newListPager: newTracker[azfake.PagerResponder[armpostgresqlflexibleservers.ServerCapabilitiesClientListResponse]](), + newListPager: newTracker[azfake.PagerResponder[armpostgresqlflexibleservers.CapabilitiesByServerClientListResponse]](), } } -// ServerCapabilitiesServerTransport connects instances of armpostgresqlflexibleservers.ServerCapabilitiesClient to instances of ServerCapabilitiesServer. -// Don't use this type directly, use NewServerCapabilitiesServerTransport instead. -type ServerCapabilitiesServerTransport struct { - srv *ServerCapabilitiesServer - newListPager *tracker[azfake.PagerResponder[armpostgresqlflexibleservers.ServerCapabilitiesClientListResponse]] +// CapabilitiesByServerServerTransport connects instances of armpostgresqlflexibleservers.CapabilitiesByServerClient to instances of CapabilitiesByServerServer. +// Don't use this type directly, use NewCapabilitiesByServerServerTransport instead. +type CapabilitiesByServerServerTransport struct { + srv *CapabilitiesByServerServer + newListPager *tracker[azfake.PagerResponder[armpostgresqlflexibleservers.CapabilitiesByServerClientListResponse]] } -// Do implements the policy.Transporter interface for ServerCapabilitiesServerTransport. -func (s *ServerCapabilitiesServerTransport) Do(req *http.Request) (*http.Response, error) { +// Do implements the policy.Transporter interface for CapabilitiesByServerServerTransport. +func (c *CapabilitiesByServerServerTransport) Do(req *http.Request) (*http.Response, error) { rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) method, ok := rawMethod.(string) if !ok { return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - return s.dispatchToMethodFake(req, method) + return c.dispatchToMethodFake(req, method) } -func (s *ServerCapabilitiesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { +func (c *CapabilitiesByServerServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { resultChan := make(chan result) defer close(resultChan) go func() { var intercepted bool var res result - if serverCapabilitiesServerTransportInterceptor != nil { - res.resp, res.err, intercepted = serverCapabilitiesServerTransportInterceptor.Do(req) + if capabilitiesByServerTransportInterceptor != nil { + res.resp, res.err, intercepted = capabilitiesByServerTransportInterceptor.Do(req) } if !intercepted { switch method { - case "ServerCapabilitiesClient.NewListPager": - res.resp, res.err = s.dispatchNewListPager(req) + case "CapabilitiesByServerClient.NewListPager": + res.resp, res.err = c.dispatchNewListPager(req) default: res.err = fmt.Errorf("unhandled API %s", method) } @@ -86,16 +86,16 @@ func (s *ServerCapabilitiesServerTransport) dispatchToMethodFake(req *http.Reque } } -func (s *ServerCapabilitiesServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { - if s.srv.NewListPager == nil { +func (c *CapabilitiesByServerServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { + if c.srv.NewListPager == nil { return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} } - newListPager := s.newListPager.get(req) + newListPager := c.newListPager.get(req) if newListPager == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/capabilities` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { + if len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -106,10 +106,10 @@ func (s *ServerCapabilitiesServerTransport) dispatchNewListPager(req *http.Reque if err != nil { return nil, err } - resp := s.srv.NewListPager(resourceGroupNameParam, serverNameParam, nil) + resp := c.srv.NewListPager(resourceGroupNameParam, serverNameParam, nil) newListPager = &resp - s.newListPager.add(req, newListPager) - server.PagerResponderInjectNextLinks(newListPager, req, func(page *armpostgresqlflexibleservers.ServerCapabilitiesClientListResponse, createLink func() string) { + c.newListPager.add(req, newListPager) + server.PagerResponderInjectNextLinks(newListPager, req, func(page *armpostgresqlflexibleservers.CapabilitiesByServerClientListResponse, createLink func() string) { page.NextLink = to.Ptr(createLink()) }) } @@ -118,17 +118,17 @@ func (s *ServerCapabilitiesServerTransport) dispatchNewListPager(req *http.Reque return nil, err } if !contains([]int{http.StatusOK}, resp.StatusCode) { - s.newListPager.remove(req) + c.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } if !server.PagerResponderMore(newListPager) { - s.newListPager.remove(req) + c.newListPager.remove(req) } return resp, nil } -// set this to conditionally intercept incoming requests to ServerCapabilitiesServerTransport -var serverCapabilitiesServerTransportInterceptor interface { +// set this to conditionally intercept incoming requests to CapabilitiesByServerServerTransport +var capabilitiesByServerTransportInterceptor interface { // Do returns true if the server transport should use the returned response/error Do(*http.Request) (*http.Response, error, bool) } diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/logfiles_server.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/capturedlogs_server.go similarity index 56% rename from sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/logfiles_server.go rename to sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/capturedlogs_server.go index b9e396385c33..a376e6685ca8 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/logfiles_server.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/capturedlogs_server.go @@ -18,55 +18,55 @@ import ( "regexp" ) -// LogFilesServer is a fake server for instances of the armpostgresqlflexibleservers.LogFilesClient type. -type LogFilesServer struct { - // NewListByServerPager is the fake for method LogFilesClient.NewListByServerPager +// CapturedLogsServer is a fake server for instances of the armpostgresqlflexibleservers.CapturedLogsClient type. +type CapturedLogsServer struct { + // NewListByServerPager is the fake for method CapturedLogsClient.NewListByServerPager // HTTP status codes to indicate success: http.StatusOK - NewListByServerPager func(resourceGroupName string, serverName string, options *armpostgresqlflexibleservers.LogFilesClientListByServerOptions) (resp azfake.PagerResponder[armpostgresqlflexibleservers.LogFilesClientListByServerResponse]) + NewListByServerPager func(resourceGroupName string, serverName string, options *armpostgresqlflexibleservers.CapturedLogsClientListByServerOptions) (resp azfake.PagerResponder[armpostgresqlflexibleservers.CapturedLogsClientListByServerResponse]) } -// NewLogFilesServerTransport creates a new instance of LogFilesServerTransport with the provided implementation. -// The returned LogFilesServerTransport instance is connected to an instance of armpostgresqlflexibleservers.LogFilesClient via the +// NewCapturedLogsServerTransport creates a new instance of CapturedLogsServerTransport with the provided implementation. +// The returned CapturedLogsServerTransport instance is connected to an instance of armpostgresqlflexibleservers.CapturedLogsClient via the // azcore.ClientOptions.Transporter field in the client's constructor parameters. -func NewLogFilesServerTransport(srv *LogFilesServer) *LogFilesServerTransport { - return &LogFilesServerTransport{ +func NewCapturedLogsServerTransport(srv *CapturedLogsServer) *CapturedLogsServerTransport { + return &CapturedLogsServerTransport{ srv: srv, - newListByServerPager: newTracker[azfake.PagerResponder[armpostgresqlflexibleservers.LogFilesClientListByServerResponse]](), + newListByServerPager: newTracker[azfake.PagerResponder[armpostgresqlflexibleservers.CapturedLogsClientListByServerResponse]](), } } -// LogFilesServerTransport connects instances of armpostgresqlflexibleservers.LogFilesClient to instances of LogFilesServer. -// Don't use this type directly, use NewLogFilesServerTransport instead. -type LogFilesServerTransport struct { - srv *LogFilesServer - newListByServerPager *tracker[azfake.PagerResponder[armpostgresqlflexibleservers.LogFilesClientListByServerResponse]] +// CapturedLogsServerTransport connects instances of armpostgresqlflexibleservers.CapturedLogsClient to instances of CapturedLogsServer. +// Don't use this type directly, use NewCapturedLogsServerTransport instead. +type CapturedLogsServerTransport struct { + srv *CapturedLogsServer + newListByServerPager *tracker[azfake.PagerResponder[armpostgresqlflexibleservers.CapturedLogsClientListByServerResponse]] } -// Do implements the policy.Transporter interface for LogFilesServerTransport. -func (l *LogFilesServerTransport) Do(req *http.Request) (*http.Response, error) { +// Do implements the policy.Transporter interface for CapturedLogsServerTransport. +func (c *CapturedLogsServerTransport) Do(req *http.Request) (*http.Response, error) { rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) method, ok := rawMethod.(string) if !ok { return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - return l.dispatchToMethodFake(req, method) + return c.dispatchToMethodFake(req, method) } -func (l *LogFilesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { +func (c *CapturedLogsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { resultChan := make(chan result) defer close(resultChan) go func() { var intercepted bool var res result - if logFilesServerTransportInterceptor != nil { - res.resp, res.err, intercepted = logFilesServerTransportInterceptor.Do(req) + if capturedLogsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = capturedLogsServerTransportInterceptor.Do(req) } if !intercepted { switch method { - case "LogFilesClient.NewListByServerPager": - res.resp, res.err = l.dispatchNewListByServerPager(req) + case "CapturedLogsClient.NewListByServerPager": + res.resp, res.err = c.dispatchNewListByServerPager(req) default: res.err = fmt.Errorf("unhandled API %s", method) } @@ -86,16 +86,16 @@ func (l *LogFilesServerTransport) dispatchToMethodFake(req *http.Request, method } } -func (l *LogFilesServerTransport) dispatchNewListByServerPager(req *http.Request) (*http.Response, error) { - if l.srv.NewListByServerPager == nil { +func (c *CapturedLogsServerTransport) dispatchNewListByServerPager(req *http.Request) (*http.Response, error) { + if c.srv.NewListByServerPager == nil { return nil, &nonRetriableError{errors.New("fake for method NewListByServerPager not implemented")} } - newListByServerPager := l.newListByServerPager.get(req) + newListByServerPager := c.newListByServerPager.get(req) if newListByServerPager == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/logFiles` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { + if len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -106,10 +106,10 @@ func (l *LogFilesServerTransport) dispatchNewListByServerPager(req *http.Request if err != nil { return nil, err } - resp := l.srv.NewListByServerPager(resourceGroupNameParam, serverNameParam, nil) + resp := c.srv.NewListByServerPager(resourceGroupNameParam, serverNameParam, nil) newListByServerPager = &resp - l.newListByServerPager.add(req, newListByServerPager) - server.PagerResponderInjectNextLinks(newListByServerPager, req, func(page *armpostgresqlflexibleservers.LogFilesClientListByServerResponse, createLink func() string) { + c.newListByServerPager.add(req, newListByServerPager) + server.PagerResponderInjectNextLinks(newListByServerPager, req, func(page *armpostgresqlflexibleservers.CapturedLogsClientListByServerResponse, createLink func() string) { page.NextLink = to.Ptr(createLink()) }) } @@ -118,17 +118,17 @@ func (l *LogFilesServerTransport) dispatchNewListByServerPager(req *http.Request return nil, err } if !contains([]int{http.StatusOK}, resp.StatusCode) { - l.newListByServerPager.remove(req) + c.newListByServerPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } if !server.PagerResponderMore(newListByServerPager) { - l.newListByServerPager.remove(req) + c.newListByServerPager.remove(req) } return resp, nil } -// set this to conditionally intercept incoming requests to LogFilesServerTransport -var logFilesServerTransportInterceptor interface { +// set this to conditionally intercept incoming requests to CapturedLogsServerTransport +var capturedLogsServerTransportInterceptor interface { // Do returns true if the server transport should use the returned response/error Do(*http.Request) (*http.Response, error, bool) } diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/checknameavailability_server.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/checknameavailability_server.go deleted file mode 100644 index 23173a398818..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/checknameavailability_server.go +++ /dev/null @@ -1,117 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package fake - -import ( - "context" - "errors" - "fmt" - azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v5" - "net/http" - "regexp" -) - -// CheckNameAvailabilityServer is a fake server for instances of the armpostgresqlflexibleservers.CheckNameAvailabilityClient type. -type CheckNameAvailabilityServer struct { - // Execute is the fake for method CheckNameAvailabilityClient.Execute - // HTTP status codes to indicate success: http.StatusOK - Execute func(ctx context.Context, nameAvailabilityRequest armpostgresqlflexibleservers.CheckNameAvailabilityRequest, options *armpostgresqlflexibleservers.CheckNameAvailabilityClientExecuteOptions) (resp azfake.Responder[armpostgresqlflexibleservers.CheckNameAvailabilityClientExecuteResponse], errResp azfake.ErrorResponder) -} - -// NewCheckNameAvailabilityServerTransport creates a new instance of CheckNameAvailabilityServerTransport with the provided implementation. -// The returned CheckNameAvailabilityServerTransport instance is connected to an instance of armpostgresqlflexibleservers.CheckNameAvailabilityClient via the -// azcore.ClientOptions.Transporter field in the client's constructor parameters. -func NewCheckNameAvailabilityServerTransport(srv *CheckNameAvailabilityServer) *CheckNameAvailabilityServerTransport { - return &CheckNameAvailabilityServerTransport{srv: srv} -} - -// CheckNameAvailabilityServerTransport connects instances of armpostgresqlflexibleservers.CheckNameAvailabilityClient to instances of CheckNameAvailabilityServer. -// Don't use this type directly, use NewCheckNameAvailabilityServerTransport instead. -type CheckNameAvailabilityServerTransport struct { - srv *CheckNameAvailabilityServer -} - -// Do implements the policy.Transporter interface for CheckNameAvailabilityServerTransport. -func (c *CheckNameAvailabilityServerTransport) Do(req *http.Request) (*http.Response, error) { - rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) - method, ok := rawMethod.(string) - if !ok { - return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} - } - - return c.dispatchToMethodFake(req, method) -} - -func (c *CheckNameAvailabilityServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - - go func() { - var intercepted bool - var res result - if checkNameAvailabilityServerTransportInterceptor != nil { - res.resp, res.err, intercepted = checkNameAvailabilityServerTransportInterceptor.Do(req) - } - if !intercepted { - switch method { - case "CheckNameAvailabilityClient.Execute": - res.resp, res.err = c.dispatchExecute(req) - default: - res.err = fmt.Errorf("unhandled API %s", method) - } - - } - select { - case resultChan <- res: - case <-req.Context().Done(): - } - }() - - select { - case <-req.Context().Done(): - return nil, req.Context().Err() - case res := <-resultChan: - return res.resp, res.err - } -} - -func (c *CheckNameAvailabilityServerTransport) dispatchExecute(req *http.Request) (*http.Response, error) { - if c.srv.Execute == nil { - return nil, &nonRetriableError{errors.New("fake for method Execute not implemented")} - } - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/checkNameAvailability` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 1 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - body, err := server.UnmarshalRequestAsJSON[armpostgresqlflexibleservers.CheckNameAvailabilityRequest](req) - if err != nil { - return nil, err - } - respr, errRespr := c.srv.Execute(req.Context(), body, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} - } - resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).NameAvailability, req) - if err != nil { - return nil, err - } - return resp, nil -} - -// set this to conditionally intercept incoming requests to CheckNameAvailabilityServerTransport -var checkNameAvailabilityServerTransportInterceptor interface { - // Do returns true if the server transport should use the returned response/error - Do(*http.Request) (*http.Response, error, bool) -} diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/checknameavailabilitywithlocation_server.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/checknameavailabilitywithlocation_server.go deleted file mode 100644 index 423255e7a6f5..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/checknameavailabilitywithlocation_server.go +++ /dev/null @@ -1,122 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package fake - -import ( - "context" - "errors" - "fmt" - azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v5" - "net/http" - "net/url" - "regexp" -) - -// CheckNameAvailabilityWithLocationServer is a fake server for instances of the armpostgresqlflexibleservers.CheckNameAvailabilityWithLocationClient type. -type CheckNameAvailabilityWithLocationServer struct { - // Execute is the fake for method CheckNameAvailabilityWithLocationClient.Execute - // HTTP status codes to indicate success: http.StatusOK - Execute func(ctx context.Context, locationName string, nameAvailabilityRequest armpostgresqlflexibleservers.CheckNameAvailabilityRequest, options *armpostgresqlflexibleservers.CheckNameAvailabilityWithLocationClientExecuteOptions) (resp azfake.Responder[armpostgresqlflexibleservers.CheckNameAvailabilityWithLocationClientExecuteResponse], errResp azfake.ErrorResponder) -} - -// NewCheckNameAvailabilityWithLocationServerTransport creates a new instance of CheckNameAvailabilityWithLocationServerTransport with the provided implementation. -// The returned CheckNameAvailabilityWithLocationServerTransport instance is connected to an instance of armpostgresqlflexibleservers.CheckNameAvailabilityWithLocationClient via the -// azcore.ClientOptions.Transporter field in the client's constructor parameters. -func NewCheckNameAvailabilityWithLocationServerTransport(srv *CheckNameAvailabilityWithLocationServer) *CheckNameAvailabilityWithLocationServerTransport { - return &CheckNameAvailabilityWithLocationServerTransport{srv: srv} -} - -// CheckNameAvailabilityWithLocationServerTransport connects instances of armpostgresqlflexibleservers.CheckNameAvailabilityWithLocationClient to instances of CheckNameAvailabilityWithLocationServer. -// Don't use this type directly, use NewCheckNameAvailabilityWithLocationServerTransport instead. -type CheckNameAvailabilityWithLocationServerTransport struct { - srv *CheckNameAvailabilityWithLocationServer -} - -// Do implements the policy.Transporter interface for CheckNameAvailabilityWithLocationServerTransport. -func (c *CheckNameAvailabilityWithLocationServerTransport) Do(req *http.Request) (*http.Response, error) { - rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) - method, ok := rawMethod.(string) - if !ok { - return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} - } - - return c.dispatchToMethodFake(req, method) -} - -func (c *CheckNameAvailabilityWithLocationServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - - go func() { - var intercepted bool - var res result - if checkNameAvailabilityWithLocationServerTransportInterceptor != nil { - res.resp, res.err, intercepted = checkNameAvailabilityWithLocationServerTransportInterceptor.Do(req) - } - if !intercepted { - switch method { - case "CheckNameAvailabilityWithLocationClient.Execute": - res.resp, res.err = c.dispatchExecute(req) - default: - res.err = fmt.Errorf("unhandled API %s", method) - } - - } - select { - case resultChan <- res: - case <-req.Context().Done(): - } - }() - - select { - case <-req.Context().Done(): - return nil, req.Context().Err() - case res := <-resultChan: - return res.resp, res.err - } -} - -func (c *CheckNameAvailabilityWithLocationServerTransport) dispatchExecute(req *http.Request) (*http.Response, error) { - if c.srv.Execute == nil { - return nil, &nonRetriableError{errors.New("fake for method Execute not implemented")} - } - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/locations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/checkNameAvailability` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 2 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - body, err := server.UnmarshalRequestAsJSON[armpostgresqlflexibleservers.CheckNameAvailabilityRequest](req) - if err != nil { - return nil, err - } - locationNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("locationName")]) - if err != nil { - return nil, err - } - respr, errRespr := c.srv.Execute(req.Context(), locationNameParam, body, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} - } - resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).NameAvailability, req) - if err != nil { - return nil, err - } - return resp, nil -} - -// set this to conditionally intercept incoming requests to CheckNameAvailabilityWithLocationServerTransport -var checkNameAvailabilityWithLocationServerTransportInterceptor interface { - // Do returns true if the server transport should use the returned response/error - Do(*http.Request) (*http.Response, error, bool) -} diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/configurations_server.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/configurations_server.go index 43b4ac755103..4094f59e72ff 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/configurations_server.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/configurations_server.go @@ -30,11 +30,11 @@ type ConfigurationsServer struct { NewListByServerPager func(resourceGroupName string, serverName string, options *armpostgresqlflexibleservers.ConfigurationsClientListByServerOptions) (resp azfake.PagerResponder[armpostgresqlflexibleservers.ConfigurationsClientListByServerResponse]) // BeginPut is the fake for method ConfigurationsClient.BeginPut - // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated, http.StatusAccepted - BeginPut func(ctx context.Context, resourceGroupName string, serverName string, configurationName string, parameters armpostgresqlflexibleservers.Configuration, options *armpostgresqlflexibleservers.ConfigurationsClientBeginPutOptions) (resp azfake.PollerResponder[armpostgresqlflexibleservers.ConfigurationsClientPutResponse], errResp azfake.ErrorResponder) + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent + BeginPut func(ctx context.Context, resourceGroupName string, serverName string, configurationName string, parameters armpostgresqlflexibleservers.ConfigurationForUpdate, options *armpostgresqlflexibleservers.ConfigurationsClientBeginPutOptions) (resp azfake.PollerResponder[armpostgresqlflexibleservers.ConfigurationsClientPutResponse], errResp azfake.ErrorResponder) // BeginUpdate is the fake for method ConfigurationsClient.BeginUpdate - // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated, http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginUpdate func(ctx context.Context, resourceGroupName string, serverName string, configurationName string, parameters armpostgresqlflexibleservers.ConfigurationForUpdate, options *armpostgresqlflexibleservers.ConfigurationsClientBeginUpdateOptions) (resp azfake.PollerResponder[armpostgresqlflexibleservers.ConfigurationsClientUpdateResponse], errResp azfake.ErrorResponder) } @@ -116,7 +116,7 @@ func (c *ConfigurationsServerTransport) dispatchGet(req *http.Request) (*http.Re const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/configurations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { + if len(matches) < 5 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -155,7 +155,7 @@ func (c *ConfigurationsServerTransport) dispatchNewListByServerPager(req *http.R const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/configurations` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { + if len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -196,10 +196,10 @@ func (c *ConfigurationsServerTransport) dispatchBeginPut(req *http.Request) (*ht const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/configurations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { + if len(matches) < 5 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } - body, err := server.UnmarshalRequestAsJSON[armpostgresqlflexibleservers.Configuration](req) + body, err := server.UnmarshalRequestAsJSON[armpostgresqlflexibleservers.ConfigurationForUpdate](req) if err != nil { return nil, err } @@ -228,9 +228,9 @@ func (c *ConfigurationsServerTransport) dispatchBeginPut(req *http.Request) (*ht return nil, err } - if !contains([]int{http.StatusOK, http.StatusCreated, http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { c.beginPut.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated, http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginPut) { c.beginPut.remove(req) @@ -248,7 +248,7 @@ func (c *ConfigurationsServerTransport) dispatchBeginUpdate(req *http.Request) ( const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/configurations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { + if len(matches) < 5 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } body, err := server.UnmarshalRequestAsJSON[armpostgresqlflexibleservers.ConfigurationForUpdate](req) @@ -280,9 +280,9 @@ func (c *ConfigurationsServerTransport) dispatchBeginUpdate(req *http.Request) ( return nil, err } - if !contains([]int{http.StatusOK, http.StatusCreated, http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { c.beginUpdate.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated, http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginUpdate) { c.beginUpdate.remove(req) diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/databases_server.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/databases_server.go index 4b66424f57e3..fd93cc7b232a 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/databases_server.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/databases_server.go @@ -22,7 +22,7 @@ import ( // DatabasesServer is a fake server for instances of the armpostgresqlflexibleservers.DatabasesClient type. type DatabasesServer struct { // BeginCreate is the fake for method DatabasesClient.BeginCreate - // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated, http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginCreate func(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters armpostgresqlflexibleservers.Database, options *armpostgresqlflexibleservers.DatabasesClientBeginCreateOptions) (resp azfake.PollerResponder[armpostgresqlflexibleservers.DatabasesClientCreateResponse], errResp azfake.ErrorResponder) // BeginDelete is the fake for method DatabasesClient.BeginDelete @@ -118,7 +118,7 @@ func (d *DatabasesServerTransport) dispatchBeginCreate(req *http.Request) (*http const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/databases/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { + if len(matches) < 5 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } body, err := server.UnmarshalRequestAsJSON[armpostgresqlflexibleservers.Database](req) @@ -150,9 +150,9 @@ func (d *DatabasesServerTransport) dispatchBeginCreate(req *http.Request) (*http return nil, err } - if !contains([]int{http.StatusOK, http.StatusCreated, http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { d.beginCreate.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated, http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginCreate) { d.beginCreate.remove(req) @@ -170,7 +170,7 @@ func (d *DatabasesServerTransport) dispatchBeginDelete(req *http.Request) (*http const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/databases/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { + if len(matches) < 5 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -216,7 +216,7 @@ func (d *DatabasesServerTransport) dispatchGet(req *http.Request) (*http.Respons const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/databases/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { + if len(matches) < 5 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -255,7 +255,7 @@ func (d *DatabasesServerTransport) dispatchNewListByServerPager(req *http.Reques const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/databases` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { + if len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/firewallrules_server.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/firewallrules_server.go index 3d5a25d7fbfa..bf43cf528ad5 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/firewallrules_server.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/firewallrules_server.go @@ -22,7 +22,7 @@ import ( // FirewallRulesServer is a fake server for instances of the armpostgresqlflexibleservers.FirewallRulesClient type. type FirewallRulesServer struct { // BeginCreateOrUpdate is the fake for method FirewallRulesClient.BeginCreateOrUpdate - // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated, http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginCreateOrUpdate func(ctx context.Context, resourceGroupName string, serverName string, firewallRuleName string, parameters armpostgresqlflexibleservers.FirewallRule, options *armpostgresqlflexibleservers.FirewallRulesClientBeginCreateOrUpdateOptions) (resp azfake.PollerResponder[armpostgresqlflexibleservers.FirewallRulesClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) // BeginDelete is the fake for method FirewallRulesClient.BeginDelete @@ -118,7 +118,7 @@ func (f *FirewallRulesServerTransport) dispatchBeginCreateOrUpdate(req *http.Req const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/firewallRules/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { + if len(matches) < 5 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } body, err := server.UnmarshalRequestAsJSON[armpostgresqlflexibleservers.FirewallRule](req) @@ -150,9 +150,9 @@ func (f *FirewallRulesServerTransport) dispatchBeginCreateOrUpdate(req *http.Req return nil, err } - if !contains([]int{http.StatusOK, http.StatusCreated, http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { f.beginCreateOrUpdate.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated, http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginCreateOrUpdate) { f.beginCreateOrUpdate.remove(req) @@ -170,7 +170,7 @@ func (f *FirewallRulesServerTransport) dispatchBeginDelete(req *http.Request) (* const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/firewallRules/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { + if len(matches) < 5 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -216,7 +216,7 @@ func (f *FirewallRulesServerTransport) dispatchGet(req *http.Request) (*http.Res const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/firewallRules/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { + if len(matches) < 5 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -255,7 +255,7 @@ func (f *FirewallRulesServerTransport) dispatchNewListByServerPager(req *http.Re const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/firewallRules` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { + if len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/flexibleserver_server.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/flexibleserver_server.go deleted file mode 100644 index 9dcf1e6b2a0a..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/flexibleserver_server.go +++ /dev/null @@ -1,187 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package fake - -import ( - "context" - "errors" - "fmt" - azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v5" - "net/http" - "net/url" - "regexp" -) - -// FlexibleServerServer is a fake server for instances of the armpostgresqlflexibleservers.FlexibleServerClient type. -type FlexibleServerServer struct { - // BeginStartLtrBackup is the fake for method FlexibleServerClient.BeginStartLtrBackup - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted - BeginStartLtrBackup func(ctx context.Context, resourceGroupName string, serverName string, parameters armpostgresqlflexibleservers.LtrBackupRequest, options *armpostgresqlflexibleservers.FlexibleServerClientBeginStartLtrBackupOptions) (resp azfake.PollerResponder[armpostgresqlflexibleservers.FlexibleServerClientStartLtrBackupResponse], errResp azfake.ErrorResponder) - - // TriggerLtrPreBackup is the fake for method FlexibleServerClient.TriggerLtrPreBackup - // HTTP status codes to indicate success: http.StatusOK - TriggerLtrPreBackup func(ctx context.Context, resourceGroupName string, serverName string, parameters armpostgresqlflexibleservers.LtrPreBackupRequest, options *armpostgresqlflexibleservers.FlexibleServerClientTriggerLtrPreBackupOptions) (resp azfake.Responder[armpostgresqlflexibleservers.FlexibleServerClientTriggerLtrPreBackupResponse], errResp azfake.ErrorResponder) -} - -// NewFlexibleServerServerTransport creates a new instance of FlexibleServerServerTransport with the provided implementation. -// The returned FlexibleServerServerTransport instance is connected to an instance of armpostgresqlflexibleservers.FlexibleServerClient via the -// azcore.ClientOptions.Transporter field in the client's constructor parameters. -func NewFlexibleServerServerTransport(srv *FlexibleServerServer) *FlexibleServerServerTransport { - return &FlexibleServerServerTransport{ - srv: srv, - beginStartLtrBackup: newTracker[azfake.PollerResponder[armpostgresqlflexibleservers.FlexibleServerClientStartLtrBackupResponse]](), - } -} - -// FlexibleServerServerTransport connects instances of armpostgresqlflexibleservers.FlexibleServerClient to instances of FlexibleServerServer. -// Don't use this type directly, use NewFlexibleServerServerTransport instead. -type FlexibleServerServerTransport struct { - srv *FlexibleServerServer - beginStartLtrBackup *tracker[azfake.PollerResponder[armpostgresqlflexibleservers.FlexibleServerClientStartLtrBackupResponse]] -} - -// Do implements the policy.Transporter interface for FlexibleServerServerTransport. -func (f *FlexibleServerServerTransport) Do(req *http.Request) (*http.Response, error) { - rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) - method, ok := rawMethod.(string) - if !ok { - return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} - } - - return f.dispatchToMethodFake(req, method) -} - -func (f *FlexibleServerServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - - go func() { - var intercepted bool - var res result - if flexibleServerTransportInterceptor != nil { - res.resp, res.err, intercepted = flexibleServerTransportInterceptor.Do(req) - } - if !intercepted { - switch method { - case "FlexibleServerClient.BeginStartLtrBackup": - res.resp, res.err = f.dispatchBeginStartLtrBackup(req) - case "FlexibleServerClient.TriggerLtrPreBackup": - res.resp, res.err = f.dispatchTriggerLtrPreBackup(req) - default: - res.err = fmt.Errorf("unhandled API %s", method) - } - - } - select { - case resultChan <- res: - case <-req.Context().Done(): - } - }() - - select { - case <-req.Context().Done(): - return nil, req.Context().Err() - case res := <-resultChan: - return res.resp, res.err - } -} - -func (f *FlexibleServerServerTransport) dispatchBeginStartLtrBackup(req *http.Request) (*http.Response, error) { - if f.srv.BeginStartLtrBackup == nil { - return nil, &nonRetriableError{errors.New("fake for method BeginStartLtrBackup not implemented")} - } - beginStartLtrBackup := f.beginStartLtrBackup.get(req) - if beginStartLtrBackup == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/startLtrBackup` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - body, err := server.UnmarshalRequestAsJSON[armpostgresqlflexibleservers.LtrBackupRequest](req) - if err != nil { - return nil, err - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - serverNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("serverName")]) - if err != nil { - return nil, err - } - respr, errRespr := f.srv.BeginStartLtrBackup(req.Context(), resourceGroupNameParam, serverNameParam, body, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - beginStartLtrBackup = &respr - f.beginStartLtrBackup.add(req, beginStartLtrBackup) - } - - resp, err := server.PollerResponderNext(beginStartLtrBackup, req) - if err != nil { - return nil, err - } - - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { - f.beginStartLtrBackup.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} - } - if !server.PollerResponderMore(beginStartLtrBackup) { - f.beginStartLtrBackup.remove(req) - } - - return resp, nil -} - -func (f *FlexibleServerServerTransport) dispatchTriggerLtrPreBackup(req *http.Request) (*http.Response, error) { - if f.srv.TriggerLtrPreBackup == nil { - return nil, &nonRetriableError{errors.New("fake for method TriggerLtrPreBackup not implemented")} - } - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/ltrPreBackup` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - body, err := server.UnmarshalRequestAsJSON[armpostgresqlflexibleservers.LtrPreBackupRequest](req) - if err != nil { - return nil, err - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - serverNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("serverName")]) - if err != nil { - return nil, err - } - respr, errRespr := f.srv.TriggerLtrPreBackup(req.Context(), resourceGroupNameParam, serverNameParam, body, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} - } - resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).LtrPreBackupResponse, req) - if err != nil { - return nil, err - } - if val := server.GetResponse(respr).XMSRequestID; val != nil { - resp.Header.Set("x-ms-request-id", *val) - } - return resp, nil -} - -// set this to conditionally intercept incoming requests to FlexibleServerServerTransport -var flexibleServerTransportInterceptor interface { - // Do returns true if the server transport should use the returned response/error - Do(*http.Request) (*http.Response, error, bool) -} diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/getprivatednszonesuffix_server.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/getprivatednszonesuffix_server.go deleted file mode 100644 index 3fc37a30a279..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/getprivatednszonesuffix_server.go +++ /dev/null @@ -1,106 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package fake - -import ( - "context" - "errors" - "fmt" - azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v5" - "net/http" -) - -// GetPrivateDNSZoneSuffixServer is a fake server for instances of the armpostgresqlflexibleservers.GetPrivateDNSZoneSuffixClient type. -type GetPrivateDNSZoneSuffixServer struct { - // Execute is the fake for method GetPrivateDNSZoneSuffixClient.Execute - // HTTP status codes to indicate success: http.StatusOK - Execute func(ctx context.Context, options *armpostgresqlflexibleservers.GetPrivateDNSZoneSuffixClientExecuteOptions) (resp azfake.Responder[armpostgresqlflexibleservers.GetPrivateDNSZoneSuffixClientExecuteResponse], errResp azfake.ErrorResponder) -} - -// NewGetPrivateDNSZoneSuffixServerTransport creates a new instance of GetPrivateDNSZoneSuffixServerTransport with the provided implementation. -// The returned GetPrivateDNSZoneSuffixServerTransport instance is connected to an instance of armpostgresqlflexibleservers.GetPrivateDNSZoneSuffixClient via the -// azcore.ClientOptions.Transporter field in the client's constructor parameters. -func NewGetPrivateDNSZoneSuffixServerTransport(srv *GetPrivateDNSZoneSuffixServer) *GetPrivateDNSZoneSuffixServerTransport { - return &GetPrivateDNSZoneSuffixServerTransport{srv: srv} -} - -// GetPrivateDNSZoneSuffixServerTransport connects instances of armpostgresqlflexibleservers.GetPrivateDNSZoneSuffixClient to instances of GetPrivateDNSZoneSuffixServer. -// Don't use this type directly, use NewGetPrivateDNSZoneSuffixServerTransport instead. -type GetPrivateDNSZoneSuffixServerTransport struct { - srv *GetPrivateDNSZoneSuffixServer -} - -// Do implements the policy.Transporter interface for GetPrivateDNSZoneSuffixServerTransport. -func (g *GetPrivateDNSZoneSuffixServerTransport) Do(req *http.Request) (*http.Response, error) { - rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) - method, ok := rawMethod.(string) - if !ok { - return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} - } - - return g.dispatchToMethodFake(req, method) -} - -func (g *GetPrivateDNSZoneSuffixServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - - go func() { - var intercepted bool - var res result - if getPrivateDnsZoneSuffixServerTransportInterceptor != nil { - res.resp, res.err, intercepted = getPrivateDnsZoneSuffixServerTransportInterceptor.Do(req) - } - if !intercepted { - switch method { - case "GetPrivateDNSZoneSuffixClient.Execute": - res.resp, res.err = g.dispatchExecute(req) - default: - res.err = fmt.Errorf("unhandled API %s", method) - } - - } - select { - case resultChan <- res: - case <-req.Context().Done(): - } - }() - - select { - case <-req.Context().Done(): - return nil, req.Context().Err() - case res := <-resultChan: - return res.resp, res.err - } -} - -func (g *GetPrivateDNSZoneSuffixServerTransport) dispatchExecute(req *http.Request) (*http.Response, error) { - if g.srv.Execute == nil { - return nil, &nonRetriableError{errors.New("fake for method Execute not implemented")} - } - respr, errRespr := g.srv.Execute(req.Context(), nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} - } - resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).Value, req) - if err != nil { - return nil, err - } - return resp, nil -} - -// set this to conditionally intercept incoming requests to GetPrivateDNSZoneSuffixServerTransport -var getPrivateDnsZoneSuffixServerTransportInterceptor interface { - // Do returns true if the server transport should use the returned response/error - Do(*http.Request) (*http.Response, error, bool) -} diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/locationbasedcapabilities_server.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/locationbasedcapabilities_server.go deleted file mode 100644 index 31bf420dd923..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/locationbasedcapabilities_server.go +++ /dev/null @@ -1,130 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package fake - -import ( - "errors" - "fmt" - azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v5" - "net/http" - "net/url" - "regexp" -) - -// LocationBasedCapabilitiesServer is a fake server for instances of the armpostgresqlflexibleservers.LocationBasedCapabilitiesClient type. -type LocationBasedCapabilitiesServer struct { - // NewExecutePager is the fake for method LocationBasedCapabilitiesClient.NewExecutePager - // HTTP status codes to indicate success: http.StatusOK - NewExecutePager func(locationName string, options *armpostgresqlflexibleservers.LocationBasedCapabilitiesClientExecuteOptions) (resp azfake.PagerResponder[armpostgresqlflexibleservers.LocationBasedCapabilitiesClientExecuteResponse]) -} - -// NewLocationBasedCapabilitiesServerTransport creates a new instance of LocationBasedCapabilitiesServerTransport with the provided implementation. -// The returned LocationBasedCapabilitiesServerTransport instance is connected to an instance of armpostgresqlflexibleservers.LocationBasedCapabilitiesClient via the -// azcore.ClientOptions.Transporter field in the client's constructor parameters. -func NewLocationBasedCapabilitiesServerTransport(srv *LocationBasedCapabilitiesServer) *LocationBasedCapabilitiesServerTransport { - return &LocationBasedCapabilitiesServerTransport{ - srv: srv, - newExecutePager: newTracker[azfake.PagerResponder[armpostgresqlflexibleservers.LocationBasedCapabilitiesClientExecuteResponse]](), - } -} - -// LocationBasedCapabilitiesServerTransport connects instances of armpostgresqlflexibleservers.LocationBasedCapabilitiesClient to instances of LocationBasedCapabilitiesServer. -// Don't use this type directly, use NewLocationBasedCapabilitiesServerTransport instead. -type LocationBasedCapabilitiesServerTransport struct { - srv *LocationBasedCapabilitiesServer - newExecutePager *tracker[azfake.PagerResponder[armpostgresqlflexibleservers.LocationBasedCapabilitiesClientExecuteResponse]] -} - -// Do implements the policy.Transporter interface for LocationBasedCapabilitiesServerTransport. -func (l *LocationBasedCapabilitiesServerTransport) Do(req *http.Request) (*http.Response, error) { - rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) - method, ok := rawMethod.(string) - if !ok { - return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} - } - - return l.dispatchToMethodFake(req, method) -} - -func (l *LocationBasedCapabilitiesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - - go func() { - var intercepted bool - var res result - if locationBasedCapabilitiesServerTransportInterceptor != nil { - res.resp, res.err, intercepted = locationBasedCapabilitiesServerTransportInterceptor.Do(req) - } - if !intercepted { - switch method { - case "LocationBasedCapabilitiesClient.NewExecutePager": - res.resp, res.err = l.dispatchNewExecutePager(req) - default: - res.err = fmt.Errorf("unhandled API %s", method) - } - - } - select { - case resultChan <- res: - case <-req.Context().Done(): - } - }() - - select { - case <-req.Context().Done(): - return nil, req.Context().Err() - case res := <-resultChan: - return res.resp, res.err - } -} - -func (l *LocationBasedCapabilitiesServerTransport) dispatchNewExecutePager(req *http.Request) (*http.Response, error) { - if l.srv.NewExecutePager == nil { - return nil, &nonRetriableError{errors.New("fake for method NewExecutePager not implemented")} - } - newExecutePager := l.newExecutePager.get(req) - if newExecutePager == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/locations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/capabilities` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 2 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - locationNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("locationName")]) - if err != nil { - return nil, err - } - resp := l.srv.NewExecutePager(locationNameParam, nil) - newExecutePager = &resp - l.newExecutePager.add(req, newExecutePager) - server.PagerResponderInjectNextLinks(newExecutePager, req, func(page *armpostgresqlflexibleservers.LocationBasedCapabilitiesClientExecuteResponse, createLink func() string) { - page.NextLink = to.Ptr(createLink()) - }) - } - resp, err := server.PagerResponderNext(newExecutePager, req) - if err != nil { - return nil, err - } - if !contains([]int{http.StatusOK}, resp.StatusCode) { - l.newExecutePager.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} - } - if !server.PagerResponderMore(newExecutePager) { - l.newExecutePager.remove(req) - } - return resp, nil -} - -// set this to conditionally intercept incoming requests to LocationBasedCapabilitiesServerTransport -var locationBasedCapabilitiesServerTransportInterceptor interface { - // Do returns true if the server transport should use the returned response/error - Do(*http.Request) (*http.Response, error, bool) -} diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/ltrbackupoperations_server.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/ltrbackupoperations_server.go deleted file mode 100644 index b17b97102512..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/ltrbackupoperations_server.go +++ /dev/null @@ -1,178 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package fake - -import ( - "context" - "errors" - "fmt" - azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v5" - "net/http" - "net/url" - "regexp" -) - -// LtrBackupOperationsServer is a fake server for instances of the armpostgresqlflexibleservers.LtrBackupOperationsClient type. -type LtrBackupOperationsServer struct { - // Get is the fake for method LtrBackupOperationsClient.Get - // HTTP status codes to indicate success: http.StatusOK - Get func(ctx context.Context, resourceGroupName string, serverName string, backupName string, options *armpostgresqlflexibleservers.LtrBackupOperationsClientGetOptions) (resp azfake.Responder[armpostgresqlflexibleservers.LtrBackupOperationsClientGetResponse], errResp azfake.ErrorResponder) - - // NewListByServerPager is the fake for method LtrBackupOperationsClient.NewListByServerPager - // HTTP status codes to indicate success: http.StatusOK - NewListByServerPager func(resourceGroupName string, serverName string, options *armpostgresqlflexibleservers.LtrBackupOperationsClientListByServerOptions) (resp azfake.PagerResponder[armpostgresqlflexibleservers.LtrBackupOperationsClientListByServerResponse]) -} - -// NewLtrBackupOperationsServerTransport creates a new instance of LtrBackupOperationsServerTransport with the provided implementation. -// The returned LtrBackupOperationsServerTransport instance is connected to an instance of armpostgresqlflexibleservers.LtrBackupOperationsClient via the -// azcore.ClientOptions.Transporter field in the client's constructor parameters. -func NewLtrBackupOperationsServerTransport(srv *LtrBackupOperationsServer) *LtrBackupOperationsServerTransport { - return &LtrBackupOperationsServerTransport{ - srv: srv, - newListByServerPager: newTracker[azfake.PagerResponder[armpostgresqlflexibleservers.LtrBackupOperationsClientListByServerResponse]](), - } -} - -// LtrBackupOperationsServerTransport connects instances of armpostgresqlflexibleservers.LtrBackupOperationsClient to instances of LtrBackupOperationsServer. -// Don't use this type directly, use NewLtrBackupOperationsServerTransport instead. -type LtrBackupOperationsServerTransport struct { - srv *LtrBackupOperationsServer - newListByServerPager *tracker[azfake.PagerResponder[armpostgresqlflexibleservers.LtrBackupOperationsClientListByServerResponse]] -} - -// Do implements the policy.Transporter interface for LtrBackupOperationsServerTransport. -func (l *LtrBackupOperationsServerTransport) Do(req *http.Request) (*http.Response, error) { - rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) - method, ok := rawMethod.(string) - if !ok { - return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} - } - - return l.dispatchToMethodFake(req, method) -} - -func (l *LtrBackupOperationsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - - go func() { - var intercepted bool - var res result - if ltrBackupOperationsServerTransportInterceptor != nil { - res.resp, res.err, intercepted = ltrBackupOperationsServerTransportInterceptor.Do(req) - } - if !intercepted { - switch method { - case "LtrBackupOperationsClient.Get": - res.resp, res.err = l.dispatchGet(req) - case "LtrBackupOperationsClient.NewListByServerPager": - res.resp, res.err = l.dispatchNewListByServerPager(req) - default: - res.err = fmt.Errorf("unhandled API %s", method) - } - - } - select { - case resultChan <- res: - case <-req.Context().Done(): - } - }() - - select { - case <-req.Context().Done(): - return nil, req.Context().Err() - case res := <-resultChan: - return res.resp, res.err - } -} - -func (l *LtrBackupOperationsServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { - if l.srv.Get == nil { - return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} - } - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/ltrBackupOperations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - serverNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("serverName")]) - if err != nil { - return nil, err - } - backupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("backupName")]) - if err != nil { - return nil, err - } - respr, errRespr := l.srv.Get(req.Context(), resourceGroupNameParam, serverNameParam, backupNameParam, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} - } - resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).LtrServerBackupOperation, req) - if err != nil { - return nil, err - } - return resp, nil -} - -func (l *LtrBackupOperationsServerTransport) dispatchNewListByServerPager(req *http.Request) (*http.Response, error) { - if l.srv.NewListByServerPager == nil { - return nil, &nonRetriableError{errors.New("fake for method NewListByServerPager not implemented")} - } - newListByServerPager := l.newListByServerPager.get(req) - if newListByServerPager == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/ltrBackupOperations` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - serverNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("serverName")]) - if err != nil { - return nil, err - } - resp := l.srv.NewListByServerPager(resourceGroupNameParam, serverNameParam, nil) - newListByServerPager = &resp - l.newListByServerPager.add(req, newListByServerPager) - server.PagerResponderInjectNextLinks(newListByServerPager, req, func(page *armpostgresqlflexibleservers.LtrBackupOperationsClientListByServerResponse, createLink func() string) { - page.NextLink = to.Ptr(createLink()) - }) - } - resp, err := server.PagerResponderNext(newListByServerPager, req) - if err != nil { - return nil, err - } - if !contains([]int{http.StatusOK}, resp.StatusCode) { - l.newListByServerPager.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} - } - if !server.PagerResponderMore(newListByServerPager) { - l.newListByServerPager.remove(req) - } - return resp, nil -} - -// set this to conditionally intercept incoming requests to LtrBackupOperationsServerTransport -var ltrBackupOperationsServerTransportInterceptor interface { - // Do returns true if the server transport should use the returned response/error - Do(*http.Request) (*http.Response, error, bool) -} diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/migrations_server.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/migrations_server.go index 6e1e47cd365d..702d38a8dcf4 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/migrations_server.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/migrations_server.go @@ -21,25 +21,29 @@ import ( // MigrationsServer is a fake server for instances of the armpostgresqlflexibleservers.MigrationsClient type. type MigrationsServer struct { + // Cancel is the fake for method MigrationsClient.Cancel + // HTTP status codes to indicate success: http.StatusOK, http.StatusNoContent + Cancel func(ctx context.Context, resourceGroupName string, serverName string, migrationName string, options *armpostgresqlflexibleservers.MigrationsClientCancelOptions) (resp azfake.Responder[armpostgresqlflexibleservers.MigrationsClientCancelResponse], errResp azfake.ErrorResponder) + + // CheckNameAvailability is the fake for method MigrationsClient.CheckNameAvailability + // HTTP status codes to indicate success: http.StatusOK + CheckNameAvailability func(ctx context.Context, resourceGroupName string, serverName string, parameters armpostgresqlflexibleservers.MigrationNameAvailability, options *armpostgresqlflexibleservers.MigrationsClientCheckNameAvailabilityOptions) (resp azfake.Responder[armpostgresqlflexibleservers.MigrationsClientCheckNameAvailabilityResponse], errResp azfake.ErrorResponder) + // Create is the fake for method MigrationsClient.Create // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated - Create func(ctx context.Context, subscriptionID string, resourceGroupName string, targetDbServerName string, migrationName string, parameters armpostgresqlflexibleservers.MigrationResource, options *armpostgresqlflexibleservers.MigrationsClientCreateOptions) (resp azfake.Responder[armpostgresqlflexibleservers.MigrationsClientCreateResponse], errResp azfake.ErrorResponder) - - // Delete is the fake for method MigrationsClient.Delete - // HTTP status codes to indicate success: http.StatusOK, http.StatusNoContent - Delete func(ctx context.Context, subscriptionID string, resourceGroupName string, targetDbServerName string, migrationName string, options *armpostgresqlflexibleservers.MigrationsClientDeleteOptions) (resp azfake.Responder[armpostgresqlflexibleservers.MigrationsClientDeleteResponse], errResp azfake.ErrorResponder) + Create func(ctx context.Context, resourceGroupName string, serverName string, migrationName string, parameters armpostgresqlflexibleservers.Migration, options *armpostgresqlflexibleservers.MigrationsClientCreateOptions) (resp azfake.Responder[armpostgresqlflexibleservers.MigrationsClientCreateResponse], errResp azfake.ErrorResponder) // Get is the fake for method MigrationsClient.Get // HTTP status codes to indicate success: http.StatusOK - Get func(ctx context.Context, subscriptionID string, resourceGroupName string, targetDbServerName string, migrationName string, options *armpostgresqlflexibleservers.MigrationsClientGetOptions) (resp azfake.Responder[armpostgresqlflexibleservers.MigrationsClientGetResponse], errResp azfake.ErrorResponder) + Get func(ctx context.Context, resourceGroupName string, serverName string, migrationName string, options *armpostgresqlflexibleservers.MigrationsClientGetOptions) (resp azfake.Responder[armpostgresqlflexibleservers.MigrationsClientGetResponse], errResp azfake.ErrorResponder) // NewListByTargetServerPager is the fake for method MigrationsClient.NewListByTargetServerPager // HTTP status codes to indicate success: http.StatusOK - NewListByTargetServerPager func(subscriptionID string, resourceGroupName string, targetDbServerName string, options *armpostgresqlflexibleservers.MigrationsClientListByTargetServerOptions) (resp azfake.PagerResponder[armpostgresqlflexibleservers.MigrationsClientListByTargetServerResponse]) + NewListByTargetServerPager func(resourceGroupName string, serverName string, options *armpostgresqlflexibleservers.MigrationsClientListByTargetServerOptions) (resp azfake.PagerResponder[armpostgresqlflexibleservers.MigrationsClientListByTargetServerResponse]) // Update is the fake for method MigrationsClient.Update // HTTP status codes to indicate success: http.StatusOK - Update func(ctx context.Context, subscriptionID string, resourceGroupName string, targetDbServerName string, migrationName string, parameters armpostgresqlflexibleservers.MigrationResourceForPatch, options *armpostgresqlflexibleservers.MigrationsClientUpdateOptions) (resp azfake.Responder[armpostgresqlflexibleservers.MigrationsClientUpdateResponse], errResp azfake.ErrorResponder) + Update func(ctx context.Context, resourceGroupName string, serverName string, migrationName string, parameters armpostgresqlflexibleservers.MigrationResourceForPatch, options *armpostgresqlflexibleservers.MigrationsClientUpdateOptions) (resp azfake.Responder[armpostgresqlflexibleservers.MigrationsClientUpdateResponse], errResp azfake.ErrorResponder) } // NewMigrationsServerTransport creates a new instance of MigrationsServerTransport with the provided implementation. @@ -82,10 +86,12 @@ func (m *MigrationsServerTransport) dispatchToMethodFake(req *http.Request, meth } if !intercepted { switch method { + case "MigrationsClient.Cancel": + res.resp, res.err = m.dispatchCancel(req) + case "MigrationsClient.CheckNameAvailability": + res.resp, res.err = m.dispatchCheckNameAvailability(req) case "MigrationsClient.Create": res.resp, res.err = m.dispatchCreate(req) - case "MigrationsClient.Delete": - res.resp, res.err = m.dispatchDelete(req) case "MigrationsClient.Get": res.resp, res.err = m.dispatchGet(req) case "MigrationsClient.NewListByTargetServerPager": @@ -111,62 +117,91 @@ func (m *MigrationsServerTransport) dispatchToMethodFake(req *http.Request, meth } } -func (m *MigrationsServerTransport) dispatchCreate(req *http.Request) (*http.Response, error) { - if m.srv.Create == nil { - return nil, &nonRetriableError{errors.New("fake for method Create not implemented")} +func (m *MigrationsServerTransport) dispatchCancel(req *http.Request) (*http.Response, error) { + if m.srv.Cancel == nil { + return nil, &nonRetriableError{errors.New("fake for method Cancel not implemented")} } - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/migrations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/migrations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { + if len(matches) < 5 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } - body, err := server.UnmarshalRequestAsJSON[armpostgresqlflexibleservers.MigrationResource](req) + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) if err != nil { return nil, err } - subscriptionIDParam, err := url.PathUnescape(matches[regex.SubexpIndex("subscriptionId")]) + serverNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("serverName")]) if err != nil { return nil, err } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + migrationNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("migrationName")]) if err != nil { return nil, err } - targetDbServerNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("targetDbServerName")]) + respr, errRespr := m.srv.Cancel(req.Context(), resourceGroupNameParam, serverNameParam, migrationNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK, http.StatusNoContent}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusNoContent", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).Migration, req) if err != nil { return nil, err } - migrationNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("migrationName")]) + return resp, nil +} + +func (m *MigrationsServerTransport) dispatchCheckNameAvailability(req *http.Request) (*http.Response, error) { + if m.srv.CheckNameAvailability == nil { + return nil, &nonRetriableError{errors.New("fake for method CheckNameAvailability not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/checkMigrationNameAvailability` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armpostgresqlflexibleservers.MigrationNameAvailability](req) if err != nil { return nil, err } - respr, errRespr := m.srv.Create(req.Context(), subscriptionIDParam, resourceGroupNameParam, targetDbServerNameParam, migrationNameParam, body, nil) + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + serverNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("serverName")]) + if err != nil { + return nil, err + } + respr, errRespr := m.srv.CheckNameAvailability(req.Context(), resourceGroupNameParam, serverNameParam, body, nil) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK, http.StatusCreated}, respContent.HTTPStatus) { - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", respContent.HTTPStatus)} + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } - resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).MigrationResource, req) + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).MigrationNameAvailability, req) if err != nil { return nil, err } return resp, nil } -func (m *MigrationsServerTransport) dispatchDelete(req *http.Request) (*http.Response, error) { - if m.srv.Delete == nil { - return nil, &nonRetriableError{errors.New("fake for method Delete not implemented")} +func (m *MigrationsServerTransport) dispatchCreate(req *http.Request) (*http.Response, error) { + if m.srv.Create == nil { + return nil, &nonRetriableError{errors.New("fake for method Create not implemented")} } - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/migrations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/migrations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { + if len(matches) < 5 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } - subscriptionIDParam, err := url.PathUnescape(matches[regex.SubexpIndex("subscriptionId")]) + body, err := server.UnmarshalRequestAsJSON[armpostgresqlflexibleservers.Migration](req) if err != nil { return nil, err } @@ -174,7 +209,7 @@ func (m *MigrationsServerTransport) dispatchDelete(req *http.Request) (*http.Res if err != nil { return nil, err } - targetDbServerNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("targetDbServerName")]) + serverNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("serverName")]) if err != nil { return nil, err } @@ -182,15 +217,15 @@ func (m *MigrationsServerTransport) dispatchDelete(req *http.Request) (*http.Res if err != nil { return nil, err } - respr, errRespr := m.srv.Delete(req.Context(), subscriptionIDParam, resourceGroupNameParam, targetDbServerNameParam, migrationNameParam, nil) + respr, errRespr := m.srv.Create(req.Context(), resourceGroupNameParam, serverNameParam, migrationNameParam, body, nil) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK, http.StatusNoContent}, respContent.HTTPStatus) { - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusNoContent", respContent.HTTPStatus)} + if !contains([]int{http.StatusOK, http.StatusCreated}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", respContent.HTTPStatus)} } - resp, err := server.NewResponse(respContent, req, nil) + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).Migration, req) if err != nil { return nil, err } @@ -201,21 +236,17 @@ func (m *MigrationsServerTransport) dispatchGet(req *http.Request) (*http.Respon if m.srv.Get == nil { return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} } - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/migrations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/migrations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { + if len(matches) < 5 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } - subscriptionIDParam, err := url.PathUnescape(matches[regex.SubexpIndex("subscriptionId")]) - if err != nil { - return nil, err - } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) if err != nil { return nil, err } - targetDbServerNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("targetDbServerName")]) + serverNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("serverName")]) if err != nil { return nil, err } @@ -223,7 +254,7 @@ func (m *MigrationsServerTransport) dispatchGet(req *http.Request) (*http.Respon if err != nil { return nil, err } - respr, errRespr := m.srv.Get(req.Context(), subscriptionIDParam, resourceGroupNameParam, targetDbServerNameParam, migrationNameParam, nil) + respr, errRespr := m.srv.Get(req.Context(), resourceGroupNameParam, serverNameParam, migrationNameParam, nil) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } @@ -231,7 +262,7 @@ func (m *MigrationsServerTransport) dispatchGet(req *http.Request) (*http.Respon if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } - resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).MigrationResource, req) + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).Migration, req) if err != nil { return nil, err } @@ -244,22 +275,18 @@ func (m *MigrationsServerTransport) dispatchNewListByTargetServerPager(req *http } newListByTargetServerPager := m.newListByTargetServerPager.get(req) if newListByTargetServerPager == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/migrations` + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/migrations` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { + if len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } qp := req.URL.Query() - subscriptionIDParam, err := url.PathUnescape(matches[regex.SubexpIndex("subscriptionId")]) - if err != nil { - return nil, err - } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) if err != nil { return nil, err } - targetDbServerNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("targetDbServerName")]) + serverNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("serverName")]) if err != nil { return nil, err } @@ -274,7 +301,7 @@ func (m *MigrationsServerTransport) dispatchNewListByTargetServerPager(req *http MigrationListFilter: migrationListFilterParam, } } - resp := m.srv.NewListByTargetServerPager(subscriptionIDParam, resourceGroupNameParam, targetDbServerNameParam, options) + resp := m.srv.NewListByTargetServerPager(resourceGroupNameParam, serverNameParam, options) newListByTargetServerPager = &resp m.newListByTargetServerPager.add(req, newListByTargetServerPager) server.PagerResponderInjectNextLinks(newListByTargetServerPager, req, func(page *armpostgresqlflexibleservers.MigrationsClientListByTargetServerResponse, createLink func() string) { @@ -299,25 +326,21 @@ func (m *MigrationsServerTransport) dispatchUpdate(req *http.Request) (*http.Res if m.srv.Update == nil { return nil, &nonRetriableError{errors.New("fake for method Update not implemented")} } - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/migrations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/migrations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { + if len(matches) < 5 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } body, err := server.UnmarshalRequestAsJSON[armpostgresqlflexibleservers.MigrationResourceForPatch](req) if err != nil { return nil, err } - subscriptionIDParam, err := url.PathUnescape(matches[regex.SubexpIndex("subscriptionId")]) - if err != nil { - return nil, err - } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) if err != nil { return nil, err } - targetDbServerNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("targetDbServerName")]) + serverNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("serverName")]) if err != nil { return nil, err } @@ -325,7 +348,7 @@ func (m *MigrationsServerTransport) dispatchUpdate(req *http.Request) (*http.Res if err != nil { return nil, err } - respr, errRespr := m.srv.Update(req.Context(), subscriptionIDParam, resourceGroupNameParam, targetDbServerNameParam, migrationNameParam, body, nil) + respr, errRespr := m.srv.Update(req.Context(), resourceGroupNameParam, serverNameParam, migrationNameParam, body, nil) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } @@ -333,7 +356,7 @@ func (m *MigrationsServerTransport) dispatchUpdate(req *http.Request) (*http.Res if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } - resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).MigrationResource, req) + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).Migration, req) if err != nil { return nil, err } diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/nameavailability_server.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/nameavailability_server.go new file mode 100644 index 000000000000..879c59b19540 --- /dev/null +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/nameavailability_server.go @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package fake + +import ( + "context" + "errors" + "fmt" + azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v5" + "net/http" + "net/url" + "regexp" +) + +// NameAvailabilityServer is a fake server for instances of the armpostgresqlflexibleservers.NameAvailabilityClient type. +type NameAvailabilityServer struct { + // CheckGlobally is the fake for method NameAvailabilityClient.CheckGlobally + // HTTP status codes to indicate success: http.StatusOK + CheckGlobally func(ctx context.Context, parameters armpostgresqlflexibleservers.CheckNameAvailabilityRequest, options *armpostgresqlflexibleservers.NameAvailabilityClientCheckGloballyOptions) (resp azfake.Responder[armpostgresqlflexibleservers.NameAvailabilityClientCheckGloballyResponse], errResp azfake.ErrorResponder) + + // CheckWithLocation is the fake for method NameAvailabilityClient.CheckWithLocation + // HTTP status codes to indicate success: http.StatusOK + CheckWithLocation func(ctx context.Context, locationName string, parameters armpostgresqlflexibleservers.CheckNameAvailabilityRequest, options *armpostgresqlflexibleservers.NameAvailabilityClientCheckWithLocationOptions) (resp azfake.Responder[armpostgresqlflexibleservers.NameAvailabilityClientCheckWithLocationResponse], errResp azfake.ErrorResponder) +} + +// NewNameAvailabilityServerTransport creates a new instance of NameAvailabilityServerTransport with the provided implementation. +// The returned NameAvailabilityServerTransport instance is connected to an instance of armpostgresqlflexibleservers.NameAvailabilityClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewNameAvailabilityServerTransport(srv *NameAvailabilityServer) *NameAvailabilityServerTransport { + return &NameAvailabilityServerTransport{srv: srv} +} + +// NameAvailabilityServerTransport connects instances of armpostgresqlflexibleservers.NameAvailabilityClient to instances of NameAvailabilityServer. +// Don't use this type directly, use NewNameAvailabilityServerTransport instead. +type NameAvailabilityServerTransport struct { + srv *NameAvailabilityServer +} + +// Do implements the policy.Transporter interface for NameAvailabilityServerTransport. +func (n *NameAvailabilityServerTransport) Do(req *http.Request) (*http.Response, error) { + rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) + method, ok := rawMethod.(string) + if !ok { + return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} + } + + return n.dispatchToMethodFake(req, method) +} + +func (n *NameAvailabilityServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) + + go func() { + var intercepted bool + var res result + if nameAvailabilityServerTransportInterceptor != nil { + res.resp, res.err, intercepted = nameAvailabilityServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "NameAvailabilityClient.CheckGlobally": + res.resp, res.err = n.dispatchCheckGlobally(req) + case "NameAvailabilityClient.CheckWithLocation": + res.resp, res.err = n.dispatchCheckWithLocation(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } + + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } +} + +func (n *NameAvailabilityServerTransport) dispatchCheckGlobally(req *http.Request) (*http.Response, error) { + if n.srv.CheckGlobally == nil { + return nil, &nonRetriableError{errors.New("fake for method CheckGlobally not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/checkNameAvailability` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if len(matches) < 2 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armpostgresqlflexibleservers.CheckNameAvailabilityRequest](req) + if err != nil { + return nil, err + } + respr, errRespr := n.srv.CheckGlobally(req.Context(), body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).NameAvailabilityModel, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (n *NameAvailabilityServerTransport) dispatchCheckWithLocation(req *http.Request) (*http.Response, error) { + if n.srv.CheckWithLocation == nil { + return nil, &nonRetriableError{errors.New("fake for method CheckWithLocation not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/locations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/checkNameAvailability` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armpostgresqlflexibleservers.CheckNameAvailabilityRequest](req) + if err != nil { + return nil, err + } + locationNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("locationName")]) + if err != nil { + return nil, err + } + respr, errRespr := n.srv.CheckWithLocation(req.Context(), locationNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).NameAvailabilityModel, req) + if err != nil { + return nil, err + } + return resp, nil +} + +// set this to conditionally intercept incoming requests to NameAvailabilityServerTransport +var nameAvailabilityServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/postgresqlmanagement_server.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/postgresqlmanagement_server.go deleted file mode 100644 index 2267ba6c8bed..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/postgresqlmanagement_server.go +++ /dev/null @@ -1,130 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package fake - -import ( - "context" - "errors" - "fmt" - azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v5" - "net/http" - "net/url" - "regexp" -) - -// PostgreSQLManagementServer is a fake server for instances of the armpostgresqlflexibleservers.PostgreSQLManagementClient type. -type PostgreSQLManagementServer struct { - // CheckMigrationNameAvailability is the fake for method PostgreSQLManagementClient.CheckMigrationNameAvailability - // HTTP status codes to indicate success: http.StatusOK - CheckMigrationNameAvailability func(ctx context.Context, subscriptionID string, resourceGroupName string, targetDbServerName string, parameters armpostgresqlflexibleservers.MigrationNameAvailabilityResource, options *armpostgresqlflexibleservers.PostgreSQLManagementClientCheckMigrationNameAvailabilityOptions) (resp azfake.Responder[armpostgresqlflexibleservers.PostgreSQLManagementClientCheckMigrationNameAvailabilityResponse], errResp azfake.ErrorResponder) -} - -// NewPostgreSQLManagementServerTransport creates a new instance of PostgreSQLManagementServerTransport with the provided implementation. -// The returned PostgreSQLManagementServerTransport instance is connected to an instance of armpostgresqlflexibleservers.PostgreSQLManagementClient via the -// azcore.ClientOptions.Transporter field in the client's constructor parameters. -func NewPostgreSQLManagementServerTransport(srv *PostgreSQLManagementServer) *PostgreSQLManagementServerTransport { - return &PostgreSQLManagementServerTransport{srv: srv} -} - -// PostgreSQLManagementServerTransport connects instances of armpostgresqlflexibleservers.PostgreSQLManagementClient to instances of PostgreSQLManagementServer. -// Don't use this type directly, use NewPostgreSQLManagementServerTransport instead. -type PostgreSQLManagementServerTransport struct { - srv *PostgreSQLManagementServer -} - -// Do implements the policy.Transporter interface for PostgreSQLManagementServerTransport. -func (p *PostgreSQLManagementServerTransport) Do(req *http.Request) (*http.Response, error) { - rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) - method, ok := rawMethod.(string) - if !ok { - return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} - } - - return p.dispatchToMethodFake(req, method) -} - -func (p *PostgreSQLManagementServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - - go func() { - var intercepted bool - var res result - if postgreSqlManagementServerTransportInterceptor != nil { - res.resp, res.err, intercepted = postgreSqlManagementServerTransportInterceptor.Do(req) - } - if !intercepted { - switch method { - case "PostgreSQLManagementClient.CheckMigrationNameAvailability": - res.resp, res.err = p.dispatchCheckMigrationNameAvailability(req) - default: - res.err = fmt.Errorf("unhandled API %s", method) - } - - } - select { - case resultChan <- res: - case <-req.Context().Done(): - } - }() - - select { - case <-req.Context().Done(): - return nil, req.Context().Err() - case res := <-resultChan: - return res.resp, res.err - } -} - -func (p *PostgreSQLManagementServerTransport) dispatchCheckMigrationNameAvailability(req *http.Request) (*http.Response, error) { - if p.srv.CheckMigrationNameAvailability == nil { - return nil, &nonRetriableError{errors.New("fake for method CheckMigrationNameAvailability not implemented")} - } - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/checkMigrationNameAvailability` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - body, err := server.UnmarshalRequestAsJSON[armpostgresqlflexibleservers.MigrationNameAvailabilityResource](req) - if err != nil { - return nil, err - } - subscriptionIDParam, err := url.PathUnescape(matches[regex.SubexpIndex("subscriptionId")]) - if err != nil { - return nil, err - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - targetDbServerNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("targetDbServerName")]) - if err != nil { - return nil, err - } - respr, errRespr := p.srv.CheckMigrationNameAvailability(req.Context(), subscriptionIDParam, resourceGroupNameParam, targetDbServerNameParam, body, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} - } - resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).MigrationNameAvailabilityResource, req) - if err != nil { - return nil, err - } - return resp, nil -} - -// set this to conditionally intercept incoming requests to PostgreSQLManagementServerTransport -var postgreSqlManagementServerTransportInterceptor interface { - // Do returns true if the server transport should use the returned response/error - Do(*http.Request) (*http.Response, error, bool) -} diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/privatednszonesuffix_server.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/privatednszonesuffix_server.go new file mode 100644 index 000000000000..fefdf970715e --- /dev/null +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/privatednszonesuffix_server.go @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package fake + +import ( + "context" + "errors" + "fmt" + azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v5" + "net/http" +) + +// PrivateDNSZoneSuffixServer is a fake server for instances of the armpostgresqlflexibleservers.PrivateDNSZoneSuffixClient type. +type PrivateDNSZoneSuffixServer struct { + // Get is the fake for method PrivateDNSZoneSuffixClient.Get + // HTTP status codes to indicate success: http.StatusOK + Get func(ctx context.Context, options *armpostgresqlflexibleservers.PrivateDNSZoneSuffixClientGetOptions) (resp azfake.Responder[armpostgresqlflexibleservers.PrivateDNSZoneSuffixClientGetResponse], errResp azfake.ErrorResponder) +} + +// NewPrivateDNSZoneSuffixServerTransport creates a new instance of PrivateDNSZoneSuffixServerTransport with the provided implementation. +// The returned PrivateDNSZoneSuffixServerTransport instance is connected to an instance of armpostgresqlflexibleservers.PrivateDNSZoneSuffixClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewPrivateDNSZoneSuffixServerTransport(srv *PrivateDNSZoneSuffixServer) *PrivateDNSZoneSuffixServerTransport { + return &PrivateDNSZoneSuffixServerTransport{srv: srv} +} + +// PrivateDNSZoneSuffixServerTransport connects instances of armpostgresqlflexibleservers.PrivateDNSZoneSuffixClient to instances of PrivateDNSZoneSuffixServer. +// Don't use this type directly, use NewPrivateDNSZoneSuffixServerTransport instead. +type PrivateDNSZoneSuffixServerTransport struct { + srv *PrivateDNSZoneSuffixServer +} + +// Do implements the policy.Transporter interface for PrivateDNSZoneSuffixServerTransport. +func (p *PrivateDNSZoneSuffixServerTransport) Do(req *http.Request) (*http.Response, error) { + rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) + method, ok := rawMethod.(string) + if !ok { + return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} + } + + return p.dispatchToMethodFake(req, method) +} + +func (p *PrivateDNSZoneSuffixServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) + + go func() { + var intercepted bool + var res result + if privateDnsZoneSuffixServerTransportInterceptor != nil { + res.resp, res.err, intercepted = privateDnsZoneSuffixServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "PrivateDNSZoneSuffixClient.Get": + res.resp, res.err = p.dispatchGet(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } + + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } +} + +func (p *PrivateDNSZoneSuffixServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { + if p.srv.Get == nil { + return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} + } + respr, errRespr := p.srv.Get(req.Context(), nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).Value, req) + if err != nil { + return nil, err + } + return resp, nil +} + +// set this to conditionally intercept incoming requests to PrivateDNSZoneSuffixServerTransport +var privateDnsZoneSuffixServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/privateendpointconnection_server.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/privateendpointconnection_server.go deleted file mode 100644 index 92e33845f55a..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/privateendpointconnection_server.go +++ /dev/null @@ -1,201 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package fake - -import ( - "context" - "errors" - "fmt" - azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v5" - "net/http" - "net/url" - "regexp" -) - -// PrivateEndpointConnectionServer is a fake server for instances of the armpostgresqlflexibleservers.PrivateEndpointConnectionClient type. -type PrivateEndpointConnectionServer struct { - // BeginDelete is the fake for method PrivateEndpointConnectionClient.BeginDelete - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent - BeginDelete func(ctx context.Context, resourceGroupName string, serverName string, privateEndpointConnectionName string, options *armpostgresqlflexibleservers.PrivateEndpointConnectionClientBeginDeleteOptions) (resp azfake.PollerResponder[armpostgresqlflexibleservers.PrivateEndpointConnectionClientDeleteResponse], errResp azfake.ErrorResponder) - - // BeginUpdate is the fake for method PrivateEndpointConnectionClient.BeginUpdate - // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated, http.StatusAccepted - BeginUpdate func(ctx context.Context, resourceGroupName string, serverName string, privateEndpointConnectionName string, parameters armpostgresqlflexibleservers.PrivateEndpointConnection, options *armpostgresqlflexibleservers.PrivateEndpointConnectionClientBeginUpdateOptions) (resp azfake.PollerResponder[armpostgresqlflexibleservers.PrivateEndpointConnectionClientUpdateResponse], errResp azfake.ErrorResponder) -} - -// NewPrivateEndpointConnectionServerTransport creates a new instance of PrivateEndpointConnectionServerTransport with the provided implementation. -// The returned PrivateEndpointConnectionServerTransport instance is connected to an instance of armpostgresqlflexibleservers.PrivateEndpointConnectionClient via the -// azcore.ClientOptions.Transporter field in the client's constructor parameters. -func NewPrivateEndpointConnectionServerTransport(srv *PrivateEndpointConnectionServer) *PrivateEndpointConnectionServerTransport { - return &PrivateEndpointConnectionServerTransport{ - srv: srv, - beginDelete: newTracker[azfake.PollerResponder[armpostgresqlflexibleservers.PrivateEndpointConnectionClientDeleteResponse]](), - beginUpdate: newTracker[azfake.PollerResponder[armpostgresqlflexibleservers.PrivateEndpointConnectionClientUpdateResponse]](), - } -} - -// PrivateEndpointConnectionServerTransport connects instances of armpostgresqlflexibleservers.PrivateEndpointConnectionClient to instances of PrivateEndpointConnectionServer. -// Don't use this type directly, use NewPrivateEndpointConnectionServerTransport instead. -type PrivateEndpointConnectionServerTransport struct { - srv *PrivateEndpointConnectionServer - beginDelete *tracker[azfake.PollerResponder[armpostgresqlflexibleservers.PrivateEndpointConnectionClientDeleteResponse]] - beginUpdate *tracker[azfake.PollerResponder[armpostgresqlflexibleservers.PrivateEndpointConnectionClientUpdateResponse]] -} - -// Do implements the policy.Transporter interface for PrivateEndpointConnectionServerTransport. -func (p *PrivateEndpointConnectionServerTransport) Do(req *http.Request) (*http.Response, error) { - rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) - method, ok := rawMethod.(string) - if !ok { - return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} - } - - return p.dispatchToMethodFake(req, method) -} - -func (p *PrivateEndpointConnectionServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - - go func() { - var intercepted bool - var res result - if privateEndpointConnectionServerTransportInterceptor != nil { - res.resp, res.err, intercepted = privateEndpointConnectionServerTransportInterceptor.Do(req) - } - if !intercepted { - switch method { - case "PrivateEndpointConnectionClient.BeginDelete": - res.resp, res.err = p.dispatchBeginDelete(req) - case "PrivateEndpointConnectionClient.BeginUpdate": - res.resp, res.err = p.dispatchBeginUpdate(req) - default: - res.err = fmt.Errorf("unhandled API %s", method) - } - - } - select { - case resultChan <- res: - case <-req.Context().Done(): - } - }() - - select { - case <-req.Context().Done(): - return nil, req.Context().Err() - case res := <-resultChan: - return res.resp, res.err - } -} - -func (p *PrivateEndpointConnectionServerTransport) dispatchBeginDelete(req *http.Request) (*http.Response, error) { - if p.srv.BeginDelete == nil { - return nil, &nonRetriableError{errors.New("fake for method BeginDelete not implemented")} - } - beginDelete := p.beginDelete.get(req) - if beginDelete == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/privateEndpointConnections/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - serverNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("serverName")]) - if err != nil { - return nil, err - } - privateEndpointConnectionNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("privateEndpointConnectionName")]) - if err != nil { - return nil, err - } - respr, errRespr := p.srv.BeginDelete(req.Context(), resourceGroupNameParam, serverNameParam, privateEndpointConnectionNameParam, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - beginDelete = &respr - p.beginDelete.add(req, beginDelete) - } - - resp, err := server.PollerResponderNext(beginDelete, req) - if err != nil { - return nil, err - } - - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { - p.beginDelete.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} - } - if !server.PollerResponderMore(beginDelete) { - p.beginDelete.remove(req) - } - - return resp, nil -} - -func (p *PrivateEndpointConnectionServerTransport) dispatchBeginUpdate(req *http.Request) (*http.Response, error) { - if p.srv.BeginUpdate == nil { - return nil, &nonRetriableError{errors.New("fake for method BeginUpdate not implemented")} - } - beginUpdate := p.beginUpdate.get(req) - if beginUpdate == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/privateEndpointConnections/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - body, err := server.UnmarshalRequestAsJSON[armpostgresqlflexibleservers.PrivateEndpointConnection](req) - if err != nil { - return nil, err - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - serverNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("serverName")]) - if err != nil { - return nil, err - } - privateEndpointConnectionNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("privateEndpointConnectionName")]) - if err != nil { - return nil, err - } - respr, errRespr := p.srv.BeginUpdate(req.Context(), resourceGroupNameParam, serverNameParam, privateEndpointConnectionNameParam, body, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - beginUpdate = &respr - p.beginUpdate.add(req, beginUpdate) - } - - resp, err := server.PollerResponderNext(beginUpdate, req) - if err != nil { - return nil, err - } - - if !contains([]int{http.StatusOK, http.StatusCreated, http.StatusAccepted}, resp.StatusCode) { - p.beginUpdate.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated, http.StatusAccepted", resp.StatusCode)} - } - if !server.PollerResponderMore(beginUpdate) { - p.beginUpdate.remove(req) - } - - return resp, nil -} - -// set this to conditionally intercept incoming requests to PrivateEndpointConnectionServerTransport -var privateEndpointConnectionServerTransportInterceptor interface { - // Do returns true if the server transport should use the returned response/error - Do(*http.Request) (*http.Response, error, bool) -} diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/privateendpointconnections_server.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/privateendpointconnections_server.go index 35286904b769..d757c7f2350f 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/privateendpointconnections_server.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/privateendpointconnections_server.go @@ -21,6 +21,10 @@ import ( // PrivateEndpointConnectionsServer is a fake server for instances of the armpostgresqlflexibleservers.PrivateEndpointConnectionsClient type. type PrivateEndpointConnectionsServer struct { + // BeginDelete is the fake for method PrivateEndpointConnectionsClient.BeginDelete + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent + BeginDelete func(ctx context.Context, resourceGroupName string, serverName string, privateEndpointConnectionName string, options *armpostgresqlflexibleservers.PrivateEndpointConnectionsClientBeginDeleteOptions) (resp azfake.PollerResponder[armpostgresqlflexibleservers.PrivateEndpointConnectionsClientDeleteResponse], errResp azfake.ErrorResponder) + // Get is the fake for method PrivateEndpointConnectionsClient.Get // HTTP status codes to indicate success: http.StatusOK Get func(ctx context.Context, resourceGroupName string, serverName string, privateEndpointConnectionName string, options *armpostgresqlflexibleservers.PrivateEndpointConnectionsClientGetOptions) (resp azfake.Responder[armpostgresqlflexibleservers.PrivateEndpointConnectionsClientGetResponse], errResp azfake.ErrorResponder) @@ -28,6 +32,10 @@ type PrivateEndpointConnectionsServer struct { // NewListByServerPager is the fake for method PrivateEndpointConnectionsClient.NewListByServerPager // HTTP status codes to indicate success: http.StatusOK NewListByServerPager func(resourceGroupName string, serverName string, options *armpostgresqlflexibleservers.PrivateEndpointConnectionsClientListByServerOptions) (resp azfake.PagerResponder[armpostgresqlflexibleservers.PrivateEndpointConnectionsClientListByServerResponse]) + + // BeginUpdate is the fake for method PrivateEndpointConnectionsClient.BeginUpdate + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent + BeginUpdate func(ctx context.Context, resourceGroupName string, serverName string, privateEndpointConnectionName string, parameters armpostgresqlflexibleservers.PrivateEndpointConnection, options *armpostgresqlflexibleservers.PrivateEndpointConnectionsClientBeginUpdateOptions) (resp azfake.PollerResponder[armpostgresqlflexibleservers.PrivateEndpointConnectionsClientUpdateResponse], errResp azfake.ErrorResponder) } // NewPrivateEndpointConnectionsServerTransport creates a new instance of PrivateEndpointConnectionsServerTransport with the provided implementation. @@ -36,7 +44,9 @@ type PrivateEndpointConnectionsServer struct { func NewPrivateEndpointConnectionsServerTransport(srv *PrivateEndpointConnectionsServer) *PrivateEndpointConnectionsServerTransport { return &PrivateEndpointConnectionsServerTransport{ srv: srv, + beginDelete: newTracker[azfake.PollerResponder[armpostgresqlflexibleservers.PrivateEndpointConnectionsClientDeleteResponse]](), newListByServerPager: newTracker[azfake.PagerResponder[armpostgresqlflexibleservers.PrivateEndpointConnectionsClientListByServerResponse]](), + beginUpdate: newTracker[azfake.PollerResponder[armpostgresqlflexibleservers.PrivateEndpointConnectionsClientUpdateResponse]](), } } @@ -44,7 +54,9 @@ func NewPrivateEndpointConnectionsServerTransport(srv *PrivateEndpointConnection // Don't use this type directly, use NewPrivateEndpointConnectionsServerTransport instead. type PrivateEndpointConnectionsServerTransport struct { srv *PrivateEndpointConnectionsServer + beginDelete *tracker[azfake.PollerResponder[armpostgresqlflexibleservers.PrivateEndpointConnectionsClientDeleteResponse]] newListByServerPager *tracker[azfake.PagerResponder[armpostgresqlflexibleservers.PrivateEndpointConnectionsClientListByServerResponse]] + beginUpdate *tracker[azfake.PollerResponder[armpostgresqlflexibleservers.PrivateEndpointConnectionsClientUpdateResponse]] } // Do implements the policy.Transporter interface for PrivateEndpointConnectionsServerTransport. @@ -70,10 +82,14 @@ func (p *PrivateEndpointConnectionsServerTransport) dispatchToMethodFake(req *ht } if !intercepted { switch method { + case "PrivateEndpointConnectionsClient.BeginDelete": + res.resp, res.err = p.dispatchBeginDelete(req) case "PrivateEndpointConnectionsClient.Get": res.resp, res.err = p.dispatchGet(req) case "PrivateEndpointConnectionsClient.NewListByServerPager": res.resp, res.err = p.dispatchNewListByServerPager(req) + case "PrivateEndpointConnectionsClient.BeginUpdate": + res.resp, res.err = p.dispatchBeginUpdate(req) default: res.err = fmt.Errorf("unhandled API %s", method) } @@ -93,6 +109,54 @@ func (p *PrivateEndpointConnectionsServerTransport) dispatchToMethodFake(req *ht } } +func (p *PrivateEndpointConnectionsServerTransport) dispatchBeginDelete(req *http.Request) (*http.Response, error) { + if p.srv.BeginDelete == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginDelete not implemented")} + } + beginDelete := p.beginDelete.get(req) + if beginDelete == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/privateEndpointConnections/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if len(matches) < 5 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + serverNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("serverName")]) + if err != nil { + return nil, err + } + privateEndpointConnectionNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("privateEndpointConnectionName")]) + if err != nil { + return nil, err + } + respr, errRespr := p.srv.BeginDelete(req.Context(), resourceGroupNameParam, serverNameParam, privateEndpointConnectionNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginDelete = &respr + p.beginDelete.add(req, beginDelete) + } + + resp, err := server.PollerResponderNext(beginDelete, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + p.beginDelete.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} + } + if !server.PollerResponderMore(beginDelete) { + p.beginDelete.remove(req) + } + + return resp, nil +} + func (p *PrivateEndpointConnectionsServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { if p.srv.Get == nil { return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} @@ -100,7 +164,7 @@ func (p *PrivateEndpointConnectionsServerTransport) dispatchGet(req *http.Reques const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/privateEndpointConnections/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { + if len(matches) < 5 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -139,7 +203,7 @@ func (p *PrivateEndpointConnectionsServerTransport) dispatchNewListByServerPager const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/privateEndpointConnections` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { + if len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -171,6 +235,58 @@ func (p *PrivateEndpointConnectionsServerTransport) dispatchNewListByServerPager return resp, nil } +func (p *PrivateEndpointConnectionsServerTransport) dispatchBeginUpdate(req *http.Request) (*http.Response, error) { + if p.srv.BeginUpdate == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginUpdate not implemented")} + } + beginUpdate := p.beginUpdate.get(req) + if beginUpdate == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/privateEndpointConnections/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if len(matches) < 5 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armpostgresqlflexibleservers.PrivateEndpointConnection](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + serverNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("serverName")]) + if err != nil { + return nil, err + } + privateEndpointConnectionNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("privateEndpointConnectionName")]) + if err != nil { + return nil, err + } + respr, errRespr := p.srv.BeginUpdate(req.Context(), resourceGroupNameParam, serverNameParam, privateEndpointConnectionNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginUpdate = &respr + p.beginUpdate.add(req, beginUpdate) + } + + resp, err := server.PollerResponderNext(beginUpdate, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + p.beginUpdate.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} + } + if !server.PollerResponderMore(beginUpdate) { + p.beginUpdate.remove(req) + } + + return resp, nil +} + // set this to conditionally intercept incoming requests to PrivateEndpointConnectionsServerTransport var privateEndpointConnectionsServerTransportInterceptor interface { // Do returns true if the server transport should use the returned response/error diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/privatelinkresources_server.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/privatelinkresources_server.go index bc3601ff251d..4525050c013f 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/privatelinkresources_server.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/privatelinkresources_server.go @@ -100,7 +100,7 @@ func (p *PrivateLinkResourcesServerTransport) dispatchGet(req *http.Request) (*h const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/privateLinkResources/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { + if len(matches) < 5 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -139,7 +139,7 @@ func (p *PrivateLinkResourcesServerTransport) dispatchNewListByServerPager(req * const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/privateLinkResources` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { + if len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/quotausages_server.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/quotausages_server.go index cfe6367066f6..a13a1a30c86d 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/quotausages_server.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/quotausages_server.go @@ -95,7 +95,7 @@ func (q *QuotaUsagesServerTransport) dispatchNewListPager(req *http.Request) (*h const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/locations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceType/flexibleServers/usages` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 2 { + if len(matches) < 3 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } locationNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("locationName")]) diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/replicas_server.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/replicas_server.go index 5a1e314fa3f2..796deb0bfc2f 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/replicas_server.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/replicas_server.go @@ -94,7 +94,7 @@ func (r *ReplicasServerTransport) dispatchNewListByServerPager(req *http.Request const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/replicas` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { + if len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/server_factory.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/server_factory.go index 1d283c438e82..6325ab66bfab 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/server_factory.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/server_factory.go @@ -16,17 +16,26 @@ import ( // ServerFactory is a fake server for instances of the armpostgresqlflexibleservers.ClientFactory type. type ServerFactory struct { - // AdministratorsServer contains the fakes for client AdministratorsClient - AdministratorsServer AdministratorsServer + // AdministratorsMicrosoftEntraServer contains the fakes for client AdministratorsMicrosoftEntraClient + AdministratorsMicrosoftEntraServer AdministratorsMicrosoftEntraServer - // BackupsServer contains the fakes for client BackupsClient - BackupsServer BackupsServer + // AdvancedThreatProtectionSettingsServer contains the fakes for client AdvancedThreatProtectionSettingsClient + AdvancedThreatProtectionSettingsServer AdvancedThreatProtectionSettingsServer - // CheckNameAvailabilityServer contains the fakes for client CheckNameAvailabilityClient - CheckNameAvailabilityServer CheckNameAvailabilityServer + // BackupsAutomaticAndOnDemandServer contains the fakes for client BackupsAutomaticAndOnDemandClient + BackupsAutomaticAndOnDemandServer BackupsAutomaticAndOnDemandServer - // CheckNameAvailabilityWithLocationServer contains the fakes for client CheckNameAvailabilityWithLocationClient - CheckNameAvailabilityWithLocationServer CheckNameAvailabilityWithLocationServer + // BackupsLongTermRetentionServer contains the fakes for client BackupsLongTermRetentionClient + BackupsLongTermRetentionServer BackupsLongTermRetentionServer + + // CapabilitiesByLocationServer contains the fakes for client CapabilitiesByLocationClient + CapabilitiesByLocationServer CapabilitiesByLocationServer + + // CapabilitiesByServerServer contains the fakes for client CapabilitiesByServerClient + CapabilitiesByServerServer CapabilitiesByServerServer + + // CapturedLogsServer contains the fakes for client CapturedLogsClient + CapturedLogsServer CapturedLogsServer // ConfigurationsServer contains the fakes for client ConfigurationsClient ConfigurationsServer ConfigurationsServer @@ -37,32 +46,17 @@ type ServerFactory struct { // FirewallRulesServer contains the fakes for client FirewallRulesClient FirewallRulesServer FirewallRulesServer - // FlexibleServerServer contains the fakes for client FlexibleServerClient - FlexibleServerServer FlexibleServerServer - - // GetPrivateDNSZoneSuffixServer contains the fakes for client GetPrivateDNSZoneSuffixClient - GetPrivateDNSZoneSuffixServer GetPrivateDNSZoneSuffixServer - - // LocationBasedCapabilitiesServer contains the fakes for client LocationBasedCapabilitiesClient - LocationBasedCapabilitiesServer LocationBasedCapabilitiesServer - - // LogFilesServer contains the fakes for client LogFilesClient - LogFilesServer LogFilesServer - - // LtrBackupOperationsServer contains the fakes for client LtrBackupOperationsClient - LtrBackupOperationsServer LtrBackupOperationsServer - // MigrationsServer contains the fakes for client MigrationsClient MigrationsServer MigrationsServer + // NameAvailabilityServer contains the fakes for client NameAvailabilityClient + NameAvailabilityServer NameAvailabilityServer + // OperationsServer contains the fakes for client OperationsClient OperationsServer OperationsServer - // PostgreSQLManagementServer contains the fakes for client PostgreSQLManagementClient - PostgreSQLManagementServer PostgreSQLManagementServer - - // PrivateEndpointConnectionServer contains the fakes for client PrivateEndpointConnectionClient - PrivateEndpointConnectionServer PrivateEndpointConnectionServer + // PrivateDNSZoneSuffixServer contains the fakes for client PrivateDNSZoneSuffixClient + PrivateDNSZoneSuffixServer PrivateDNSZoneSuffixServer // PrivateEndpointConnectionsServer contains the fakes for client PrivateEndpointConnectionsClient PrivateEndpointConnectionsServer PrivateEndpointConnectionsServer @@ -76,21 +70,12 @@ type ServerFactory struct { // ReplicasServer contains the fakes for client ReplicasClient ReplicasServer ReplicasServer - // ServerCapabilitiesServer contains the fakes for client ServerCapabilitiesClient - ServerCapabilitiesServer ServerCapabilitiesServer - // ServerThreatProtectionSettingsServer contains the fakes for client ServerThreatProtectionSettingsClient ServerThreatProtectionSettingsServer ServerThreatProtectionSettingsServer // ServersServer contains the fakes for client ServersClient ServersServer ServersServer - // TuningConfigurationServer contains the fakes for client TuningConfigurationClient - TuningConfigurationServer TuningConfigurationServer - - // TuningIndexServer contains the fakes for client TuningIndexClient - TuningIndexServer TuningIndexServer - // TuningOptionsServer contains the fakes for client TuningOptionsClient TuningOptionsServer TuningOptionsServer @@ -113,36 +98,31 @@ func NewServerFactoryTransport(srv *ServerFactory) *ServerFactoryTransport { // ServerFactoryTransport connects instances of armpostgresqlflexibleservers.ClientFactory to instances of ServerFactory. // Don't use this type directly, use NewServerFactoryTransport instead. type ServerFactoryTransport struct { - srv *ServerFactory - trMu sync.Mutex - trAdministratorsServer *AdministratorsServerTransport - trBackupsServer *BackupsServerTransport - trCheckNameAvailabilityServer *CheckNameAvailabilityServerTransport - trCheckNameAvailabilityWithLocationServer *CheckNameAvailabilityWithLocationServerTransport - trConfigurationsServer *ConfigurationsServerTransport - trDatabasesServer *DatabasesServerTransport - trFirewallRulesServer *FirewallRulesServerTransport - trFlexibleServerServer *FlexibleServerServerTransport - trGetPrivateDNSZoneSuffixServer *GetPrivateDNSZoneSuffixServerTransport - trLocationBasedCapabilitiesServer *LocationBasedCapabilitiesServerTransport - trLogFilesServer *LogFilesServerTransport - trLtrBackupOperationsServer *LtrBackupOperationsServerTransport - trMigrationsServer *MigrationsServerTransport - trOperationsServer *OperationsServerTransport - trPostgreSQLManagementServer *PostgreSQLManagementServerTransport - trPrivateEndpointConnectionServer *PrivateEndpointConnectionServerTransport - trPrivateEndpointConnectionsServer *PrivateEndpointConnectionsServerTransport - trPrivateLinkResourcesServer *PrivateLinkResourcesServerTransport - trQuotaUsagesServer *QuotaUsagesServerTransport - trReplicasServer *ReplicasServerTransport - trServerCapabilitiesServer *ServerCapabilitiesServerTransport - trServerThreatProtectionSettingsServer *ServerThreatProtectionSettingsServerTransport - trServersServer *ServersServerTransport - trTuningConfigurationServer *TuningConfigurationServerTransport - trTuningIndexServer *TuningIndexServerTransport - trTuningOptionsServer *TuningOptionsServerTransport - trVirtualEndpointsServer *VirtualEndpointsServerTransport - trVirtualNetworkSubnetUsageServer *VirtualNetworkSubnetUsageServerTransport + srv *ServerFactory + trMu sync.Mutex + trAdministratorsMicrosoftEntraServer *AdministratorsMicrosoftEntraServerTransport + trAdvancedThreatProtectionSettingsServer *AdvancedThreatProtectionSettingsServerTransport + trBackupsAutomaticAndOnDemandServer *BackupsAutomaticAndOnDemandServerTransport + trBackupsLongTermRetentionServer *BackupsLongTermRetentionServerTransport + trCapabilitiesByLocationServer *CapabilitiesByLocationServerTransport + trCapabilitiesByServerServer *CapabilitiesByServerServerTransport + trCapturedLogsServer *CapturedLogsServerTransport + trConfigurationsServer *ConfigurationsServerTransport + trDatabasesServer *DatabasesServerTransport + trFirewallRulesServer *FirewallRulesServerTransport + trMigrationsServer *MigrationsServerTransport + trNameAvailabilityServer *NameAvailabilityServerTransport + trOperationsServer *OperationsServerTransport + trPrivateDNSZoneSuffixServer *PrivateDNSZoneSuffixServerTransport + trPrivateEndpointConnectionsServer *PrivateEndpointConnectionsServerTransport + trPrivateLinkResourcesServer *PrivateLinkResourcesServerTransport + trQuotaUsagesServer *QuotaUsagesServerTransport + trReplicasServer *ReplicasServerTransport + trServerThreatProtectionSettingsServer *ServerThreatProtectionSettingsServerTransport + trServersServer *ServersServerTransport + trTuningOptionsServer *TuningOptionsServerTransport + trVirtualEndpointsServer *VirtualEndpointsServerTransport + trVirtualNetworkSubnetUsageServer *VirtualNetworkSubnetUsageServerTransport } // Do implements the policy.Transporter interface for ServerFactoryTransport. @@ -158,24 +138,39 @@ func (s *ServerFactoryTransport) Do(req *http.Request) (*http.Response, error) { var err error switch client { - case "AdministratorsClient": - initServer(s, &s.trAdministratorsServer, func() *AdministratorsServerTransport { - return NewAdministratorsServerTransport(&s.srv.AdministratorsServer) + case "AdministratorsMicrosoftEntraClient": + initServer(s, &s.trAdministratorsMicrosoftEntraServer, func() *AdministratorsMicrosoftEntraServerTransport { + return NewAdministratorsMicrosoftEntraServerTransport(&s.srv.AdministratorsMicrosoftEntraServer) + }) + resp, err = s.trAdministratorsMicrosoftEntraServer.Do(req) + case "AdvancedThreatProtectionSettingsClient": + initServer(s, &s.trAdvancedThreatProtectionSettingsServer, func() *AdvancedThreatProtectionSettingsServerTransport { + return NewAdvancedThreatProtectionSettingsServerTransport(&s.srv.AdvancedThreatProtectionSettingsServer) + }) + resp, err = s.trAdvancedThreatProtectionSettingsServer.Do(req) + case "BackupsAutomaticAndOnDemandClient": + initServer(s, &s.trBackupsAutomaticAndOnDemandServer, func() *BackupsAutomaticAndOnDemandServerTransport { + return NewBackupsAutomaticAndOnDemandServerTransport(&s.srv.BackupsAutomaticAndOnDemandServer) }) - resp, err = s.trAdministratorsServer.Do(req) - case "BackupsClient": - initServer(s, &s.trBackupsServer, func() *BackupsServerTransport { return NewBackupsServerTransport(&s.srv.BackupsServer) }) - resp, err = s.trBackupsServer.Do(req) - case "CheckNameAvailabilityClient": - initServer(s, &s.trCheckNameAvailabilityServer, func() *CheckNameAvailabilityServerTransport { - return NewCheckNameAvailabilityServerTransport(&s.srv.CheckNameAvailabilityServer) + resp, err = s.trBackupsAutomaticAndOnDemandServer.Do(req) + case "BackupsLongTermRetentionClient": + initServer(s, &s.trBackupsLongTermRetentionServer, func() *BackupsLongTermRetentionServerTransport { + return NewBackupsLongTermRetentionServerTransport(&s.srv.BackupsLongTermRetentionServer) }) - resp, err = s.trCheckNameAvailabilityServer.Do(req) - case "CheckNameAvailabilityWithLocationClient": - initServer(s, &s.trCheckNameAvailabilityWithLocationServer, func() *CheckNameAvailabilityWithLocationServerTransport { - return NewCheckNameAvailabilityWithLocationServerTransport(&s.srv.CheckNameAvailabilityWithLocationServer) + resp, err = s.trBackupsLongTermRetentionServer.Do(req) + case "CapabilitiesByLocationClient": + initServer(s, &s.trCapabilitiesByLocationServer, func() *CapabilitiesByLocationServerTransport { + return NewCapabilitiesByLocationServerTransport(&s.srv.CapabilitiesByLocationServer) }) - resp, err = s.trCheckNameAvailabilityWithLocationServer.Do(req) + resp, err = s.trCapabilitiesByLocationServer.Do(req) + case "CapabilitiesByServerClient": + initServer(s, &s.trCapabilitiesByServerServer, func() *CapabilitiesByServerServerTransport { + return NewCapabilitiesByServerServerTransport(&s.srv.CapabilitiesByServerServer) + }) + resp, err = s.trCapabilitiesByServerServer.Do(req) + case "CapturedLogsClient": + initServer(s, &s.trCapturedLogsServer, func() *CapturedLogsServerTransport { return NewCapturedLogsServerTransport(&s.srv.CapturedLogsServer) }) + resp, err = s.trCapturedLogsServer.Do(req) case "ConfigurationsClient": initServer(s, &s.trConfigurationsServer, func() *ConfigurationsServerTransport { return NewConfigurationsServerTransport(&s.srv.ConfigurationsServer) @@ -189,45 +184,22 @@ func (s *ServerFactoryTransport) Do(req *http.Request) (*http.Response, error) { return NewFirewallRulesServerTransport(&s.srv.FirewallRulesServer) }) resp, err = s.trFirewallRulesServer.Do(req) - case "FlexibleServerClient": - initServer(s, &s.trFlexibleServerServer, func() *FlexibleServerServerTransport { - return NewFlexibleServerServerTransport(&s.srv.FlexibleServerServer) - }) - resp, err = s.trFlexibleServerServer.Do(req) - case "GetPrivateDNSZoneSuffixClient": - initServer(s, &s.trGetPrivateDNSZoneSuffixServer, func() *GetPrivateDNSZoneSuffixServerTransport { - return NewGetPrivateDNSZoneSuffixServerTransport(&s.srv.GetPrivateDNSZoneSuffixServer) - }) - resp, err = s.trGetPrivateDNSZoneSuffixServer.Do(req) - case "LocationBasedCapabilitiesClient": - initServer(s, &s.trLocationBasedCapabilitiesServer, func() *LocationBasedCapabilitiesServerTransport { - return NewLocationBasedCapabilitiesServerTransport(&s.srv.LocationBasedCapabilitiesServer) - }) - resp, err = s.trLocationBasedCapabilitiesServer.Do(req) - case "LogFilesClient": - initServer(s, &s.trLogFilesServer, func() *LogFilesServerTransport { return NewLogFilesServerTransport(&s.srv.LogFilesServer) }) - resp, err = s.trLogFilesServer.Do(req) - case "LtrBackupOperationsClient": - initServer(s, &s.trLtrBackupOperationsServer, func() *LtrBackupOperationsServerTransport { - return NewLtrBackupOperationsServerTransport(&s.srv.LtrBackupOperationsServer) - }) - resp, err = s.trLtrBackupOperationsServer.Do(req) case "MigrationsClient": initServer(s, &s.trMigrationsServer, func() *MigrationsServerTransport { return NewMigrationsServerTransport(&s.srv.MigrationsServer) }) resp, err = s.trMigrationsServer.Do(req) + case "NameAvailabilityClient": + initServer(s, &s.trNameAvailabilityServer, func() *NameAvailabilityServerTransport { + return NewNameAvailabilityServerTransport(&s.srv.NameAvailabilityServer) + }) + resp, err = s.trNameAvailabilityServer.Do(req) case "OperationsClient": initServer(s, &s.trOperationsServer, func() *OperationsServerTransport { return NewOperationsServerTransport(&s.srv.OperationsServer) }) resp, err = s.trOperationsServer.Do(req) - case "PostgreSQLManagementClient": - initServer(s, &s.trPostgreSQLManagementServer, func() *PostgreSQLManagementServerTransport { - return NewPostgreSQLManagementServerTransport(&s.srv.PostgreSQLManagementServer) + case "PrivateDNSZoneSuffixClient": + initServer(s, &s.trPrivateDNSZoneSuffixServer, func() *PrivateDNSZoneSuffixServerTransport { + return NewPrivateDNSZoneSuffixServerTransport(&s.srv.PrivateDNSZoneSuffixServer) }) - resp, err = s.trPostgreSQLManagementServer.Do(req) - case "PrivateEndpointConnectionClient": - initServer(s, &s.trPrivateEndpointConnectionServer, func() *PrivateEndpointConnectionServerTransport { - return NewPrivateEndpointConnectionServerTransport(&s.srv.PrivateEndpointConnectionServer) - }) - resp, err = s.trPrivateEndpointConnectionServer.Do(req) + resp, err = s.trPrivateDNSZoneSuffixServer.Do(req) case "PrivateEndpointConnectionsClient": initServer(s, &s.trPrivateEndpointConnectionsServer, func() *PrivateEndpointConnectionsServerTransport { return NewPrivateEndpointConnectionsServerTransport(&s.srv.PrivateEndpointConnectionsServer) @@ -244,11 +216,6 @@ func (s *ServerFactoryTransport) Do(req *http.Request) (*http.Response, error) { case "ReplicasClient": initServer(s, &s.trReplicasServer, func() *ReplicasServerTransport { return NewReplicasServerTransport(&s.srv.ReplicasServer) }) resp, err = s.trReplicasServer.Do(req) - case "ServerCapabilitiesClient": - initServer(s, &s.trServerCapabilitiesServer, func() *ServerCapabilitiesServerTransport { - return NewServerCapabilitiesServerTransport(&s.srv.ServerCapabilitiesServer) - }) - resp, err = s.trServerCapabilitiesServer.Do(req) case "ServerThreatProtectionSettingsClient": initServer(s, &s.trServerThreatProtectionSettingsServer, func() *ServerThreatProtectionSettingsServerTransport { return NewServerThreatProtectionSettingsServerTransport(&s.srv.ServerThreatProtectionSettingsServer) @@ -257,14 +224,6 @@ func (s *ServerFactoryTransport) Do(req *http.Request) (*http.Response, error) { case "ServersClient": initServer(s, &s.trServersServer, func() *ServersServerTransport { return NewServersServerTransport(&s.srv.ServersServer) }) resp, err = s.trServersServer.Do(req) - case "TuningConfigurationClient": - initServer(s, &s.trTuningConfigurationServer, func() *TuningConfigurationServerTransport { - return NewTuningConfigurationServerTransport(&s.srv.TuningConfigurationServer) - }) - resp, err = s.trTuningConfigurationServer.Do(req) - case "TuningIndexClient": - initServer(s, &s.trTuningIndexServer, func() *TuningIndexServerTransport { return NewTuningIndexServerTransport(&s.srv.TuningIndexServer) }) - resp, err = s.trTuningIndexServer.Do(req) case "TuningOptionsClient": initServer(s, &s.trTuningOptionsServer, func() *TuningOptionsServerTransport { return NewTuningOptionsServerTransport(&s.srv.TuningOptionsServer) diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/servers_server.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/servers_server.go index 57dc041f682b..c874d4f45263 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/servers_server.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/servers_server.go @@ -22,9 +22,9 @@ import ( // ServersServer is a fake server for instances of the armpostgresqlflexibleservers.ServersClient type. type ServersServer struct { - // BeginCreate is the fake for method ServersClient.BeginCreate - // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated, http.StatusAccepted - BeginCreate func(ctx context.Context, resourceGroupName string, serverName string, parameters armpostgresqlflexibleservers.Server, options *armpostgresqlflexibleservers.ServersClientBeginCreateOptions) (resp azfake.PollerResponder[armpostgresqlflexibleservers.ServersClientCreateResponse], errResp azfake.ErrorResponder) + // BeginCreateOrUpdate is the fake for method ServersClient.BeginCreateOrUpdate + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent + BeginCreateOrUpdate func(ctx context.Context, resourceGroupName string, serverName string, parameters armpostgresqlflexibleservers.Server, options *armpostgresqlflexibleservers.ServersClientBeginCreateOrUpdateOptions) (resp azfake.PollerResponder[armpostgresqlflexibleservers.ServersClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) // BeginDelete is the fake for method ServersClient.BeginDelete // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent @@ -34,14 +34,14 @@ type ServersServer struct { // HTTP status codes to indicate success: http.StatusOK Get func(ctx context.Context, resourceGroupName string, serverName string, options *armpostgresqlflexibleservers.ServersClientGetOptions) (resp azfake.Responder[armpostgresqlflexibleservers.ServersClientGetResponse], errResp azfake.ErrorResponder) - // NewListPager is the fake for method ServersClient.NewListPager - // HTTP status codes to indicate success: http.StatusOK - NewListPager func(options *armpostgresqlflexibleservers.ServersClientListOptions) (resp azfake.PagerResponder[armpostgresqlflexibleservers.ServersClientListResponse]) - // NewListByResourceGroupPager is the fake for method ServersClient.NewListByResourceGroupPager // HTTP status codes to indicate success: http.StatusOK NewListByResourceGroupPager func(resourceGroupName string, options *armpostgresqlflexibleservers.ServersClientListByResourceGroupOptions) (resp azfake.PagerResponder[armpostgresqlflexibleservers.ServersClientListByResourceGroupResponse]) + // NewListBySubscriptionPager is the fake for method ServersClient.NewListBySubscriptionPager + // HTTP status codes to indicate success: http.StatusOK + NewListBySubscriptionPager func(options *armpostgresqlflexibleservers.ServersClientListBySubscriptionOptions) (resp azfake.PagerResponder[armpostgresqlflexibleservers.ServersClientListBySubscriptionResponse]) + // BeginRestart is the fake for method ServersClient.BeginRestart // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginRestart func(ctx context.Context, resourceGroupName string, serverName string, options *armpostgresqlflexibleservers.ServersClientBeginRestartOptions) (resp azfake.PollerResponder[armpostgresqlflexibleservers.ServersClientRestartResponse], errResp azfake.ErrorResponder) @@ -55,8 +55,8 @@ type ServersServer struct { BeginStop func(ctx context.Context, resourceGroupName string, serverName string, options *armpostgresqlflexibleservers.ServersClientBeginStopOptions) (resp azfake.PollerResponder[armpostgresqlflexibleservers.ServersClientStopResponse], errResp azfake.ErrorResponder) // BeginUpdate is the fake for method ServersClient.BeginUpdate - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted - BeginUpdate func(ctx context.Context, resourceGroupName string, serverName string, parameters armpostgresqlflexibleservers.ServerForUpdate, options *armpostgresqlflexibleservers.ServersClientBeginUpdateOptions) (resp azfake.PollerResponder[armpostgresqlflexibleservers.ServersClientUpdateResponse], errResp azfake.ErrorResponder) + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent + BeginUpdate func(ctx context.Context, resourceGroupName string, serverName string, parameters armpostgresqlflexibleservers.ServerForPatch, options *armpostgresqlflexibleservers.ServersClientBeginUpdateOptions) (resp azfake.PollerResponder[armpostgresqlflexibleservers.ServersClientUpdateResponse], errResp azfake.ErrorResponder) } // NewServersServerTransport creates a new instance of ServersServerTransport with the provided implementation. @@ -65,10 +65,10 @@ type ServersServer struct { func NewServersServerTransport(srv *ServersServer) *ServersServerTransport { return &ServersServerTransport{ srv: srv, - beginCreate: newTracker[azfake.PollerResponder[armpostgresqlflexibleservers.ServersClientCreateResponse]](), + beginCreateOrUpdate: newTracker[azfake.PollerResponder[armpostgresqlflexibleservers.ServersClientCreateOrUpdateResponse]](), beginDelete: newTracker[azfake.PollerResponder[armpostgresqlflexibleservers.ServersClientDeleteResponse]](), - newListPager: newTracker[azfake.PagerResponder[armpostgresqlflexibleservers.ServersClientListResponse]](), newListByResourceGroupPager: newTracker[azfake.PagerResponder[armpostgresqlflexibleservers.ServersClientListByResourceGroupResponse]](), + newListBySubscriptionPager: newTracker[azfake.PagerResponder[armpostgresqlflexibleservers.ServersClientListBySubscriptionResponse]](), beginRestart: newTracker[azfake.PollerResponder[armpostgresqlflexibleservers.ServersClientRestartResponse]](), beginStart: newTracker[azfake.PollerResponder[armpostgresqlflexibleservers.ServersClientStartResponse]](), beginStop: newTracker[azfake.PollerResponder[armpostgresqlflexibleservers.ServersClientStopResponse]](), @@ -80,10 +80,10 @@ func NewServersServerTransport(srv *ServersServer) *ServersServerTransport { // Don't use this type directly, use NewServersServerTransport instead. type ServersServerTransport struct { srv *ServersServer - beginCreate *tracker[azfake.PollerResponder[armpostgresqlflexibleservers.ServersClientCreateResponse]] + beginCreateOrUpdate *tracker[azfake.PollerResponder[armpostgresqlflexibleservers.ServersClientCreateOrUpdateResponse]] beginDelete *tracker[azfake.PollerResponder[armpostgresqlflexibleservers.ServersClientDeleteResponse]] - newListPager *tracker[azfake.PagerResponder[armpostgresqlflexibleservers.ServersClientListResponse]] newListByResourceGroupPager *tracker[azfake.PagerResponder[armpostgresqlflexibleservers.ServersClientListByResourceGroupResponse]] + newListBySubscriptionPager *tracker[azfake.PagerResponder[armpostgresqlflexibleservers.ServersClientListBySubscriptionResponse]] beginRestart *tracker[azfake.PollerResponder[armpostgresqlflexibleservers.ServersClientRestartResponse]] beginStart *tracker[azfake.PollerResponder[armpostgresqlflexibleservers.ServersClientStartResponse]] beginStop *tracker[azfake.PollerResponder[armpostgresqlflexibleservers.ServersClientStopResponse]] @@ -113,16 +113,16 @@ func (s *ServersServerTransport) dispatchToMethodFake(req *http.Request, method } if !intercepted { switch method { - case "ServersClient.BeginCreate": - res.resp, res.err = s.dispatchBeginCreate(req) + case "ServersClient.BeginCreateOrUpdate": + res.resp, res.err = s.dispatchBeginCreateOrUpdate(req) case "ServersClient.BeginDelete": res.resp, res.err = s.dispatchBeginDelete(req) case "ServersClient.Get": res.resp, res.err = s.dispatchGet(req) - case "ServersClient.NewListPager": - res.resp, res.err = s.dispatchNewListPager(req) case "ServersClient.NewListByResourceGroupPager": res.resp, res.err = s.dispatchNewListByResourceGroupPager(req) + case "ServersClient.NewListBySubscriptionPager": + res.resp, res.err = s.dispatchNewListBySubscriptionPager(req) case "ServersClient.BeginRestart": res.resp, res.err = s.dispatchBeginRestart(req) case "ServersClient.BeginStart": @@ -150,16 +150,16 @@ func (s *ServersServerTransport) dispatchToMethodFake(req *http.Request, method } } -func (s *ServersServerTransport) dispatchBeginCreate(req *http.Request) (*http.Response, error) { - if s.srv.BeginCreate == nil { - return nil, &nonRetriableError{errors.New("fake for method BeginCreate not implemented")} +func (s *ServersServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { + if s.srv.BeginCreateOrUpdate == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginCreateOrUpdate not implemented")} } - beginCreate := s.beginCreate.get(req) - if beginCreate == nil { + beginCreateOrUpdate := s.beginCreateOrUpdate.get(req) + if beginCreateOrUpdate == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { + if len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } body, err := server.UnmarshalRequestAsJSON[armpostgresqlflexibleservers.Server](req) @@ -174,25 +174,25 @@ func (s *ServersServerTransport) dispatchBeginCreate(req *http.Request) (*http.R if err != nil { return nil, err } - respr, errRespr := s.srv.BeginCreate(req.Context(), resourceGroupNameParam, serverNameParam, body, nil) + respr, errRespr := s.srv.BeginCreateOrUpdate(req.Context(), resourceGroupNameParam, serverNameParam, body, nil) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } - beginCreate = &respr - s.beginCreate.add(req, beginCreate) + beginCreateOrUpdate = &respr + s.beginCreateOrUpdate.add(req, beginCreateOrUpdate) } - resp, err := server.PollerResponderNext(beginCreate, req) + resp, err := server.PollerResponderNext(beginCreateOrUpdate, req) if err != nil { return nil, err } - if !contains([]int{http.StatusOK, http.StatusCreated, http.StatusAccepted}, resp.StatusCode) { - s.beginCreate.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated, http.StatusAccepted", resp.StatusCode)} + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + s.beginCreateOrUpdate.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } - if !server.PollerResponderMore(beginCreate) { - s.beginCreate.remove(req) + if !server.PollerResponderMore(beginCreateOrUpdate) { + s.beginCreateOrUpdate.remove(req) } return resp, nil @@ -207,7 +207,7 @@ func (s *ServersServerTransport) dispatchBeginDelete(req *http.Request) (*http.R const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { + if len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -249,7 +249,7 @@ func (s *ServersServerTransport) dispatchGet(req *http.Request) (*http.Response, const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { + if len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -275,39 +275,6 @@ func (s *ServersServerTransport) dispatchGet(req *http.Request) (*http.Response, return resp, nil } -func (s *ServersServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { - if s.srv.NewListPager == nil { - return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} - } - newListPager := s.newListPager.get(req) - if newListPager == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/flexibleServers` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 1 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - resp := s.srv.NewListPager(nil) - newListPager = &resp - s.newListPager.add(req, newListPager) - server.PagerResponderInjectNextLinks(newListPager, req, func(page *armpostgresqlflexibleservers.ServersClientListResponse, createLink func() string) { - page.NextLink = to.Ptr(createLink()) - }) - } - resp, err := server.PagerResponderNext(newListPager, req) - if err != nil { - return nil, err - } - if !contains([]int{http.StatusOK}, resp.StatusCode) { - s.newListPager.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} - } - if !server.PagerResponderMore(newListPager) { - s.newListPager.remove(req) - } - return resp, nil -} - func (s *ServersServerTransport) dispatchNewListByResourceGroupPager(req *http.Request) (*http.Response, error) { if s.srv.NewListByResourceGroupPager == nil { return nil, &nonRetriableError{errors.New("fake for method NewListByResourceGroupPager not implemented")} @@ -317,7 +284,7 @@ func (s *ServersServerTransport) dispatchNewListByResourceGroupPager(req *http.R const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/flexibleServers` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 2 { + if len(matches) < 3 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -345,6 +312,39 @@ func (s *ServersServerTransport) dispatchNewListByResourceGroupPager(req *http.R return resp, nil } +func (s *ServersServerTransport) dispatchNewListBySubscriptionPager(req *http.Request) (*http.Response, error) { + if s.srv.NewListBySubscriptionPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListBySubscriptionPager not implemented")} + } + newListBySubscriptionPager := s.newListBySubscriptionPager.get(req) + if newListBySubscriptionPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/flexibleServers` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if len(matches) < 2 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resp := s.srv.NewListBySubscriptionPager(nil) + newListBySubscriptionPager = &resp + s.newListBySubscriptionPager.add(req, newListBySubscriptionPager) + server.PagerResponderInjectNextLinks(newListBySubscriptionPager, req, func(page *armpostgresqlflexibleservers.ServersClientListBySubscriptionResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListBySubscriptionPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + s.newListBySubscriptionPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListBySubscriptionPager) { + s.newListBySubscriptionPager.remove(req) + } + return resp, nil +} + func (s *ServersServerTransport) dispatchBeginRestart(req *http.Request) (*http.Response, error) { if s.srv.BeginRestart == nil { return nil, &nonRetriableError{errors.New("fake for method BeginRestart not implemented")} @@ -354,7 +354,7 @@ func (s *ServersServerTransport) dispatchBeginRestart(req *http.Request) (*http. const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/restart` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { + if len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } body, err := server.UnmarshalRequestAsJSON[armpostgresqlflexibleservers.RestartParameter](req) @@ -408,7 +408,7 @@ func (s *ServersServerTransport) dispatchBeginStart(req *http.Request) (*http.Re const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/start` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { + if len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -452,7 +452,7 @@ func (s *ServersServerTransport) dispatchBeginStop(req *http.Request) (*http.Res const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/stop` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { + if len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -496,10 +496,10 @@ func (s *ServersServerTransport) dispatchBeginUpdate(req *http.Request) (*http.R const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { + if len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } - body, err := server.UnmarshalRequestAsJSON[armpostgresqlflexibleservers.ServerForUpdate](req) + body, err := server.UnmarshalRequestAsJSON[armpostgresqlflexibleservers.ServerForPatch](req) if err != nil { return nil, err } @@ -524,9 +524,9 @@ func (s *ServersServerTransport) dispatchBeginUpdate(req *http.Request) (*http.R return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { s.beginUpdate.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginUpdate) { s.beginUpdate.remove(req) diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/serverthreatprotectionsettings_server.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/serverthreatprotectionsettings_server.go index 8109e5826182..380fe22cfc82 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/serverthreatprotectionsettings_server.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/serverthreatprotectionsettings_server.go @@ -12,7 +12,6 @@ import ( azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v5" "net/http" "net/url" @@ -22,16 +21,8 @@ import ( // ServerThreatProtectionSettingsServer is a fake server for instances of the armpostgresqlflexibleservers.ServerThreatProtectionSettingsClient type. type ServerThreatProtectionSettingsServer struct { // BeginCreateOrUpdate is the fake for method ServerThreatProtectionSettingsClient.BeginCreateOrUpdate - // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated, http.StatusAccepted - BeginCreateOrUpdate func(ctx context.Context, resourceGroupName string, serverName string, threatProtectionName armpostgresqlflexibleservers.ThreatProtectionName, parameters armpostgresqlflexibleservers.ServerThreatProtectionSettingsModel, options *armpostgresqlflexibleservers.ServerThreatProtectionSettingsClientBeginCreateOrUpdateOptions) (resp azfake.PollerResponder[armpostgresqlflexibleservers.ServerThreatProtectionSettingsClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) - - // Get is the fake for method ServerThreatProtectionSettingsClient.Get - // HTTP status codes to indicate success: http.StatusOK - Get func(ctx context.Context, resourceGroupName string, serverName string, threatProtectionName armpostgresqlflexibleservers.ThreatProtectionName, options *armpostgresqlflexibleservers.ServerThreatProtectionSettingsClientGetOptions) (resp azfake.Responder[armpostgresqlflexibleservers.ServerThreatProtectionSettingsClientGetResponse], errResp azfake.ErrorResponder) - - // NewListByServerPager is the fake for method ServerThreatProtectionSettingsClient.NewListByServerPager - // HTTP status codes to indicate success: http.StatusOK - NewListByServerPager func(resourceGroupName string, serverName string, options *armpostgresqlflexibleservers.ServerThreatProtectionSettingsClientListByServerOptions) (resp azfake.PagerResponder[armpostgresqlflexibleservers.ServerThreatProtectionSettingsClientListByServerResponse]) + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent + BeginCreateOrUpdate func(ctx context.Context, resourceGroupName string, serverName string, threatProtectionName armpostgresqlflexibleservers.ThreatProtectionName, parameters armpostgresqlflexibleservers.AdvancedThreatProtectionSettingsModel, options *armpostgresqlflexibleservers.ServerThreatProtectionSettingsClientBeginCreateOrUpdateOptions) (resp azfake.PollerResponder[armpostgresqlflexibleservers.ServerThreatProtectionSettingsClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) } // NewServerThreatProtectionSettingsServerTransport creates a new instance of ServerThreatProtectionSettingsServerTransport with the provided implementation. @@ -39,18 +30,16 @@ type ServerThreatProtectionSettingsServer struct { // azcore.ClientOptions.Transporter field in the client's constructor parameters. func NewServerThreatProtectionSettingsServerTransport(srv *ServerThreatProtectionSettingsServer) *ServerThreatProtectionSettingsServerTransport { return &ServerThreatProtectionSettingsServerTransport{ - srv: srv, - beginCreateOrUpdate: newTracker[azfake.PollerResponder[armpostgresqlflexibleservers.ServerThreatProtectionSettingsClientCreateOrUpdateResponse]](), - newListByServerPager: newTracker[azfake.PagerResponder[armpostgresqlflexibleservers.ServerThreatProtectionSettingsClientListByServerResponse]](), + srv: srv, + beginCreateOrUpdate: newTracker[azfake.PollerResponder[armpostgresqlflexibleservers.ServerThreatProtectionSettingsClientCreateOrUpdateResponse]](), } } // ServerThreatProtectionSettingsServerTransport connects instances of armpostgresqlflexibleservers.ServerThreatProtectionSettingsClient to instances of ServerThreatProtectionSettingsServer. // Don't use this type directly, use NewServerThreatProtectionSettingsServerTransport instead. type ServerThreatProtectionSettingsServerTransport struct { - srv *ServerThreatProtectionSettingsServer - beginCreateOrUpdate *tracker[azfake.PollerResponder[armpostgresqlflexibleservers.ServerThreatProtectionSettingsClientCreateOrUpdateResponse]] - newListByServerPager *tracker[azfake.PagerResponder[armpostgresqlflexibleservers.ServerThreatProtectionSettingsClientListByServerResponse]] + srv *ServerThreatProtectionSettingsServer + beginCreateOrUpdate *tracker[azfake.PollerResponder[armpostgresqlflexibleservers.ServerThreatProtectionSettingsClientCreateOrUpdateResponse]] } // Do implements the policy.Transporter interface for ServerThreatProtectionSettingsServerTransport. @@ -78,10 +67,6 @@ func (s *ServerThreatProtectionSettingsServerTransport) dispatchToMethodFake(req switch method { case "ServerThreatProtectionSettingsClient.BeginCreateOrUpdate": res.resp, res.err = s.dispatchBeginCreateOrUpdate(req) - case "ServerThreatProtectionSettingsClient.Get": - res.resp, res.err = s.dispatchGet(req) - case "ServerThreatProtectionSettingsClient.NewListByServerPager": - res.resp, res.err = s.dispatchNewListByServerPager(req) default: res.err = fmt.Errorf("unhandled API %s", method) } @@ -110,10 +95,10 @@ func (s *ServerThreatProtectionSettingsServerTransport) dispatchBeginCreateOrUpd const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/advancedThreatProtectionSettings/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { + if len(matches) < 5 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } - body, err := server.UnmarshalRequestAsJSON[armpostgresqlflexibleservers.ServerThreatProtectionSettingsModel](req) + body, err := server.UnmarshalRequestAsJSON[armpostgresqlflexibleservers.AdvancedThreatProtectionSettingsModel](req) if err != nil { return nil, err } @@ -148,9 +133,9 @@ func (s *ServerThreatProtectionSettingsServerTransport) dispatchBeginCreateOrUpd return nil, err } - if !contains([]int{http.StatusOK, http.StatusCreated, http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { s.beginCreateOrUpdate.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated, http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginCreateOrUpdate) { s.beginCreateOrUpdate.remove(req) @@ -159,90 +144,6 @@ func (s *ServerThreatProtectionSettingsServerTransport) dispatchBeginCreateOrUpd return resp, nil } -func (s *ServerThreatProtectionSettingsServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { - if s.srv.Get == nil { - return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} - } - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/advancedThreatProtectionSettings/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - serverNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("serverName")]) - if err != nil { - return nil, err - } - threatProtectionNameParam, err := parseWithCast(matches[regex.SubexpIndex("threatProtectionName")], func(v string) (armpostgresqlflexibleservers.ThreatProtectionName, error) { - p, unescapeErr := url.PathUnescape(v) - if unescapeErr != nil { - return "", unescapeErr - } - return armpostgresqlflexibleservers.ThreatProtectionName(p), nil - }) - if err != nil { - return nil, err - } - respr, errRespr := s.srv.Get(req.Context(), resourceGroupNameParam, serverNameParam, threatProtectionNameParam, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} - } - resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).ServerThreatProtectionSettingsModel, req) - if err != nil { - return nil, err - } - return resp, nil -} - -func (s *ServerThreatProtectionSettingsServerTransport) dispatchNewListByServerPager(req *http.Request) (*http.Response, error) { - if s.srv.NewListByServerPager == nil { - return nil, &nonRetriableError{errors.New("fake for method NewListByServerPager not implemented")} - } - newListByServerPager := s.newListByServerPager.get(req) - if newListByServerPager == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/advancedThreatProtectionSettings` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - serverNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("serverName")]) - if err != nil { - return nil, err - } - resp := s.srv.NewListByServerPager(resourceGroupNameParam, serverNameParam, nil) - newListByServerPager = &resp - s.newListByServerPager.add(req, newListByServerPager) - server.PagerResponderInjectNextLinks(newListByServerPager, req, func(page *armpostgresqlflexibleservers.ServerThreatProtectionSettingsClientListByServerResponse, createLink func() string) { - page.NextLink = to.Ptr(createLink()) - }) - } - resp, err := server.PagerResponderNext(newListByServerPager, req) - if err != nil { - return nil, err - } - if !contains([]int{http.StatusOK}, resp.StatusCode) { - s.newListByServerPager.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} - } - if !server.PagerResponderMore(newListByServerPager) { - s.newListByServerPager.remove(req) - } - return resp, nil -} - // set this to conditionally intercept incoming requests to ServerThreatProtectionSettingsServerTransport var serverThreatProtectionSettingsServerTransportInterceptor interface { // Do returns true if the server transport should use the returned response/error diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/tuningconfiguration_server.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/tuningconfiguration_server.go deleted file mode 100644 index 80c095050475..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/tuningconfiguration_server.go +++ /dev/null @@ -1,461 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package fake - -import ( - "context" - "errors" - "fmt" - azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v5" - "net/http" - "net/url" - "regexp" -) - -// TuningConfigurationServer is a fake server for instances of the armpostgresqlflexibleservers.TuningConfigurationClient type. -type TuningConfigurationServer struct { - // BeginDisable is the fake for method TuningConfigurationClient.BeginDisable - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent - BeginDisable func(ctx context.Context, resourceGroupName string, serverName string, tuningOption armpostgresqlflexibleservers.TuningOptionEnum, options *armpostgresqlflexibleservers.TuningConfigurationClientBeginDisableOptions) (resp azfake.PollerResponder[armpostgresqlflexibleservers.TuningConfigurationClientDisableResponse], errResp azfake.ErrorResponder) - - // BeginEnable is the fake for method TuningConfigurationClient.BeginEnable - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent - BeginEnable func(ctx context.Context, resourceGroupName string, serverName string, tuningOption armpostgresqlflexibleservers.TuningOptionEnum, options *armpostgresqlflexibleservers.TuningConfigurationClientBeginEnableOptions) (resp azfake.PollerResponder[armpostgresqlflexibleservers.TuningConfigurationClientEnableResponse], errResp azfake.ErrorResponder) - - // NewListSessionDetailsPager is the fake for method TuningConfigurationClient.NewListSessionDetailsPager - // HTTP status codes to indicate success: http.StatusOK - NewListSessionDetailsPager func(resourceGroupName string, serverName string, tuningOption armpostgresqlflexibleservers.TuningOptionEnum, sessionID string, options *armpostgresqlflexibleservers.TuningConfigurationClientListSessionDetailsOptions) (resp azfake.PagerResponder[armpostgresqlflexibleservers.TuningConfigurationClientListSessionDetailsResponse]) - - // NewListSessionsPager is the fake for method TuningConfigurationClient.NewListSessionsPager - // HTTP status codes to indicate success: http.StatusOK - NewListSessionsPager func(resourceGroupName string, serverName string, tuningOption armpostgresqlflexibleservers.TuningOptionEnum, options *armpostgresqlflexibleservers.TuningConfigurationClientListSessionsOptions) (resp azfake.PagerResponder[armpostgresqlflexibleservers.TuningConfigurationClientListSessionsResponse]) - - // BeginStartSession is the fake for method TuningConfigurationClient.BeginStartSession - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent - BeginStartSession func(ctx context.Context, resourceGroupName string, serverName string, tuningOption armpostgresqlflexibleservers.TuningOptionEnum, configTuningRequest armpostgresqlflexibleservers.ConfigTuningRequestParameter, options *armpostgresqlflexibleservers.TuningConfigurationClientBeginStartSessionOptions) (resp azfake.PollerResponder[armpostgresqlflexibleservers.TuningConfigurationClientStartSessionResponse], errResp azfake.ErrorResponder) - - // BeginStopSession is the fake for method TuningConfigurationClient.BeginStopSession - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent - BeginStopSession func(ctx context.Context, resourceGroupName string, serverName string, tuningOption armpostgresqlflexibleservers.TuningOptionEnum, options *armpostgresqlflexibleservers.TuningConfigurationClientBeginStopSessionOptions) (resp azfake.PollerResponder[armpostgresqlflexibleservers.TuningConfigurationClientStopSessionResponse], errResp azfake.ErrorResponder) -} - -// NewTuningConfigurationServerTransport creates a new instance of TuningConfigurationServerTransport with the provided implementation. -// The returned TuningConfigurationServerTransport instance is connected to an instance of armpostgresqlflexibleservers.TuningConfigurationClient via the -// azcore.ClientOptions.Transporter field in the client's constructor parameters. -func NewTuningConfigurationServerTransport(srv *TuningConfigurationServer) *TuningConfigurationServerTransport { - return &TuningConfigurationServerTransport{ - srv: srv, - beginDisable: newTracker[azfake.PollerResponder[armpostgresqlflexibleservers.TuningConfigurationClientDisableResponse]](), - beginEnable: newTracker[azfake.PollerResponder[armpostgresqlflexibleservers.TuningConfigurationClientEnableResponse]](), - newListSessionDetailsPager: newTracker[azfake.PagerResponder[armpostgresqlflexibleservers.TuningConfigurationClientListSessionDetailsResponse]](), - newListSessionsPager: newTracker[azfake.PagerResponder[armpostgresqlflexibleservers.TuningConfigurationClientListSessionsResponse]](), - beginStartSession: newTracker[azfake.PollerResponder[armpostgresqlflexibleservers.TuningConfigurationClientStartSessionResponse]](), - beginStopSession: newTracker[azfake.PollerResponder[armpostgresqlflexibleservers.TuningConfigurationClientStopSessionResponse]](), - } -} - -// TuningConfigurationServerTransport connects instances of armpostgresqlflexibleservers.TuningConfigurationClient to instances of TuningConfigurationServer. -// Don't use this type directly, use NewTuningConfigurationServerTransport instead. -type TuningConfigurationServerTransport struct { - srv *TuningConfigurationServer - beginDisable *tracker[azfake.PollerResponder[armpostgresqlflexibleservers.TuningConfigurationClientDisableResponse]] - beginEnable *tracker[azfake.PollerResponder[armpostgresqlflexibleservers.TuningConfigurationClientEnableResponse]] - newListSessionDetailsPager *tracker[azfake.PagerResponder[armpostgresqlflexibleservers.TuningConfigurationClientListSessionDetailsResponse]] - newListSessionsPager *tracker[azfake.PagerResponder[armpostgresqlflexibleservers.TuningConfigurationClientListSessionsResponse]] - beginStartSession *tracker[azfake.PollerResponder[armpostgresqlflexibleservers.TuningConfigurationClientStartSessionResponse]] - beginStopSession *tracker[azfake.PollerResponder[armpostgresqlflexibleservers.TuningConfigurationClientStopSessionResponse]] -} - -// Do implements the policy.Transporter interface for TuningConfigurationServerTransport. -func (t *TuningConfigurationServerTransport) Do(req *http.Request) (*http.Response, error) { - rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) - method, ok := rawMethod.(string) - if !ok { - return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} - } - - return t.dispatchToMethodFake(req, method) -} - -func (t *TuningConfigurationServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - - go func() { - var intercepted bool - var res result - if tuningConfigurationServerTransportInterceptor != nil { - res.resp, res.err, intercepted = tuningConfigurationServerTransportInterceptor.Do(req) - } - if !intercepted { - switch method { - case "TuningConfigurationClient.BeginDisable": - res.resp, res.err = t.dispatchBeginDisable(req) - case "TuningConfigurationClient.BeginEnable": - res.resp, res.err = t.dispatchBeginEnable(req) - case "TuningConfigurationClient.NewListSessionDetailsPager": - res.resp, res.err = t.dispatchNewListSessionDetailsPager(req) - case "TuningConfigurationClient.NewListSessionsPager": - res.resp, res.err = t.dispatchNewListSessionsPager(req) - case "TuningConfigurationClient.BeginStartSession": - res.resp, res.err = t.dispatchBeginStartSession(req) - case "TuningConfigurationClient.BeginStopSession": - res.resp, res.err = t.dispatchBeginStopSession(req) - default: - res.err = fmt.Errorf("unhandled API %s", method) - } - - } - select { - case resultChan <- res: - case <-req.Context().Done(): - } - }() - - select { - case <-req.Context().Done(): - return nil, req.Context().Err() - case res := <-resultChan: - return res.resp, res.err - } -} - -func (t *TuningConfigurationServerTransport) dispatchBeginDisable(req *http.Request) (*http.Response, error) { - if t.srv.BeginDisable == nil { - return nil, &nonRetriableError{errors.New("fake for method BeginDisable not implemented")} - } - beginDisable := t.beginDisable.get(req) - if beginDisable == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/tuningOptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/disable` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - serverNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("serverName")]) - if err != nil { - return nil, err - } - tuningOptionParam, err := parseWithCast(matches[regex.SubexpIndex("tuningOption")], func(v string) (armpostgresqlflexibleservers.TuningOptionEnum, error) { - p, unescapeErr := url.PathUnescape(v) - if unescapeErr != nil { - return "", unescapeErr - } - return armpostgresqlflexibleservers.TuningOptionEnum(p), nil - }) - if err != nil { - return nil, err - } - respr, errRespr := t.srv.BeginDisable(req.Context(), resourceGroupNameParam, serverNameParam, tuningOptionParam, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - beginDisable = &respr - t.beginDisable.add(req, beginDisable) - } - - resp, err := server.PollerResponderNext(beginDisable, req) - if err != nil { - return nil, err - } - - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { - t.beginDisable.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} - } - if !server.PollerResponderMore(beginDisable) { - t.beginDisable.remove(req) - } - - return resp, nil -} - -func (t *TuningConfigurationServerTransport) dispatchBeginEnable(req *http.Request) (*http.Response, error) { - if t.srv.BeginEnable == nil { - return nil, &nonRetriableError{errors.New("fake for method BeginEnable not implemented")} - } - beginEnable := t.beginEnable.get(req) - if beginEnable == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/tuningOptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/enable` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - serverNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("serverName")]) - if err != nil { - return nil, err - } - tuningOptionParam, err := parseWithCast(matches[regex.SubexpIndex("tuningOption")], func(v string) (armpostgresqlflexibleservers.TuningOptionEnum, error) { - p, unescapeErr := url.PathUnescape(v) - if unescapeErr != nil { - return "", unescapeErr - } - return armpostgresqlflexibleservers.TuningOptionEnum(p), nil - }) - if err != nil { - return nil, err - } - respr, errRespr := t.srv.BeginEnable(req.Context(), resourceGroupNameParam, serverNameParam, tuningOptionParam, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - beginEnable = &respr - t.beginEnable.add(req, beginEnable) - } - - resp, err := server.PollerResponderNext(beginEnable, req) - if err != nil { - return nil, err - } - - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { - t.beginEnable.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} - } - if !server.PollerResponderMore(beginEnable) { - t.beginEnable.remove(req) - } - - return resp, nil -} - -func (t *TuningConfigurationServerTransport) dispatchNewListSessionDetailsPager(req *http.Request) (*http.Response, error) { - if t.srv.NewListSessionDetailsPager == nil { - return nil, &nonRetriableError{errors.New("fake for method NewListSessionDetailsPager not implemented")} - } - newListSessionDetailsPager := t.newListSessionDetailsPager.get(req) - if newListSessionDetailsPager == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/tuningOptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/sessionDetails` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - qp := req.URL.Query() - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - serverNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("serverName")]) - if err != nil { - return nil, err - } - tuningOptionParam, err := parseWithCast(matches[regex.SubexpIndex("tuningOption")], func(v string) (armpostgresqlflexibleservers.TuningOptionEnum, error) { - p, unescapeErr := url.PathUnescape(v) - if unescapeErr != nil { - return "", unescapeErr - } - return armpostgresqlflexibleservers.TuningOptionEnum(p), nil - }) - if err != nil { - return nil, err - } - sessionIDParam, err := url.QueryUnescape(qp.Get("sessionId")) - if err != nil { - return nil, err - } - resp := t.srv.NewListSessionDetailsPager(resourceGroupNameParam, serverNameParam, tuningOptionParam, sessionIDParam, nil) - newListSessionDetailsPager = &resp - t.newListSessionDetailsPager.add(req, newListSessionDetailsPager) - server.PagerResponderInjectNextLinks(newListSessionDetailsPager, req, func(page *armpostgresqlflexibleservers.TuningConfigurationClientListSessionDetailsResponse, createLink func() string) { - page.NextLink = to.Ptr(createLink()) - }) - } - resp, err := server.PagerResponderNext(newListSessionDetailsPager, req) - if err != nil { - return nil, err - } - if !contains([]int{http.StatusOK}, resp.StatusCode) { - t.newListSessionDetailsPager.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} - } - if !server.PagerResponderMore(newListSessionDetailsPager) { - t.newListSessionDetailsPager.remove(req) - } - return resp, nil -} - -func (t *TuningConfigurationServerTransport) dispatchNewListSessionsPager(req *http.Request) (*http.Response, error) { - if t.srv.NewListSessionsPager == nil { - return nil, &nonRetriableError{errors.New("fake for method NewListSessionsPager not implemented")} - } - newListSessionsPager := t.newListSessionsPager.get(req) - if newListSessionsPager == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/tuningOptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/sessions` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - serverNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("serverName")]) - if err != nil { - return nil, err - } - tuningOptionParam, err := parseWithCast(matches[regex.SubexpIndex("tuningOption")], func(v string) (armpostgresqlflexibleservers.TuningOptionEnum, error) { - p, unescapeErr := url.PathUnescape(v) - if unescapeErr != nil { - return "", unescapeErr - } - return armpostgresqlflexibleservers.TuningOptionEnum(p), nil - }) - if err != nil { - return nil, err - } - resp := t.srv.NewListSessionsPager(resourceGroupNameParam, serverNameParam, tuningOptionParam, nil) - newListSessionsPager = &resp - t.newListSessionsPager.add(req, newListSessionsPager) - server.PagerResponderInjectNextLinks(newListSessionsPager, req, func(page *armpostgresqlflexibleservers.TuningConfigurationClientListSessionsResponse, createLink func() string) { - page.NextLink = to.Ptr(createLink()) - }) - } - resp, err := server.PagerResponderNext(newListSessionsPager, req) - if err != nil { - return nil, err - } - if !contains([]int{http.StatusOK}, resp.StatusCode) { - t.newListSessionsPager.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} - } - if !server.PagerResponderMore(newListSessionsPager) { - t.newListSessionsPager.remove(req) - } - return resp, nil -} - -func (t *TuningConfigurationServerTransport) dispatchBeginStartSession(req *http.Request) (*http.Response, error) { - if t.srv.BeginStartSession == nil { - return nil, &nonRetriableError{errors.New("fake for method BeginStartSession not implemented")} - } - beginStartSession := t.beginStartSession.get(req) - if beginStartSession == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/tuningOptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/startSession` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - body, err := server.UnmarshalRequestAsJSON[armpostgresqlflexibleservers.ConfigTuningRequestParameter](req) - if err != nil { - return nil, err - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - serverNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("serverName")]) - if err != nil { - return nil, err - } - tuningOptionParam, err := parseWithCast(matches[regex.SubexpIndex("tuningOption")], func(v string) (armpostgresqlflexibleservers.TuningOptionEnum, error) { - p, unescapeErr := url.PathUnescape(v) - if unescapeErr != nil { - return "", unescapeErr - } - return armpostgresqlflexibleservers.TuningOptionEnum(p), nil - }) - if err != nil { - return nil, err - } - respr, errRespr := t.srv.BeginStartSession(req.Context(), resourceGroupNameParam, serverNameParam, tuningOptionParam, body, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - beginStartSession = &respr - t.beginStartSession.add(req, beginStartSession) - } - - resp, err := server.PollerResponderNext(beginStartSession, req) - if err != nil { - return nil, err - } - - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { - t.beginStartSession.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} - } - if !server.PollerResponderMore(beginStartSession) { - t.beginStartSession.remove(req) - } - - return resp, nil -} - -func (t *TuningConfigurationServerTransport) dispatchBeginStopSession(req *http.Request) (*http.Response, error) { - if t.srv.BeginStopSession == nil { - return nil, &nonRetriableError{errors.New("fake for method BeginStopSession not implemented")} - } - beginStopSession := t.beginStopSession.get(req) - if beginStopSession == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/tuningOptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/stopSession` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - serverNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("serverName")]) - if err != nil { - return nil, err - } - tuningOptionParam, err := parseWithCast(matches[regex.SubexpIndex("tuningOption")], func(v string) (armpostgresqlflexibleservers.TuningOptionEnum, error) { - p, unescapeErr := url.PathUnescape(v) - if unescapeErr != nil { - return "", unescapeErr - } - return armpostgresqlflexibleservers.TuningOptionEnum(p), nil - }) - if err != nil { - return nil, err - } - respr, errRespr := t.srv.BeginStopSession(req.Context(), resourceGroupNameParam, serverNameParam, tuningOptionParam, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - beginStopSession = &respr - t.beginStopSession.add(req, beginStopSession) - } - - resp, err := server.PollerResponderNext(beginStopSession, req) - if err != nil { - return nil, err - } - - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { - t.beginStopSession.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} - } - if !server.PollerResponderMore(beginStopSession) { - t.beginStopSession.remove(req) - } - - return resp, nil -} - -// set this to conditionally intercept incoming requests to TuningConfigurationServerTransport -var tuningConfigurationServerTransportInterceptor interface { - // Do returns true if the server transport should use the returned response/error - Do(*http.Request) (*http.Response, error, bool) -} diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/tuningindex_server.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/tuningindex_server.go deleted file mode 100644 index 9c3c95754c00..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/tuningindex_server.go +++ /dev/null @@ -1,156 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package fake - -import ( - "errors" - "fmt" - azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v5" - "net/http" - "net/url" - "regexp" -) - -// TuningIndexServer is a fake server for instances of the armpostgresqlflexibleservers.TuningIndexClient type. -type TuningIndexServer struct { - // NewListRecommendationsPager is the fake for method TuningIndexClient.NewListRecommendationsPager - // HTTP status codes to indicate success: http.StatusOK - NewListRecommendationsPager func(resourceGroupName string, serverName string, tuningOption armpostgresqlflexibleservers.TuningOptionEnum, options *armpostgresqlflexibleservers.TuningIndexClientListRecommendationsOptions) (resp azfake.PagerResponder[armpostgresqlflexibleservers.TuningIndexClientListRecommendationsResponse]) -} - -// NewTuningIndexServerTransport creates a new instance of TuningIndexServerTransport with the provided implementation. -// The returned TuningIndexServerTransport instance is connected to an instance of armpostgresqlflexibleservers.TuningIndexClient via the -// azcore.ClientOptions.Transporter field in the client's constructor parameters. -func NewTuningIndexServerTransport(srv *TuningIndexServer) *TuningIndexServerTransport { - return &TuningIndexServerTransport{ - srv: srv, - newListRecommendationsPager: newTracker[azfake.PagerResponder[armpostgresqlflexibleservers.TuningIndexClientListRecommendationsResponse]](), - } -} - -// TuningIndexServerTransport connects instances of armpostgresqlflexibleservers.TuningIndexClient to instances of TuningIndexServer. -// Don't use this type directly, use NewTuningIndexServerTransport instead. -type TuningIndexServerTransport struct { - srv *TuningIndexServer - newListRecommendationsPager *tracker[azfake.PagerResponder[armpostgresqlflexibleservers.TuningIndexClientListRecommendationsResponse]] -} - -// Do implements the policy.Transporter interface for TuningIndexServerTransport. -func (t *TuningIndexServerTransport) Do(req *http.Request) (*http.Response, error) { - rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) - method, ok := rawMethod.(string) - if !ok { - return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} - } - - return t.dispatchToMethodFake(req, method) -} - -func (t *TuningIndexServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - - go func() { - var intercepted bool - var res result - if tuningIndexServerTransportInterceptor != nil { - res.resp, res.err, intercepted = tuningIndexServerTransportInterceptor.Do(req) - } - if !intercepted { - switch method { - case "TuningIndexClient.NewListRecommendationsPager": - res.resp, res.err = t.dispatchNewListRecommendationsPager(req) - default: - res.err = fmt.Errorf("unhandled API %s", method) - } - - } - select { - case resultChan <- res: - case <-req.Context().Done(): - } - }() - - select { - case <-req.Context().Done(): - return nil, req.Context().Err() - case res := <-resultChan: - return res.resp, res.err - } -} - -func (t *TuningIndexServerTransport) dispatchNewListRecommendationsPager(req *http.Request) (*http.Response, error) { - if t.srv.NewListRecommendationsPager == nil { - return nil, &nonRetriableError{errors.New("fake for method NewListRecommendationsPager not implemented")} - } - newListRecommendationsPager := t.newListRecommendationsPager.get(req) - if newListRecommendationsPager == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/tuningOptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/recommendations` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - qp := req.URL.Query() - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - serverNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("serverName")]) - if err != nil { - return nil, err - } - tuningOptionParam, err := parseWithCast(matches[regex.SubexpIndex("tuningOption")], func(v string) (armpostgresqlflexibleservers.TuningOptionEnum, error) { - p, unescapeErr := url.PathUnescape(v) - if unescapeErr != nil { - return "", unescapeErr - } - return armpostgresqlflexibleservers.TuningOptionEnum(p), nil - }) - if err != nil { - return nil, err - } - recommendationTypeUnescaped, err := url.QueryUnescape(qp.Get("recommendationType")) - if err != nil { - return nil, err - } - recommendationTypeParam := getOptional(armpostgresqlflexibleservers.RecommendationType(recommendationTypeUnescaped)) - var options *armpostgresqlflexibleservers.TuningIndexClientListRecommendationsOptions - if recommendationTypeParam != nil { - options = &armpostgresqlflexibleservers.TuningIndexClientListRecommendationsOptions{ - RecommendationType: recommendationTypeParam, - } - } - resp := t.srv.NewListRecommendationsPager(resourceGroupNameParam, serverNameParam, tuningOptionParam, options) - newListRecommendationsPager = &resp - t.newListRecommendationsPager.add(req, newListRecommendationsPager) - server.PagerResponderInjectNextLinks(newListRecommendationsPager, req, func(page *armpostgresqlflexibleservers.TuningIndexClientListRecommendationsResponse, createLink func() string) { - page.NextLink = to.Ptr(createLink()) - }) - } - resp, err := server.PagerResponderNext(newListRecommendationsPager, req) - if err != nil { - return nil, err - } - if !contains([]int{http.StatusOK}, resp.StatusCode) { - t.newListRecommendationsPager.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} - } - if !server.PagerResponderMore(newListRecommendationsPager) { - t.newListRecommendationsPager.remove(req) - } - return resp, nil -} - -// set this to conditionally intercept incoming requests to TuningIndexServerTransport -var tuningIndexServerTransportInterceptor interface { - // Do returns true if the server transport should use the returned response/error - Do(*http.Request) (*http.Response, error, bool) -} diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/tuningoptions_server.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/tuningoptions_server.go index 8dd010745450..8dcfb07a1fa1 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/tuningoptions_server.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/tuningoptions_server.go @@ -23,11 +23,15 @@ import ( type TuningOptionsServer struct { // Get is the fake for method TuningOptionsClient.Get // HTTP status codes to indicate success: http.StatusOK - Get func(ctx context.Context, resourceGroupName string, serverName string, tuningOption armpostgresqlflexibleservers.TuningOptionEnum, options *armpostgresqlflexibleservers.TuningOptionsClientGetOptions) (resp azfake.Responder[armpostgresqlflexibleservers.TuningOptionsClientGetResponse], errResp azfake.ErrorResponder) + Get func(ctx context.Context, resourceGroupName string, serverName string, tuningOption armpostgresqlflexibleservers.TuningOptionParameterEnum, options *armpostgresqlflexibleservers.TuningOptionsClientGetOptions) (resp azfake.Responder[armpostgresqlflexibleservers.TuningOptionsClientGetResponse], errResp azfake.ErrorResponder) // NewListByServerPager is the fake for method TuningOptionsClient.NewListByServerPager // HTTP status codes to indicate success: http.StatusOK NewListByServerPager func(resourceGroupName string, serverName string, options *armpostgresqlflexibleservers.TuningOptionsClientListByServerOptions) (resp azfake.PagerResponder[armpostgresqlflexibleservers.TuningOptionsClientListByServerResponse]) + + // NewListRecommendationsPager is the fake for method TuningOptionsClient.NewListRecommendationsPager + // HTTP status codes to indicate success: http.StatusOK + NewListRecommendationsPager func(resourceGroupName string, serverName string, tuningOption armpostgresqlflexibleservers.TuningOptionParameterEnum, options *armpostgresqlflexibleservers.TuningOptionsClientListRecommendationsOptions) (resp azfake.PagerResponder[armpostgresqlflexibleservers.TuningOptionsClientListRecommendationsResponse]) } // NewTuningOptionsServerTransport creates a new instance of TuningOptionsServerTransport with the provided implementation. @@ -35,16 +39,18 @@ type TuningOptionsServer struct { // azcore.ClientOptions.Transporter field in the client's constructor parameters. func NewTuningOptionsServerTransport(srv *TuningOptionsServer) *TuningOptionsServerTransport { return &TuningOptionsServerTransport{ - srv: srv, - newListByServerPager: newTracker[azfake.PagerResponder[armpostgresqlflexibleservers.TuningOptionsClientListByServerResponse]](), + srv: srv, + newListByServerPager: newTracker[azfake.PagerResponder[armpostgresqlflexibleservers.TuningOptionsClientListByServerResponse]](), + newListRecommendationsPager: newTracker[azfake.PagerResponder[armpostgresqlflexibleservers.TuningOptionsClientListRecommendationsResponse]](), } } // TuningOptionsServerTransport connects instances of armpostgresqlflexibleservers.TuningOptionsClient to instances of TuningOptionsServer. // Don't use this type directly, use NewTuningOptionsServerTransport instead. type TuningOptionsServerTransport struct { - srv *TuningOptionsServer - newListByServerPager *tracker[azfake.PagerResponder[armpostgresqlflexibleservers.TuningOptionsClientListByServerResponse]] + srv *TuningOptionsServer + newListByServerPager *tracker[azfake.PagerResponder[armpostgresqlflexibleservers.TuningOptionsClientListByServerResponse]] + newListRecommendationsPager *tracker[azfake.PagerResponder[armpostgresqlflexibleservers.TuningOptionsClientListRecommendationsResponse]] } // Do implements the policy.Transporter interface for TuningOptionsServerTransport. @@ -74,6 +80,8 @@ func (t *TuningOptionsServerTransport) dispatchToMethodFake(req *http.Request, m res.resp, res.err = t.dispatchGet(req) case "TuningOptionsClient.NewListByServerPager": res.resp, res.err = t.dispatchNewListByServerPager(req) + case "TuningOptionsClient.NewListRecommendationsPager": + res.resp, res.err = t.dispatchNewListRecommendationsPager(req) default: res.err = fmt.Errorf("unhandled API %s", method) } @@ -100,7 +108,7 @@ func (t *TuningOptionsServerTransport) dispatchGet(req *http.Request) (*http.Res const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/tuningOptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { + if len(matches) < 5 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -111,12 +119,12 @@ func (t *TuningOptionsServerTransport) dispatchGet(req *http.Request) (*http.Res if err != nil { return nil, err } - tuningOptionParam, err := parseWithCast(matches[regex.SubexpIndex("tuningOption")], func(v string) (armpostgresqlflexibleservers.TuningOptionEnum, error) { + tuningOptionParam, err := parseWithCast(matches[regex.SubexpIndex("tuningOption")], func(v string) (armpostgresqlflexibleservers.TuningOptionParameterEnum, error) { p, unescapeErr := url.PathUnescape(v) if unescapeErr != nil { return "", unescapeErr } - return armpostgresqlflexibleservers.TuningOptionEnum(p), nil + return armpostgresqlflexibleservers.TuningOptionParameterEnum(p), nil }) if err != nil { return nil, err @@ -129,7 +137,7 @@ func (t *TuningOptionsServerTransport) dispatchGet(req *http.Request) (*http.Res if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } - resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).TuningOptionsResource, req) + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).TuningOptions, req) if err != nil { return nil, err } @@ -145,7 +153,7 @@ func (t *TuningOptionsServerTransport) dispatchNewListByServerPager(req *http.Re const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/tuningOptions` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { + if len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -177,6 +185,69 @@ func (t *TuningOptionsServerTransport) dispatchNewListByServerPager(req *http.Re return resp, nil } +func (t *TuningOptionsServerTransport) dispatchNewListRecommendationsPager(req *http.Request) (*http.Response, error) { + if t.srv.NewListRecommendationsPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListRecommendationsPager not implemented")} + } + newListRecommendationsPager := t.newListRecommendationsPager.get(req) + if newListRecommendationsPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/tuningOptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/recommendations` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if len(matches) < 5 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + qp := req.URL.Query() + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + serverNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("serverName")]) + if err != nil { + return nil, err + } + tuningOptionParam, err := parseWithCast(matches[regex.SubexpIndex("tuningOption")], func(v string) (armpostgresqlflexibleservers.TuningOptionParameterEnum, error) { + p, unescapeErr := url.PathUnescape(v) + if unescapeErr != nil { + return "", unescapeErr + } + return armpostgresqlflexibleservers.TuningOptionParameterEnum(p), nil + }) + if err != nil { + return nil, err + } + recommendationTypeUnescaped, err := url.QueryUnescape(qp.Get("recommendationType")) + if err != nil { + return nil, err + } + recommendationTypeParam := getOptional(armpostgresqlflexibleservers.RecommendationTypeParameterEnum(recommendationTypeUnescaped)) + var options *armpostgresqlflexibleservers.TuningOptionsClientListRecommendationsOptions + if recommendationTypeParam != nil { + options = &armpostgresqlflexibleservers.TuningOptionsClientListRecommendationsOptions{ + RecommendationType: recommendationTypeParam, + } + } + resp := t.srv.NewListRecommendationsPager(resourceGroupNameParam, serverNameParam, tuningOptionParam, options) + newListRecommendationsPager = &resp + t.newListRecommendationsPager.add(req, newListRecommendationsPager) + server.PagerResponderInjectNextLinks(newListRecommendationsPager, req, func(page *armpostgresqlflexibleservers.TuningOptionsClientListRecommendationsResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListRecommendationsPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + t.newListRecommendationsPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListRecommendationsPager) { + t.newListRecommendationsPager.remove(req) + } + return resp, nil +} + // set this to conditionally intercept incoming requests to TuningOptionsServerTransport var tuningOptionsServerTransportInterceptor interface { // Do returns true if the server transport should use the returned response/error diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/virtualendpoints_server.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/virtualendpoints_server.go index b52446bed10a..7f5dff8a8954 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/virtualendpoints_server.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/virtualendpoints_server.go @@ -22,8 +22,8 @@ import ( // VirtualEndpointsServer is a fake server for instances of the armpostgresqlflexibleservers.VirtualEndpointsClient type. type VirtualEndpointsServer struct { // BeginCreate is the fake for method VirtualEndpointsClient.BeginCreate - // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated, http.StatusAccepted - BeginCreate func(ctx context.Context, resourceGroupName string, serverName string, virtualEndpointName string, parameters armpostgresqlflexibleservers.VirtualEndpointResource, options *armpostgresqlflexibleservers.VirtualEndpointsClientBeginCreateOptions) (resp azfake.PollerResponder[armpostgresqlflexibleservers.VirtualEndpointsClientCreateResponse], errResp azfake.ErrorResponder) + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent + BeginCreate func(ctx context.Context, resourceGroupName string, serverName string, virtualEndpointName string, parameters armpostgresqlflexibleservers.VirtualEndpoint, options *armpostgresqlflexibleservers.VirtualEndpointsClientBeginCreateOptions) (resp azfake.PollerResponder[armpostgresqlflexibleservers.VirtualEndpointsClientCreateResponse], errResp azfake.ErrorResponder) // BeginDelete is the fake for method VirtualEndpointsClient.BeginDelete // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent @@ -38,7 +38,7 @@ type VirtualEndpointsServer struct { NewListByServerPager func(resourceGroupName string, serverName string, options *armpostgresqlflexibleservers.VirtualEndpointsClientListByServerOptions) (resp azfake.PagerResponder[armpostgresqlflexibleservers.VirtualEndpointsClientListByServerResponse]) // BeginUpdate is the fake for method VirtualEndpointsClient.BeginUpdate - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginUpdate func(ctx context.Context, resourceGroupName string, serverName string, virtualEndpointName string, parameters armpostgresqlflexibleservers.VirtualEndpointResourceForPatch, options *armpostgresqlflexibleservers.VirtualEndpointsClientBeginUpdateOptions) (resp azfake.PollerResponder[armpostgresqlflexibleservers.VirtualEndpointsClientUpdateResponse], errResp azfake.ErrorResponder) } @@ -126,10 +126,10 @@ func (v *VirtualEndpointsServerTransport) dispatchBeginCreate(req *http.Request) const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/virtualendpoints/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { + if len(matches) < 5 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } - body, err := server.UnmarshalRequestAsJSON[armpostgresqlflexibleservers.VirtualEndpointResource](req) + body, err := server.UnmarshalRequestAsJSON[armpostgresqlflexibleservers.VirtualEndpoint](req) if err != nil { return nil, err } @@ -158,9 +158,9 @@ func (v *VirtualEndpointsServerTransport) dispatchBeginCreate(req *http.Request) return nil, err } - if !contains([]int{http.StatusOK, http.StatusCreated, http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { v.beginCreate.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated, http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginCreate) { v.beginCreate.remove(req) @@ -178,7 +178,7 @@ func (v *VirtualEndpointsServerTransport) dispatchBeginDelete(req *http.Request) const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/virtualendpoints/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { + if len(matches) < 5 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -224,7 +224,7 @@ func (v *VirtualEndpointsServerTransport) dispatchGet(req *http.Request) (*http. const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/virtualendpoints/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { + if len(matches) < 5 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -247,7 +247,7 @@ func (v *VirtualEndpointsServerTransport) dispatchGet(req *http.Request) (*http. if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } - resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).VirtualEndpointResource, req) + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).VirtualEndpoint, req) if err != nil { return nil, err } @@ -263,7 +263,7 @@ func (v *VirtualEndpointsServerTransport) dispatchNewListByServerPager(req *http const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/virtualendpoints` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { + if len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -304,7 +304,7 @@ func (v *VirtualEndpointsServerTransport) dispatchBeginUpdate(req *http.Request) const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/virtualendpoints/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { + if len(matches) < 5 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } body, err := server.UnmarshalRequestAsJSON[armpostgresqlflexibleservers.VirtualEndpointResourceForPatch](req) @@ -336,9 +336,9 @@ func (v *VirtualEndpointsServerTransport) dispatchBeginUpdate(req *http.Request) return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { v.beginUpdate.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginUpdate) { v.beginUpdate.remove(req) diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/virtualnetworksubnetusage_server.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/virtualnetworksubnetusage_server.go index d9f0d58c3b98..afbe502cf5d7 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/virtualnetworksubnetusage_server.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/virtualnetworksubnetusage_server.go @@ -20,9 +20,9 @@ import ( // VirtualNetworkSubnetUsageServer is a fake server for instances of the armpostgresqlflexibleservers.VirtualNetworkSubnetUsageClient type. type VirtualNetworkSubnetUsageServer struct { - // Execute is the fake for method VirtualNetworkSubnetUsageClient.Execute + // List is the fake for method VirtualNetworkSubnetUsageClient.List // HTTP status codes to indicate success: http.StatusOK - Execute func(ctx context.Context, locationName string, parameters armpostgresqlflexibleservers.VirtualNetworkSubnetUsageParameter, options *armpostgresqlflexibleservers.VirtualNetworkSubnetUsageClientExecuteOptions) (resp azfake.Responder[armpostgresqlflexibleservers.VirtualNetworkSubnetUsageClientExecuteResponse], errResp azfake.ErrorResponder) + List func(ctx context.Context, locationName string, parameters armpostgresqlflexibleservers.VirtualNetworkSubnetUsageParameter, options *armpostgresqlflexibleservers.VirtualNetworkSubnetUsageClientListOptions) (resp azfake.Responder[armpostgresqlflexibleservers.VirtualNetworkSubnetUsageClientListResponse], errResp azfake.ErrorResponder) } // NewVirtualNetworkSubnetUsageServerTransport creates a new instance of VirtualNetworkSubnetUsageServerTransport with the provided implementation. @@ -61,8 +61,8 @@ func (v *VirtualNetworkSubnetUsageServerTransport) dispatchToMethodFake(req *htt } if !intercepted { switch method { - case "VirtualNetworkSubnetUsageClient.Execute": - res.resp, res.err = v.dispatchExecute(req) + case "VirtualNetworkSubnetUsageClient.List": + res.resp, res.err = v.dispatchList(req) default: res.err = fmt.Errorf("unhandled API %s", method) } @@ -82,14 +82,14 @@ func (v *VirtualNetworkSubnetUsageServerTransport) dispatchToMethodFake(req *htt } } -func (v *VirtualNetworkSubnetUsageServerTransport) dispatchExecute(req *http.Request) (*http.Response, error) { - if v.srv.Execute == nil { - return nil, &nonRetriableError{errors.New("fake for method Execute not implemented")} +func (v *VirtualNetworkSubnetUsageServerTransport) dispatchList(req *http.Request) (*http.Response, error) { + if v.srv.List == nil { + return nil, &nonRetriableError{errors.New("fake for method List not implemented")} } const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/locations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/checkVirtualNetworkSubnetUsage` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 2 { + if len(matches) < 3 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } body, err := server.UnmarshalRequestAsJSON[armpostgresqlflexibleservers.VirtualNetworkSubnetUsageParameter](req) @@ -100,7 +100,7 @@ func (v *VirtualNetworkSubnetUsageServerTransport) dispatchExecute(req *http.Req if err != nil { return nil, err } - respr, errRespr := v.srv.Execute(req.Context(), locationNameParam, body, nil) + respr, errRespr := v.srv.List(req.Context(), locationNameParam, body, nil) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } @@ -108,7 +108,7 @@ func (v *VirtualNetworkSubnetUsageServerTransport) dispatchExecute(req *http.Req if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } - resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).VirtualNetworkSubnetUsageResult, req) + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).VirtualNetworkSubnetUsageModel, req) if err != nil { return nil, err } diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/firewallrules_client.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/firewallrules_client.go index 987a6444b67e..75cd8eb1af75 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/firewallrules_client.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/firewallrules_client.go @@ -27,7 +27,7 @@ type FirewallRulesClient struct { // NewFirewallRulesClient creates a new instance of FirewallRulesClient with the specified values. // - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. +// - options - Contains optional client configuration. Pass nil to accept the default values. func NewFirewallRulesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*FirewallRulesClient, error) { cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) if err != nil { @@ -43,11 +43,11 @@ func NewFirewallRulesClient(subscriptionID string, credential azcore.TokenCreden // BeginCreateOrUpdate - Creates a new firewall rule or updates an existing firewall rule. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-01-01-preview +// Generated from API version 2025-08-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. -// - firewallRuleName - The name of the server firewall rule. -// - parameters - The required parameters for creating or updating a firewall rule. +// - firewallRuleName - Name of the firewall rule. +// - parameters - Parameters required for creating or updating a firewall rule. // - options - FirewallRulesClientBeginCreateOrUpdateOptions contains the optional parameters for the FirewallRulesClient.BeginCreateOrUpdate // method. func (client *FirewallRulesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, firewallRuleName string, parameters FirewallRule, options *FirewallRulesClientBeginCreateOrUpdateOptions) (*runtime.Poller[FirewallRulesClientCreateOrUpdateResponse], error) { @@ -71,7 +71,7 @@ func (client *FirewallRulesClient) BeginCreateOrUpdate(ctx context.Context, reso // CreateOrUpdate - Creates a new firewall rule or updates an existing firewall rule. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-01-01-preview +// Generated from API version 2025-08-01 func (client *FirewallRulesClient) createOrUpdate(ctx context.Context, resourceGroupName string, serverName string, firewallRuleName string, parameters FirewallRule, options *FirewallRulesClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "FirewallRulesClient.BeginCreateOrUpdate" @@ -86,7 +86,7 @@ func (client *FirewallRulesClient) createOrUpdate(ctx context.Context, resourceG if err != nil { return nil, err } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { + if !runtime.HasStatusCode(httpResp, http.StatusAccepted) { err = runtime.NewResponseError(httpResp) return nil, err } @@ -117,7 +117,7 @@ func (client *FirewallRulesClient) createOrUpdateCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-01-01-preview") + reqQP.Set("api-version", "2025-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -126,13 +126,13 @@ func (client *FirewallRulesClient) createOrUpdateCreateRequest(ctx context.Conte return req, nil } -// BeginDelete - Deletes a PostgreSQL server firewall rule. +// BeginDelete - Deletes an existing firewall rule. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-01-01-preview +// Generated from API version 2025-08-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. -// - firewallRuleName - The name of the server firewall rule. +// - firewallRuleName - Name of the firewall rule. // - options - FirewallRulesClientBeginDeleteOptions contains the optional parameters for the FirewallRulesClient.BeginDelete // method. func (client *FirewallRulesClient) BeginDelete(ctx context.Context, resourceGroupName string, serverName string, firewallRuleName string, options *FirewallRulesClientBeginDeleteOptions) (*runtime.Poller[FirewallRulesClientDeleteResponse], error) { @@ -153,10 +153,10 @@ func (client *FirewallRulesClient) BeginDelete(ctx context.Context, resourceGrou } } -// Delete - Deletes a PostgreSQL server firewall rule. +// Delete - Deletes an existing firewall rule. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-01-01-preview +// Generated from API version 2025-08-01 func (client *FirewallRulesClient) deleteOperation(ctx context.Context, resourceGroupName string, serverName string, firewallRuleName string, options *FirewallRulesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "FirewallRulesClient.BeginDelete" @@ -171,7 +171,7 @@ func (client *FirewallRulesClient) deleteOperation(ctx context.Context, resource if err != nil { return nil, err } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + if !runtime.HasStatusCode(httpResp, http.StatusAccepted, http.StatusNoContent) { err = runtime.NewResponseError(httpResp) return nil, err } @@ -202,19 +202,19 @@ func (client *FirewallRulesClient) deleteCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-01-01-preview") + reqQP.Set("api-version", "2025-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } -// Get - List all the firewall rules in a given server. +// Get - Gets information about a firewall rule in a server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-01-01-preview +// Generated from API version 2025-08-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. -// - firewallRuleName - The name of the server firewall rule. +// - firewallRuleName - Name of the firewall rule. // - options - FirewallRulesClientGetOptions contains the optional parameters for the FirewallRulesClient.Get method. func (client *FirewallRulesClient) Get(ctx context.Context, resourceGroupName string, serverName string, firewallRuleName string, options *FirewallRulesClientGetOptions) (FirewallRulesClientGetResponse, error) { var err error @@ -262,7 +262,7 @@ func (client *FirewallRulesClient) getCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-01-01-preview") + reqQP.Set("api-version", "2025-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -277,9 +277,9 @@ func (client *FirewallRulesClient) getHandleResponse(resp *http.Response) (Firew return result, nil } -// NewListByServerPager - List all the firewall rules in a given PostgreSQL server. +// NewListByServerPager - Lists information about all firewall rules in a server. // -// Generated from API version 2025-01-01-preview +// Generated from API version 2025-08-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - options - FirewallRulesClientListByServerOptions contains the optional parameters for the FirewallRulesClient.NewListByServerPager @@ -327,7 +327,7 @@ func (client *FirewallRulesClient) listByServerCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-01-01-preview") + reqQP.Set("api-version", "2025-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -336,7 +336,7 @@ func (client *FirewallRulesClient) listByServerCreateRequest(ctx context.Context // listByServerHandleResponse handles the ListByServer response. func (client *FirewallRulesClient) listByServerHandleResponse(resp *http.Response) (FirewallRulesClientListByServerResponse, error) { result := FirewallRulesClientListByServerResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.FirewallRuleListResult); err != nil { + if err := runtime.UnmarshalAsJSON(resp, &result.FirewallRuleList); err != nil { return FirewallRulesClientListByServerResponse{}, err } return result, nil diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/firewallrules_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/firewallrules_client_example_test.go index 0bd4cd7e2133..dfaee39074aa 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/firewallrules_client_example_test.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/firewallrules_client_example_test.go @@ -18,7 +18,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v5" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b1f4d539964453ce8008e4b069e59885e12ba441/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/FirewallRuleCreate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/735d21dbd7e1cc446babf58860af4cca757d620d/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/FirewallRulesCreateOrUpdate.json func ExampleFirewallRulesClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -29,7 +29,7 @@ func ExampleFirewallRulesClient_BeginCreateOrUpdate() { if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewFirewallRulesClient().BeginCreateOrUpdate(ctx, "testrg", "testserver", "rule1", armpostgresqlflexibleservers.FirewallRule{ + poller, err := clientFactory.NewFirewallRulesClient().BeginCreateOrUpdate(ctx, "exampleresourcegroup", "exampleserver", "examplefirewallrule", armpostgresqlflexibleservers.FirewallRule{ Properties: &armpostgresqlflexibleservers.FirewallRuleProperties{ EndIPAddress: to.Ptr("255.255.255.255"), StartIPAddress: to.Ptr("0.0.0.0"), @@ -38,25 +38,13 @@ func ExampleFirewallRulesClient_BeginCreateOrUpdate() { if err != nil { log.Fatalf("failed to finish the request: %v", err) } - res, err := poller.PollUntilDone(ctx, nil) + _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.FirewallRule = armpostgresqlflexibleservers.FirewallRule{ - // Name: to.Ptr("rule1"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/firewallRules"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/servers/testserver/firewallRules/rule1"), - // Properties: &armpostgresqlflexibleservers.FirewallRuleProperties{ - // EndIPAddress: to.Ptr("255.255.255.255"), - // StartIPAddress: to.Ptr("0.0.0.0"), - // }, - // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b1f4d539964453ce8008e4b069e59885e12ba441/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/FirewallRuleDelete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/735d21dbd7e1cc446babf58860af4cca757d620d/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/FirewallRulesDelete.json func ExampleFirewallRulesClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -67,7 +55,7 @@ func ExampleFirewallRulesClient_BeginDelete() { if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewFirewallRulesClient().BeginDelete(ctx, "testrg", "testserver", "rule1", nil) + poller, err := clientFactory.NewFirewallRulesClient().BeginDelete(ctx, "exampleresourcegroup", "exampleserver", "examplefirewallrule", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -77,7 +65,7 @@ func ExampleFirewallRulesClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b1f4d539964453ce8008e4b069e59885e12ba441/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/FirewallRuleGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/735d21dbd7e1cc446babf58860af4cca757d620d/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/FirewallRulesGet.json func ExampleFirewallRulesClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -88,7 +76,7 @@ func ExampleFirewallRulesClient_Get() { if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewFirewallRulesClient().Get(ctx, "testrg", "testserver", "rule1", nil) + res, err := clientFactory.NewFirewallRulesClient().Get(ctx, "exampleresourcegroup", "exampleserver", "examplefirewallrule", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -96,9 +84,9 @@ func ExampleFirewallRulesClient_Get() { _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.FirewallRule = armpostgresqlflexibleservers.FirewallRule{ - // Name: to.Ptr("rule1"), + // Name: to.Ptr("examplefirewallrule"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/firewallRules"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/servers/testserver/firewallRules/rule1"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/servers/exampleserver/firewallRules/examplefirewallrule"), // Properties: &armpostgresqlflexibleservers.FirewallRuleProperties{ // EndIPAddress: to.Ptr("255.255.255.255"), // StartIPAddress: to.Ptr("0.0.0.0"), @@ -106,7 +94,7 @@ func ExampleFirewallRulesClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b1f4d539964453ce8008e4b069e59885e12ba441/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/FirewallRuleListByServer.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/735d21dbd7e1cc446babf58860af4cca757d620d/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/FirewallRulesListByServer.json func ExampleFirewallRulesClient_NewListByServerPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -117,7 +105,7 @@ func ExampleFirewallRulesClient_NewListByServerPager() { if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewFirewallRulesClient().NewListByServerPager("testrg", "testserver", nil) + pager := clientFactory.NewFirewallRulesClient().NewListByServerPager("exampleresourcegroup", "exampleserver", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -128,21 +116,21 @@ func ExampleFirewallRulesClient_NewListByServerPager() { _ = v } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.FirewallRuleListResult = armpostgresqlflexibleservers.FirewallRuleListResult{ + // page.FirewallRuleList = armpostgresqlflexibleservers.FirewallRuleList{ // Value: []*armpostgresqlflexibleservers.FirewallRule{ // { - // Name: to.Ptr("rule1"), + // Name: to.Ptr("examplefirewallrule1"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/firewallRules"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/firewallRules/rule1"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/firewallRules/examplefirewallrule1"), // Properties: &armpostgresqlflexibleservers.FirewallRuleProperties{ // EndIPAddress: to.Ptr("255.255.255.255"), // StartIPAddress: to.Ptr("0.0.0.0"), // }, // }, // { - // Name: to.Ptr("rule2"), + // Name: to.Ptr("examplefirewallrule2"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/firewallRules"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/firewallRules/rule2"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/firewallRules/examplefirewallrule2"), // Properties: &armpostgresqlflexibleservers.FirewallRuleProperties{ // EndIPAddress: to.Ptr("255.0.0.0"), // StartIPAddress: to.Ptr("1.0.0.0"), diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/flexibleserver_client.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/flexibleserver_client.go deleted file mode 100644 index 64288b608209..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/flexibleserver_client.go +++ /dev/null @@ -1,195 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armpostgresqlflexibleservers - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// FlexibleServerClient contains the methods for the FlexibleServer group. -// Don't use this type directly, use NewFlexibleServerClient() instead. -type FlexibleServerClient struct { - internal *arm.Client - subscriptionID string -} - -// NewFlexibleServerClient creates a new instance of FlexibleServerClient with the specified values. -// - subscriptionID - The ID of the target subscription. The value must be an UUID. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewFlexibleServerClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*FlexibleServerClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &FlexibleServerClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// BeginStartLtrBackup - Start the Long Term Retention Backup operation -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-01-01-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - serverName - The name of the server. -// - parameters - Request body for operation -// - options - FlexibleServerClientBeginStartLtrBackupOptions contains the optional parameters for the FlexibleServerClient.BeginStartLtrBackup -// method. -func (client *FlexibleServerClient) BeginStartLtrBackup(ctx context.Context, resourceGroupName string, serverName string, parameters LtrBackupRequest, options *FlexibleServerClientBeginStartLtrBackupOptions) (*runtime.Poller[FlexibleServerClientStartLtrBackupResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.startLtrBackup(ctx, resourceGroupName, serverName, parameters, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[FlexibleServerClientStartLtrBackupResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[FlexibleServerClientStartLtrBackupResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// StartLtrBackup - Start the Long Term Retention Backup operation -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-01-01-preview -func (client *FlexibleServerClient) startLtrBackup(ctx context.Context, resourceGroupName string, serverName string, parameters LtrBackupRequest, options *FlexibleServerClientBeginStartLtrBackupOptions) (*http.Response, error) { - var err error - const operationName = "FlexibleServerClient.BeginStartLtrBackup" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.startLtrBackupCreateRequest(ctx, resourceGroupName, serverName, parameters, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// startLtrBackupCreateRequest creates the StartLtrBackup request. -func (client *FlexibleServerClient) startLtrBackupCreateRequest(ctx context.Context, resourceGroupName string, serverName string, parameters LtrBackupRequest, _ *FlexibleServerClientBeginStartLtrBackupOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/startLtrBackup" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if serverName == "" { - return nil, errors.New("parameter serverName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{serverName}", url.PathEscape(serverName)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-01-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, parameters); err != nil { - return nil, err - } - return req, nil -} - -// TriggerLtrPreBackup - PreBackup operation performs all the checks that are needed for the subsequent long term retention -// backup operation to succeed. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-01-01-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - serverName - The name of the server. -// - parameters - Request body for operation -// - options - FlexibleServerClientTriggerLtrPreBackupOptions contains the optional parameters for the FlexibleServerClient.TriggerLtrPreBackup -// method. -func (client *FlexibleServerClient) TriggerLtrPreBackup(ctx context.Context, resourceGroupName string, serverName string, parameters LtrPreBackupRequest, options *FlexibleServerClientTriggerLtrPreBackupOptions) (FlexibleServerClientTriggerLtrPreBackupResponse, error) { - var err error - const operationName = "FlexibleServerClient.TriggerLtrPreBackup" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.triggerLtrPreBackupCreateRequest(ctx, resourceGroupName, serverName, parameters, options) - if err != nil { - return FlexibleServerClientTriggerLtrPreBackupResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return FlexibleServerClientTriggerLtrPreBackupResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return FlexibleServerClientTriggerLtrPreBackupResponse{}, err - } - resp, err := client.triggerLtrPreBackupHandleResponse(httpResp) - return resp, err -} - -// triggerLtrPreBackupCreateRequest creates the TriggerLtrPreBackup request. -func (client *FlexibleServerClient) triggerLtrPreBackupCreateRequest(ctx context.Context, resourceGroupName string, serverName string, parameters LtrPreBackupRequest, _ *FlexibleServerClientTriggerLtrPreBackupOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/ltrPreBackup" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if serverName == "" { - return nil, errors.New("parameter serverName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{serverName}", url.PathEscape(serverName)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-01-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, parameters); err != nil { - return nil, err - } - return req, nil -} - -// triggerLtrPreBackupHandleResponse handles the TriggerLtrPreBackup response. -func (client *FlexibleServerClient) triggerLtrPreBackupHandleResponse(resp *http.Response) (FlexibleServerClientTriggerLtrPreBackupResponse, error) { - result := FlexibleServerClientTriggerLtrPreBackupResponse{} - if val := resp.Header.Get("x-ms-request-id"); val != "" { - result.XMSRequestID = &val - } - if err := runtime.UnmarshalAsJSON(resp, &result.LtrPreBackupResponse); err != nil { - return FlexibleServerClientTriggerLtrPreBackupResponse{}, err - } - return result, nil -} diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/getprivatednszonesuffix_client.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/getprivatednszonesuffix_client.go deleted file mode 100644 index 86f2037da988..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/getprivatednszonesuffix_client.go +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armpostgresqlflexibleservers - -import ( - "context" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" -) - -// GetPrivateDNSZoneSuffixClient contains the methods for the GetPrivateDNSZoneSuffix group. -// Don't use this type directly, use NewGetPrivateDNSZoneSuffixClient() instead. -type GetPrivateDNSZoneSuffixClient struct { - internal *arm.Client -} - -// NewGetPrivateDNSZoneSuffixClient creates a new instance of GetPrivateDNSZoneSuffixClient with the specified values. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewGetPrivateDNSZoneSuffixClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*GetPrivateDNSZoneSuffixClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &GetPrivateDNSZoneSuffixClient{ - internal: cl, - } - return client, nil -} - -// Execute - Get private DNS zone suffix in the cloud -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-01-01-preview -// - options - GetPrivateDNSZoneSuffixClientExecuteOptions contains the optional parameters for the GetPrivateDNSZoneSuffixClient.Execute -// method. -func (client *GetPrivateDNSZoneSuffixClient) Execute(ctx context.Context, options *GetPrivateDNSZoneSuffixClientExecuteOptions) (GetPrivateDNSZoneSuffixClientExecuteResponse, error) { - var err error - const operationName = "GetPrivateDNSZoneSuffixClient.Execute" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.executeCreateRequest(ctx, options) - if err != nil { - return GetPrivateDNSZoneSuffixClientExecuteResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return GetPrivateDNSZoneSuffixClientExecuteResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return GetPrivateDNSZoneSuffixClientExecuteResponse{}, err - } - resp, err := client.executeHandleResponse(httpResp) - return resp, err -} - -// executeCreateRequest creates the Execute request. -func (client *GetPrivateDNSZoneSuffixClient) executeCreateRequest(ctx context.Context, _ *GetPrivateDNSZoneSuffixClientExecuteOptions) (*policy.Request, error) { - urlPath := "/providers/Microsoft.DBforPostgreSQL/getPrivateDnsZoneSuffix" - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-01-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// executeHandleResponse handles the Execute response. -func (client *GetPrivateDNSZoneSuffixClient) executeHandleResponse(resp *http.Response) (GetPrivateDNSZoneSuffixClientExecuteResponse, error) { - result := GetPrivateDNSZoneSuffixClientExecuteResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.Value); err != nil { - return GetPrivateDNSZoneSuffixClientExecuteResponse{}, err - } - return result, nil -} diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/go.mod b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/go.mod index 364b5e0a3f62..adefc65016f7 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/go.mod +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/go.mod @@ -3,8 +3,8 @@ module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostg go 1.23.0 require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.18.1 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.10.1 + github.com/Azure/azure-sdk-for-go/sdk/azcore v1.20.0 + github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.13.1 github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1.2.0 ) @@ -15,16 +15,16 @@ require ( ) require ( - github.com/Azure/azure-sdk-for-go/sdk/internal v1.11.1 + github.com/Azure/azure-sdk-for-go/sdk/internal v1.11.2 github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3 v3.1.0 - github.com/AzureAD/microsoft-authentication-library-for-go v1.4.2 // indirect - github.com/golang-jwt/jwt/v5 v5.2.2 // indirect + github.com/AzureAD/microsoft-authentication-library-for-go v1.6.0 // indirect + github.com/golang-jwt/jwt/v5 v5.3.0 // indirect github.com/google/uuid v1.6.0 // indirect github.com/kylelemons/godebug v1.1.0 // indirect github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect - github.com/stretchr/testify v1.10.0 - golang.org/x/crypto v0.40.0 // indirect - golang.org/x/net v0.42.0 // indirect - golang.org/x/sys v0.34.0 // indirect - golang.org/x/text v0.27.0 // indirect + github.com/stretchr/testify v1.11.1 + golang.org/x/crypto v0.41.0 // indirect + golang.org/x/net v0.43.0 // indirect + golang.org/x/sys v0.35.0 // indirect + golang.org/x/text v0.28.0 // indirect ) diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/go.sum b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/go.sum index 2bf8ec4cf7b1..87f09be937cc 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/go.sum +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/go.sum @@ -1,11 +1,11 @@ -github.com/Azure/azure-sdk-for-go/sdk/azcore v1.18.1 h1:Wc1ml6QlJs2BHQ/9Bqu1jiyggbsSjramq2oUmp5WeIo= -github.com/Azure/azure-sdk-for-go/sdk/azcore v1.18.1/go.mod h1:Ot/6aikWnKWi4l9QB7qVSwa8iMphQNqkWALMoNT3rzM= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.10.1 h1:B+blDbyVIG3WaikNxPnhPiJ1MThR03b3vKGtER95TP4= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.10.1/go.mod h1:JdM5psgjfBf5fo2uWOZhflPWyDBZ/O/CNAH9CtsuZE4= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.20.0 h1:JXg2dwJUmPB9JmtVmdEB16APJ7jurfbY5jnfXpJoRMc= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.20.0/go.mod h1:YD5h/ldMsG0XiIw7PdyNhLxaM317eFh5yNLccNfGdyw= +github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.13.1 h1:Hk5QBxZQC1jb2Fwj6mpzme37xbCDdNTxU7O9eb5+LB4= +github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.13.1/go.mod h1:IYus9qsFobWIc2YVwe/WPjcnyCkPKtnHAqUYeebc8z0= github.com/Azure/azure-sdk-for-go/sdk/azidentity/cache v0.3.2 h1:yz1bePFlP5Vws5+8ez6T3HWXPmwOK7Yvq8QxDBD3SKY= github.com/Azure/azure-sdk-for-go/sdk/azidentity/cache v0.3.2/go.mod h1:Pa9ZNPuoNu/GztvBSKk9J1cDJW6vk/n0zLtV4mgd8N8= -github.com/Azure/azure-sdk-for-go/sdk/internal v1.11.1 h1:FPKJS1T+clwv+OLGt13a8UjqeRuh0O4SJ3lUriThc+4= -github.com/Azure/azure-sdk-for-go/sdk/internal v1.11.1/go.mod h1:j2chePtV91HrC22tGoRX3sGY42uF13WzmmV80/OdVAA= +github.com/Azure/azure-sdk-for-go/sdk/internal v1.11.2 h1:9iefClla7iYpfYWdzPCRDozdmndjTm8DXdpCzPajMgA= +github.com/Azure/azure-sdk-for-go/sdk/internal v1.11.2/go.mod h1:XtLgD3ZD34DAaVIIAyG3objl5DynM3CQ/vMcbBNJZGI= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v2 v2.0.0 h1:PTFGRSlMKCQelWwxUyYVEUqseBJVemLyqWJjvMyt0do= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v2 v2.0.0/go.mod h1:LRr2FzBTQlONPPa5HREE5+RjSCTXl7BwOvYOaWTqCaI= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3 v3.1.0 h1:2qsIIvxVT+uE6yrNldntJKlLRgxGbZ85kgtz5SNBhMw= @@ -16,16 +16,12 @@ github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1. github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1.2.0/go.mod h1:5kakwfW5CjC9KK+Q4wjXAg+ShuIm2mBMua0ZFj2C8PE= github.com/AzureAD/microsoft-authentication-extensions-for-go/cache v0.1.1 h1:WJTmL004Abzc5wDB5VtZG2PJk5ndYDgVacGqfirKxjM= github.com/AzureAD/microsoft-authentication-extensions-for-go/cache v0.1.1/go.mod h1:tCcJZ0uHAmvjsVYzEFivsRTN00oz5BEsRgQHu5JZ9WE= -github.com/AzureAD/microsoft-authentication-library-for-go v1.4.2 h1:oygO0locgZJe7PpYPXT5A29ZkwJaPqcva7BVeemZOZs= -github.com/AzureAD/microsoft-authentication-library-for-go v1.4.2/go.mod h1:wP83P5OoQ5p6ip3ScPr0BAq0BvuPAvacpEuSzyouqAI= -github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= -github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/AzureAD/microsoft-authentication-library-for-go v1.6.0 h1:XRzhVemXdgvJqCH0sFfrBUTnUJSBrBf7++ypk+twtRs= +github.com/AzureAD/microsoft-authentication-library-for-go v1.6.0/go.mod h1:HKpQxkWaGLJ+D/5H8QRpyQXA1eKjxkFlOMwck5+33Jk= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78= -github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc= -github.com/golang-jwt/jwt/v5 v5.2.2 h1:Rl4B7itRWVtYIHFrSNd7vhTiz9UpLdi6gZhZ3wEeDy8= -github.com/golang-jwt/jwt/v5 v5.2.2/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= +github.com/golang-jwt/jwt/v5 v5.3.0 h1:pv4AsKCKKZuqlgs5sUmn4x8UlGa0kEVt/puTpKx9vvo= +github.com/golang-jwt/jwt/v5 v5.3.0/go.mod h1:fxCRLWMO43lRc8nhHWY6LGqRcf+1gQWArsqaEUEa5bE= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/keybase/go-keychain v0.0.1 h1:way+bWYa6lDppZoZcgMbYsvC7GxljxrskdNInRtuthU= @@ -40,21 +36,19 @@ github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c h1:+mdjkGKdHQG3305AYmd github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c/go.mod h1:7rwL4CYBLnjLxUqIJNnCWiEdr3bn6IUYi15bNlnbCCU= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/redis/go-redis/v9 v9.8.0 h1:q3nRvjrlge/6UD7eTu/DSg2uYiU2mCL0G/uzBWqhicI= -github.com/redis/go-redis/v9 v9.8.0/go.mod h1:huWgSWd8mW6+m0VPhJjSSQ+d6Nh1VICQ6Q5lHuCH/Iw= github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= -github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= -github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= -golang.org/x/crypto v0.40.0 h1:r4x+VvoG5Fm+eJcxMaY8CQM7Lb0l1lsmjGBQ6s8BfKM= -golang.org/x/crypto v0.40.0/go.mod h1:Qr1vMER5WyS2dfPHAlsOj01wgLbsyWtFn/aY+5+ZdxY= -golang.org/x/net v0.42.0 h1:jzkYrhi3YQWD6MLBJcsklgQsoAcw89EcZbJw8Z614hs= -golang.org/x/net v0.42.0/go.mod h1:FF1RA5d3u7nAYA4z2TkclSCKh68eSXtiFwcWQpPXdt8= +github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U= +github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= +golang.org/x/crypto v0.41.0 h1:WKYxWedPGCTVVl5+WHSSrOBT0O8lx32+zxmHxijgXp4= +golang.org/x/crypto v0.41.0/go.mod h1:pO5AFd7FA68rFak7rOAGVuygIISepHftHnr8dr6+sUc= +golang.org/x/net v0.43.0 h1:lat02VYK2j4aLzMzecihNvTlJNQUq316m2Mr9rnM6YE= +golang.org/x/net v0.43.0/go.mod h1:vhO1fvI4dGsIjh73sWfUVjj3N7CA9WkKJNQm2svM6Jg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.34.0 h1:H5Y5sJ2L2JRdyv7ROF1he/lPdvFsd0mJHFw2ThKHxLA= -golang.org/x/sys v0.34.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= -golang.org/x/text v0.27.0 h1:4fGWRpyh641NLlecmyl4LOe6yDdfaYNrGb2zdfo4JV4= -golang.org/x/text v0.27.0/go.mod h1:1D28KMCvyooCX9hBiosv5Tz/+YLxj0j7XhWjpSUF7CU= +golang.org/x/sys v0.35.0 h1:vz1N37gP5bs89s7He8XuIYXpyY0+QlsKmzipCbUtyxI= +golang.org/x/sys v0.35.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= +golang.org/x/text v0.28.0 h1:rhazDwis8INMIwQ4tpjLDzUhx6RlXqZNPEM0huQojng= +golang.org/x/text v0.28.0/go.mod h1:U8nCwOR8jO/marOQ0QbDiOngZVEBB7MAiitBuMjXiNU= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/locationbasedcapabilities_client.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/locationbasedcapabilities_client.go deleted file mode 100644 index 4292acd0cc2b..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/locationbasedcapabilities_client.go +++ /dev/null @@ -1,101 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armpostgresqlflexibleservers - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// LocationBasedCapabilitiesClient contains the methods for the LocationBasedCapabilities group. -// Don't use this type directly, use NewLocationBasedCapabilitiesClient() instead. -type LocationBasedCapabilitiesClient struct { - internal *arm.Client - subscriptionID string -} - -// NewLocationBasedCapabilitiesClient creates a new instance of LocationBasedCapabilitiesClient with the specified values. -// - subscriptionID - The ID of the target subscription. The value must be an UUID. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewLocationBasedCapabilitiesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*LocationBasedCapabilitiesClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &LocationBasedCapabilitiesClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// NewExecutePager - Get capabilities at specified location in a given subscription. -// -// Generated from API version 2025-01-01-preview -// - locationName - The name of the location. -// - options - LocationBasedCapabilitiesClientExecuteOptions contains the optional parameters for the LocationBasedCapabilitiesClient.NewExecutePager -// method. -func (client *LocationBasedCapabilitiesClient) NewExecutePager(locationName string, options *LocationBasedCapabilitiesClientExecuteOptions) *runtime.Pager[LocationBasedCapabilitiesClientExecuteResponse] { - return runtime.NewPager(runtime.PagingHandler[LocationBasedCapabilitiesClientExecuteResponse]{ - More: func(page LocationBasedCapabilitiesClientExecuteResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *LocationBasedCapabilitiesClientExecuteResponse) (LocationBasedCapabilitiesClientExecuteResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "LocationBasedCapabilitiesClient.NewExecutePager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.executeCreateRequest(ctx, locationName, options) - }, nil) - if err != nil { - return LocationBasedCapabilitiesClientExecuteResponse{}, err - } - return client.executeHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// executeCreateRequest creates the Execute request. -func (client *LocationBasedCapabilitiesClient) executeCreateRequest(ctx context.Context, locationName string, _ *LocationBasedCapabilitiesClientExecuteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.DBforPostgreSQL/locations/{locationName}/capabilities" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if locationName == "" { - return nil, errors.New("parameter locationName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{locationName}", url.PathEscape(locationName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-01-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// executeHandleResponse handles the Execute response. -func (client *LocationBasedCapabilitiesClient) executeHandleResponse(resp *http.Response) (LocationBasedCapabilitiesClientExecuteResponse, error) { - result := LocationBasedCapabilitiesClientExecuteResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.CapabilitiesListResult); err != nil { - return LocationBasedCapabilitiesClientExecuteResponse{}, err - } - return result, nil -} diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/ltrbackupoperations_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/ltrbackupoperations_client_example_test.go deleted file mode 100644 index c9927f2425d3..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/ltrbackupoperations_client_example_test.go +++ /dev/null @@ -1,96 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armpostgresqlflexibleservers_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v5" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b1f4d539964453ce8008e4b069e59885e12ba441/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/LongTermRetentionOperationGet.json -func ExampleLtrBackupOperationsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewLtrBackupOperationsClient().Get(ctx, "rgLongTermRetention", "pgsqlltrtestserver", "backup1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.LtrServerBackupOperation = armpostgresqlflexibleservers.LtrServerBackupOperation{ - // Name: to.Ptr("backup1"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/ltrbackupOperations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/rgLongTermRetention/providers/Microsoft.DBforPostgreSQL/flexibleServers/pgsqlltrtestserver"), - // Properties: &armpostgresqlflexibleservers.LtrBackupOperationResponseProperties{ - // BackupMetadata: to.Ptr("backupMetadata"), - // BackupName: to.Ptr("backup1"), - // DataTransferredInBytes: to.Ptr[int64](9), - // DatasourceSizeInBytes: to.Ptr[int64](21), - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-04-13T01:32:30.128Z"); return t}()), - // PercentComplete: to.Ptr[float64](4), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-04-13T01:32:30.128Z"); return t}()), - // Status: to.Ptr(armpostgresqlflexibleservers.ExecutionStatusRunning), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b1f4d539964453ce8008e4b069e59885e12ba441/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/LongTermRetentionOperationListByServer.json -func ExampleLtrBackupOperationsClient_NewListByServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewLtrBackupOperationsClient().NewListByServerPager("rgLongTermRetention", "pgsqlltrtestserver", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.LtrServerBackupOperationList = armpostgresqlflexibleservers.LtrServerBackupOperationList{ - // Value: []*armpostgresqlflexibleservers.LtrServerBackupOperation{ - // { - // Name: to.Ptr("backup1"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/ltrbackupOperations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/rgLongTermRetention/providers/Microsoft.DBforPostgreSQL/flexibleServers/pgsqlltrtestserver"), - // Properties: &armpostgresqlflexibleservers.LtrBackupOperationResponseProperties{ - // BackupMetadata: to.Ptr("backupMetadata"), - // BackupName: to.Ptr("backup1"), - // DataTransferredInBytes: to.Ptr[int64](9), - // DatasourceSizeInBytes: to.Ptr[int64](21), - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-04-13T01:32:30.128Z"); return t}()), - // PercentComplete: to.Ptr[float64](4), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-04-13T01:32:30.128Z"); return t}()), - // Status: to.Ptr(armpostgresqlflexibleservers.ExecutionStatusRunning), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/migrations_client.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/migrations_client.go index 1c8918843b64..988c9e635cec 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/migrations_client.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/migrations_client.go @@ -20,80 +20,147 @@ import ( // MigrationsClient contains the methods for the Migrations group. // Don't use this type directly, use NewMigrationsClient() instead. type MigrationsClient struct { - internal *arm.Client + internal *arm.Client + subscriptionID string } // NewMigrationsClient creates a new instance of MigrationsClient with the specified values. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewMigrationsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*MigrationsClient, error) { +// - options - Contains optional client configuration. Pass nil to accept the default values. +func NewMigrationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*MigrationsClient, error) { cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) if err != nil { return nil, err } client := &MigrationsClient{ - internal: cl, + subscriptionID: subscriptionID, + internal: cl, } return client, nil } -// Create - Creates a new migration. +// Cancel - Cancels an active migration. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-01-01-preview -// - subscriptionID - The subscription ID of the target database server. -// - resourceGroupName - The resource group name of the target database server. -// - targetDbServerName - The name of the target database server. -// - migrationName - The name of the migration. -// - parameters - The required parameters for creating a migration. -// - options - MigrationsClientCreateOptions contains the optional parameters for the MigrationsClient.Create method. -func (client *MigrationsClient) Create(ctx context.Context, subscriptionID string, resourceGroupName string, targetDbServerName string, migrationName string, parameters MigrationResource, options *MigrationsClientCreateOptions) (MigrationsClientCreateResponse, error) { +// Generated from API version 2025-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serverName - The name of the server. +// - migrationName - Name of migration. +// - options - MigrationsClientCancelOptions contains the optional parameters for the MigrationsClient.Cancel method. +func (client *MigrationsClient) Cancel(ctx context.Context, resourceGroupName string, serverName string, migrationName string, options *MigrationsClientCancelOptions) (MigrationsClientCancelResponse, error) { var err error - const operationName = "MigrationsClient.Create" + const operationName = "MigrationsClient.Cancel" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) defer func() { endSpan(err) }() - req, err := client.createCreateRequest(ctx, subscriptionID, resourceGroupName, targetDbServerName, migrationName, parameters, options) + req, err := client.cancelCreateRequest(ctx, resourceGroupName, serverName, migrationName, options) if err != nil { - return MigrationsClientCreateResponse{}, err + return MigrationsClientCancelResponse{}, err } httpResp, err := client.internal.Pipeline().Do(req) if err != nil { - return MigrationsClientCreateResponse{}, err + return MigrationsClientCancelResponse{}, err } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { err = runtime.NewResponseError(httpResp) - return MigrationsClientCreateResponse{}, err + return MigrationsClientCancelResponse{}, err } - resp, err := client.createHandleResponse(httpResp) + resp, err := client.cancelHandleResponse(httpResp) return resp, err } -// createCreateRequest creates the Create request. -func (client *MigrationsClient) createCreateRequest(ctx context.Context, subscriptionID string, resourceGroupName string, targetDbServerName string, migrationName string, parameters MigrationResource, _ *MigrationsClientCreateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{targetDbServerName}/migrations/{migrationName}" - if subscriptionID == "" { - return nil, errors.New("parameter subscriptionID cannot be empty") +// cancelCreateRequest creates the Cancel request. +func (client *MigrationsClient) cancelCreateRequest(ctx context.Context, resourceGroupName string, serverName string, migrationName string, _ *MigrationsClientCancelOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/migrations/{migrationName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(subscriptionID)) + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if targetDbServerName == "" { - return nil, errors.New("parameter targetDbServerName cannot be empty") + if serverName == "" { + return nil, errors.New("parameter serverName cannot be empty") } - urlPath = strings.ReplaceAll(urlPath, "{targetDbServerName}", url.PathEscape(targetDbServerName)) + urlPath = strings.ReplaceAll(urlPath, "{serverName}", url.PathEscape(serverName)) if migrationName == "" { return nil, errors.New("parameter migrationName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{migrationName}", url.PathEscape(migrationName)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-01-01-preview") + reqQP.Set("api-version", "2025-08-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// cancelHandleResponse handles the Cancel response. +func (client *MigrationsClient) cancelHandleResponse(resp *http.Response) (MigrationsClientCancelResponse, error) { + result := MigrationsClientCancelResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.Migration); err != nil { + return MigrationsClientCancelResponse{}, err + } + return result, nil +} + +// CheckNameAvailability - Checks if a proposed migration name is valid and available. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2025-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serverName - The name of the server. +// - parameters - Parameters required to check if a migration name is valid and available. +// - options - MigrationsClientCheckNameAvailabilityOptions contains the optional parameters for the MigrationsClient.CheckNameAvailability +// method. +func (client *MigrationsClient) CheckNameAvailability(ctx context.Context, resourceGroupName string, serverName string, parameters MigrationNameAvailability, options *MigrationsClientCheckNameAvailabilityOptions) (MigrationsClientCheckNameAvailabilityResponse, error) { + var err error + const operationName = "MigrationsClient.CheckNameAvailability" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.checkNameAvailabilityCreateRequest(ctx, resourceGroupName, serverName, parameters, options) + if err != nil { + return MigrationsClientCheckNameAvailabilityResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return MigrationsClientCheckNameAvailabilityResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return MigrationsClientCheckNameAvailabilityResponse{}, err + } + resp, err := client.checkNameAvailabilityHandleResponse(httpResp) + return resp, err +} + +// checkNameAvailabilityCreateRequest creates the CheckNameAvailability request. +func (client *MigrationsClient) checkNameAvailabilityCreateRequest(ctx context.Context, resourceGroupName string, serverName string, parameters MigrationNameAvailability, _ *MigrationsClientCheckNameAvailabilityOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/checkMigrationNameAvailability" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serverName == "" { + return nil, errors.New("parameter serverName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serverName}", url.PathEscape(serverName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2025-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -102,91 +169,103 @@ func (client *MigrationsClient) createCreateRequest(ctx context.Context, subscri return req, nil } -// createHandleResponse handles the Create response. -func (client *MigrationsClient) createHandleResponse(resp *http.Response) (MigrationsClientCreateResponse, error) { - result := MigrationsClientCreateResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.MigrationResource); err != nil { - return MigrationsClientCreateResponse{}, err +// checkNameAvailabilityHandleResponse handles the CheckNameAvailability response. +func (client *MigrationsClient) checkNameAvailabilityHandleResponse(resp *http.Response) (MigrationsClientCheckNameAvailabilityResponse, error) { + result := MigrationsClientCheckNameAvailabilityResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.MigrationNameAvailability); err != nil { + return MigrationsClientCheckNameAvailabilityResponse{}, err } return result, nil } -// Delete - Deletes a migration. +// Create - Creates a new migration. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-01-01-preview -// - subscriptionID - The subscription ID of the target database server. -// - resourceGroupName - The resource group name of the target database server. -// - targetDbServerName - The name of the target database server. -// - migrationName - The name of the migration. -// - options - MigrationsClientDeleteOptions contains the optional parameters for the MigrationsClient.Delete method. -func (client *MigrationsClient) Delete(ctx context.Context, subscriptionID string, resourceGroupName string, targetDbServerName string, migrationName string, options *MigrationsClientDeleteOptions) (MigrationsClientDeleteResponse, error) { +// Generated from API version 2025-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serverName - The name of the server. +// - migrationName - Name of migration. +// - parameters - Parameters required for creating a migration. +// - options - MigrationsClientCreateOptions contains the optional parameters for the MigrationsClient.Create method. +func (client *MigrationsClient) Create(ctx context.Context, resourceGroupName string, serverName string, migrationName string, parameters Migration, options *MigrationsClientCreateOptions) (MigrationsClientCreateResponse, error) { var err error - const operationName = "MigrationsClient.Delete" + const operationName = "MigrationsClient.Create" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) defer func() { endSpan(err) }() - req, err := client.deleteCreateRequest(ctx, subscriptionID, resourceGroupName, targetDbServerName, migrationName, options) + req, err := client.createCreateRequest(ctx, resourceGroupName, serverName, migrationName, parameters, options) if err != nil { - return MigrationsClientDeleteResponse{}, err + return MigrationsClientCreateResponse{}, err } httpResp, err := client.internal.Pipeline().Do(req) if err != nil { - return MigrationsClientDeleteResponse{}, err + return MigrationsClientCreateResponse{}, err } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { err = runtime.NewResponseError(httpResp) - return MigrationsClientDeleteResponse{}, err + return MigrationsClientCreateResponse{}, err } - return MigrationsClientDeleteResponse{}, nil + resp, err := client.createHandleResponse(httpResp) + return resp, err } -// deleteCreateRequest creates the Delete request. -func (client *MigrationsClient) deleteCreateRequest(ctx context.Context, subscriptionID string, resourceGroupName string, targetDbServerName string, migrationName string, _ *MigrationsClientDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{targetDbServerName}/migrations/{migrationName}" - if subscriptionID == "" { - return nil, errors.New("parameter subscriptionID cannot be empty") +// createCreateRequest creates the Create request. +func (client *MigrationsClient) createCreateRequest(ctx context.Context, resourceGroupName string, serverName string, migrationName string, parameters Migration, _ *MigrationsClientCreateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/migrations/{migrationName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(subscriptionID)) + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if targetDbServerName == "" { - return nil, errors.New("parameter targetDbServerName cannot be empty") + if serverName == "" { + return nil, errors.New("parameter serverName cannot be empty") } - urlPath = strings.ReplaceAll(urlPath, "{targetDbServerName}", url.PathEscape(targetDbServerName)) + urlPath = strings.ReplaceAll(urlPath, "{serverName}", url.PathEscape(serverName)) if migrationName == "" { return nil, errors.New("parameter migrationName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{migrationName}", url.PathEscape(migrationName)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-01-01-preview") + reqQP.Set("api-version", "2025-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } return req, nil } -// Get - Gets details of a migration. +// createHandleResponse handles the Create response. +func (client *MigrationsClient) createHandleResponse(resp *http.Response) (MigrationsClientCreateResponse, error) { + result := MigrationsClientCreateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.Migration); err != nil { + return MigrationsClientCreateResponse{}, err + } + return result, nil +} + +// Get - Gets information about a migration. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-01-01-preview -// - subscriptionID - The subscription ID of the target database server. -// - resourceGroupName - The resource group name of the target database server. -// - targetDbServerName - The name of the target database server. -// - migrationName - The name of the migration. +// Generated from API version 2025-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serverName - The name of the server. +// - migrationName - Name of migration. // - options - MigrationsClientGetOptions contains the optional parameters for the MigrationsClient.Get method. -func (client *MigrationsClient) Get(ctx context.Context, subscriptionID string, resourceGroupName string, targetDbServerName string, migrationName string, options *MigrationsClientGetOptions) (MigrationsClientGetResponse, error) { +func (client *MigrationsClient) Get(ctx context.Context, resourceGroupName string, serverName string, migrationName string, options *MigrationsClientGetOptions) (MigrationsClientGetResponse, error) { var err error const operationName = "MigrationsClient.Get" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) defer func() { endSpan(err) }() - req, err := client.getCreateRequest(ctx, subscriptionID, resourceGroupName, targetDbServerName, migrationName, options) + req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, migrationName, options) if err != nil { return MigrationsClientGetResponse{}, err } @@ -203,20 +282,20 @@ func (client *MigrationsClient) Get(ctx context.Context, subscriptionID string, } // getCreateRequest creates the Get request. -func (client *MigrationsClient) getCreateRequest(ctx context.Context, subscriptionID string, resourceGroupName string, targetDbServerName string, migrationName string, _ *MigrationsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{targetDbServerName}/migrations/{migrationName}" - if subscriptionID == "" { - return nil, errors.New("parameter subscriptionID cannot be empty") +func (client *MigrationsClient) getCreateRequest(ctx context.Context, resourceGroupName string, serverName string, migrationName string, _ *MigrationsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/migrations/{migrationName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(subscriptionID)) + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if targetDbServerName == "" { - return nil, errors.New("parameter targetDbServerName cannot be empty") + if serverName == "" { + return nil, errors.New("parameter serverName cannot be empty") } - urlPath = strings.ReplaceAll(urlPath, "{targetDbServerName}", url.PathEscape(targetDbServerName)) + urlPath = strings.ReplaceAll(urlPath, "{serverName}", url.PathEscape(serverName)) if migrationName == "" { return nil, errors.New("parameter migrationName cannot be empty") } @@ -226,7 +305,7 @@ func (client *MigrationsClient) getCreateRequest(ctx context.Context, subscripti return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-01-01-preview") + reqQP.Set("api-version", "2025-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -235,21 +314,20 @@ func (client *MigrationsClient) getCreateRequest(ctx context.Context, subscripti // getHandleResponse handles the Get response. func (client *MigrationsClient) getHandleResponse(resp *http.Response) (MigrationsClientGetResponse, error) { result := MigrationsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.MigrationResource); err != nil { + if err := runtime.UnmarshalAsJSON(resp, &result.Migration); err != nil { return MigrationsClientGetResponse{}, err } return result, nil } -// NewListByTargetServerPager - List all the migrations on a given target server. +// NewListByTargetServerPager - Lists all migrations of a target flexible server. // -// Generated from API version 2025-01-01-preview -// - subscriptionID - The subscription ID of the target database server. -// - resourceGroupName - The resource group name of the target database server. -// - targetDbServerName - The name of the target database server. +// Generated from API version 2025-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serverName - The name of the server. // - options - MigrationsClientListByTargetServerOptions contains the optional parameters for the MigrationsClient.NewListByTargetServerPager // method. -func (client *MigrationsClient) NewListByTargetServerPager(subscriptionID string, resourceGroupName string, targetDbServerName string, options *MigrationsClientListByTargetServerOptions) *runtime.Pager[MigrationsClientListByTargetServerResponse] { +func (client *MigrationsClient) NewListByTargetServerPager(resourceGroupName string, serverName string, options *MigrationsClientListByTargetServerOptions) *runtime.Pager[MigrationsClientListByTargetServerResponse] { return runtime.NewPager(runtime.PagingHandler[MigrationsClientListByTargetServerResponse]{ More: func(page MigrationsClientListByTargetServerResponse) bool { return page.NextLink != nil && len(*page.NextLink) > 0 @@ -261,7 +339,7 @@ func (client *MigrationsClient) NewListByTargetServerPager(subscriptionID string nextLink = *page.NextLink } resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listByTargetServerCreateRequest(ctx, subscriptionID, resourceGroupName, targetDbServerName, options) + return client.listByTargetServerCreateRequest(ctx, resourceGroupName, serverName, options) }, nil) if err != nil { return MigrationsClientListByTargetServerResponse{}, err @@ -273,26 +351,26 @@ func (client *MigrationsClient) NewListByTargetServerPager(subscriptionID string } // listByTargetServerCreateRequest creates the ListByTargetServer request. -func (client *MigrationsClient) listByTargetServerCreateRequest(ctx context.Context, subscriptionID string, resourceGroupName string, targetDbServerName string, options *MigrationsClientListByTargetServerOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{targetDbServerName}/migrations" - if subscriptionID == "" { - return nil, errors.New("parameter subscriptionID cannot be empty") +func (client *MigrationsClient) listByTargetServerCreateRequest(ctx context.Context, resourceGroupName string, serverName string, options *MigrationsClientListByTargetServerOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/migrations" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(subscriptionID)) + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if targetDbServerName == "" { - return nil, errors.New("parameter targetDbServerName cannot be empty") + if serverName == "" { + return nil, errors.New("parameter serverName cannot be empty") } - urlPath = strings.ReplaceAll(urlPath, "{targetDbServerName}", url.PathEscape(targetDbServerName)) + urlPath = strings.ReplaceAll(urlPath, "{serverName}", url.PathEscape(serverName)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-01-01-preview") + reqQP.Set("api-version", "2025-08-01") if options != nil && options.MigrationListFilter != nil { reqQP.Set("migrationListFilter", string(*options.MigrationListFilter)) } @@ -304,7 +382,7 @@ func (client *MigrationsClient) listByTargetServerCreateRequest(ctx context.Cont // listByTargetServerHandleResponse handles the ListByTargetServer response. func (client *MigrationsClient) listByTargetServerHandleResponse(resp *http.Response) (MigrationsClientListByTargetServerResponse, error) { result := MigrationsClientListByTargetServerResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.MigrationResourceListResult); err != nil { + if err := runtime.UnmarshalAsJSON(resp, &result.MigrationList); err != nil { return MigrationsClientListByTargetServerResponse{}, err } return result, nil @@ -314,20 +392,19 @@ func (client *MigrationsClient) listByTargetServerHandleResponse(resp *http.Resp // migration definition. Certain property updates initiate migration state transitions. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-01-01-preview -// - subscriptionID - The subscription ID of the target database server. -// - resourceGroupName - The resource group name of the target database server. -// - targetDbServerName - The name of the target database server. -// - migrationName - The name of the migration. -// - parameters - The required parameters for updating a migration. +// Generated from API version 2025-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serverName - The name of the server. +// - migrationName - Name of migration. +// - parameters - Parameters required to update an existing migration. // - options - MigrationsClientUpdateOptions contains the optional parameters for the MigrationsClient.Update method. -func (client *MigrationsClient) Update(ctx context.Context, subscriptionID string, resourceGroupName string, targetDbServerName string, migrationName string, parameters MigrationResourceForPatch, options *MigrationsClientUpdateOptions) (MigrationsClientUpdateResponse, error) { +func (client *MigrationsClient) Update(ctx context.Context, resourceGroupName string, serverName string, migrationName string, parameters MigrationResourceForPatch, options *MigrationsClientUpdateOptions) (MigrationsClientUpdateResponse, error) { var err error const operationName = "MigrationsClient.Update" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) defer func() { endSpan(err) }() - req, err := client.updateCreateRequest(ctx, subscriptionID, resourceGroupName, targetDbServerName, migrationName, parameters, options) + req, err := client.updateCreateRequest(ctx, resourceGroupName, serverName, migrationName, parameters, options) if err != nil { return MigrationsClientUpdateResponse{}, err } @@ -344,20 +421,20 @@ func (client *MigrationsClient) Update(ctx context.Context, subscriptionID strin } // updateCreateRequest creates the Update request. -func (client *MigrationsClient) updateCreateRequest(ctx context.Context, subscriptionID string, resourceGroupName string, targetDbServerName string, migrationName string, parameters MigrationResourceForPatch, _ *MigrationsClientUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{targetDbServerName}/migrations/{migrationName}" - if subscriptionID == "" { - return nil, errors.New("parameter subscriptionID cannot be empty") +func (client *MigrationsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, serverName string, migrationName string, parameters MigrationResourceForPatch, _ *MigrationsClientUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/migrations/{migrationName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(subscriptionID)) + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if targetDbServerName == "" { - return nil, errors.New("parameter targetDbServerName cannot be empty") + if serverName == "" { + return nil, errors.New("parameter serverName cannot be empty") } - urlPath = strings.ReplaceAll(urlPath, "{targetDbServerName}", url.PathEscape(targetDbServerName)) + urlPath = strings.ReplaceAll(urlPath, "{serverName}", url.PathEscape(serverName)) if migrationName == "" { return nil, errors.New("parameter migrationName cannot be empty") } @@ -367,7 +444,7 @@ func (client *MigrationsClient) updateCreateRequest(ctx context.Context, subscri return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-01-01-preview") + reqQP.Set("api-version", "2025-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -379,7 +456,7 @@ func (client *MigrationsClient) updateCreateRequest(ctx context.Context, subscri // updateHandleResponse handles the Update response. func (client *MigrationsClient) updateHandleResponse(resp *http.Response) (MigrationsClientUpdateResponse, error) { result := MigrationsClientUpdateResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.MigrationResource); err != nil { + if err := runtime.UnmarshalAsJSON(resp, &result.Migration); err != nil { return MigrationsClientUpdateResponse{}, err } return result, nil diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/migrations_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/migrations_client_example_test.go index 01e261751bbd..f54375713b01 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/migrations_client_example_test.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/migrations_client_example_test.go @@ -18,8 +18,8 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v5" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b1f4d539964453ce8008e4b069e59885e12ba441/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/Migrations_Create_Other_SourceTypes_Validate_Migrate.json -func ExampleMigrationsClient_Create_createMigrationWithOtherSourceTypesForValidateAndMigrate() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/735d21dbd7e1cc446babf58860af4cca757d620d/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/MigrationsCreateValidateOnly.json +func ExampleMigrationsClient_Create_createAMigrationForValidatingOnly() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -29,26 +29,24 @@ func ExampleMigrationsClient_Create_createMigrationWithOtherSourceTypesForValida if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewMigrationsClient().Create(ctx, "ffffffff-ffff-ffff-ffff-ffffffffffff", "testrg", "testtarget", "testmigration", armpostgresqlflexibleservers.MigrationResource{ - Location: to.Ptr("westus"), - Properties: &armpostgresqlflexibleservers.MigrationResourceProperties{ + res, err := clientFactory.NewMigrationsClient().Create(ctx, "exampleresourcegroup", "exampleserver", "examplemigration", armpostgresqlflexibleservers.Migration{ + Location: to.Ptr("eastus"), + Properties: &armpostgresqlflexibleservers.MigrationProperties{ DbsToMigrate: []*string{ - to.Ptr("db1"), - to.Ptr("db2"), - to.Ptr("db3"), - to.Ptr("db4")}, + to.Ptr("exampledatabase1"), + to.Ptr("exampledatabase2"), + to.Ptr("exampledatabase3"), + to.Ptr("exampledatabase4")}, MigrationMode: to.Ptr(armpostgresqlflexibleservers.MigrationModeOffline), - MigrationOption: to.Ptr(armpostgresqlflexibleservers.MigrationOptionValidateAndMigrate), - OverwriteDbsInTarget: to.Ptr(armpostgresqlflexibleservers.OverwriteDbsInTargetEnumTrue), + MigrationOption: to.Ptr(armpostgresqlflexibleservers.MigrationOptionValidate), + OverwriteDbsInTarget: to.Ptr(armpostgresqlflexibleservers.OverwriteDatabasesOnTargetServerTrue), SecretParameters: &armpostgresqlflexibleservers.MigrationSecretParameters{ AdminCredentials: &armpostgresqlflexibleservers.AdminCredentials{ - SourceServerPassword: to.Ptr("xxxxxxxx"), - TargetServerPassword: to.Ptr("xxxxxxxx"), + SourceServerPassword: to.Ptr("examplesourcepassword"), + TargetServerPassword: to.Ptr("exampletargetpassword"), }, }, - SourceDbServerResourceID: to.Ptr("testsource:5432@pguser"), - SourceType: to.Ptr(armpostgresqlflexibleservers.SourceTypeOnPremises), - SSLMode: to.Ptr(armpostgresqlflexibleservers.SSLModePrefer), + SourceDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBForPostgreSql/servers/examplesource"), }, }, nil) if err != nil { @@ -57,45 +55,43 @@ func ExampleMigrationsClient_Create_createMigrationWithOtherSourceTypesForValida // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.MigrationResource = armpostgresqlflexibleservers.MigrationResource{ - // Name: to.Ptr("testmigration"), + // res.Migration = armpostgresqlflexibleservers.Migration{ + // Name: to.Ptr("examplemigration"), // Type: to.Ptr("Microsoft.DBForPostgreSql/flexibleServers/migrations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/flexibleServers/testtarget/migrations/testmigration"), - // Location: to.Ptr("westus"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBForPostgreSql/flexibleServers/exampletarget/migrations/examplemigration"), + // Location: to.Ptr("eastus"), // Tags: map[string]*string{ // "key1624": to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), // }, - // Properties: &armpostgresqlflexibleservers.MigrationResourceProperties{ + // Properties: &armpostgresqlflexibleservers.MigrationProperties{ // CurrentStatus: &armpostgresqlflexibleservers.MigrationStatus{ - // CurrentSubStateDetails: &armpostgresqlflexibleservers.MigrationSubStateDetails{ - // CurrentSubState: to.Ptr(armpostgresqlflexibleservers.MigrationSubStateValidationInProgress), + // CurrentSubStateDetails: &armpostgresqlflexibleservers.MigrationSubstateDetails{ + // CurrentSubState: to.Ptr(armpostgresqlflexibleservers.MigrationSubstateValidationInProgress), // }, // Error: to.Ptr(""), // State: to.Ptr(armpostgresqlflexibleservers.MigrationStateInProgress), // }, // DbsToMigrate: []*string{ - // to.Ptr("db1"), - // to.Ptr("db2"), - // to.Ptr("db3"), - // to.Ptr("db4")}, - // MigrateRoles: to.Ptr(armpostgresqlflexibleservers.MigrateRolesEnumFalse), + // to.Ptr("exampledatabase1"), + // to.Ptr("exampledatabase2"), + // to.Ptr("exampledatabase3"), + // to.Ptr("exampledatabase4")}, + // MigrateRoles: to.Ptr(armpostgresqlflexibleservers.MigrateRolesAndPermissionsFalse), // MigrationID: to.Ptr("d3ceacbb-a5fd-43dc-a9db-6022b5154856"), - // MigrationOption: to.Ptr(armpostgresqlflexibleservers.MigrationOptionValidateAndMigrate), - // MigrationWindowStartTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-12-06T16:05:58.895Z"); return t}()), - // OverwriteDbsInTarget: to.Ptr(armpostgresqlflexibleservers.OverwriteDbsInTargetEnumTrue), - // SetupLogicalReplicationOnSourceDbIfNeeded: to.Ptr(armpostgresqlflexibleservers.LogicalReplicationOnSourceDbEnumFalse), - // SourceDbServerResourceID: to.Ptr("testsource:5432@pguser"), - // SourceType: to.Ptr(armpostgresqlflexibleservers.SourceTypeOnPremises), - // SSLMode: to.Ptr(armpostgresqlflexibleservers.SSLModePrefer), - // StartDataMigration: to.Ptr(armpostgresqlflexibleservers.StartDataMigrationEnumFalse), - // TargetDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/flexibleServers/testtarget"), - // TriggerCutover: to.Ptr(armpostgresqlflexibleservers.TriggerCutoverEnumFalse), + // MigrationOption: to.Ptr(armpostgresqlflexibleservers.MigrationOptionValidate), + // MigrationWindowStartTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T18:30:22.123Z"); return t}()), + // OverwriteDbsInTarget: to.Ptr(armpostgresqlflexibleservers.OverwriteDatabasesOnTargetServerTrue), + // SetupLogicalReplicationOnSourceDbIfNeeded: to.Ptr(armpostgresqlflexibleservers.LogicalReplicationOnSourceServerFalse), + // SourceDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBForPostgreSql/servers/examplesource"), + // StartDataMigration: to.Ptr(armpostgresqlflexibleservers.StartDataMigrationFalse), + // TargetDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBForPostgreSql/flexibleServers/exampletarget"), + // TriggerCutover: to.Ptr(armpostgresqlflexibleservers.TriggerCutoverFalse), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b1f4d539964453ce8008e4b069e59885e12ba441/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/Migrations_Create_Validate_Only.json -func ExampleMigrationsClient_Create_createPreMigrationValidation() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/735d21dbd7e1cc446babf58860af4cca757d620d/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/MigrationsCreateWithOtherUsers.json +func ExampleMigrationsClient_Create_createAMigrationSpecifyingUserNames() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -105,24 +101,24 @@ func ExampleMigrationsClient_Create_createPreMigrationValidation() { if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewMigrationsClient().Create(ctx, "ffffffff-ffff-ffff-ffff-ffffffffffff", "testrg", "testtarget", "testmigration", armpostgresqlflexibleservers.MigrationResource{ - Location: to.Ptr("westus"), - Properties: &armpostgresqlflexibleservers.MigrationResourceProperties{ + res, err := clientFactory.NewMigrationsClient().Create(ctx, "exampleresourcegroup", "exampleserver", "examplemigration", armpostgresqlflexibleservers.Migration{ + Location: to.Ptr("eastus"), + Properties: &armpostgresqlflexibleservers.MigrationProperties{ DbsToMigrate: []*string{ - to.Ptr("db1"), - to.Ptr("db2"), - to.Ptr("db3"), - to.Ptr("db4")}, - MigrationMode: to.Ptr(armpostgresqlflexibleservers.MigrationModeOffline), - MigrationOption: to.Ptr(armpostgresqlflexibleservers.MigrationOptionValidate), - OverwriteDbsInTarget: to.Ptr(armpostgresqlflexibleservers.OverwriteDbsInTargetEnumTrue), + to.Ptr("exampledatabase1"), + to.Ptr("exampledatabase2"), + to.Ptr("exampledatabase3"), + to.Ptr("exampledatabase4")}, + MigrationMode: to.Ptr(armpostgresqlflexibleservers.MigrationModeOffline), SecretParameters: &armpostgresqlflexibleservers.MigrationSecretParameters{ AdminCredentials: &armpostgresqlflexibleservers.AdminCredentials{ - SourceServerPassword: to.Ptr("xxxxxxxx"), - TargetServerPassword: to.Ptr("xxxxxxxx"), + SourceServerPassword: to.Ptr("examplesourcepassword"), + TargetServerPassword: to.Ptr("exampletargetpassword"), }, + SourceServerUsername: to.Ptr("newadmin@examplesource"), + TargetServerUsername: to.Ptr("targetadmin"), }, - SourceDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/servers/testsource"), + SourceDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBForPostgreSql/servers/examplesource"), }, }, nil) if err != nil { @@ -131,43 +127,43 @@ func ExampleMigrationsClient_Create_createPreMigrationValidation() { // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.MigrationResource = armpostgresqlflexibleservers.MigrationResource{ - // Name: to.Ptr("testmigration"), + // res.Migration = armpostgresqlflexibleservers.Migration{ + // Name: to.Ptr("examplemigration"), // Type: to.Ptr("Microsoft.DBForPostgreSql/flexibleServers/migrations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/flexibleServers/testtarget/migrations/testmigration"), - // Location: to.Ptr("westus"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBForPostgreSql/flexibleServers/exampletarget/migrations/examplemigration"), + // Location: to.Ptr("eastus"), // Tags: map[string]*string{ // "key1624": to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), // }, - // Properties: &armpostgresqlflexibleservers.MigrationResourceProperties{ + // Properties: &armpostgresqlflexibleservers.MigrationProperties{ // CurrentStatus: &armpostgresqlflexibleservers.MigrationStatus{ - // CurrentSubStateDetails: &armpostgresqlflexibleservers.MigrationSubStateDetails{ - // CurrentSubState: to.Ptr(armpostgresqlflexibleservers.MigrationSubStateValidationInProgress), + // CurrentSubStateDetails: &armpostgresqlflexibleservers.MigrationSubstateDetails{ + // CurrentSubState: to.Ptr(armpostgresqlflexibleservers.MigrationSubstatePerformingPreRequisiteSteps), // }, // Error: to.Ptr(""), // State: to.Ptr(armpostgresqlflexibleservers.MigrationStateInProgress), // }, // DbsToMigrate: []*string{ - // to.Ptr("db1"), - // to.Ptr("db2"), - // to.Ptr("db3"), - // to.Ptr("db4")}, - // MigrateRoles: to.Ptr(armpostgresqlflexibleservers.MigrateRolesEnumFalse), + // to.Ptr("exampledatabase1"), + // to.Ptr("exampledatabase2"), + // to.Ptr("exampledatabase3"), + // to.Ptr("exampledatabase4")}, + // MigrateRoles: to.Ptr(armpostgresqlflexibleservers.MigrateRolesAndPermissionsFalse), // MigrationID: to.Ptr("d3ceacbb-a5fd-43dc-a9db-6022b5154856"), - // MigrationOption: to.Ptr(armpostgresqlflexibleservers.MigrationOptionValidate), - // MigrationWindowStartTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-12-06T16:05:58.895Z"); return t}()), - // OverwriteDbsInTarget: to.Ptr(armpostgresqlflexibleservers.OverwriteDbsInTargetEnumTrue), - // SetupLogicalReplicationOnSourceDbIfNeeded: to.Ptr(armpostgresqlflexibleservers.LogicalReplicationOnSourceDbEnumFalse), - // SourceDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/servers/testsource"), - // StartDataMigration: to.Ptr(armpostgresqlflexibleservers.StartDataMigrationEnumFalse), - // TargetDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/flexibleServers/testtarget"), - // TriggerCutover: to.Ptr(armpostgresqlflexibleservers.TriggerCutoverEnumFalse), + // MigrationMode: to.Ptr(armpostgresqlflexibleservers.MigrationModeOffline), + // MigrationWindowStartTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T18:30:22.123Z"); return t}()), + // OverwriteDbsInTarget: to.Ptr(armpostgresqlflexibleservers.OverwriteDatabasesOnTargetServerFalse), + // SetupLogicalReplicationOnSourceDbIfNeeded: to.Ptr(armpostgresqlflexibleservers.LogicalReplicationOnSourceServerFalse), + // SourceDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBForPostgreSql/servers/examplesource"), + // StartDataMigration: to.Ptr(armpostgresqlflexibleservers.StartDataMigrationFalse), + // TargetDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBForPostgreSql/flexibleServers/exampletarget"), + // TriggerCutover: to.Ptr(armpostgresqlflexibleservers.TriggerCutoverFalse), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b1f4d539964453ce8008e4b069e59885e12ba441/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/Migrations_Create_With_Other_Users.json -func ExampleMigrationsClient_Create_migrationsCreateByPassingUserNames() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/735d21dbd7e1cc446babf58860af4cca757d620d/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/MigrationsCreateWithFullyQualifiedDomainName.json +func ExampleMigrationsClient_Create_createAMigrationWithFullyQualifiedDomainNamesForSourceAndTargetServers() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -177,24 +173,25 @@ func ExampleMigrationsClient_Create_migrationsCreateByPassingUserNames() { if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewMigrationsClient().Create(ctx, "ffffffff-ffff-ffff-ffff-ffffffffffff", "testrg", "testtarget", "testmigration", armpostgresqlflexibleservers.MigrationResource{ - Location: to.Ptr("westus"), - Properties: &armpostgresqlflexibleservers.MigrationResourceProperties{ + res, err := clientFactory.NewMigrationsClient().Create(ctx, "exampleresourcegroup", "exampleserver", "examplemigration", armpostgresqlflexibleservers.Migration{ + Location: to.Ptr("eastus"), + Properties: &armpostgresqlflexibleservers.MigrationProperties{ DbsToMigrate: []*string{ - to.Ptr("db1"), - to.Ptr("db2"), - to.Ptr("db3"), - to.Ptr("db4")}, - MigrationMode: to.Ptr(armpostgresqlflexibleservers.MigrationModeOffline), + to.Ptr("exampledatabase1"), + to.Ptr("exampledatabase2"), + to.Ptr("exampledatabase3"), + to.Ptr("exampledatabase4")}, + MigrationMode: to.Ptr(armpostgresqlflexibleservers.MigrationModeOffline), + OverwriteDbsInTarget: to.Ptr(armpostgresqlflexibleservers.OverwriteDatabasesOnTargetServerTrue), SecretParameters: &armpostgresqlflexibleservers.MigrationSecretParameters{ AdminCredentials: &armpostgresqlflexibleservers.AdminCredentials{ SourceServerPassword: to.Ptr("xxxxxxxx"), TargetServerPassword: to.Ptr("xxxxxxxx"), }, - SourceServerUsername: to.Ptr("newadmin@testsource"), - TargetServerUsername: to.Ptr("targetadmin"), }, - SourceDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/servers/testsource"), + SourceDbServerFullyQualifiedDomainName: to.Ptr("examplesource.contoso.com"), + SourceDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBForPostgreSql/servers/examplesource"), + TargetDbServerFullyQualifiedDomainName: to.Ptr("exampletarget.contoso.com"), }, }, nil) if err != nil { @@ -203,43 +200,44 @@ func ExampleMigrationsClient_Create_migrationsCreateByPassingUserNames() { // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.MigrationResource = armpostgresqlflexibleservers.MigrationResource{ - // Name: to.Ptr("testmigration"), + // res.Migration = armpostgresqlflexibleservers.Migration{ + // Name: to.Ptr("examplemigration"), // Type: to.Ptr("Microsoft.DBForPostgreSql/flexibleServers/migrations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/flexibleServers/testtarget/migrations/testmigration"), - // Location: to.Ptr("westus"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBForPostgreSql/flexibleServers/exampletarget/migrations/examplemigration"), + // Location: to.Ptr("eastus"), // Tags: map[string]*string{ // "key1624": to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), // }, - // Properties: &armpostgresqlflexibleservers.MigrationResourceProperties{ + // Properties: &armpostgresqlflexibleservers.MigrationProperties{ // CurrentStatus: &armpostgresqlflexibleservers.MigrationStatus{ - // CurrentSubStateDetails: &armpostgresqlflexibleservers.MigrationSubStateDetails{ - // CurrentSubState: to.Ptr(armpostgresqlflexibleservers.MigrationSubStatePerformingPreRequisiteSteps), + // CurrentSubStateDetails: &armpostgresqlflexibleservers.MigrationSubstateDetails{ + // CurrentSubState: to.Ptr(armpostgresqlflexibleservers.MigrationSubstatePerformingPreRequisiteSteps), // }, // Error: to.Ptr(""), // State: to.Ptr(armpostgresqlflexibleservers.MigrationStateInProgress), // }, // DbsToMigrate: []*string{ - // to.Ptr("db1"), - // to.Ptr("db2"), - // to.Ptr("db3"), - // to.Ptr("db4")}, - // MigrateRoles: to.Ptr(armpostgresqlflexibleservers.MigrateRolesEnumFalse), + // to.Ptr("exampledatabase1"), + // to.Ptr("exampledatabase2"), + // to.Ptr("exampledatabase3"), + // to.Ptr("exampledatabase4")}, + // MigrateRoles: to.Ptr(armpostgresqlflexibleservers.MigrateRolesAndPermissionsFalse), // MigrationID: to.Ptr("d3ceacbb-a5fd-43dc-a9db-6022b5154856"), - // MigrationMode: to.Ptr(armpostgresqlflexibleservers.MigrationModeOffline), - // MigrationWindowStartTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-12-06T16:05:58.895Z"); return t}()), - // OverwriteDbsInTarget: to.Ptr(armpostgresqlflexibleservers.OverwriteDbsInTargetEnumFalse), - // SetupLogicalReplicationOnSourceDbIfNeeded: to.Ptr(armpostgresqlflexibleservers.LogicalReplicationOnSourceDbEnumFalse), - // SourceDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/servers/testsource"), - // StartDataMigration: to.Ptr(armpostgresqlflexibleservers.StartDataMigrationEnumFalse), - // TargetDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/flexibleServers/testtarget"), - // TriggerCutover: to.Ptr(armpostgresqlflexibleservers.TriggerCutoverEnumFalse), + // MigrationWindowStartTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T18:30:22.123Z"); return t}()), + // OverwriteDbsInTarget: to.Ptr(armpostgresqlflexibleservers.OverwriteDatabasesOnTargetServerTrue), + // SetupLogicalReplicationOnSourceDbIfNeeded: to.Ptr(armpostgresqlflexibleservers.LogicalReplicationOnSourceServerFalse), + // SourceDbServerFullyQualifiedDomainName: to.Ptr("examplesource.contoso.com"), + // SourceDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBForPostgreSql/servers/examplesource"), + // StartDataMigration: to.Ptr(armpostgresqlflexibleservers.StartDataMigrationFalse), + // TargetDbServerFullyQualifiedDomainName: to.Ptr("exampletarget.contoso.com"), + // TargetDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBForPostgreSql/flexibleServers/exampletarget"), + // TriggerCutover: to.Ptr(armpostgresqlflexibleservers.TriggerCutoverFalse), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b1f4d539964453ce8008e4b069e59885e12ba441/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/Migrations_Create_With_FullyQualifiedDomainName.json -func ExampleMigrationsClient_Create_migrationsCreateWithFullyQualifiedDomainName() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/735d21dbd7e1cc446babf58860af4cca757d620d/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/MigrationsCreateOtherSourceTypesValidateMigrate.json +func ExampleMigrationsClient_Create_createAMigrationWithOtherSourceTypeForValidatingAndMigrating() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -249,25 +247,26 @@ func ExampleMigrationsClient_Create_migrationsCreateWithFullyQualifiedDomainName if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewMigrationsClient().Create(ctx, "ffffffff-ffff-ffff-ffff-ffffffffffff", "testrg", "testtarget", "testmigration", armpostgresqlflexibleservers.MigrationResource{ - Location: to.Ptr("westus"), - Properties: &armpostgresqlflexibleservers.MigrationResourceProperties{ + res, err := clientFactory.NewMigrationsClient().Create(ctx, "exampleresourcegroup", "exampleserver", "examplemigration", armpostgresqlflexibleservers.Migration{ + Location: to.Ptr("eastus"), + Properties: &armpostgresqlflexibleservers.MigrationProperties{ DbsToMigrate: []*string{ - to.Ptr("db1"), - to.Ptr("db2"), - to.Ptr("db3"), - to.Ptr("db4")}, + to.Ptr("exampledatabase1"), + to.Ptr("exampledatabase2"), + to.Ptr("exampledatabase3"), + to.Ptr("exampledatabase4")}, MigrationMode: to.Ptr(armpostgresqlflexibleservers.MigrationModeOffline), - OverwriteDbsInTarget: to.Ptr(armpostgresqlflexibleservers.OverwriteDbsInTargetEnumTrue), + MigrationOption: to.Ptr(armpostgresqlflexibleservers.MigrationOptionValidateAndMigrate), + OverwriteDbsInTarget: to.Ptr(armpostgresqlflexibleservers.OverwriteDatabasesOnTargetServerTrue), SecretParameters: &armpostgresqlflexibleservers.MigrationSecretParameters{ AdminCredentials: &armpostgresqlflexibleservers.AdminCredentials{ - SourceServerPassword: to.Ptr("xxxxxxxx"), - TargetServerPassword: to.Ptr("xxxxxxxx"), + SourceServerPassword: to.Ptr("examplesourcepassword"), + TargetServerPassword: to.Ptr("exampletargetpassword"), }, }, - SourceDbServerFullyQualifiedDomainName: to.Ptr("testsourcefqdn.example.com"), - SourceDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/servers/testsource"), - TargetDbServerFullyQualifiedDomainName: to.Ptr("test-target-fqdn.example.com"), + SourceDbServerResourceID: to.Ptr("examplesource:5432@exampleuser"), + SourceType: to.Ptr(armpostgresqlflexibleservers.SourceTypeOnPremises), + SSLMode: to.Ptr(armpostgresqlflexibleservers.SSLModePrefer), }, }, nil) if err != nil { @@ -276,44 +275,45 @@ func ExampleMigrationsClient_Create_migrationsCreateWithFullyQualifiedDomainName // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.MigrationResource = armpostgresqlflexibleservers.MigrationResource{ - // Name: to.Ptr("testmigration"), + // res.Migration = armpostgresqlflexibleservers.Migration{ + // Name: to.Ptr("examplemigration"), // Type: to.Ptr("Microsoft.DBForPostgreSql/flexibleServers/migrations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/flexibleServers/testtarget/migrations/testmigration"), - // Location: to.Ptr("westus"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBForPostgreSql/flexibleServers/exampletarget/migrations/examplemigration"), + // Location: to.Ptr("eastus"), // Tags: map[string]*string{ // "key1624": to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), // }, - // Properties: &armpostgresqlflexibleservers.MigrationResourceProperties{ + // Properties: &armpostgresqlflexibleservers.MigrationProperties{ // CurrentStatus: &armpostgresqlflexibleservers.MigrationStatus{ - // CurrentSubStateDetails: &armpostgresqlflexibleservers.MigrationSubStateDetails{ - // CurrentSubState: to.Ptr(armpostgresqlflexibleservers.MigrationSubStatePerformingPreRequisiteSteps), + // CurrentSubStateDetails: &armpostgresqlflexibleservers.MigrationSubstateDetails{ + // CurrentSubState: to.Ptr(armpostgresqlflexibleservers.MigrationSubstateValidationInProgress), // }, // Error: to.Ptr(""), // State: to.Ptr(armpostgresqlflexibleservers.MigrationStateInProgress), // }, // DbsToMigrate: []*string{ - // to.Ptr("db1"), - // to.Ptr("db2"), - // to.Ptr("db3"), - // to.Ptr("db4")}, - // MigrateRoles: to.Ptr(armpostgresqlflexibleservers.MigrateRolesEnumFalse), + // to.Ptr("exampledatabase1"), + // to.Ptr("exampledatabase2"), + // to.Ptr("exampledatabase3"), + // to.Ptr("exampledatabase4")}, + // MigrateRoles: to.Ptr(armpostgresqlflexibleservers.MigrateRolesAndPermissionsFalse), // MigrationID: to.Ptr("d3ceacbb-a5fd-43dc-a9db-6022b5154856"), - // MigrationWindowStartTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-10-10T16:05:58.895Z"); return t}()), - // OverwriteDbsInTarget: to.Ptr(armpostgresqlflexibleservers.OverwriteDbsInTargetEnumTrue), - // SetupLogicalReplicationOnSourceDbIfNeeded: to.Ptr(armpostgresqlflexibleservers.LogicalReplicationOnSourceDbEnumFalse), - // SourceDbServerFullyQualifiedDomainName: to.Ptr("testsourcefqdn.example.com"), - // SourceDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/servers/testsource"), - // StartDataMigration: to.Ptr(armpostgresqlflexibleservers.StartDataMigrationEnumFalse), - // TargetDbServerFullyQualifiedDomainName: to.Ptr("test-target-fqdn.example.com"), - // TargetDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/flexibleServers/testtarget"), - // TriggerCutover: to.Ptr(armpostgresqlflexibleservers.TriggerCutoverEnumFalse), + // MigrationOption: to.Ptr(armpostgresqlflexibleservers.MigrationOptionValidateAndMigrate), + // MigrationWindowStartTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T18:30:22.123Z"); return t}()), + // OverwriteDbsInTarget: to.Ptr(armpostgresqlflexibleservers.OverwriteDatabasesOnTargetServerTrue), + // SetupLogicalReplicationOnSourceDbIfNeeded: to.Ptr(armpostgresqlflexibleservers.LogicalReplicationOnSourceServerFalse), + // SourceDbServerResourceID: to.Ptr("examplesource:5432@exampleuser"), + // SourceType: to.Ptr(armpostgresqlflexibleservers.SourceTypeOnPremises), + // SSLMode: to.Ptr(armpostgresqlflexibleservers.SSLModePrefer), + // StartDataMigration: to.Ptr(armpostgresqlflexibleservers.StartDataMigrationFalse), + // TargetDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBForPostgreSql/flexibleServers/exampletarget"), + // TriggerCutover: to.Ptr(armpostgresqlflexibleservers.TriggerCutoverFalse), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b1f4d539964453ce8008e4b069e59885e12ba441/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/Migrations_Create_With_PrivateEndpoint_Servers.json -func ExampleMigrationsClient_Create_migrationsCreateWithPrivateEndpoint() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/735d21dbd7e1cc446babf58860af4cca757d620d/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/MigrationsCreateWithPrivateEndpointServers.json +func ExampleMigrationsClient_Create_createAMigrationWithPrivateEndpoint() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -323,24 +323,24 @@ func ExampleMigrationsClient_Create_migrationsCreateWithPrivateEndpoint() { if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewMigrationsClient().Create(ctx, "ffffffff-ffff-ffff-ffff-ffffffffffff", "testrg", "testtarget", "testmigration", armpostgresqlflexibleservers.MigrationResource{ - Location: to.Ptr("westus"), - Properties: &armpostgresqlflexibleservers.MigrationResourceProperties{ + res, err := clientFactory.NewMigrationsClient().Create(ctx, "exampleresourcegroup", "exampleserver", "examplemigration", armpostgresqlflexibleservers.Migration{ + Location: to.Ptr("eastus"), + Properties: &armpostgresqlflexibleservers.MigrationProperties{ DbsToMigrate: []*string{ - to.Ptr("db1"), - to.Ptr("db2"), - to.Ptr("db3"), - to.Ptr("db4")}, - MigrationInstanceResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/flexibleServers/testsourcemigration"), + to.Ptr("exampledatabase1"), + to.Ptr("exampledatabase2"), + to.Ptr("exampledatabase3"), + to.Ptr("exampledatabase4")}, + MigrationInstanceResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBForPostgreSql/flexibleServers/examplesourcemigration"), MigrationMode: to.Ptr(armpostgresqlflexibleservers.MigrationModeOffline), - OverwriteDbsInTarget: to.Ptr(armpostgresqlflexibleservers.OverwriteDbsInTargetEnumTrue), + OverwriteDbsInTarget: to.Ptr(armpostgresqlflexibleservers.OverwriteDatabasesOnTargetServerTrue), SecretParameters: &armpostgresqlflexibleservers.MigrationSecretParameters{ AdminCredentials: &armpostgresqlflexibleservers.AdminCredentials{ - SourceServerPassword: to.Ptr("xxxxxxxx"), - TargetServerPassword: to.Ptr("xxxxxxxx"), + SourceServerPassword: to.Ptr("examplesourcepassword"), + TargetServerPassword: to.Ptr("exampletargetpassword"), }, }, - SourceDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/servers/testsource"), + SourceDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBForPostgreSql/servers/examplesource"), }, }, nil) if err != nil { @@ -349,43 +349,43 @@ func ExampleMigrationsClient_Create_migrationsCreateWithPrivateEndpoint() { // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.MigrationResource = armpostgresqlflexibleservers.MigrationResource{ - // Name: to.Ptr("testmigration"), + // res.Migration = armpostgresqlflexibleservers.Migration{ + // Name: to.Ptr("examplemigration"), // Type: to.Ptr("Microsoft.DBForPostgreSql/flexibleServers/migrations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/flexibleServers/testtarget/migrations/testmigration"), - // Location: to.Ptr("westus"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBForPostgreSql/flexibleServers/exampletarget/migrations/examplemigration"), + // Location: to.Ptr("eastus"), // Tags: map[string]*string{ // "key1624": to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), // }, - // Properties: &armpostgresqlflexibleservers.MigrationResourceProperties{ + // Properties: &armpostgresqlflexibleservers.MigrationProperties{ // CurrentStatus: &armpostgresqlflexibleservers.MigrationStatus{ - // CurrentSubStateDetails: &armpostgresqlflexibleservers.MigrationSubStateDetails{ - // CurrentSubState: to.Ptr(armpostgresqlflexibleservers.MigrationSubStatePerformingPreRequisiteSteps), + // CurrentSubStateDetails: &armpostgresqlflexibleservers.MigrationSubstateDetails{ + // CurrentSubState: to.Ptr(armpostgresqlflexibleservers.MigrationSubstatePerformingPreRequisiteSteps), // }, // Error: to.Ptr(""), // State: to.Ptr(armpostgresqlflexibleservers.MigrationStateInProgress), // }, // DbsToMigrate: []*string{ - // to.Ptr("db1"), - // to.Ptr("db2"), - // to.Ptr("db3"), - // to.Ptr("db4")}, - // MigrateRoles: to.Ptr(armpostgresqlflexibleservers.MigrateRolesEnumFalse), + // to.Ptr("exampledatabase1"), + // to.Ptr("exampledatabase2"), + // to.Ptr("exampledatabase3"), + // to.Ptr("exampledatabase4")}, + // MigrateRoles: to.Ptr(armpostgresqlflexibleservers.MigrateRolesAndPermissionsFalse), // MigrationID: to.Ptr("d3ceacbb-a5fd-43dc-a9db-6022b5154856"), - // MigrationInstanceResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/flexibleServers/testsourcemigration"), - // MigrationWindowStartTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-12-06T16:05:58.895Z"); return t}()), - // OverwriteDbsInTarget: to.Ptr(armpostgresqlflexibleservers.OverwriteDbsInTargetEnumTrue), - // SetupLogicalReplicationOnSourceDbIfNeeded: to.Ptr(armpostgresqlflexibleservers.LogicalReplicationOnSourceDbEnumFalse), - // SourceDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/servers/testsource"), - // StartDataMigration: to.Ptr(armpostgresqlflexibleservers.StartDataMigrationEnumFalse), - // TargetDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/flexibleServers/testtarget"), - // TriggerCutover: to.Ptr(armpostgresqlflexibleservers.TriggerCutoverEnumFalse), + // MigrationInstanceResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBForPostgreSql/flexibleServers/examplesourcemigration"), + // MigrationWindowStartTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T18:30:22.123Z"); return t}()), + // OverwriteDbsInTarget: to.Ptr(armpostgresqlflexibleservers.OverwriteDatabasesOnTargetServerTrue), + // SetupLogicalReplicationOnSourceDbIfNeeded: to.Ptr(armpostgresqlflexibleservers.LogicalReplicationOnSourceServerFalse), + // SourceDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBForPostgreSql/servers/examplesource"), + // StartDataMigration: to.Ptr(armpostgresqlflexibleservers.StartDataMigrationFalse), + // TargetDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBForPostgreSql/flexibleServers/exampletarget"), + // TriggerCutover: to.Ptr(armpostgresqlflexibleservers.TriggerCutoverFalse), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b1f4d539964453ce8008e4b069e59885e12ba441/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/Migrations_Create_With_Roles.json -func ExampleMigrationsClient_Create_migrationsCreateWithRoles() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/735d21dbd7e1cc446babf58860af4cca757d620d/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/MigrationsCreateWithRoles.json +func ExampleMigrationsClient_Create_createAMigrationWithRoles() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -395,24 +395,24 @@ func ExampleMigrationsClient_Create_migrationsCreateWithRoles() { if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewMigrationsClient().Create(ctx, "ffffffff-ffff-ffff-ffff-ffffffffffff", "testrg", "testtarget", "testmigration", armpostgresqlflexibleservers.MigrationResource{ - Location: to.Ptr("westus"), - Properties: &armpostgresqlflexibleservers.MigrationResourceProperties{ + res, err := clientFactory.NewMigrationsClient().Create(ctx, "exampleresourcegroup", "exampleserver", "examplemigration", armpostgresqlflexibleservers.Migration{ + Location: to.Ptr("eastus"), + Properties: &armpostgresqlflexibleservers.MigrationProperties{ DbsToMigrate: []*string{ - to.Ptr("db1"), - to.Ptr("db2"), - to.Ptr("db3"), - to.Ptr("db4")}, - MigrateRoles: to.Ptr(armpostgresqlflexibleservers.MigrateRolesEnumTrue), + to.Ptr("exampledatabase1"), + to.Ptr("exampledatabase2"), + to.Ptr("exampledatabase3"), + to.Ptr("exampledatabase4")}, + MigrateRoles: to.Ptr(armpostgresqlflexibleservers.MigrateRolesAndPermissionsTrue), MigrationMode: to.Ptr(armpostgresqlflexibleservers.MigrationModeOffline), - OverwriteDbsInTarget: to.Ptr(armpostgresqlflexibleservers.OverwriteDbsInTargetEnumTrue), + OverwriteDbsInTarget: to.Ptr(armpostgresqlflexibleservers.OverwriteDatabasesOnTargetServerTrue), SecretParameters: &armpostgresqlflexibleservers.MigrationSecretParameters{ AdminCredentials: &armpostgresqlflexibleservers.AdminCredentials{ - SourceServerPassword: to.Ptr("xxxxxxxx"), - TargetServerPassword: to.Ptr("xxxxxxxx"), + SourceServerPassword: to.Ptr("examplesourcepassword"), + TargetServerPassword: to.Ptr("exampletargetpassword"), }, }, - SourceDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/servers/testsource"), + SourceDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBForPostgreSql/servers/examplesource"), }, }, nil) if err != nil { @@ -421,42 +421,42 @@ func ExampleMigrationsClient_Create_migrationsCreateWithRoles() { // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.MigrationResource = armpostgresqlflexibleservers.MigrationResource{ - // Name: to.Ptr("testmigration"), + // res.Migration = armpostgresqlflexibleservers.Migration{ + // Name: to.Ptr("examplemigration"), // Type: to.Ptr("Microsoft.DBForPostgreSql/flexibleServers/migrations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/flexibleServers/testtarget/migrations/testmigration"), - // Location: to.Ptr("westus"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBForPostgreSql/flexibleServers/exampletarget/migrations/examplemigration"), + // Location: to.Ptr("eastus"), // Tags: map[string]*string{ // "key1624": to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), // }, - // Properties: &armpostgresqlflexibleservers.MigrationResourceProperties{ + // Properties: &armpostgresqlflexibleservers.MigrationProperties{ // CurrentStatus: &armpostgresqlflexibleservers.MigrationStatus{ - // CurrentSubStateDetails: &armpostgresqlflexibleservers.MigrationSubStateDetails{ - // CurrentSubState: to.Ptr(armpostgresqlflexibleservers.MigrationSubStatePerformingPreRequisiteSteps), + // CurrentSubStateDetails: &armpostgresqlflexibleservers.MigrationSubstateDetails{ + // CurrentSubState: to.Ptr(armpostgresqlflexibleservers.MigrationSubstatePerformingPreRequisiteSteps), // }, // Error: to.Ptr(""), // State: to.Ptr(armpostgresqlflexibleservers.MigrationStateInProgress), // }, // DbsToMigrate: []*string{ - // to.Ptr("db1"), - // to.Ptr("db2"), - // to.Ptr("db3"), - // to.Ptr("db4")}, - // MigrateRoles: to.Ptr(armpostgresqlflexibleservers.MigrateRolesEnumTrue), + // to.Ptr("exampledatabase1"), + // to.Ptr("exampledatabase2"), + // to.Ptr("exampledatabase3"), + // to.Ptr("exampledatabase4")}, + // MigrateRoles: to.Ptr(armpostgresqlflexibleservers.MigrateRolesAndPermissionsTrue), // MigrationID: to.Ptr("d3ceacbb-a5fd-43dc-a9db-6022b5154856"), - // MigrationWindowStartTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-12-06T16:05:58.895Z"); return t}()), - // OverwriteDbsInTarget: to.Ptr(armpostgresqlflexibleservers.OverwriteDbsInTargetEnumTrue), - // SetupLogicalReplicationOnSourceDbIfNeeded: to.Ptr(armpostgresqlflexibleservers.LogicalReplicationOnSourceDbEnumFalse), - // SourceDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/servers/testsource"), - // StartDataMigration: to.Ptr(armpostgresqlflexibleservers.StartDataMigrationEnumFalse), - // TargetDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/flexibleServers/testtarget"), - // TriggerCutover: to.Ptr(armpostgresqlflexibleservers.TriggerCutoverEnumFalse), + // MigrationWindowStartTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T18:30:22.123Z"); return t}()), + // OverwriteDbsInTarget: to.Ptr(armpostgresqlflexibleservers.OverwriteDatabasesOnTargetServerTrue), + // SetupLogicalReplicationOnSourceDbIfNeeded: to.Ptr(armpostgresqlflexibleservers.LogicalReplicationOnSourceServerFalse), + // SourceDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBForPostgreSql/servers/examplesource"), + // StartDataMigration: to.Ptr(armpostgresqlflexibleservers.StartDataMigrationFalse), + // TargetDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBForPostgreSql/flexibleServers/exampletarget"), + // TriggerCutover: to.Ptr(armpostgresqlflexibleservers.TriggerCutoverFalse), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b1f4d539964453ce8008e4b069e59885e12ba441/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/Migrations_Create.json -func ExampleMigrationsClient_Create_migrationsCreate() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/735d21dbd7e1cc446babf58860af4cca757d620d/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/MigrationsCreate.json +func ExampleMigrationsClient_Create_createAMigration() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -466,23 +466,23 @@ func ExampleMigrationsClient_Create_migrationsCreate() { if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewMigrationsClient().Create(ctx, "ffffffff-ffff-ffff-ffff-ffffffffffff", "testrg", "testtarget", "testmigration", armpostgresqlflexibleservers.MigrationResource{ - Location: to.Ptr("westus"), - Properties: &armpostgresqlflexibleservers.MigrationResourceProperties{ + res, err := clientFactory.NewMigrationsClient().Create(ctx, "exampleresourcegroup", "exampleserver", "examplemigration", armpostgresqlflexibleservers.Migration{ + Location: to.Ptr("eastus"), + Properties: &armpostgresqlflexibleservers.MigrationProperties{ DbsToMigrate: []*string{ - to.Ptr("db1"), - to.Ptr("db2"), - to.Ptr("db3"), - to.Ptr("db4")}, + to.Ptr("exampledatabase1"), + to.Ptr("exampledatabase2"), + to.Ptr("exampledatabase3"), + to.Ptr("exampledatabase4")}, MigrationMode: to.Ptr(armpostgresqlflexibleservers.MigrationModeOffline), - OverwriteDbsInTarget: to.Ptr(armpostgresqlflexibleservers.OverwriteDbsInTargetEnumTrue), + OverwriteDbsInTarget: to.Ptr(armpostgresqlflexibleservers.OverwriteDatabasesOnTargetServerTrue), SecretParameters: &armpostgresqlflexibleservers.MigrationSecretParameters{ AdminCredentials: &armpostgresqlflexibleservers.AdminCredentials{ - SourceServerPassword: to.Ptr("xxxxxxxx"), - TargetServerPassword: to.Ptr("xxxxxxxx"), + SourceServerPassword: to.Ptr("examplesourcepassword"), + TargetServerPassword: to.Ptr("exampletargetpassword"), }, }, - SourceDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/servers/testsource"), + SourceDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBForPostgreSql/servers/examplesource"), }, }, nil) if err != nil { @@ -491,109 +491,42 @@ func ExampleMigrationsClient_Create_migrationsCreate() { // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.MigrationResource = armpostgresqlflexibleservers.MigrationResource{ - // Name: to.Ptr("testmigration"), + // res.Migration = armpostgresqlflexibleservers.Migration{ + // Name: to.Ptr("examplemigration"), // Type: to.Ptr("Microsoft.DBForPostgreSql/flexibleServers/migrations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/flexibleServers/testtarget/migrations/testmigration"), - // Location: to.Ptr("westus"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBForPostgreSql/flexibleServers/exampletarget/migrations/examplemigration"), + // Location: to.Ptr("eastus"), // Tags: map[string]*string{ // "key1624": to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), // }, - // Properties: &armpostgresqlflexibleservers.MigrationResourceProperties{ - // CurrentStatus: &armpostgresqlflexibleservers.MigrationStatus{ - // CurrentSubStateDetails: &armpostgresqlflexibleservers.MigrationSubStateDetails{ - // CurrentSubState: to.Ptr(armpostgresqlflexibleservers.MigrationSubStatePerformingPreRequisiteSteps), - // }, - // Error: to.Ptr(""), - // State: to.Ptr(armpostgresqlflexibleservers.MigrationStateInProgress), - // }, - // DbsToMigrate: []*string{ - // to.Ptr("db1"), - // to.Ptr("db2"), - // to.Ptr("db3"), - // to.Ptr("db4")}, - // MigrateRoles: to.Ptr(armpostgresqlflexibleservers.MigrateRolesEnumFalse), - // MigrationID: to.Ptr("d3ceacbb-a5fd-43dc-a9db-6022b5154856"), - // MigrationWindowStartTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-12-06T16:05:58.895Z"); return t}()), - // OverwriteDbsInTarget: to.Ptr(armpostgresqlflexibleservers.OverwriteDbsInTargetEnumTrue), - // SetupLogicalReplicationOnSourceDbIfNeeded: to.Ptr(armpostgresqlflexibleservers.LogicalReplicationOnSourceDbEnumFalse), - // SourceDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/servers/testsource"), - // StartDataMigration: to.Ptr(armpostgresqlflexibleservers.StartDataMigrationEnumFalse), - // TargetDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/flexibleServers/testtarget"), - // TriggerCutover: to.Ptr(armpostgresqlflexibleservers.TriggerCutoverEnumFalse), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b1f4d539964453ce8008e4b069e59885e12ba441/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/Migrations_Get.json -func ExampleMigrationsClient_Get_migrationsGet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewMigrationsClient().Get(ctx, "ffffffff-ffff-ffff-ffff-ffffffffffff", "testrg", "testtarget", "testmigration", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.MigrationResource = armpostgresqlflexibleservers.MigrationResource{ - // Name: to.Ptr("testmigration"), - // Type: to.Ptr("Microsoft.DBForPostgreSql/flexibleServers/migrations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/flexibleServers/testtarget/migrations/testmigration"), - // Location: to.Ptr("westus"), - // Properties: &armpostgresqlflexibleservers.MigrationResourceProperties{ + // Properties: &armpostgresqlflexibleservers.MigrationProperties{ // CurrentStatus: &armpostgresqlflexibleservers.MigrationStatus{ - // CurrentSubStateDetails: &armpostgresqlflexibleservers.MigrationSubStateDetails{ - // CurrentSubState: to.Ptr(armpostgresqlflexibleservers.MigrationSubStatePerformingPreRequisiteSteps), + // CurrentSubStateDetails: &armpostgresqlflexibleservers.MigrationSubstateDetails{ + // CurrentSubState: to.Ptr(armpostgresqlflexibleservers.MigrationSubstatePerformingPreRequisiteSteps), // }, // Error: to.Ptr(""), // State: to.Ptr(armpostgresqlflexibleservers.MigrationStateInProgress), // }, // DbsToMigrate: []*string{ - // to.Ptr("db1"), - // to.Ptr("db2"), - // to.Ptr("db3"), - // to.Ptr("db4")}, - // MigrateRoles: to.Ptr(armpostgresqlflexibleservers.MigrateRolesEnumFalse), + // to.Ptr("exampledatabase1"), + // to.Ptr("exampledatabase2"), + // to.Ptr("exampledatabase3"), + // to.Ptr("exampledatabase4")}, + // MigrateRoles: to.Ptr(armpostgresqlflexibleservers.MigrateRolesAndPermissionsFalse), // MigrationID: to.Ptr("d3ceacbb-a5fd-43dc-a9db-6022b5154856"), - // MigrationWindowStartTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-12-06T16:05:58.895Z"); return t}()), - // OverwriteDbsInTarget: to.Ptr(armpostgresqlflexibleservers.OverwriteDbsInTargetEnumFalse), - // SetupLogicalReplicationOnSourceDbIfNeeded: to.Ptr(armpostgresqlflexibleservers.LogicalReplicationOnSourceDbEnumFalse), - // SourceDbServerMetadata: &armpostgresqlflexibleservers.DbServerMetadata{ - // Location: to.Ptr("westus"), - // SKU: &armpostgresqlflexibleservers.ServerSKU{ - // Name: to.Ptr("B_Gen5_2"), - // Tier: to.Ptr(armpostgresqlflexibleservers.SKUTier("Basic")), - // }, - // StorageMb: to.Ptr[int32](1024), - // Version: to.Ptr("10"), - // }, - // SourceDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/servers/testsource"), - // StartDataMigration: to.Ptr(armpostgresqlflexibleservers.StartDataMigrationEnumFalse), - // TargetDbServerMetadata: &armpostgresqlflexibleservers.DbServerMetadata{ - // Location: to.Ptr("westus"), - // SKU: &armpostgresqlflexibleservers.ServerSKU{ - // Name: to.Ptr("Standard_D4ds_v5"), - // Tier: to.Ptr(armpostgresqlflexibleservers.SKUTierGeneralPurpose), - // }, - // StorageMb: to.Ptr[int32](2048), - // Version: to.Ptr("16"), - // }, - // TargetDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/flexibleServers/testtarget"), - // TriggerCutover: to.Ptr(armpostgresqlflexibleservers.TriggerCutoverEnumFalse), + // MigrationWindowStartTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T18:30:22.123Z"); return t}()), + // OverwriteDbsInTarget: to.Ptr(armpostgresqlflexibleservers.OverwriteDatabasesOnTargetServerTrue), + // SetupLogicalReplicationOnSourceDbIfNeeded: to.Ptr(armpostgresqlflexibleservers.LogicalReplicationOnSourceServerFalse), + // SourceDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBForPostgreSql/servers/examplesource"), + // StartDataMigration: to.Ptr(armpostgresqlflexibleservers.StartDataMigrationFalse), + // TargetDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBForPostgreSql/flexibleServers/exampletarget"), + // TriggerCutover: to.Ptr(armpostgresqlflexibleservers.TriggerCutoverFalse), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b1f4d539964453ce8008e4b069e59885e12ba441/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/Migrations_GetMigrationWithSuccessfulValidationAndMigration.json -func ExampleMigrationsClient_Get_migrationsGetMigrationWithSuccessfulValidationAndMigration() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/735d21dbd7e1cc446babf58860af4cca757d620d/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/MigrationsGetMigrationWithSuccessfulValidationAndMigration.json +func ExampleMigrationsClient_Get_getInformationAboutAMigrationWithSuccessfulValidationAndSuccessfulMigration() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -603,46 +536,46 @@ func ExampleMigrationsClient_Get_migrationsGetMigrationWithSuccessfulValidationA if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewMigrationsClient().Get(ctx, "ffffffff-ffff-ffff-ffff-ffffffffffff", "testrg", "testtarget", "testmigrationwithsuccessfulvalidationandmigration", nil) + res, err := clientFactory.NewMigrationsClient().Get(ctx, "exampleresourcegroup", "exampleserver", "examplemigration", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.MigrationResource = armpostgresqlflexibleservers.MigrationResource{ - // Name: to.Ptr("testmigrationwithsuccessfulvalidationandmigration"), + // res.Migration = armpostgresqlflexibleservers.Migration{ + // Name: to.Ptr("examplemigration"), // Type: to.Ptr("Microsoft.DBForPostgreSql/flexibleServers/migrations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/flexibleServers/testtarget/migrations/testmigrationwithsuccessfulvalidationandmigration"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBForPostgreSql/flexibleServers/exampletarget/migrations/examplemigration"), // Location: to.Ptr("eastus"), - // Properties: &armpostgresqlflexibleservers.MigrationResourceProperties{ + // Properties: &armpostgresqlflexibleservers.MigrationProperties{ // CurrentStatus: &armpostgresqlflexibleservers.MigrationStatus{ - // CurrentSubStateDetails: &armpostgresqlflexibleservers.MigrationSubStateDetails{ - // CurrentSubState: to.Ptr(armpostgresqlflexibleservers.MigrationSubStateCompleted), - // DbDetails: map[string]*armpostgresqlflexibleservers.DbMigrationStatus{ - // "testdb3": &armpostgresqlflexibleservers.DbMigrationStatus{ + // CurrentSubStateDetails: &armpostgresqlflexibleservers.MigrationSubstateDetails{ + // CurrentSubState: to.Ptr(armpostgresqlflexibleservers.MigrationSubstateCompleted), + // DbDetails: map[string]*armpostgresqlflexibleservers.DatabaseMigrationState{ + // "exampledatabase": &armpostgresqlflexibleservers.DatabaseMigrationState{ // AppliedChanges: to.Ptr[int32](0), // CdcDeleteCounter: to.Ptr[int32](0), // CdcInsertCounter: to.Ptr[int32](0), // CdcUpdateCounter: to.Ptr[int32](0), - // DatabaseName: to.Ptr("testdb3"), - // EndedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-12T05:55:49.681Z"); return t}()), + // DatabaseName: to.Ptr("exampledatabase"), + // EndedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T20:30:22.123Z"); return t}()), // FullLoadCompletedTables: to.Ptr[int32](10), // FullLoadErroredTables: to.Ptr[int32](0), // FullLoadLoadingTables: to.Ptr[int32](0), // FullLoadQueuedTables: to.Ptr[int32](0), // IncomingChanges: to.Ptr[int32](0), // Latency: to.Ptr[int32](0), - // MigrationState: to.Ptr(armpostgresqlflexibleservers.MigrationDbStateSucceeded), - // StartedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-12T05:55:28.995Z"); return t}()), + // MigrationState: to.Ptr(armpostgresqlflexibleservers.MigrationDatabaseStateSucceeded), + // StartedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T18:30:22.123Z"); return t}()), // }, // }, // ValidationDetails: &armpostgresqlflexibleservers.ValidationDetails{ // DbLevelValidationDetails: []*armpostgresqlflexibleservers.DbLevelValidationStatus{ // { - // DatabaseName: to.Ptr("testdb3"), - // EndedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-12T05:54:29.894Z"); return t}()), - // StartedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-12T05:54:29.553Z"); return t}()), + // DatabaseName: to.Ptr("exampledatabase"), + // EndedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T20:30:22.123Z"); return t}()), + // StartedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T18:30:22.123Z"); return t}()), // Summary: []*armpostgresqlflexibleservers.ValidationSummaryItem{ // { // Type: to.Ptr("SchemaValidation"), @@ -671,31 +604,31 @@ func ExampleMigrationsClient_Get_migrationsGetMigrationWithSuccessfulValidationA // State: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded), // }}, // Status: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded), - // ValidationEndTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-12T05:55:00.499Z"); return t}()), - // ValidationStartTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-12T05:54:28.077Z"); return t}()), + // ValidationEndTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T20:30:22.123Z"); return t}()), + // ValidationStartTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T18:30:22.123Z"); return t}()), // }, // }, // State: to.Ptr(armpostgresqlflexibleservers.MigrationStateSucceeded), // }, // DbsToMigrate: []*string{ - // to.Ptr("testdb3")}, - // MigrateRoles: to.Ptr(armpostgresqlflexibleservers.MigrateRolesEnumFalse), + // to.Ptr("exampledatabase")}, + // MigrateRoles: to.Ptr(armpostgresqlflexibleservers.MigrateRolesAndPermissionsFalse), // MigrationID: to.Ptr("f2354e72-2828-4a19-ad20-b4cd9e2673c1"), // MigrationMode: to.Ptr(armpostgresqlflexibleservers.MigrationModeOffline), // MigrationOption: to.Ptr(armpostgresqlflexibleservers.MigrationOptionValidateAndMigrate), - // MigrationWindowEndTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-12T05:57:30.736Z"); return t}()), - // MigrationWindowStartTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-12T05:54:15.999Z"); return t}()), - // OverwriteDbsInTarget: to.Ptr(armpostgresqlflexibleservers.OverwriteDbsInTargetEnumTrue), - // SetupLogicalReplicationOnSourceDbIfNeeded: to.Ptr(armpostgresqlflexibleservers.LogicalReplicationOnSourceDbEnumTrue), + // MigrationWindowEndTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T20:30:22.123Z"); return t}()), + // MigrationWindowStartTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T18:30:22.123Z"); return t}()), + // OverwriteDbsInTarget: to.Ptr(armpostgresqlflexibleservers.OverwriteDatabasesOnTargetServerTrue), + // SetupLogicalReplicationOnSourceDbIfNeeded: to.Ptr(armpostgresqlflexibleservers.LogicalReplicationOnSourceServerTrue), // SourceDbServerResourceID: to.Ptr("20.228.214.65:5432@postgres"), - // TargetDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/flexibleServers/testtarget"), - // TriggerCutover: to.Ptr(armpostgresqlflexibleservers.TriggerCutoverEnumTrue), + // TargetDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBForPostgreSql/flexibleServers/exampletarget"), + // TriggerCutover: to.Ptr(armpostgresqlflexibleservers.TriggerCutoverTrue), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b1f4d539964453ce8008e4b069e59885e12ba441/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/Migrations_GetMigrationWithSuccessfulValidationButMigrationFailure.json -func ExampleMigrationsClient_Get_migrationsGetMigrationWithSuccessfulValidationButMigrationFailure() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/735d21dbd7e1cc446babf58860af4cca757d620d/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/MigrationsGetMigrationWithSuccessfulValidationButMigrationFailure.json +func ExampleMigrationsClient_Get_getInformationAboutAMigrationWithSuccessfulValidationButFailedMigration() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -705,30 +638,30 @@ func ExampleMigrationsClient_Get_migrationsGetMigrationWithSuccessfulValidationB if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewMigrationsClient().Get(ctx, "ffffffff-ffff-ffff-ffff-ffffffffffff", "testrg", "testtarget", "testmigrationwithsuccessfulvalidationbutmigrationfailure", nil) + res, err := clientFactory.NewMigrationsClient().Get(ctx, "exampleresourcegroup", "exampleserver", "examplemigration", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.MigrationResource = armpostgresqlflexibleservers.MigrationResource{ - // Name: to.Ptr("testmigrationwithsuccessfulvalidationbutmigrationfailure"), + // res.Migration = armpostgresqlflexibleservers.Migration{ + // Name: to.Ptr("examplemigration"), // Type: to.Ptr("Microsoft.DBForPostgreSql/flexibleServers/migrations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/flexibleServers/testtarget/migrations/testmigrationwithsuccessfulvalidationbutmigrationfailure"), - // Location: to.Ptr("eastus2"), - // Properties: &armpostgresqlflexibleservers.MigrationResourceProperties{ + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBForPostgreSql/flexibleServers/exampletarget/migrations/examplemigration"), + // Location: to.Ptr("eastus"), + // Properties: &armpostgresqlflexibleservers.MigrationProperties{ // CurrentStatus: &armpostgresqlflexibleservers.MigrationStatus{ - // CurrentSubStateDetails: &armpostgresqlflexibleservers.MigrationSubStateDetails{ - // CurrentSubState: to.Ptr(armpostgresqlflexibleservers.MigrationSubStateCompleted), - // DbDetails: map[string]*armpostgresqlflexibleservers.DbMigrationStatus{ - // "testdb6": &armpostgresqlflexibleservers.DbMigrationStatus{ + // CurrentSubStateDetails: &armpostgresqlflexibleservers.MigrationSubstateDetails{ + // CurrentSubState: to.Ptr(armpostgresqlflexibleservers.MigrationSubstateCompleted), + // DbDetails: map[string]*armpostgresqlflexibleservers.DatabaseMigrationState{ + // "exampledatabase": &armpostgresqlflexibleservers.DatabaseMigrationState{ // AppliedChanges: to.Ptr[int32](0), // CdcDeleteCounter: to.Ptr[int32](0), // CdcInsertCounter: to.Ptr[int32](0), // CdcUpdateCounter: to.Ptr[int32](0), - // DatabaseName: to.Ptr("testdb6"), - // EndedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-21T13:09:53.252Z"); return t}()), + // DatabaseName: to.Ptr("exampledatabase"), + // EndedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T20:30:22.123Z"); return t}()), // FullLoadCompletedTables: to.Ptr[int32](0), // FullLoadErroredTables: to.Ptr[int32](0), // FullLoadLoadingTables: to.Ptr[int32](0), @@ -736,16 +669,16 @@ func ExampleMigrationsClient_Get_migrationsGetMigrationWithSuccessfulValidationB // IncomingChanges: to.Ptr[int32](0), // Latency: to.Ptr[int32](0), // Message: to.Ptr("Collation/Encoding not Supported Error: User defined Collations are present in the source database. Please drop them before retrying the migration."), - // MigrationState: to.Ptr(armpostgresqlflexibleservers.MigrationDbStateFailed), - // StartedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-21T13:09:52.922Z"); return t}()), + // MigrationState: to.Ptr(armpostgresqlflexibleservers.MigrationDatabaseStateFailed), + // StartedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T18:30:22.123Z"); return t}()), // }, // }, // ValidationDetails: &armpostgresqlflexibleservers.ValidationDetails{ // DbLevelValidationDetails: []*armpostgresqlflexibleservers.DbLevelValidationStatus{ // { // DatabaseName: to.Ptr("address_standardizer"), - // EndedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-21T13:04:24.565Z"); return t}()), - // StartedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-21T13:04:24.565Z"); return t}()), + // EndedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T20:30:22.123Z"); return t}()), + // StartedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T18:30:22.123Z"); return t}()), // Summary: []*armpostgresqlflexibleservers.ValidationSummaryItem{ // { // Type: to.Ptr("ExtensionsValidation"), @@ -758,45 +691,45 @@ func ExampleMigrationsClient_Get_migrationsGetMigrationWithSuccessfulValidationB // State: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded), // }}, // Status: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded), - // ValidationEndTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-21T13:04:24.565Z"); return t}()), - // ValidationStartTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-21T13:04:21.623Z"); return t}()), + // ValidationEndTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T20:30:22.123Z"); return t}()), + // ValidationStartTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T18:30:22.123Z"); return t}()), // }, // }, - // Error: to.Ptr("testdb6: Collation/Encoding not Supported Error: User defined Collations are present in the source database. Please drop them before retrying the migration. "), + // Error: to.Ptr("exampledatabase: Collation/Encoding not Supported Error: User defined Collations are present in the source database. Please drop them before retrying the migration."), // State: to.Ptr(armpostgresqlflexibleservers.MigrationStateFailed), // }, // DbsToMigrate: []*string{ - // to.Ptr("testdb6")}, - // MigrateRoles: to.Ptr(armpostgresqlflexibleservers.MigrateRolesEnumFalse), + // to.Ptr("exampledatabase")}, + // MigrateRoles: to.Ptr(armpostgresqlflexibleservers.MigrateRolesAndPermissionsFalse), // MigrationID: to.Ptr("da52db29-cfeb-4670-a1ad-683edb14c621"), // MigrationMode: to.Ptr(armpostgresqlflexibleservers.MigrationModeOffline), // MigrationOption: to.Ptr(armpostgresqlflexibleservers.MigrationOptionValidateAndMigrate), - // MigrationWindowEndTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-21T13:04:24.565Z"); return t}()), - // MigrationWindowStartTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-21T13:04:24.565Z"); return t}()), - // OverwriteDbsInTarget: to.Ptr(armpostgresqlflexibleservers.OverwriteDbsInTargetEnumTrue), - // SetupLogicalReplicationOnSourceDbIfNeeded: to.Ptr(armpostgresqlflexibleservers.LogicalReplicationOnSourceDbEnumTrue), + // MigrationWindowEndTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T20:30:22.123Z"); return t}()), + // MigrationWindowStartTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T18:30:22.123Z"); return t}()), + // OverwriteDbsInTarget: to.Ptr(armpostgresqlflexibleservers.OverwriteDatabasesOnTargetServerTrue), + // SetupLogicalReplicationOnSourceDbIfNeeded: to.Ptr(armpostgresqlflexibleservers.LogicalReplicationOnSourceServerTrue), // SourceDbServerMetadata: &armpostgresqlflexibleservers.DbServerMetadata{ - // Location: to.Ptr("eastus2"), + // Location: to.Ptr("eastus"), // SKU: &armpostgresqlflexibleservers.ServerSKU{ // }, // StorageMb: to.Ptr[int32](102400), // }, - // SourceDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/source-rg/providers/Microsoft.DBforPostgreSQL/servers/testsource"), + // SourceDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/servers/examplesource"), // TargetDbServerMetadata: &armpostgresqlflexibleservers.DbServerMetadata{ - // Location: to.Ptr("East US 2"), + // Location: to.Ptr("eastus"), // SKU: &armpostgresqlflexibleservers.ServerSKU{ // Name: to.Ptr("Standard_D2ds_v4"), // Tier: to.Ptr(armpostgresqlflexibleservers.SKUTier("Standard_D2ds_v4")), // }, // StorageMb: to.Ptr[int32](131072), // }, - // TargetDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testtarget"), + // TargetDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampletarget"), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b1f4d539964453ce8008e4b069e59885e12ba441/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/Migrations_GetMigrationWithSuccessfulValidationOnly.json -func ExampleMigrationsClient_Get_migrationsGetMigrationWithSuccessfulValidationOnly() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/735d21dbd7e1cc446babf58860af4cca757d620d/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/MigrationsGetMigrationWithSuccessfulValidationOnly.json +func ExampleMigrationsClient_Get_getInformationAboutAMigrationWithSuccessfulValidationOnly() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -806,30 +739,30 @@ func ExampleMigrationsClient_Get_migrationsGetMigrationWithSuccessfulValidationO if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewMigrationsClient().Get(ctx, "ffffffff-ffff-ffff-ffff-ffffffffffff", "testrg", "testtarget", "testmigrationwithsuccessfulvalidationonly", nil) + res, err := clientFactory.NewMigrationsClient().Get(ctx, "exampleresourcegroup", "exampleserver", "examplemigration", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.MigrationResource = armpostgresqlflexibleservers.MigrationResource{ - // Name: to.Ptr("testmigrationwithsuccessfulvalidationonly"), + // res.Migration = armpostgresqlflexibleservers.Migration{ + // Name: to.Ptr("examplemigration"), // Type: to.Ptr("Microsoft.DBForPostgreSql/flexibleServers/migrations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/flexibleServers/testtarget/migrations/testmigrationwithsuccessfulvalidationonly"), - // Location: to.Ptr("westus"), - // Properties: &armpostgresqlflexibleservers.MigrationResourceProperties{ + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBForPostgreSql/flexibleServers/exampletarget/migrations/examplemigration"), + // Location: to.Ptr("eastus"), + // Properties: &armpostgresqlflexibleservers.MigrationProperties{ // CurrentStatus: &armpostgresqlflexibleservers.MigrationStatus{ - // CurrentSubStateDetails: &armpostgresqlflexibleservers.MigrationSubStateDetails{ - // CurrentSubState: to.Ptr(armpostgresqlflexibleservers.MigrationSubStateCompleted), - // DbDetails: map[string]*armpostgresqlflexibleservers.DbMigrationStatus{ + // CurrentSubStateDetails: &armpostgresqlflexibleservers.MigrationSubstateDetails{ + // CurrentSubState: to.Ptr(armpostgresqlflexibleservers.MigrationSubstateCompleted), + // DbDetails: map[string]*armpostgresqlflexibleservers.DatabaseMigrationState{ // }, // ValidationDetails: &armpostgresqlflexibleservers.ValidationDetails{ // DbLevelValidationDetails: []*armpostgresqlflexibleservers.DbLevelValidationStatus{ // { // DatabaseName: to.Ptr("UnknownCollationTest"), - // EndedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-16T05:29:39.248Z"); return t}()), - // StartedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-16T05:29:38.904Z"); return t}()), + // EndedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T20:30:22.123Z"); return t}()), + // StartedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T18:30:22.123Z"); return t}()), // Summary: []*armpostgresqlflexibleservers.ValidationSummaryItem{ // { // Type: to.Ptr("SchemaValidation"), @@ -858,31 +791,31 @@ func ExampleMigrationsClient_Get_migrationsGetMigrationWithSuccessfulValidationO // State: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded), // }}, // Status: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded), - // ValidationEndTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-16T05:29:39.666Z"); return t}()), - // ValidationStartTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-16T05:29:35.634Z"); return t}()), + // ValidationEndTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T20:30:22.123Z"); return t}()), + // ValidationStartTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T18:30:22.123Z"); return t}()), // }, // }, // State: to.Ptr(armpostgresqlflexibleservers.MigrationStateSucceeded), // }, // DbsToMigrate: []*string{ // to.Ptr("UnknownCollationTest")}, - // MigrateRoles: to.Ptr(armpostgresqlflexibleservers.MigrateRolesEnumFalse), + // MigrateRoles: to.Ptr(armpostgresqlflexibleservers.MigrateRolesAndPermissionsFalse), // MigrationID: to.Ptr("77840327-7be8-44b8-adc0-af0ccccfeb36"), // MigrationMode: to.Ptr(armpostgresqlflexibleservers.MigrationModeOffline), // MigrationOption: to.Ptr(armpostgresqlflexibleservers.MigrationOptionValidate), - // MigrationWindowEndTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-16T05:30:05.885Z"); return t}()), - // MigrationWindowStartTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-16T05:28:58.775Z"); return t}()), - // OverwriteDbsInTarget: to.Ptr(armpostgresqlflexibleservers.OverwriteDbsInTargetEnumTrue), - // SetupLogicalReplicationOnSourceDbIfNeeded: to.Ptr(armpostgresqlflexibleservers.LogicalReplicationOnSourceDbEnumTrue), + // MigrationWindowEndTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T20:30:22.123Z"); return t}()), + // MigrationWindowStartTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T18:30:22.123Z"); return t}()), + // OverwriteDbsInTarget: to.Ptr(armpostgresqlflexibleservers.OverwriteDatabasesOnTargetServerTrue), + // SetupLogicalReplicationOnSourceDbIfNeeded: to.Ptr(armpostgresqlflexibleservers.LogicalReplicationOnSourceServerTrue), // SourceDbServerResourceID: to.Ptr("20.228.214.65:5432@postgres"), - // TargetDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/flexibleServers/testtarget"), - // TriggerCutover: to.Ptr(armpostgresqlflexibleservers.TriggerCutoverEnumTrue), + // TargetDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBForPostgreSql/flexibleServers/exampletarget"), + // TriggerCutover: to.Ptr(armpostgresqlflexibleservers.TriggerCutoverTrue), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b1f4d539964453ce8008e4b069e59885e12ba441/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/Migrations_GetMigrationWithValidationFailures.json -func ExampleMigrationsClient_Get_migrationsGetMigrationWithValidationFailures() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/735d21dbd7e1cc446babf58860af4cca757d620d/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/MigrationsGetMigrationWithValidationFailures.json +func ExampleMigrationsClient_Get_getInformationAboutAMigrationWithValidationFailures() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -892,30 +825,30 @@ func ExampleMigrationsClient_Get_migrationsGetMigrationWithValidationFailures() if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewMigrationsClient().Get(ctx, "ffffffff-ffff-ffff-ffff-ffffffffffff", "testrg", "testtarget", "testmigrationwithvalidationfailure", nil) + res, err := clientFactory.NewMigrationsClient().Get(ctx, "exampleresourcegroup", "exampleserver", "examplemigration", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.MigrationResource = armpostgresqlflexibleservers.MigrationResource{ - // Name: to.Ptr("testmigrationwithvalidationfailure"), + // res.Migration = armpostgresqlflexibleservers.Migration{ + // Name: to.Ptr("examplemigration"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/migrations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testtarget/migrations/testmigrationwithvalidationfailure"), - // Location: to.Ptr("East US"), - // Properties: &armpostgresqlflexibleservers.MigrationResourceProperties{ + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampletarget/migrations/examplemigration"), + // Location: to.Ptr("eastus"), + // Properties: &armpostgresqlflexibleservers.MigrationProperties{ // CurrentStatus: &armpostgresqlflexibleservers.MigrationStatus{ - // CurrentSubStateDetails: &armpostgresqlflexibleservers.MigrationSubStateDetails{ - // CurrentSubState: to.Ptr(armpostgresqlflexibleservers.MigrationSubStateCompleted), - // DbDetails: map[string]*armpostgresqlflexibleservers.DbMigrationStatus{ + // CurrentSubStateDetails: &armpostgresqlflexibleservers.MigrationSubstateDetails{ + // CurrentSubState: to.Ptr(armpostgresqlflexibleservers.MigrationSubstateCompleted), + // DbDetails: map[string]*armpostgresqlflexibleservers.DatabaseMigrationState{ // }, // ValidationDetails: &armpostgresqlflexibleservers.ValidationDetails{ // DbLevelValidationDetails: []*armpostgresqlflexibleservers.DbLevelValidationStatus{ // { - // DatabaseName: to.Ptr("c.utf-8"), - // EndedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-17T19:20:02.810Z"); return t}()), - // StartedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-17T19:20:01.830Z"); return t}()), + // DatabaseName: to.Ptr("exampledatabase1"), + // EndedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T20:30:22.123Z"); return t}()), + // StartedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T18:30:22.123Z"); return t}()), // Summary: []*armpostgresqlflexibleservers.ValidationSummaryItem{ // { // Type: to.Ptr("SchemaValidation"), @@ -936,9 +869,9 @@ func ExampleMigrationsClient_Get_migrationsGetMigrationWithValidationFailures() // }}, // }, // { - // DatabaseName: to.Ptr("postgres"), - // EndedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-17T19:20:02.810Z"); return t}()), - // StartedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-17T19:20:01.830Z"); return t}()), + // DatabaseName: to.Ptr("exampledatabase2"), + // EndedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T20:30:22.123Z"); return t}()), + // StartedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T18:30:22.123Z"); return t}()), // Summary: []*armpostgresqlflexibleservers.ValidationSummaryItem{ // { // Type: to.Ptr("SchemaValidation"), @@ -954,9 +887,9 @@ func ExampleMigrationsClient_Get_migrationsGetMigrationWithValidationFailures() // }}, // }, // { - // DatabaseName: to.Ptr("readme_to_recover"), - // EndedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-17T19:20:02.810Z"); return t}()), - // StartedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-17T19:20:01.830Z"); return t}()), + // DatabaseName: to.Ptr("exampledatabase3"), + // EndedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T20:30:22.123Z"); return t}()), + // StartedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T18:30:22.123Z"); return t}()), // Summary: []*armpostgresqlflexibleservers.ValidationSummaryItem{ // { // Type: to.Ptr("SchemaValidation"), @@ -972,9 +905,9 @@ func ExampleMigrationsClient_Get_migrationsGetMigrationWithValidationFailures() // }}, // }, // { - // DatabaseName: to.Ptr("testdb1"), - // EndedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-17T19:20:02.810Z"); return t}()), - // StartedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-17T19:20:01.830Z"); return t}()), + // DatabaseName: to.Ptr("exampledatabase4"), + // EndedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T20:30:22.123Z"); return t}()), + // StartedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T18:30:22.123Z"); return t}()), // Summary: []*armpostgresqlflexibleservers.ValidationSummaryItem{ // { // Type: to.Ptr("SchemaValidation"), @@ -986,9 +919,9 @@ func ExampleMigrationsClient_Get_migrationsGetMigrationWithValidationFailures() // }}, // }, // { - // DatabaseName: to.Ptr("testdb2"), - // EndedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-17T19:20:02.810Z"); return t}()), - // StartedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-17T19:20:01.830Z"); return t}()), + // DatabaseName: to.Ptr("exampledatabase5"), + // EndedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T20:30:22.123Z"); return t}()), + // StartedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T18:30:22.123Z"); return t}()), // Summary: []*armpostgresqlflexibleservers.ValidationSummaryItem{ // { // Type: to.Ptr("SchemaValidation"), @@ -1000,9 +933,9 @@ func ExampleMigrationsClient_Get_migrationsGetMigrationWithValidationFailures() // }}, // }, // { - // DatabaseName: to.Ptr("testSchema"), - // EndedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-17T19:20:02.810Z"); return t}()), - // StartedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-17T19:20:01.830Z"); return t}()), + // DatabaseName: to.Ptr("exampledatabase6"), + // EndedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T20:30:22.123Z"); return t}()), + // StartedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T18:30:22.123Z"); return t}()), // Summary: []*armpostgresqlflexibleservers.ValidationSummaryItem{ // { // Type: to.Ptr("SchemaValidation"), @@ -1014,9 +947,9 @@ func ExampleMigrationsClient_Get_migrationsGetMigrationWithValidationFailures() // }}, // }, // { - // DatabaseName: to.Ptr("UnknownCollationTest"), - // EndedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-17T19:20:02.810Z"); return t}()), - // StartedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-17T19:20:01.830Z"); return t}()), + // DatabaseName: to.Ptr("exampledatabase7"), + // EndedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T20:30:22.123Z"); return t}()), + // StartedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T18:30:22.123Z"); return t}()), // Summary: []*armpostgresqlflexibleservers.ValidationSummaryItem{ // { // Type: to.Ptr("SchemaValidation"), @@ -1046,37 +979,37 @@ func ExampleMigrationsClient_Get_migrationsGetMigrationWithValidationFailures() // State: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded), // }}, // Status: to.Ptr(armpostgresqlflexibleservers.ValidationStateFailed), - // ValidationEndTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-17T19:20:33.136Z"); return t}()), - // ValidationStartTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-17T19:19:59.917Z"); return t}()), + // ValidationEndTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T20:30:22.123Z"); return t}()), + // ValidationStartTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T18:30:22.123Z"); return t}()), // }, // }, // State: to.Ptr(armpostgresqlflexibleservers.MigrationStateValidationFailed), // }, // DbsToMigrate: []*string{ - // to.Ptr("c.utf-8"), - // to.Ptr("postgres"), - // to.Ptr("readme_to_recover"), - // to.Ptr("testdb1"), - // to.Ptr("testdb2"), - // to.Ptr("testSchema"), - // to.Ptr("UnknownCollationTest")}, - // MigrateRoles: to.Ptr(armpostgresqlflexibleservers.MigrateRolesEnumFalse), + // to.Ptr("exampledatabase1"), + // to.Ptr("exampledatabase2"), + // to.Ptr("exampledatabase3"), + // to.Ptr("exampledatabase4"), + // to.Ptr("exampledatabase5"), + // to.Ptr("exampledatabase6"), + // to.Ptr("exampledatabase7")}, + // MigrateRoles: to.Ptr(armpostgresqlflexibleservers.MigrateRolesAndPermissionsFalse), // MigrationID: to.Ptr("a3e2d3cc-b139-4201-9431-e4f3003140fd"), // MigrationMode: to.Ptr(armpostgresqlflexibleservers.MigrationModeOffline), // MigrationOption: to.Ptr(armpostgresqlflexibleservers.MigrationOptionValidate), - // MigrationWindowEndTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-17T19:21:00.043Z"); return t}()), - // MigrationWindowStartTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-17T19:19:47.448Z"); return t}()), - // OverwriteDbsInTarget: to.Ptr(armpostgresqlflexibleservers.OverwriteDbsInTargetEnumTrue), - // SetupLogicalReplicationOnSourceDbIfNeeded: to.Ptr(armpostgresqlflexibleservers.LogicalReplicationOnSourceDbEnumTrue), + // MigrationWindowEndTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T20:30:22.123Z"); return t}()), + // MigrationWindowStartTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T18:30:22.123Z"); return t}()), + // OverwriteDbsInTarget: to.Ptr(armpostgresqlflexibleservers.OverwriteDatabasesOnTargetServerTrue), + // SetupLogicalReplicationOnSourceDbIfNeeded: to.Ptr(armpostgresqlflexibleservers.LogicalReplicationOnSourceServerTrue), // SourceDbServerResourceID: to.Ptr("20.228.214.65:5432@postgres"), - // TargetDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testtarget"), - // TriggerCutover: to.Ptr(armpostgresqlflexibleservers.TriggerCutoverEnumTrue), + // TargetDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampletarget"), + // TriggerCutover: to.Ptr(armpostgresqlflexibleservers.TriggerCutoverTrue), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b1f4d539964453ce8008e4b069e59885e12ba441/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/Migrations_Cancel.json -func ExampleMigrationsClient_Update_cancelMigration() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/735d21dbd7e1cc446babf58860af4cca757d620d/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/MigrationsGet.json +func ExampleMigrationsClient_Get_getInformationAboutAMigration() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -1086,60 +1019,64 @@ func ExampleMigrationsClient_Update_cancelMigration() { if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewMigrationsClient().Update(ctx, "ffffffff-ffff-ffff-ffff-ffffffffffff", "testrg", "testtarget", "testmigration", armpostgresqlflexibleservers.MigrationResourceForPatch{ - Properties: &armpostgresqlflexibleservers.MigrationResourcePropertiesForPatch{ - Cancel: to.Ptr(armpostgresqlflexibleservers.CancelEnumTrue), - }, - }, nil) + res, err := clientFactory.NewMigrationsClient().Get(ctx, "exampleresourcegroup", "exampleserver", "examplemigration", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.MigrationResource = armpostgresqlflexibleservers.MigrationResource{ - // Name: to.Ptr("testmigration"), + // res.Migration = armpostgresqlflexibleservers.Migration{ + // Name: to.Ptr("examplemigration"), // Type: to.Ptr("Microsoft.DBForPostgreSql/flexibleServers/migrations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/flexibleServers/testtarget/migrations/testmigration"), - // Location: to.Ptr("westus"), - // Properties: &armpostgresqlflexibleservers.MigrationResourceProperties{ + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBForPostgreSql/flexibleServers/exampletarget/migrations/examplemigration"), + // Location: to.Ptr("eastus"), + // Properties: &armpostgresqlflexibleservers.MigrationProperties{ // CurrentStatus: &armpostgresqlflexibleservers.MigrationStatus{ - // CurrentSubStateDetails: &armpostgresqlflexibleservers.MigrationSubStateDetails{ - // CurrentSubState: to.Ptr(armpostgresqlflexibleservers.MigrationSubStateCompleted), + // CurrentSubStateDetails: &armpostgresqlflexibleservers.MigrationSubstateDetails{ + // CurrentSubState: to.Ptr(armpostgresqlflexibleservers.MigrationSubstatePerformingPreRequisiteSteps), // }, - // State: to.Ptr(armpostgresqlflexibleservers.MigrationStateCanceled), + // Error: to.Ptr(""), + // State: to.Ptr(armpostgresqlflexibleservers.MigrationStateInProgress), // }, // DbsToMigrate: []*string{ - // to.Ptr("postgres")}, - // MigrateRoles: to.Ptr(armpostgresqlflexibleservers.MigrateRolesEnumFalse), + // to.Ptr("exampledatabase1"), + // to.Ptr("exampledatabase2"), + // to.Ptr("exampledatabase3"), + // to.Ptr("exampledatabase4")}, + // MigrateRoles: to.Ptr(armpostgresqlflexibleservers.MigrateRolesAndPermissionsFalse), // MigrationID: to.Ptr("d3ceacbb-a5fd-43dc-a9db-6022b5154856"), - // MigrationMode: to.Ptr(armpostgresqlflexibleservers.MigrationModeOnline), - // MigrationWindowEndTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-15T07:23:56.326Z"); return t}()), - // MigrationWindowStartTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-15T07:22:57.700Z"); return t}()), - // OverwriteDbsInTarget: to.Ptr(armpostgresqlflexibleservers.OverwriteDbsInTargetEnumTrue), - // SetupLogicalReplicationOnSourceDbIfNeeded: to.Ptr(armpostgresqlflexibleservers.LogicalReplicationOnSourceDbEnumTrue), + // MigrationWindowStartTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T18:30:22.123Z"); return t}()), + // OverwriteDbsInTarget: to.Ptr(armpostgresqlflexibleservers.OverwriteDatabasesOnTargetServerFalse), + // SetupLogicalReplicationOnSourceDbIfNeeded: to.Ptr(armpostgresqlflexibleservers.LogicalReplicationOnSourceServerFalse), // SourceDbServerMetadata: &armpostgresqlflexibleservers.DbServerMetadata{ - // Location: to.Ptr("eastasia"), + // Location: to.Ptr("eastus"), // SKU: &armpostgresqlflexibleservers.ServerSKU{ // Name: to.Ptr("B_Gen5_2"), // Tier: to.Ptr(armpostgresqlflexibleservers.SKUTier("Basic")), // }, + // StorageMb: to.Ptr[int32](1024), + // Version: to.Ptr("10"), // }, - // SourceDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/servers/testsource"), + // SourceDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBForPostgreSql/servers/examplesource"), + // StartDataMigration: to.Ptr(armpostgresqlflexibleservers.StartDataMigrationFalse), // TargetDbServerMetadata: &armpostgresqlflexibleservers.DbServerMetadata{ - // Location: to.Ptr("East Asia"), + // Location: to.Ptr("eastus"), // SKU: &armpostgresqlflexibleservers.ServerSKU{ - // Name: to.Ptr("Standard_D2ds_v4"), - // Tier: to.Ptr(armpostgresqlflexibleservers.SKUTier("Standard_D2ds_v4")), + // Name: to.Ptr("Standard_D4ds_v5"), + // Tier: to.Ptr(armpostgresqlflexibleservers.SKUTierGeneralPurpose), // }, + // StorageMb: to.Ptr[int32](2048), + // Version: to.Ptr("17"), // }, - // TargetDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/flexibleServers/testtarget"), + // TargetDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBForPostgreSql/flexibleServers/exampletarget"), + // TriggerCutover: to.Ptr(armpostgresqlflexibleservers.TriggerCutoverFalse), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b1f4d539964453ce8008e4b069e59885e12ba441/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/Migrations_Update.json -func ExampleMigrationsClient_Update_migrationsUpdate() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/735d21dbd7e1cc446babf58860af4cca757d620d/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/MigrationsUpdate.json +func ExampleMigrationsClient_Update() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -1149,9 +1086,9 @@ func ExampleMigrationsClient_Update_migrationsUpdate() { if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewMigrationsClient().Update(ctx, "ffffffff-ffff-ffff-ffff-ffffffffffff", "testrg", "testtarget", "testmigration", armpostgresqlflexibleservers.MigrationResourceForPatch{ - Properties: &armpostgresqlflexibleservers.MigrationResourcePropertiesForPatch{ - SetupLogicalReplicationOnSourceDbIfNeeded: to.Ptr(armpostgresqlflexibleservers.LogicalReplicationOnSourceDbEnumTrue), + res, err := clientFactory.NewMigrationsClient().Update(ctx, "exampleresourcegroup", "exampleserver", "examplemigration", armpostgresqlflexibleservers.MigrationResourceForPatch{ + Properties: &armpostgresqlflexibleservers.MigrationPropertiesForPatch{ + SetupLogicalReplicationOnSourceDbIfNeeded: to.Ptr(armpostgresqlflexibleservers.LogicalReplicationOnSourceServerTrue), }, }, nil) if err != nil { @@ -1160,31 +1097,31 @@ func ExampleMigrationsClient_Update_migrationsUpdate() { // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.MigrationResource = armpostgresqlflexibleservers.MigrationResource{ - // Name: to.Ptr("testmigration"), + // res.Migration = armpostgresqlflexibleservers.Migration{ + // Name: to.Ptr("examplemigration"), // Type: to.Ptr("Microsoft.DBForPostgreSql/flexibleServers/migrations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/flexibleServers/testtarget/migrations/testmigration"), - // Location: to.Ptr("westus"), - // Properties: &armpostgresqlflexibleservers.MigrationResourceProperties{ + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBForPostgreSql/flexibleServers/exampletarget/migrations/examplemigration"), + // Location: to.Ptr("eastus"), + // Properties: &armpostgresqlflexibleservers.MigrationProperties{ // CurrentStatus: &armpostgresqlflexibleservers.MigrationStatus{ - // CurrentSubStateDetails: &armpostgresqlflexibleservers.MigrationSubStateDetails{ - // CurrentSubState: to.Ptr(armpostgresqlflexibleservers.MigrationSubStatePerformingPreRequisiteSteps), + // CurrentSubStateDetails: &armpostgresqlflexibleservers.MigrationSubstateDetails{ + // CurrentSubState: to.Ptr(armpostgresqlflexibleservers.MigrationSubstatePerformingPreRequisiteSteps), // }, // Error: to.Ptr(""), // State: to.Ptr(armpostgresqlflexibleservers.MigrationStateInProgress), // }, // DbsToMigrate: []*string{ - // to.Ptr("db1"), - // to.Ptr("db2"), - // to.Ptr("db3"), - // to.Ptr("db4")}, - // MigrateRoles: to.Ptr(armpostgresqlflexibleservers.MigrateRolesEnumFalse), + // to.Ptr("exampledatabase1"), + // to.Ptr("exampledatabase2"), + // to.Ptr("exampledatabase3"), + // to.Ptr("exampledatabase4")}, + // MigrateRoles: to.Ptr(armpostgresqlflexibleservers.MigrateRolesAndPermissionsFalse), // MigrationID: to.Ptr("d3ceacbb-a5fd-43dc-a9db-6022b5154856"), - // MigrationWindowStartTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-12-06T16:05:58.895Z"); return t}()), - // OverwriteDbsInTarget: to.Ptr(armpostgresqlflexibleservers.OverwriteDbsInTargetEnumFalse), - // SetupLogicalReplicationOnSourceDbIfNeeded: to.Ptr(armpostgresqlflexibleservers.LogicalReplicationOnSourceDbEnumTrue), + // MigrationWindowStartTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T20:30:22.123Z"); return t}()), + // OverwriteDbsInTarget: to.Ptr(armpostgresqlflexibleservers.OverwriteDatabasesOnTargetServerFalse), + // SetupLogicalReplicationOnSourceDbIfNeeded: to.Ptr(armpostgresqlflexibleservers.LogicalReplicationOnSourceServerTrue), // SourceDbServerMetadata: &armpostgresqlflexibleservers.DbServerMetadata{ - // Location: to.Ptr("westus"), + // Location: to.Ptr("eastus"), // SKU: &armpostgresqlflexibleservers.ServerSKU{ // Name: to.Ptr("B_Gen5_2"), // Tier: to.Ptr(armpostgresqlflexibleservers.SKUTier("Basic")), @@ -1192,25 +1129,25 @@ func ExampleMigrationsClient_Update_migrationsUpdate() { // StorageMb: to.Ptr[int32](1024), // Version: to.Ptr("10"), // }, - // SourceDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/servers/testsource"), - // StartDataMigration: to.Ptr(armpostgresqlflexibleservers.StartDataMigrationEnumFalse), + // SourceDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBForPostgreSql/servers/examplesource"), + // StartDataMigration: to.Ptr(armpostgresqlflexibleservers.StartDataMigrationFalse), // TargetDbServerMetadata: &armpostgresqlflexibleservers.DbServerMetadata{ - // Location: to.Ptr("westus"), + // Location: to.Ptr("eastus"), // SKU: &armpostgresqlflexibleservers.ServerSKU{ // Name: to.Ptr("Standard_D4ds_v5"), // Tier: to.Ptr(armpostgresqlflexibleservers.SKUTierGeneralPurpose), // }, // StorageMb: to.Ptr[int32](2048), - // Version: to.Ptr("16"), + // Version: to.Ptr("17"), // }, - // TargetDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/flexibleServers/testtarget"), - // TriggerCutover: to.Ptr(armpostgresqlflexibleservers.TriggerCutoverEnumFalse), + // TargetDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBForPostgreSql/flexibleServers/exampletarget"), + // TriggerCutover: to.Ptr(armpostgresqlflexibleservers.TriggerCutoverFalse), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b1f4d539964453ce8008e4b069e59885e12ba441/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/Migrations_Delete.json -func ExampleMigrationsClient_Delete() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/735d21dbd7e1cc446babf58860af4cca757d620d/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/MigrationsCancel.json +func ExampleMigrationsClient_Cancel() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -1220,13 +1157,58 @@ func ExampleMigrationsClient_Delete() { if err != nil { log.Fatalf("failed to create client: %v", err) } - _, err = clientFactory.NewMigrationsClient().Delete(ctx, "ffffffff-ffff-ffff-ffff-ffffffffffff", "testrg", "testtarget", "testmigration", nil) + res, err := clientFactory.NewMigrationsClient().Cancel(ctx, "exampleresourcegroup", "exampleserver", "examplemigration", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.Migration = armpostgresqlflexibleservers.Migration{ + // Name: to.Ptr("examplemigration"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/migrations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampletarget/migrations/examplemigration"), + // Location: to.Ptr("East US"), + // Properties: &armpostgresqlflexibleservers.MigrationProperties{ + // CurrentStatus: &armpostgresqlflexibleservers.MigrationStatus{ + // CurrentSubStateDetails: &armpostgresqlflexibleservers.MigrationSubstateDetails{ + // CurrentSubState: to.Ptr(armpostgresqlflexibleservers.MigrationSubstatePerformingPreRequisiteSteps), + // DbDetails: map[string]*armpostgresqlflexibleservers.DatabaseMigrationState{ + // }, + // }, + // State: to.Ptr(armpostgresqlflexibleservers.MigrationStateInProgress), + // }, + // DbsToMigrate: []*string{ + // to.Ptr("exampledatabase1"), + // to.Ptr("exampledatabase2"), + // to.Ptr("exampledatabase3"), + // to.Ptr("exampledatabase4")}, + // MigrateRoles: to.Ptr(armpostgresqlflexibleservers.MigrateRolesAndPermissionsFalse), + // MigrationID: to.Ptr("bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb"), + // MigrationMode: to.Ptr(armpostgresqlflexibleservers.MigrationModeOffline), + // MigrationOption: to.Ptr(armpostgresqlflexibleservers.MigrationOptionValidateAndMigrate), + // MigrationWindowStartTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T18:30:22.123Z"); return t}()), + // OverwriteDbsInTarget: to.Ptr(armpostgresqlflexibleservers.OverwriteDatabasesOnTargetServerTrue), + // SetupLogicalReplicationOnSourceDbIfNeeded: to.Ptr(armpostgresqlflexibleservers.LogicalReplicationOnSourceServerTrue), + // SourceDbServerResourceID: to.Ptr("examplesource:5432@exampleadministratorlogin"), + // SourceType: to.Ptr(armpostgresqlflexibleservers.SourceTypeOnPremises), + // SSLMode: to.Ptr(armpostgresqlflexibleservers.SSLModePrefer), + // TargetDbServerMetadata: &armpostgresqlflexibleservers.DbServerMetadata{ + // Location: to.Ptr("East US"), + // SKU: &armpostgresqlflexibleservers.ServerSKU{ + // Name: to.Ptr("Standard_D4ds_v4"), + // Tier: to.Ptr(armpostgresqlflexibleservers.SKUTierGeneralPurpose), + // }, + // StorageMb: to.Ptr[int32](131072), + // Version: to.Ptr("17"), + // }, + // TargetDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBForPostgreSql/flexibleServers/exampletarget"), + // TriggerCutover: to.Ptr(armpostgresqlflexibleservers.TriggerCutoverTrue), + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b1f4d539964453ce8008e4b069e59885e12ba441/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/Migrations_ListByTargetServer.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/735d21dbd7e1cc446babf58860af4cca757d620d/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/MigrationsListByTargetServer.json func ExampleMigrationsClient_NewListByTargetServerPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1237,7 +1219,7 @@ func ExampleMigrationsClient_NewListByTargetServerPager() { if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewMigrationsClient().NewListByTargetServerPager("ffffffff-ffff-ffff-ffff-ffffffffffff", "testrg", "testtarget", &armpostgresqlflexibleservers.MigrationsClientListByTargetServerOptions{MigrationListFilter: to.Ptr(armpostgresqlflexibleservers.MigrationListFilterAll)}) + pager := clientFactory.NewMigrationsClient().NewListByTargetServerPager("exampleresourcegroup", "exampleserver", &armpostgresqlflexibleservers.MigrationsClientListByTargetServerOptions{MigrationListFilter: to.Ptr(armpostgresqlflexibleservers.MigrationListFilterAll)}) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -1248,33 +1230,33 @@ func ExampleMigrationsClient_NewListByTargetServerPager() { _ = v } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.MigrationResourceListResult = armpostgresqlflexibleservers.MigrationResourceListResult{ - // Value: []*armpostgresqlflexibleservers.MigrationResource{ + // page.MigrationList = armpostgresqlflexibleservers.MigrationList{ + // Value: []*armpostgresqlflexibleservers.Migration{ // { - // Name: to.Ptr("testmigration"), + // Name: to.Ptr("examplemigration"), // Type: to.Ptr("Microsoft.DBForPostgreSql/flexibleServers/migrations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/flexibleServers/testtarget/migrations/testmigration"), - // Location: to.Ptr("westus"), - // Properties: &armpostgresqlflexibleservers.MigrationResourceProperties{ + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBForPostgreSql/flexibleServers/exampletarget/migrations/examplemigration"), + // Location: to.Ptr("eastus"), + // Properties: &armpostgresqlflexibleservers.MigrationProperties{ // CurrentStatus: &armpostgresqlflexibleservers.MigrationStatus{ - // CurrentSubStateDetails: &armpostgresqlflexibleservers.MigrationSubStateDetails{ - // CurrentSubState: to.Ptr(armpostgresqlflexibleservers.MigrationSubStatePerformingPreRequisiteSteps), + // CurrentSubStateDetails: &armpostgresqlflexibleservers.MigrationSubstateDetails{ + // CurrentSubState: to.Ptr(armpostgresqlflexibleservers.MigrationSubstatePerformingPreRequisiteSteps), // }, // Error: to.Ptr(""), // State: to.Ptr(armpostgresqlflexibleservers.MigrationStateInProgress), // }, // DbsToMigrate: []*string{ - // to.Ptr("db1"), - // to.Ptr("db2"), - // to.Ptr("db3"), - // to.Ptr("db4")}, - // MigrateRoles: to.Ptr(armpostgresqlflexibleservers.MigrateRolesEnumFalse), + // to.Ptr("exampledatabase1"), + // to.Ptr("exampledatabase2"), + // to.Ptr("exampledatabase3"), + // to.Ptr("exampledatabase4")}, + // MigrateRoles: to.Ptr(armpostgresqlflexibleservers.MigrateRolesAndPermissionsFalse), // MigrationID: to.Ptr("d3ceacbb-a5fd-43dc-a9db-6022b5154856"), - // MigrationWindowStartTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-12-06T16:05:58.895Z"); return t}()), - // OverwriteDbsInTarget: to.Ptr(armpostgresqlflexibleservers.OverwriteDbsInTargetEnumFalse), - // SetupLogicalReplicationOnSourceDbIfNeeded: to.Ptr(armpostgresqlflexibleservers.LogicalReplicationOnSourceDbEnumFalse), + // MigrationWindowStartTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T20:30:22.123Z"); return t}()), + // OverwriteDbsInTarget: to.Ptr(armpostgresqlflexibleservers.OverwriteDatabasesOnTargetServerFalse), + // SetupLogicalReplicationOnSourceDbIfNeeded: to.Ptr(armpostgresqlflexibleservers.LogicalReplicationOnSourceServerFalse), // SourceDbServerMetadata: &armpostgresqlflexibleservers.DbServerMetadata{ - // Location: to.Ptr("westus"), + // Location: to.Ptr("eastus"), // SKU: &armpostgresqlflexibleservers.ServerSKU{ // Name: to.Ptr("B_Gen5_2"), // Tier: to.Ptr(armpostgresqlflexibleservers.SKUTier("Basic")), @@ -1282,21 +1264,49 @@ func ExampleMigrationsClient_NewListByTargetServerPager() { // StorageMb: to.Ptr[int32](1024), // Version: to.Ptr("10"), // }, - // SourceDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/servers/testsource"), - // StartDataMigration: to.Ptr(armpostgresqlflexibleservers.StartDataMigrationEnumFalse), + // SourceDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBForPostgreSql/servers/examplesource"), + // StartDataMigration: to.Ptr(armpostgresqlflexibleservers.StartDataMigrationFalse), // TargetDbServerMetadata: &armpostgresqlflexibleservers.DbServerMetadata{ - // Location: to.Ptr("westus"), + // Location: to.Ptr("eastus"), // SKU: &armpostgresqlflexibleservers.ServerSKU{ // Name: to.Ptr("Standard_D4ds_v5"), // Tier: to.Ptr(armpostgresqlflexibleservers.SKUTierGeneralPurpose), // }, // StorageMb: to.Ptr[int32](2048), - // Version: to.Ptr("16"), + // Version: to.Ptr("17"), // }, - // TargetDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/flexibleServers/testtarget"), - // TriggerCutover: to.Ptr(armpostgresqlflexibleservers.TriggerCutoverEnumFalse), + // TargetDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBForPostgreSql/flexibleServers/exampletarget"), + // TriggerCutover: to.Ptr(armpostgresqlflexibleservers.TriggerCutoverFalse), // }, // }}, // } } } + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/735d21dbd7e1cc446babf58860af4cca757d620d/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/MigrationsCheckNameAvailability.json +func ExampleMigrationsClient_CheckNameAvailability() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewMigrationsClient().CheckNameAvailability(ctx, "exampleresourcegroup", "exampleserver", armpostgresqlflexibleservers.MigrationNameAvailability{ + Name: to.Ptr("examplemigration"), + Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/migrations"), + }, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.MigrationNameAvailability = armpostgresqlflexibleservers.MigrationNameAvailability{ + // Name: to.Ptr("naexamplemigration"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/migrations"), + // NameAvailable: to.Ptr(true), + // } +} diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/models.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/models.go index 832d2fcd2e0b..efd740726b79 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/models.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/models.go @@ -7,10 +7,28 @@ package armpostgresqlflexibleservers import "time" -// ActiveDirectoryAdministrator - Represents an Microsoft Entra Administrator. -type ActiveDirectoryAdministrator struct { - // REQUIRED; Properties of the Microsoft Entra Administrator. - Properties *AdministratorProperties +// AdminCredentials - Credentials of administrator users for source and target servers. +type AdminCredentials struct { + // REQUIRED; Password for the user of the source server. + SourceServerPassword *string + + // REQUIRED; Password for the user of the target server. + TargetServerPassword *string +} + +// AdminCredentialsForPatch - Credentials of administrator users for source and target servers. +type AdminCredentialsForPatch struct { + // Password for the user of the source server. + SourceServerPassword *string + + // Password for the user of the target server. + TargetServerPassword *string +} + +// AdministratorMicrosoftEntra - Server administrator associated to a Microsoft Entra principal. +type AdministratorMicrosoftEntra struct { + // REQUIRED; Properties of a server administrator associated to a Microsoft Entra principal. + Properties *AdministratorMicrosoftEntraProperties // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" ID *string @@ -25,78 +43,169 @@ type ActiveDirectoryAdministrator struct { Type *string } -// ActiveDirectoryAdministratorAdd - Represents an Microsoft Entra Administrator. -type ActiveDirectoryAdministratorAdd struct { - // Properties of the Microsoft Entra Administrator. - Properties *AdministratorPropertiesForAdd +// AdministratorMicrosoftEntraAdd - Server administrator associated to a Microsoft Entra principal. +type AdministratorMicrosoftEntraAdd struct { + // Properties of the server administrator associated to a Microsoft Entra principal. + Properties *AdministratorMicrosoftEntraPropertiesForAdd } -// AdminCredentials - Server admin credentials. -type AdminCredentials struct { - // REQUIRED; Password for source server. - SourceServerPassword *string - - // REQUIRED; Password for target server. - TargetServerPassword *string -} - -// AdministratorListResult - A list of Microsoft Entra Administrators. -type AdministratorListResult struct { - // The link used to get the next page of Microsoft Entra administrators. +// AdministratorMicrosoftEntraList - List of server administrators associated to Microsoft Entra principals. +type AdministratorMicrosoftEntraList struct { + // Link used to get the next page of results. NextLink *string - // The list of Microsoft Entra Administrators - Value []*ActiveDirectoryAdministrator + // List of server administrators associated to Microsoft Entra principals. + Value []*AdministratorMicrosoftEntra } -// AdministratorProperties - The properties of an Microsoft Entra Administrator. -type AdministratorProperties struct { - // The objectId of the Microsoft Entra Administrator. +// AdministratorMicrosoftEntraProperties - Properties of a server administrator associated to a Microsoft Entra principal. +type AdministratorMicrosoftEntraProperties struct { + // Object identifier of the Microsoft Entra principal. ObjectID *string - // Microsoft Entra Administrator principal name. + // Name of the Microsoft Entra principal. PrincipalName *string - // The principal type used to represent the type of Microsoft Entra Administrator. + // Type of Microsoft Entra principal to which the server administrator is associated. PrincipalType *PrincipalType - // The tenantId of the Microsoft Entra Administrator. + // Identifier of the tenant in which the Microsoft Entra principal exists. TenantID *string } -// AdministratorPropertiesForAdd - The properties of an Microsoft Entra Administrator. -type AdministratorPropertiesForAdd struct { - // Microsoft Entra Administrator principal name. +// AdministratorMicrosoftEntraPropertiesForAdd - Properties of a server administrator associated to a Microsoft Entra principal. +type AdministratorMicrosoftEntraPropertiesForAdd struct { + // Name of the Microsoft Entra principal. PrincipalName *string - // The principal type used to represent the type of Microsoft Entra Administrator. + // Type of Microsoft Entra principal to which the server administrator is associated. PrincipalType *PrincipalType - // The tenantId of the Microsoft Entra Administrator. + // Identifier of the tenant in which the Microsoft Entra principal exists. TenantID *string } -// AuthConfig - Authentication configuration properties of a server +// AdvancedThreatProtectionSettingsList - List of advanced threat protection settings for a server. +type AdvancedThreatProtectionSettingsList struct { + // Link used to get the next page of results. + NextLink *string + + // READ-ONLY; Array of results. + Value []*AdvancedThreatProtectionSettingsModel +} + +// AdvancedThreatProtectionSettingsModel - Advanced threat protection settings of the server. +type AdvancedThreatProtectionSettingsModel struct { + // Advanced threat protection properties. + Properties *AdvancedThreatProtectionSettingsProperties + + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + ID *string + + // READ-ONLY; The name of the resource + Name *string + + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string +} + +// AdvancedThreatProtectionSettingsProperties - Properties of advanced threat protection state for a server. +type AdvancedThreatProtectionSettingsProperties struct { + // REQUIRED; Specifies the state of the advanced threat protection, whether it is enabled, disabled, or a state has not been + // applied yet on the server. + State *ThreatProtectionState + + // READ-ONLY; Specifies the creation time (UTC) of the policy. + CreationTime *time.Time +} + +// AuthConfig - Authentication configuration properties of a server. type AuthConfig struct { - // If Enabled, Microsoft Entra authentication is enabled. - ActiveDirectoryAuth *ActiveDirectoryAuthEnum + // Indicates if the server supports Microsoft Entra authentication. + ActiveDirectoryAuth *MicrosoftEntraAuth + + // Indicates if the server supports password based authentication. + PasswordAuth *PasswordBasedAuth + + // Identifier of the tenant of the delegated resource. + TenantID *string +} + +// AuthConfigForPatch - Authentication configuration properties of a server. +type AuthConfigForPatch struct { + // Indicates if the server supports Microsoft Entra authentication. + ActiveDirectoryAuth *MicrosoftEntraAuth - // If Enabled, Password authentication is enabled. - PasswordAuth *PasswordAuthEnum + // Indicates if the server supports password based authentication. + PasswordAuth *PasswordBasedAuth - // Tenant id of the server. + // Identifier of the tenant of the delegated resource. TenantID *string } -// Backup properties of a server +// Backup properties of a server. type Backup struct { // Backup retention days for the server. BackupRetentionDays *int32 - // A value indicating whether Geo-Redundant backup is enabled on the server. - GeoRedundantBackup *GeoRedundantBackupEnum + // Indicates if the server is configured to create geographically redundant backups. + GeoRedundantBackup *GeographicallyRedundantBackup - // READ-ONLY; The earliest restore point time (ISO8601 format) for server. + // READ-ONLY; Earliest restore point time (ISO8601 format) for a server. + EarliestRestoreDate *time.Time +} + +// BackupAutomaticAndOnDemand - Properties of a backup. +type BackupAutomaticAndOnDemand struct { + // Properties of a backup. + Properties *BackupAutomaticAndOnDemandProperties + + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + ID *string + + // READ-ONLY; The name of the resource + Name *string + + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string +} + +// BackupAutomaticAndOnDemandList - List of backups. +type BackupAutomaticAndOnDemandList struct { + // Link used to get the next page of results. + NextLink *string + + // List of available backups. + Value []*BackupAutomaticAndOnDemand +} + +// BackupAutomaticAndOnDemandProperties - Properties of a backup. +type BackupAutomaticAndOnDemandProperties struct { + // Type of backup. + BackupType *BackupType + + // Time(ISO8601 format) at which the backup was completed. + CompletedTime *time.Time + + // Source of the backup. + Source *string +} + +// BackupForPatch - Backup properties of a server. +type BackupForPatch struct { + // Backup retention days for the server. + BackupRetentionDays *int32 + + // Indicates if the server is configured to create geographically redundant backups. + GeoRedundantBackup *GeographicallyRedundantBackup + + // READ-ONLY; Earliest restore point time (ISO8601 format) for a server. EarliestRestoreDate *time.Time } @@ -112,13 +221,161 @@ type BackupStoreDetails struct { SasURIList []*string } -// CapabilitiesListResult - Capability for the PostgreSQL server -type CapabilitiesListResult struct { - // READ-ONLY; Link to retrieve next page of results. +// BackupsLongTermRetentionOperation - Response for the LTR backup Operation API call +type BackupsLongTermRetentionOperation struct { + // Long Term Retention Backup Operation Resource Properties + Properties *LtrBackupOperationResponseProperties + + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + ID *string + + // READ-ONLY; The name of the resource + Name *string + + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string +} + +// BackupsLongTermRetentionRequest - The request that is made for a long term retention backup. +type BackupsLongTermRetentionRequest struct { + // REQUIRED; Backup Settings + BackupSettings *BackupSettings + + // REQUIRED; Backup store detail for target server + TargetDetails *BackupStoreDetails +} + +// BackupsLongTermRetentionResponse - Response for the LTR backup API call +type BackupsLongTermRetentionResponse struct { + // Long Term Retention Backup Operation Resource Properties + Properties *LtrBackupOperationResponseProperties +} + +// BackupsLongTermRetentionResponseProperties - Response for the pre-backup request. +type BackupsLongTermRetentionResponseProperties struct { + // REQUIRED; Number of storage containers the plugin will use during backup. More than one containers may be used for size + // limitations, parallelism, or redundancy etc. + NumberOfContainers *int32 +} + +// Capability for the Azure Database for PostgreSQL flexible server. +type Capability struct { + // Name of flexible servers capabilities. + Name *string + + // READ-ONLY; Indicates if fast provisioning is supported. 'Enabled' means fast provisioning is supported. 'Disabled' stands + // for fast provisioning is not supported. Will be deprecated in the future. Look to + // Supported Features for 'FastProvisioning'. + FastProvisioningSupported *FastProvisioningSupport + + // READ-ONLY; Indicates if geographically redundant backups are supported in this location. 'Enabled' means geographically + // redundant backups are supported. 'Disabled' stands for geographically redundant backup is + // not supported. Will be deprecated in the future. Look to Supported Features for 'GeoBackup'. + GeoBackupSupported *GeographicallyRedundantBackupSupport + + // READ-ONLY; Indicates if resizing the storage, without interrupting the operation of the database engine, is supported in + // this location for the given subscription. 'Enabled' means resizing the storage without + // interrupting the operation of the database engine is supported. 'Disabled' means resizing the storage without interrupting + // the operation of the database engine is not supported. Will be deprecated in + // the future. Look to Supported Features for 'OnlineResize'. + OnlineResizeSupported *OnlineStorageResizeSupport + + // READ-ONLY; The reason for the capability not being available. + Reason *string + + // READ-ONLY; Indicates if this location is restricted. 'Enabled' means location is restricted. 'Disabled' stands for location + // is not restricted. Will be deprecated in the future. Look to Supported Features for + // 'Restricted'. + Restricted *LocationRestricted + + // READ-ONLY; The status of the capability. + Status *CapabilityStatus + + // READ-ONLY; Indicates if storage autogrow is supported in this location. 'Enabled' means storage autogrow is supported. + // 'Disabled' stands for storage autogrow is not supported. Will be deprecated in the future. + // Look to Supported Features for 'StorageAutoGrowth'. + StorageAutoGrowthSupported *StorageAutoGrowthSupport + + // READ-ONLY; List of compute tiers supporting fast provisioning. + SupportedFastProvisioningEditions []*FastProvisioningEditionCapability + + // READ-ONLY; Features supported. + SupportedFeatures []*SupportedFeature + + // READ-ONLY; List of supported compute tiers. + SupportedServerEditions []*ServerEditionCapability + + // READ-ONLY; List of supported major versions of PostgreSQL database engine. + SupportedServerVersions []*ServerVersionCapability + + // READ-ONLY; Indicates if high availability with zone redundancy is supported in conjunction with geographically redundant + // backups in this location. 'Enabled' means high availability with zone redundancy is + // supported in conjunction with geographically redundant backups is supported. 'Disabled' stands for high availability with + // zone redundancy is supported in conjunction with geographically redundant + // backups is not supported. Will be deprecated in the future. Look to Supported Features for 'ZoneRedundantHaAndGeoBackup'. + ZoneRedundantHaAndGeoBackupSupported *ZoneRedundantHighAvailabilityAndGeographicallyRedundantBackupSupport + + // READ-ONLY; Indicates if high availability with zone redundancy is supported in this location. 'Enabled' means high availability + // with zone redundancy is supported. 'Disabled' stands for high availability with + // zone redundancy is not supported. Will be deprecated in the future. Look to Supported Features for 'ZoneRedundantHa'. + ZoneRedundantHaSupported *ZoneRedundantHighAvailabilitySupport +} + +// CapabilityList - List of capabilities for the Azure Database for PostgreSQL flexible server. +type CapabilityList struct { + // Link to retrieve next page of results. + NextLink *string + + // READ-ONLY; List of supported capabilities. + Value []*Capability +} + +// CapturedLog - Log file. +type CapturedLog struct { + // Properties of a log file. + Properties *CapturedLogProperties + + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + ID *string + + // READ-ONLY; The name of the resource + Name *string + + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string +} + +// CapturedLogList - List of log files. +type CapturedLogList struct { + // Link used to get the next page of results. NextLink *string - // READ-ONLY; A list of supported capabilities. - Value []*FlexibleServerCapability + // List of log files in a server. + Value []*CapturedLog +} + +// CapturedLogProperties - Properties of a log file. +type CapturedLogProperties struct { + // Creation timestamp of the log file. + CreatedTime *time.Time + + // Last modified timestamp of the log file. + LastModifiedTime *time.Time + + // Size (in KB) of the log file. + SizeInKb *int64 + + // Type of log file. Can be 'ServerLogs' or 'UpgradeLogs'. + Type *string + + // URL to download the log file from. + URL *string } // CheckNameAvailabilityRequest - The check availability request body. @@ -132,28 +389,16 @@ type CheckNameAvailabilityRequest struct { // Cluster properties of a server. type Cluster struct { - // The node count for the cluster. + // Number of nodes assigned to the elastic cluster. ClusterSize *int32 -} - -// ConfigTuningRequestParameter - Config tuning request parameters. -type ConfigTuningRequestParameter struct { - // Indicates whether PG should be restarted during a tuning session. - AllowServerRestarts *bool - - // The mode with which the feature will be enabled. - ConfigTuningUsageMode *bool - - // The name of server. - ServerName *string - // The target metric the tuning session is trying to improve. - TargetImprovementMetric *string + // Default database name for the elastic cluster. + DefaultDatabaseName *string } -// Configuration - Represents a Configuration. +// Configuration (also known as server parameter). type Configuration struct { - // The properties of a configuration. + // Properties of a configuration (also known as server parameter). Properties *ConfigurationProperties // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" @@ -169,84 +414,98 @@ type Configuration struct { Type *string } -// ConfigurationForUpdate - Represents a Configuration. +// ConfigurationForUpdate - Configuration (also known as server parameter). type ConfigurationForUpdate struct { - // The properties of a configuration. + // Properties of a configuration (also known as server parameter). Properties *ConfigurationProperties } -// ConfigurationListResult - A list of server configurations. -type ConfigurationListResult struct { - // The link used to get the next page of operations. +// ConfigurationList - List of configurations (also known as server parameters). +type ConfigurationList struct { + // Link used to get the next page of results. NextLink *string - // The list of server configurations. + // List of configurations (also known as server parameters). Value []*Configuration } -// ConfigurationProperties - The properties of a configuration. +// ConfigurationProperties - Properties of a configuration (also known as server parameter). type ConfigurationProperties struct { - // Source of the configuration. Required to update the configuration. + // Source of the value assigned to the configuration (also known as server parameter). Required to update the value assigned + // to a specific modifiable configuration. Source *string - // Value of the configuration. Required to update the configuration. + // Value of the configuration (also known as server parameter). Required to update the value assigned to a specific modifiable + // configuration. Value *string - // READ-ONLY; Allowed values of the configuration. + // READ-ONLY; Allowed values of the configuration (also known as server parameter). AllowedValues *string - // READ-ONLY; Data type of the configuration. + // READ-ONLY; Data type of the configuration (also known as server parameter). DataType *ConfigurationDataType - // READ-ONLY; Default value of the configuration. + // READ-ONLY; Value assigned by default to the configuration (also known as server parameter). DefaultValue *string - // READ-ONLY; Description of the configuration. + // READ-ONLY; Description of the configuration (also known as server parameter). Description *string - // READ-ONLY; Configuration documentation link. + // READ-ONLY; Link pointing to the documentation of the configuration (also known as server parameter). DocumentationLink *string - // READ-ONLY; Configuration is pending restart or not. + // READ-ONLY; Indicates if the value assigned to the configuration (also known as server parameter) is pending a server restart + // for it to take effect. IsConfigPendingRestart *bool - // READ-ONLY; Configuration dynamic or static. + // READ-ONLY; Indicates if it's a dynamic (true) or static (false) configuration (also known as server parameter). Static + // server parameters require a server restart after changing the value assigned to them, for + // the change to take effect. Dynamic server parameters do not require a server restart after changing the value assigned + // to them, for the change to take effect. IsDynamicConfig *bool - // READ-ONLY; Configuration read-only or not. + // READ-ONLY; Indicates if it's a read-only (true) or modifiable (false) configuration (also known as server parameter). IsReadOnly *bool - // READ-ONLY; Configuration unit. + // READ-ONLY; Units in which the configuration (also known as server parameter) value is expressed. Unit *string } -// DataEncryption - Data encryption properties of a server +// DataEncryption - Data encryption properties of a server. type DataEncryption struct { - // Geo-backup encryption key status for Data encryption enabled server. - GeoBackupEncryptionKeyStatus *KeyStatusEnum - - // URI for the key in keyvault for data encryption for geo-backup of server. + // Status of key used by a server configured with data encryption based on customer managed key, to encrypt the geographically + // redundant storage associated to the server when it is configured to support + // geographically redundant backups. + GeoBackupEncryptionKeyStatus *EncryptionKeyStatus + + // Identifier of the user assigned managed identity used to access the key in Azure Key Vault for data encryption of the geographically + // redundant storage associated to a server that is configured to + // support geographically redundant backups. GeoBackupKeyURI *string - // Resource Id for the User assigned identity to be used for data encryption for geo-backup of server. + // Identifier of the user assigned managed identity used to access the key in Azure Key Vault for data encryption of the geographically + // redundant storage associated to a server that is configured to + // support geographically redundant backups. GeoBackupUserAssignedIdentityID *string - // Primary encryption key status for Data encryption enabled server. - PrimaryEncryptionKeyStatus *KeyStatusEnum + // Status of key used by a server configured with data encryption based on customer managed key, to encrypt the primary storage + // associated to the server. + PrimaryEncryptionKeyStatus *EncryptionKeyStatus - // URI for the key in keyvault for data encryption of the primary server. + // URI of the key in Azure Key Vault used for data encryption of the primary storage associated to a server. PrimaryKeyURI *string - // Resource Id for the User assigned identity to be used for data encryption of the primary server. + // Identifier of the user assigned managed identity used to access the key in Azure Key Vault for data encryption of the primary + // storage associated to a server. PrimaryUserAssignedIdentityID *string - // Data encryption type to depict if it is System Managed vs Azure Key vault. - Type *ArmServerKeyType + // Data encryption type used by a server. + Type *DataEncryptionType } -// Database - Represents a Database. +// Database - Represents a database. type Database struct { - // The properties of a database. + // Properties of a database. Properties *DatabaseProperties // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" @@ -262,102 +521,102 @@ type Database struct { Type *string } -// DatabaseListResult - A List of databases. -type DatabaseListResult struct { - // The link used to get the next page of databases. +// DatabaseList - List of all databases in a server. +type DatabaseList struct { + // Link used to get the next page of results. NextLink *string - // The list of databases housed in a server + // List of all databases in a server. Value []*Database } -// DatabaseProperties - The properties of a database. -type DatabaseProperties struct { - // The charset of the database. - Charset *string - - // The collation of the database. - Collation *string -} - -// DbLevelValidationStatus - Validation status summary for an individual database -type DbLevelValidationStatus struct { - // Name of the database - DatabaseName *string - - // End date-time of a database level validation - EndedOn *time.Time - - // Start date-time of a database level validation - StartedOn *time.Time - - // Summary of database level validations - Summary []*ValidationSummaryItem -} - -// DbMigrationStatus - Migration status of an individual database -type DbMigrationStatus struct { - // CDC applied changes counter +// DatabaseMigrationState - Migration state of a database. +type DatabaseMigrationState struct { + // Change Data Capture applied changes counter. AppliedChanges *int32 - // CDC delete counter + // Change Data Capture delete counter. CdcDeleteCounter *int32 - // CDC insert counter + // Change Data Capture insert counter. CdcInsertCounter *int32 - // CDC update counter + // Change Data Capture update counter. CdcUpdateCounter *int32 - // Name of the database + // Name of database. DatabaseName *string - // End date-time of a migration state + // End time of a migration state. EndedOn *time.Time - // Number of tables loaded during the migration of a DB + // Number of tables loaded during the migration of a database. FullLoadCompletedTables *int32 - // Number of tables errored out during the migration of a DB + // Number of tables encountering errors during the migration of a database. FullLoadErroredTables *int32 - // Number of tables loading during the migration of a DB + // Number of tables loading during the migration of a database. FullLoadLoadingTables *int32 - // Number of tables queued for the migration of a DB + // Number of tables queued for the migration of a database. FullLoadQueuedTables *int32 - // CDC incoming changes counter + // Change Data Capture incoming changes counter. IncomingChanges *int32 - // Lag in seconds between source and target during online phase + // Lag in seconds between source and target during online phase. Latency *int32 - // Error message, if any, for the migration state + // Error message, if any, for the migration state. Message *string - // Migration operation of an individual database + // Migration operation of a database. MigrationOperation *string - // Migration db state of an individual database - MigrationState *MigrationDbState + // Migration state of a database. + MigrationState *MigrationDatabaseState - // Start date-time of a migration state + // Start time of a migration state. StartedOn *time.Time } +// DatabaseProperties - Properties of a database. +type DatabaseProperties struct { + // Character set of the database. + Charset *string + + // Collation of the database. + Collation *string +} + +// DbLevelValidationStatus - Validation status summary for a database. +type DbLevelValidationStatus struct { + // Name of database. + DatabaseName *string + + // End time of a database level validation. + EndedOn *time.Time + + // Start time of a database level validation. + StartedOn *time.Time + + // Summary of database level validations. + Summary []*ValidationSummaryItem +} + // DbServerMetadata - Database server metadata. type DbServerMetadata struct { - // SKU for the database server. This object is empty for PG single server + // Compute tier and size of the database server. This object is empty for an Azure Database for PostgreSQL single server. SKU *ServerSKU - // Storage size in MB for database server + // Storage size (in MB) for database server. StorageMb *int32 - // Version for database engine + // Major version of PostgreSQL database engine. Version *string - // READ-ONLY; Location of database server + // READ-ONLY; Location of database server. Location *string } @@ -370,33 +629,33 @@ type DelegatedSubnetUsage struct { Usage *int64 } -// FastProvisioningEditionCapability - Represents capability of a fast provisioning edition +// FastProvisioningEditionCapability - Capability of a fast provisioning compute tier. type FastProvisioningEditionCapability struct { // READ-ONLY; The reason for the capability not being available. Reason *string - // READ-ONLY; Count of servers in cache matching the spec + // READ-ONLY; Count of servers in cache matching this specification. ServerCount *int32 // READ-ONLY; The status of the capability. Status *CapabilityStatus - // READ-ONLY; Fast provisioning supported sku name + // READ-ONLY; Compute name (SKU) supporting fast provisioning. SupportedSKU *string - // READ-ONLY; Fast provisioning supported version + // READ-ONLY; Major version of PostgreSQL database engine supporting fast provisioning. SupportedServerVersions *string - // READ-ONLY; Fast provisioning supported storage in Gb + // READ-ONLY; Storage size (in GB) supporting fast provisioning. SupportedStorageGb *int32 - // READ-ONLY; Fast provisioning supported tier name + // READ-ONLY; Compute tier supporting fast provisioning. SupportedTier *string } -// FirewallRule - Represents a server firewall rule. +// FirewallRule - Firewall rule. type FirewallRule struct { - // REQUIRED; The properties of a firewall rule. + // REQUIRED; Properties of a firewall rule. Properties *FirewallRuleProperties // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" @@ -412,279 +671,61 @@ type FirewallRule struct { Type *string } -// FirewallRuleListResult - A list of firewall rules. -type FirewallRuleListResult struct { - // The link used to get the next page of operations. +// FirewallRuleList - List of firewall rules. +type FirewallRuleList struct { + // Link to retrieve next page of results. NextLink *string - // The list of firewall rules in a server. + // List of firewall rules in a server. Value []*FirewallRule } -// FirewallRuleProperties - The properties of a server firewall rule. +// FirewallRuleProperties - Properties of a firewall rule. type FirewallRuleProperties struct { - // REQUIRED; The end IP address of the server firewall rule. Must be IPv4 format. + // REQUIRED; IP address defining the end of the range of addresses of a firewall rule. Must be expressed in IPv4 format. EndIPAddress *string - // REQUIRED; The start IP address of the server firewall rule. Must be IPv4 format. + // REQUIRED; IP address defining the start of the range of addresses of a firewall rule. Must be expressed in IPv4 format. StartIPAddress *string } -// FlexibleServerCapability - Capability for the PostgreSQL server -type FlexibleServerCapability struct { - // Name of flexible servers capability - Name *string - - // READ-ONLY; Gets a value indicating whether fast provisioning is 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". - FastProvisioningSupported *FastProvisioningSupportedEnum - - // READ-ONLY; Determines if geo-backup is supported in this region. "Enabled" means geo-backup is supported. "Disabled" stands - // for geo-back is not supported. Will be deprecated in future, please look to Supported - // Features for "GeoBackup". - GeoBackupSupported *GeoBackupSupportedEnum - - // READ-ONLY; 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. Will be deprecated in future, please look to Supported Features for "OnlineResize". - OnlineResizeSupported *OnlineResizeSupportedEnum - - // READ-ONLY; The reason for the capability not being available. - Reason *string - - // READ-ONLY; A value indicating whether this region is restricted. "Enabled" means region is restricted. "Disabled" stands - // for region is not restricted. Will be deprecated in future, please look to Supported - // Features for "Restricted". - Restricted *RestrictedEnum - - // READ-ONLY; The status of the capability. - Status *CapabilityStatus - - // READ-ONLY; 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". - StorageAutoGrowthSupported *StorageAutoGrowthSupportedEnum - - // READ-ONLY; List of supported server editions for fast provisioning - SupportedFastProvisioningEditions []*FastProvisioningEditionCapability - - // READ-ONLY; The supported features. - SupportedFeatures []*SupportedFeature - - // READ-ONLY; List of supported flexible server editions - SupportedServerEditions []*FlexibleServerEditionCapability - - // READ-ONLY; The list of server versions supported for this capability. - SupportedServerVersions []*ServerVersionCapability - - // READ-ONLY; 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". - ZoneRedundantHaAndGeoBackupSupported *ZoneRedundantHaAndGeoBackupSupportedEnum - - // READ-ONLY; 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". - ZoneRedundantHaSupported *ZoneRedundantHaSupportedEnum -} - -// FlexibleServerEditionCapability - Flexible server edition capabilities. -type FlexibleServerEditionCapability struct { - // READ-ONLY; Default sku name for the server edition - DefaultSKUName *string - - // READ-ONLY; Server edition name - Name *string - - // READ-ONLY; The reason for the capability not being available. - Reason *string - - // READ-ONLY; The status of the capability. - Status *CapabilityStatus +// HighAvailability - High availability properties of a server. +type HighAvailability struct { + // High availability mode for a server. + Mode *HighAvailabilityMode - // READ-ONLY; List of supported server SKUs. - SupportedServerSKUs []*ServerSKUCapability + // Availability zone associated to the standby server created when high availability is set to SameZone or ZoneRedundant. + StandbyAvailabilityZone *string - // READ-ONLY; The list of editions supported by this server edition. - SupportedStorageEditions []*StorageEditionCapability + // READ-ONLY; Possible states of the standby server created when high availability is set to SameZone or ZoneRedundant. + State *HighAvailabilityState } -// HighAvailability - High availability properties of a server -type HighAvailability struct { - // The HA mode for the server. +// HighAvailabilityForPatch - High availability properties of a server. +type HighAvailabilityForPatch struct { + // High availability mode for a server. Mode *HighAvailabilityMode - // availability zone information of the standby. + // Availability zone associated to the standby server created when high availability is set to SameZone or ZoneRedundant. StandbyAvailabilityZone *string - // READ-ONLY; A state of a HA server that is visible to user. - State *ServerHAState + // READ-ONLY; Possible states of the standby server created when high availability is set to SameZone or ZoneRedundant. + State *HighAvailabilityState } -// ImpactRecord - Stores property that features impact on some metric if this recommended action is applied. +// ImpactRecord - Impact on some metric if this recommended action is applied. type ImpactRecord struct { - // Absolute value + // Absolute value. AbsoluteValue *float64 - // Dimension name - DimensionName *string - - // Optional property that can be used to store the QueryId if the metric is for a specific query. - QueryID *int64 - - // Dimension unit - Unit *string -} - -// IndexRecommendationDetails - Recommendation details for the recommended action. -type IndexRecommendationDetails struct { - // Database name. - DatabaseName *string - - // Index included columns. - IncludedColumns []*string - - // Index columns. - IndexColumns []*string - - // Index name. - IndexName *string - - // Index type. - IndexType *string - - // Schema name. - Schema *string - - // Table name. - Table *string -} - -// IndexRecommendationListResult - A list of available index recommendations. -type IndexRecommendationListResult struct { - // URL client should use to fetch the next page (per server side paging). It's null for now, added for future use. - NextLink *string - - // A list of available index recommendations. - Value []*IndexRecommendationResource -} - -// IndexRecommendationResource - Index recommendation properties. -type IndexRecommendationResource struct { - // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" - ID *string - - // READ-ONLY; The name of the resource - Name *string - - // READ-ONLY; Properties of IndexRecommendationResource. - Properties *IndexRecommendationResourceProperties - - // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. - SystemData *SystemData - - // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string -} - -// IndexRecommendationResourceProperties - Index recommendation properties. -type IndexRecommendationResourceProperties struct { - // Stores workload information for the recommended action. - AnalyzedWorkload *IndexRecommendationResourcePropertiesAnalyzedWorkload - - // Stores implementation details for the recommended action. - ImplementationDetails *IndexRecommendationResourcePropertiesImplementationDetails - - // The ImprovedQueryIds. The list will only be populated for CREATE INDEX recommendations. - ImprovedQueryIDs []*int64 - - // Creation time of this recommendation in UTC date-time string format. - InitialRecommendedTime *time.Time - - // The last refresh of this recommendation in UTC date-time string format. - LastRecommendedTime *time.Time - - // Reason for this recommendation. - RecommendationReason *string - - // Type for this recommendation. - RecommendationType *RecommendationTypeEnum - - // The number of times this recommendation has encountered. - TimesRecommended *int32 - - // READ-ONLY; Stores recommendation details for the recommended action. - Details *IndexRecommendationDetails - - // READ-ONLY; The estimated impact of this recommended action - EstimatedImpact []*ImpactRecord -} - -// IndexRecommendationResourcePropertiesAnalyzedWorkload - Stores workload information for the recommended action. -type IndexRecommendationResourcePropertiesAnalyzedWorkload struct { - // Workload end time in UTC date-time string format. - EndTime *time.Time - - // Workload query examined count. For DROP INDEX will be 0. - QueryCount *int32 - - // Workload start time in UTC date-time string format. - StartTime *time.Time -} - -// IndexRecommendationResourcePropertiesImplementationDetails - Stores implementation details for the recommended action. -type IndexRecommendationResourcePropertiesImplementationDetails struct { - // Method of implementation for recommended action - Method *string - - // Implementation script for the recommended action - Script *string -} - -// LogFile - Represents a logFile. -type LogFile struct { - // The properties of a logFile. - Properties *LogFileProperties - - // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" - ID *string - - // READ-ONLY; The name of the resource - Name *string - - // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. - SystemData *SystemData - - // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string -} - -// LogFileListResult - A List of logFiles. -type LogFileListResult struct { - // The link used to get the next page of operations. - NextLink *string - - // The list of logFiles in a server - Value []*LogFile -} - -// LogFileProperties - The properties of a logFile. -type LogFileProperties struct { - // Creation timestamp of the log file. - CreatedTime *time.Time - - // Last modified timestamp of the log file. - LastModifiedTime *time.Time - - // The size in kb of the logFile. - SizeInKb *int64 + // Dimension name. + DimensionName *string - // Type of the log file. - Type *string + // Optional property that can be used to store the identifier of the query, if the metric is for a specific query. + QueryID *int64 - // The url to download the log file from. - URL *string + // Dimension unit. + Unit *string } // LtrBackupOperationResponseProperties - Response for the backup request. @@ -721,21 +762,6 @@ type LtrBackupOperationResponseProperties struct { ErrorMessage *string } -// LtrBackupRequest - The request that is made for a long term retention backup. -type LtrBackupRequest struct { - // REQUIRED; Backup Settings - BackupSettings *BackupSettings - - // REQUIRED; Backup store detail for target server - TargetDetails *BackupStoreDetails -} - -// LtrBackupResponse - Response for the LTR backup API call -type LtrBackupResponse struct { - // Long Term Retention Backup Operation Resource Properties - Properties *LtrBackupOperationResponseProperties -} - // LtrPreBackupRequest - A request that is made for pre-backup. type LtrPreBackupRequest struct { // REQUIRED; Backup Settings @@ -745,32 +771,7 @@ type LtrPreBackupRequest struct { // LtrPreBackupResponse - Response for the LTR pre-backup API call type LtrPreBackupResponse struct { // REQUIRED; Additional Properties for the pre backup response - Properties *LtrPreBackupResponseProperties -} - -// LtrPreBackupResponseProperties - Response for the pre-backup request. -type LtrPreBackupResponseProperties struct { - // REQUIRED; Number of storage containers the plugin will use during backup. More than one containers may be used for size - // limitations, parallelism, or redundancy etc. - NumberOfContainers *int32 -} - -// LtrServerBackupOperation - Response for the LTR backup Operation API call -type LtrServerBackupOperation struct { - // Long Term Retention Backup Operation Resource Properties - Properties *LtrBackupOperationResponseProperties - - // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" - ID *string - - // READ-ONLY; The name of the resource - Name *string - - // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. - SystemData *SystemData - - // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string + Properties *BackupsLongTermRetentionResponseProperties } // LtrServerBackupOperationList - A list of long term retention backup operations for server. @@ -779,49 +780,46 @@ type LtrServerBackupOperationList struct { NextLink *string // The list of long term retention server backup operations - Value []*LtrServerBackupOperation + Value []*BackupsLongTermRetentionOperation } // MaintenanceWindow - Maintenance window properties of a server. type MaintenanceWindow struct { - // indicates whether custom window is enabled or disabled + // Indicates whether custom window is enabled or disabled. CustomWindow *string - // day of week for maintenance window + // Day of the week to be used for maintenance window. DayOfWeek *int32 - // start hour for maintenance window + // Start hour to be used for maintenance window. StartHour *int32 - // start minute for maintenance window + // Start minute to be used for maintenance window. StartMinute *int32 } -// MigrationNameAvailabilityResource - Represents a migration name's availability. -type MigrationNameAvailabilityResource struct { - // REQUIRED; The resource name to verify. - Name *string - - // REQUIRED; The type of the resource. - Type *string +// MaintenanceWindowForPatch - Maintenance window properties of a server. +type MaintenanceWindowForPatch struct { + // Indicates whether custom window is enabled or disabled. + CustomWindow *string - // READ-ONLY; Migration name availability message. - Message *string + // Day of the week to be used for maintenance window. + DayOfWeek *int32 - // READ-ONLY; Indicates whether the resource name is available. - NameAvailable *bool + // Start hour to be used for maintenance window. + StartHour *int32 - // READ-ONLY; Migration name availability reason - Reason *MigrationNameAvailabilityReason + // Start minute to be used for maintenance window. + StartMinute *int32 } -// MigrationResource - Represents a migration resource. -type MigrationResource struct { +// Migration - Properties of a migration. +type Migration struct { // REQUIRED; The geo-location where the resource lives Location *string - // Migration resource properties. - Properties *MigrationResourceProperties + // Migration properties. + Properties *MigrationProperties // Resource tags. Tags map[string]*string @@ -839,200 +837,236 @@ type MigrationResource struct { Type *string } -// MigrationResourceForPatch - Represents a migration resource for patch. -type MigrationResourceForPatch struct { - // Migration resource properties. - Properties *MigrationResourcePropertiesForPatch +// MigrationList - List of migrations. +type MigrationList struct { + // Link used to get the next page of results. + NextLink *string - // Application-specific metadata in the form of key-value pairs. - Tags map[string]*string + // READ-ONLY; List of migrations. + Value []*Migration } -// MigrationResourceListResult - A list of migration resources. -type MigrationResourceListResult struct { - // READ-ONLY; The link used to get the next page of migrations. - NextLink *string +// MigrationNameAvailability - Availability of a migration name. +type MigrationNameAvailability struct { + // REQUIRED; Name of the migration to check for validity and availability. + Name *string + + // REQUIRED; Type of resource. + Type *string + + // READ-ONLY; Migration name availability message. + Message *string - // READ-ONLY; A list of migration resources. - Value []*MigrationResource + // READ-ONLY; Indicates if the migration name is available. + NameAvailable *bool + + // READ-ONLY; Migration name availability reason. + Reason *MigrationNameAvailabilityReason } -// MigrationResourceProperties - Migration resource properties. -type MigrationResourceProperties struct { - // To trigger cancel for entire migration we need to send this flag as True - Cancel *CancelEnum +// MigrationProperties - Migration. +type MigrationProperties struct { + // Indicates if cancel must be triggered for the entire migration. + Cancel *Cancel - // When you want to trigger cancel for specific databases send cancel flag as True and database names in this array + // When you want to trigger cancel for specific databases set 'triggerCutover' to 'True' and the names of the specific databases + // in this array. DbsToCancelMigrationOn []*string - // Number of databases to migrate + // Names of databases to migrate. DbsToMigrate []*string - // When you want to trigger cutover for specific databases send triggerCutover flag as True and database names in this array + // When you want to trigger cutover for specific databases set 'triggerCutover' to 'True' and the names of the specific databases + // in this array. DbsToTriggerCutoverOn []*string - // To migrate roles and permissions we need to send this flag as True - MigrateRoles *MigrateRolesEnum + // Indicates if roles and permissions must be migrated. + MigrateRoles *MigrateRolesAndPermissions - // ResourceId of the private endpoint migration instance + // Identifier of the private endpoint migration instance. MigrationInstanceResourceID *string - // There are two types of migration modes Online and Offline + // Mode used to perform the migration: Online or Offline. MigrationMode *MigrationMode - // This indicates the supported Migration option for the migration + // Supported option for a migration. MigrationOption *MigrationOption - // End time in UTC for migration window + // End time (UTC) for migration window. MigrationWindowEndTimeInUTC *time.Time - // Start time in UTC for migration window + // Start time (UTC) for migration window. MigrationWindowStartTimeInUTC *time.Time - // Indicates whether the databases on the target server can be overwritten, if already present. If set to False, the migration - // workflow will wait for a confirmation, if it detects that the database - // already exists. - OverwriteDbsInTarget *OverwriteDbsInTargetEnum + // Indicates if databases on the target server can be overwritten when already present. If set to 'False', when the migration + // workflow detects that the database already exists on the target server, it + // will wait for a confirmation. + OverwriteDbsInTarget *OverwriteDatabasesOnTargetServer - // SSL modes for migration. Default SSL mode for PostgreSQLSingleServer is VerifyFull and Prefer for other source types + // SSL mode used by a migration. Default SSL mode for 'PostgreSQLSingleServer' is 'VerifyFull'. Default SSL mode for other + // source types is 'Prefer'. SSLMode *SSLMode - // Migration secret parameters + // Migration secret parameters. SecretParameters *MigrationSecretParameters - // Indicates whether to setup LogicalReplicationOnSourceDb, if needed - SetupLogicalReplicationOnSourceDbIfNeeded *LogicalReplicationOnSourceDbEnum + // Indicates whether to setup logical replication on source server, if needed. + SetupLogicalReplicationOnSourceDbIfNeeded *LogicalReplicationOnSourceServer - // Source server fully qualified domain name (FQDN) or IP address. It is a optional value, if customer provide it, migration - // service will always use it for connection + // Fully qualified domain name (FQDN) or IP address of the source server. This property is optional. When provided, the migration + // service will always use it to connect to the source server. SourceDbServerFullyQualifiedDomainName *string - // ResourceId of the source database server in case the sourceType is PostgreSQLSingleServer. For other source types this - // should be ipaddress:port@username or hostname:port@username + // Identifier of the source database server resource, when 'sourceType' is 'PostgreSQLSingleServer'. For other source types + // this must be set to ipaddress:port@username or hostname:port@username. SourceDbServerResourceID *string - // migration source server type : OnPremises, AWS, GCP, AzureVM, PostgreSQLSingleServer, AWSRDS, AWSAURORA, AWSEC2, GCPCloudSQL, - // GCPAlloyDB, GCPCompute, EDB, EDBOracleServer, EDBPostgreSQL, - // PostgreSQLFlexibleServer, PostgreSQLCosmosDB, HuaweiRDS, HuaweiCompute, HerokuPostgreSQL, CrunchyPostgreSQL, ApsaraDBRDS, - // DigitalOceanDroplets, DigitalOceanPostgreSQL, or Supabase_PostgreSQL + // Source server type used for the migration: ApsaraDBRDS, AWS, AWSAURORA, AWSEC2, AWSRDS, AzureVM, CrunchyPostgreSQL, DigitalOceanDroplets, + // DigitalOceanPostgreSQL, EDB, EDBOracleServer, EDBPostgreSQL, + // GCP, GCPAlloyDB, GCPCloudSQL, GCPCompute, HerokuPostgreSQL, HuaweiCompute, HuaweiRDS, OnPremises, PostgreSQLCosmosDB, PostgreSQLFlexibleServer, + // PostgreSQLSingleServer, or Supabase_PostgreSQL SourceType *SourceType - // Indicates whether the data migration should start right away - StartDataMigration *StartDataMigrationEnum + // Indicates if data migration must start right away. + StartDataMigration *StartDataMigration - // Target server fully qualified domain name (FQDN) or IP address. It is a optional value, if customer provide it, migration - // service will always use it for connection + // Fully qualified domain name (FQDN) or IP address of the target server. This property is optional. When provided, the migration + // service will always use it to connect to the target server. TargetDbServerFullyQualifiedDomainName *string - // To trigger cutover for entire migration we need to send this flag as True - TriggerCutover *TriggerCutoverEnum + // Indicates if cutover must be triggered for the entire migration. + TriggerCutover *TriggerCutover - // READ-ONLY; Current status of migration + // READ-ONLY; Current status of a migration. CurrentStatus *MigrationStatus - // READ-ONLY; ID for migration, a GUID. + // READ-ONLY; Identifier of a migration. MigrationID *string - // READ-ONLY; Metadata of the source database server + // READ-ONLY; Metadata of source database server. SourceDbServerMetadata *DbServerMetadata - // READ-ONLY; Metadata of the target database server + // READ-ONLY; Metadata of target database server. TargetDbServerMetadata *DbServerMetadata - // READ-ONLY; ResourceId of the source database server + // READ-ONLY; Identifier of the target database server resource. TargetDbServerResourceID *string } -// MigrationResourcePropertiesForPatch - Migration resource properties for patch. -type MigrationResourcePropertiesForPatch struct { - // To trigger cancel for entire migration we need to send this flag as True - Cancel *CancelEnum +// MigrationPropertiesForPatch - Migration properties. +type MigrationPropertiesForPatch struct { + // Indicates if cancel must be triggered for the entire migration. + Cancel *Cancel - // When you want to trigger cancel for specific databases send cancel flag as True and database names in this array + // When you want to trigger cancel for specific databases set 'triggerCutover' to 'True' and the names of the specific databases + // in this array. DbsToCancelMigrationOn []*string - // Number of databases to migrate + // Names of databases to migrate. DbsToMigrate []*string - // When you want to trigger cutover for specific databases send triggerCutover flag as True and database names in this array + // When you want to trigger cutover for specific databases set 'triggerCutover' to 'True' and the names of the specific databases + // in this array. DbsToTriggerCutoverOn []*string - // To migrate roles and permissions we need to send this flag as True - MigrateRoles *MigrateRolesEnum + // Indicates if roles and permissions must be migrated. + MigrateRoles *MigrateRolesAndPermissions - // There are two types of migration modes Online and Offline + // Mode used to perform the migration: Online or Offline. MigrationMode *MigrationMode - // Start time in UTC for migration window + // Start time (UTC) for migration window. MigrationWindowStartTimeInUTC *time.Time - // Indicates whether the databases on the target server can be overwritten, if already present. If set to False, the migration - // workflow will wait for a confirmation, if it detects that the database - // already exists. - OverwriteDbsInTarget *OverwriteDbsInTargetEnum + // Indicates if databases on the target server can be overwritten when already present. If set to 'False', when the migration + // workflow detects that the database already exists on the target server, it + // will wait for a confirmation. + OverwriteDbsInTarget *OverwriteDatabasesOnTargetServer - // Migration secret parameters - SecretParameters *MigrationSecretParameters + // Migration secret parameters. + SecretParameters *MigrationSecretParametersForPatch - // Indicates whether to setup LogicalReplicationOnSourceDb, if needed - SetupLogicalReplicationOnSourceDbIfNeeded *LogicalReplicationOnSourceDbEnum + // Indicates whether to setup logical replication on source server, if needed. + SetupLogicalReplicationOnSourceDbIfNeeded *LogicalReplicationOnSourceServer - // Source server fully qualified domain name (FQDN) or IP address. It is a optional value, if customer provide it, migration - // service will always use it for connection + // Fully qualified domain name (FQDN) or IP address of the source server. This property is optional. When provided, the migration + // service will always use it to connect to the source server. SourceDbServerFullyQualifiedDomainName *string - // ResourceId of the source database server + // Identifier of the source database server resource, when 'sourceType' is 'PostgreSQLSingleServer'. For other source types + // this must be set to ipaddress:port@username or hostname:port@username. SourceDbServerResourceID *string - // Indicates whether the data migration should start right away - StartDataMigration *StartDataMigrationEnum + // Indicates if data migration must start right away. + StartDataMigration *StartDataMigration - // Target server fully qualified domain name (FQDN) or IP address. It is a optional value, if customer provide it, migration - // service will always use it for connection + // Fully qualified domain name (FQDN) or IP address of the target server. This property is optional. When provided, the migration + // service will always use it to connect to the target server. TargetDbServerFullyQualifiedDomainName *string - // To trigger cutover for entire migration we need to send this flag as True - TriggerCutover *TriggerCutoverEnum + // Indicates if cutover must be triggered for the entire migration. + TriggerCutover *TriggerCutover +} + +// MigrationResourceForPatch - Migration. +type MigrationResourceForPatch struct { + // Migration properties. + Properties *MigrationPropertiesForPatch + + // Application-specific metadata in the form of key-value pairs. + Tags map[string]*string } // MigrationSecretParameters - Migration secret parameters. type MigrationSecretParameters struct { - // REQUIRED; Admin credentials for source and target servers + // REQUIRED; Credentials of administrator users for source and target servers. AdminCredentials *AdminCredentials - // Gets or sets the username for the source server. This user need not be an admin. + // Gets or sets the name of the user for the source server. This user doesn't need to be an administrator. + SourceServerUsername *string + + // Gets or sets the name of the user for the target server. This user doesn't need to be an administrator. + TargetServerUsername *string +} + +// MigrationSecretParametersForPatch - Migration secret parameters. +type MigrationSecretParametersForPatch struct { + // Credentials of administrator users for source and target servers. + AdminCredentials *AdminCredentialsForPatch + + // Gets or sets the name of the user for the source server. This user doesn't need to be an administrator. SourceServerUsername *string - // Gets or sets the username for the target server. This user need not be an admin. + // Gets or sets the name of the user for the target server. This user doesn't need to be an administrator. TargetServerUsername *string } -// MigrationStatus - Migration status. +// MigrationStatus - State of migration. type MigrationStatus struct { - // READ-ONLY; Current Migration sub state details. - CurrentSubStateDetails *MigrationSubStateDetails + // READ-ONLY; Current migration sub state details. + CurrentSubStateDetails *MigrationSubstateDetails - // READ-ONLY; Error message, if any, for the migration state + // READ-ONLY; Error message, if any, for the migration state. Error *string - // READ-ONLY; State of migration + // READ-ONLY; State of migration. State *MigrationState } -// MigrationSubStateDetails - Migration sub state details. -type MigrationSubStateDetails struct { +// MigrationSubstateDetails - Details of migration substate. +type MigrationSubstateDetails struct { // Dictionary of - DbDetails map[string]*DbMigrationStatus + DbDetails map[string]*DatabaseMigrationState - // Details for the validation for migration + // Details for the validation for migration. ValidationDetails *ValidationDetails - // READ-ONLY; Migration sub state. - CurrentSubState *MigrationSubState + // READ-ONLY; Substate of migration. + CurrentSubState *MigrationSubstate } -// NameAvailability - Represents a resource name availability. -type NameAvailability struct { +// NameAvailabilityModel - Availability of a name. +type NameAvailabilityModel struct { // Detailed reason why the given name is available. Message *string @@ -1042,10 +1076,10 @@ type NameAvailability struct { // The reason why the given name is not available. Reason *CheckNameAvailabilityReason - // READ-ONLY; name of the PostgreSQL server. + // READ-ONLY; Name for which validity and availability was checked. Name *string - // READ-ONLY; type of the server + // READ-ONLY; Type of resource. It can be 'Microsoft.DBforPostgreSQL/flexibleServers' or 'Microsoft.DBforPostgreSQL/flexibleServers/virtualendpoints'. Type *string } @@ -1060,32 +1094,146 @@ type NameProperty struct { // Network properties of a server. type Network struct { - // Delegated subnet arm resource id. This is required to be passed during create, in case we want the server to be VNET injected, - // i.e. Private access server. During update, pass this only if we want to - // update the value for Private DNS zone. + // Resource identifier of the delegated subnet. Required during creation of a new server, in case you want the server to be + // integrated into your own virtual network. For an update operation, you only + // have to provide this property if you want to change the value assigned for the private DNS zone. DelegatedSubnetResourceID *string - // Private dns zone arm resource id. This is required to be passed during create, in case we want the server to be VNET injected, - // i.e. Private access server. During update, pass this only if we want to - // update the value for Private DNS zone. + // Identifier of the private DNS zone. Required during creation of a new server, in case you want the server to be integrated + // into your own virtual network. For an update operation, you only have to + // provide this property if you want to change the value assigned for the private DNS zone. PrivateDNSZoneArmResourceID *string - // public network access is enabled or not + // Indicates if public network access is enabled or not. This is only supported for servers that are not integrated into a + // virtual network which is owned and provided by customer when server is deployed. PublicNetworkAccess *ServerPublicNetworkAccessState } +// ObjectRecommendation - Object recommendation properties. +type ObjectRecommendation struct { + // Always empty. + Kind *string + + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + ID *string + + // READ-ONLY; The name of the resource + Name *string + + // READ-ONLY; Properties of an object recommendation. + Properties *ObjectRecommendationProperties + + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string +} + +// ObjectRecommendationDetails - Recommendation details for the recommended action. +type ObjectRecommendationDetails struct { + // Database name. + DatabaseName *string + + // Index included columns. + IncludedColumns []*string + + // Index columns. + IndexColumns []*string + + // Index name. + IndexName *string + + // Index type. + IndexType *string + + // Schema name. + Schema *string + + // Table name. + Table *string +} + +// ObjectRecommendationList - List of available object recommendations. +type ObjectRecommendationList struct { + // Link used to get the next page of results. + NextLink *string + + // List of available object recommendations. + Value []*ObjectRecommendation +} + +// ObjectRecommendationProperties - Object recommendation properties. +type ObjectRecommendationProperties struct { + // Workload information for the recommended action. + AnalyzedWorkload *ObjectRecommendationPropertiesAnalyzedWorkload + + // Current state. + CurrentState *string + + // Implementation details for the recommended action. + ImplementationDetails *ObjectRecommendationPropertiesImplementationDetails + + // List of identifiers for all queries identified as targets for improvement if the recommendation is applied. The list is + // only populated for CREATE INDEX recommendations. + ImprovedQueryIDs []*int64 + + // Creation time (UTC) of this recommendation. + InitialRecommendedTime *time.Time + + // Last time (UTC) that this recommendation was produced. + LastRecommendedTime *time.Time + + // Reason for this recommendation. + RecommendationReason *string + + // Type for this recommendation. + RecommendationType *RecommendationTypeEnum + + // Number of times this recommendation has been produced. + TimesRecommended *int32 + + // READ-ONLY; Recommendation details for the recommended action. + Details *ObjectRecommendationDetails + + // READ-ONLY; Estimated impact of this recommended action. + EstimatedImpact []*ImpactRecord +} + +// ObjectRecommendationPropertiesAnalyzedWorkload - Workload information for the recommended action. +type ObjectRecommendationPropertiesAnalyzedWorkload struct { + // End time (UTC) of the workload analyzed. + EndTime *time.Time + + // Number of queries from the workload that were examined to produce this recommendation. For DROP INDEX recommendations it's + // 0 (zero). + QueryCount *int32 + + // Start time (UTC) of the workload analyzed. + StartTime *time.Time +} + +// ObjectRecommendationPropertiesImplementationDetails - Implementation details for the recommended action. +type ObjectRecommendationPropertiesImplementationDetails struct { + // Method of implementation for recommended action. + Method *string + + // Implementation script for the recommended action. + Script *string +} + // Operation - REST API operation definition. type Operation struct { - // Indicates whether the operation is a data action + // Indicates if the operation is a data action. IsDataAction *bool - // READ-ONLY; The localized display information for this particular operation or action. + // READ-ONLY; Localized display information for this particular operation or action. Display *OperationDisplay - // READ-ONLY; The name of the operation being performed on this particular object. + // READ-ONLY; Name of the operation being performed on this particular object. Name *string - // READ-ONLY; The intended executor of the operation. + // READ-ONLY; Intended executor of the operation. Origin *OperationOrigin // READ-ONLY; Additional descriptions for the operation. @@ -1094,22 +1242,22 @@ type Operation struct { // OperationDisplay - Display metadata associated with the operation. type OperationDisplay struct { - // READ-ONLY; Operation description. + // READ-ONLY; Description of the operation. Description *string - // READ-ONLY; Localized friendly name for the operation. + // READ-ONLY; Name of the operation. Operation *string - // READ-ONLY; Operation resource provider name. + // READ-ONLY; Name of the resource provider. Provider *string - // READ-ONLY; Resource on which the operation is performed. + // READ-ONLY; Type of resource on which the operation is performed. Resource *string } -// OperationListResult - A list of resource provider operations. -type OperationListResult struct { - // URL client should use to fetch the next page (per server side paging). It's null for now, added for future use. +// OperationList - List of resource provider operations. +type OperationList struct { + // Link used to get the next page of results. NextLink *string // Collection of available operation details @@ -1140,9 +1288,9 @@ type PrivateEndpointConnection struct { Type *string } -// PrivateEndpointConnectionListResult - A list of private endpoint connections. -type PrivateEndpointConnectionListResult struct { - // READ-ONLY; The URL to get the next set of results. +// PrivateEndpointConnectionList - List of private endpoint connections. +type PrivateEndpointConnectionList struct { + // Link used to get the next page of results. NextLink *string // READ-ONLY; Array of results. @@ -1182,9 +1330,9 @@ type PrivateLinkResource struct { Type *string } -// PrivateLinkResourceListResult - A list of private link resources -type PrivateLinkResourceListResult struct { - // READ-ONLY; Link to retrieve next page of results. +// PrivateLinkResourceList - A list of private link resources +type PrivateLinkResourceList struct { + // Link to retrieve next page of results. NextLink *string // READ-ONLY; Array of results. @@ -1216,7 +1364,7 @@ type PrivateLinkServiceConnectionState struct { Status *PrivateEndpointServiceConnectionStatus } -// QuotaUsage - Quota usage for flexible servers +// QuotaUsage - Quota usage for servers type QuotaUsage struct { // Current Quota usage value CurrentValue *int64 @@ -1227,71 +1375,85 @@ type QuotaUsage struct { // Quota limit Limit *int64 - // Name of quota usage for flexible servers + // Name of quota usage for servers Name *NameProperty // Quota unit Unit *string } -// QuotaUsagesListResult - Capability for the PostgreSQL server -type QuotaUsagesListResult struct { - // READ-ONLY; Link to retrieve next page of results. +// QuotaUsageList - Capability for the PostgreSQL server +type QuotaUsageList struct { + // Link to retrieve next page of results. NextLink *string // READ-ONLY; A list of quota usages. Value []*QuotaUsage } -// Replica properties of a server +// Replica properties of a server. type Replica struct { - // Sets the promote mode for a replica server. This is a write only property. + // Type of operation to apply on the read replica. This property is write only. Standalone means that the read replica will + // be promoted to a standalone server, and will become a completely independent + // entity from the replication set. Switchover means that the read replica will roles with the primary server. PromoteMode *ReadReplicaPromoteMode - // Sets the promote options for a replica server. This is a write only property. - PromoteOption *ReplicationPromoteOption + // Data synchronization option to use when processing the operation specified in the promoteMode property. This property is + // write only. + PromoteOption *ReadReplicaPromoteOption - // Used to indicate role of the server in replication set. + // Role of the server in a replication set. Role *ReplicationRole - // READ-ONLY; Replicas allowed for a server. + // READ-ONLY; Maximum number of read replicas allowed for a server. Capacity *int32 - // READ-ONLY; Gets the replication state of a replica server. This property is returned only for replicas api call. Supported - // values are Active, Catchup, Provisioning, Updating, Broken, Reconfiguring + // READ-ONLY; Indicates the replication state of a read replica. This property is returned only when the target server is + // a read replica. Possible values are Active, Broken, Catchup, Provisioning, Reconfiguring, + // and Updating ReplicationState *ReplicationState } -// RestartParameter - Represents server restart parameters. +// RestartParameter - PostgreSQL database engine restart parameters. type RestartParameter struct { // Failover mode. FailoverMode *FailoverMode - // Indicates whether to restart the server with failover. + // Indicates if restart the PostgreSQL database engine should failover or switch over from primary to standby. This only works + // if server has high availability enabled. RestartWithFailover *bool } -// SKU - Sku information related properties of a server. +// SKU - Compute information of a server. type SKU struct { - // REQUIRED; The name of the sku, typically, tier + family + cores, e.g. StandardD4sv3. + // REQUIRED; Name by which is known a given compute size assigned to a server. + Name *string + + // REQUIRED; Tier of the compute assigned to a server. + Tier *SKUTier +} + +// SKUForPatch - Compute information of a server. +type SKUForPatch struct { + // Name by which is known a given compute size assigned to a server. Name *string - // REQUIRED; The tier of the particular SKU, e.g. Burstable. + // Tier of the compute assigned to a server. Tier *SKUTier } -// Server - Represents a server. +// Server - Properties of a server. type Server struct { // REQUIRED; The geo-location where the resource lives Location *string - // Describes the identity of the application. + // User assigned managed identities assigned to the server. Identity *UserAssignedIdentity - // Properties of the server. + // Properties of a server. Properties *ServerProperties - // The SKU (pricing tier) of the server. + // Compute tier and size of a server. SKU *SKU // Resource tags. @@ -1310,82 +1472,68 @@ type Server struct { Type *string } -// ServerBackup - Server backup properties -type ServerBackup struct { - // The properties of a server backup. - Properties *ServerBackupProperties - - // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" - ID *string +// ServerEditionCapability - Capabilities in terms of compute tier. +type ServerEditionCapability struct { + // READ-ONLY; Default compute name (SKU) for this computer tier. + DefaultSKUName *string - // READ-ONLY; The name of the resource + // READ-ONLY; Name of compute tier. Name *string - // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. - SystemData *SystemData - - // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string -} - -// ServerBackupListResult - A list of server backups. -type ServerBackupListResult struct { - // The link used to get the next page of operations. - NextLink *string - - // The list of backups of a server. - Value []*ServerBackup -} + // READ-ONLY; The reason for the capability not being available. + Reason *string -// ServerBackupProperties - The properties of a server backup. -type ServerBackupProperties struct { - // Backup type. - BackupType *Origin + // READ-ONLY; The status of the capability. + Status *CapabilityStatus - // Backup completed time (ISO8601 format). - CompletedTime *time.Time + // READ-ONLY; List of supported compute names (SKUs). + SupportedServerSKUs []*ServerSKUCapability - // Backup source - Source *string + // READ-ONLY; List of storage editions supported by this compute tier and compute name. + SupportedStorageEditions []*StorageEditionCapability } -// ServerForUpdate - Represents a server to be updated. -type ServerForUpdate struct { +// ServerForPatch - Represents a server to be updated. +type ServerForPatch struct { // Describes the identity of the application. Identity *UserAssignedIdentity // Properties of the server. - Properties *ServerPropertiesForUpdate + Properties *ServerPropertiesForPatch - // The SKU (pricing tier) of the server. - SKU *SKU + // Compute tier and size of a server. + SKU *SKUForPatch // Application-specific metadata in the form of key-value pairs. Tags map[string]*string } -// ServerListResult - A list of servers. -type ServerListResult struct { +// ServerList - A list of servers. +type ServerList struct { // The link used to get the next page of operations. NextLink *string - // The list of flexible servers + // The list of servers Value []*Server } -// ServerProperties - The properties of a server. +// ServerProperties - Properties of a server. type ServerProperties struct { - // The administrator's login name of a server. Can only be specified when the server is being created (and is required for - // creation). + // Name of the login designated as the first password based administrator assigned to your instance of PostgreSQL. Must be + // specified the first time that you enable password based authentication on a + // server. Once set to a given value, it cannot be changed for the rest of the life of a server. If you disable password based + // authentication on a server which had it enabled, this password based role + // isn't deleted. AdministratorLogin *string - // The administrator login password (required for server creation). + // Password assigned to the administrator login. As long as password authentication is enabled, this password can be changed + // at any time. AdministratorLoginPassword *string - // AuthConfig properties of a server. + // Authentication configuration properties of a server. AuthConfig *AuthConfig - // availability zone information of the server. + // Availability zone of a server. AvailabilityZone *string // Backup properties of a server. @@ -1394,7 +1542,7 @@ type ServerProperties struct { // Cluster properties of a server. Cluster *Cluster - // The mode to create a new PostgreSQL server. + // Creation mode of a new server. CreateMode *CreateMode // Data encryption properties of a server. @@ -1406,174 +1554,146 @@ type ServerProperties struct { // Maintenance window properties of a server. MaintenanceWindow *MaintenanceWindow - // Network properties of a server. This Network property is required to be passed only in case you want the server to be Private - // access server. + // Network properties of a server. Only required if you want your server to be integrated into a virtual network provided + // by customer. Network *Network - // Restore point creation time (ISO8601 format), specifying the time to restore from. It's required when 'createMode' is 'PointInTimeRestore' - // or 'GeoRestore' or 'ReviveDropped'. + // Creation time (in ISO8601 format) of the backup which you want to restore in the new server. It's required when 'createMode' + // is 'PointInTimeRestore', 'GeoRestore', or 'ReviveDropped'. PointInTimeUTC *time.Time - // Replica properties of a server. These Replica properties are required to be passed only in case you want to Promote a server. + // Read replica properties of a server. Required only in case that you want to promote a server. Replica *Replica - // Replication role of the server + // Role of the server in a replication set. ReplicationRole *ReplicationRole - // The source server resource ID to restore from. It's required when 'createMode' is 'PointInTimeRestore' or 'GeoRestore' - // or 'Replica' or 'ReviveDropped'. This property is returned only for Replica - // server + // Identifier of the server to be used as the source of the new server. Required when 'createMode' is 'PointInTimeRestore', + // 'GeoRestore', 'Replica', or 'ReviveDropped'. This property is returned only + // when the target server is a read replica. SourceServerResourceID *string // Storage properties of a server. Storage *Storage - // PostgreSQL Server version. - Version *ServerVersion + // Major version of PostgreSQL database engine. + Version *PostgresMajorVersion - // READ-ONLY; The fully qualified domain name of a server. + // READ-ONLY; Fully qualified domain name of a server. FullyQualifiedDomainName *string - // READ-ONLY; The minor version of the server. + // READ-ONLY; Minor version of PostgreSQL database engine. MinorVersion *string - // READ-ONLY; List of private endpoint connections associated with the specified resource. + // READ-ONLY; List of private endpoint connections associated with the specified server. PrivateEndpointConnections []*PrivateEndpointConnection - // READ-ONLY; Replicas allowed for a server. + // READ-ONLY; Maximum number of read replicas allowed for a server. ReplicaCapacity *int32 - // READ-ONLY; A state of a server that is visible to user. + // READ-ONLY; Possible states of a server. State *ServerState } -type ServerPropertiesForUpdate struct { - // The administrator's login name of a server. Can only be specified when the server is trying to switch to password authentication - // and does not have default administrator login. +// ServerPropertiesForPatch - Properties of a server. +type ServerPropertiesForPatch struct { + // Name of the login designated as the first password based administrator assigned to your instance of PostgreSQL. Must be + // specified the first time that you enable password based authentication on a + // server. Once set to a given value, it cannot be changed for the rest of the life of a server. If you disable password based + // authentication on a server which had it enabled, this password based role + // isn't deleted. AdministratorLogin *string - // The password of the administrator login. + // Password assigned to the administrator login. As long as password authentication is enabled, this password can be changed + // at any time. AdministratorLoginPassword *string - // AuthConfig properties of a server. - AuthConfig *AuthConfig + // Authentication configuration properties of a server. + AuthConfig *AuthConfigForPatch + + // Availability zone of a server. + AvailabilityZone *string // Backup properties of a server. - Backup *Backup + Backup *BackupForPatch // Cluster properties of a server. Cluster *Cluster - // The mode to update a new PostgreSQL server. - CreateMode *CreateModeForUpdate + // Update mode of an existing server. + CreateMode *CreateModeForPatch // Data encryption properties of a server. DataEncryption *DataEncryption // High availability properties of a server. - HighAvailability *HighAvailability + HighAvailability *HighAvailabilityForPatch // Maintenance window properties of a server. - MaintenanceWindow *MaintenanceWindow + MaintenanceWindow *MaintenanceWindowForPatch - // Network properties of a server. These are required to be passed only in case if server is a private access server. + // Network properties of a server. Only required if you want your server to be integrated into a virtual network provided + // by customer. Network *Network - // Replica properties of a server. These Replica properties are required to be passed only in case you want to Promote a server. + // Read replica properties of a server. Required only in case that you want to promote a server. Replica *Replica - // Replication role of the server + // Role of the server in a replication set. ReplicationRole *ReplicationRole // Storage properties of a server. Storage *Storage - // PostgreSQL Server version. Version 17 is currently not supported for MVU. - Version *ServerVersion + // Major version of PostgreSQL database engine. + Version *PostgresMajorVersion } -// ServerSKU - Sku information related properties of a server. +// ServerSKU - Compute information of a server. type ServerSKU struct { - // The name of the sku, typically, tier + family + cores, e.g. StandardD4sv3. + // Compute tier and size of the database server. This object is empty for an Azure Database for PostgreSQL single server. Name *string - // The tier of the particular SKU, e.g. Burstable. + // Tier of the compute assigned to a server. Tier *SKUTier } -// ServerSKUCapability - Sku capability +// ServerSKUCapability - Capabilities in terms of compute. type ServerSKUCapability struct { - // READ-ONLY; Sku name + // READ-ONLY; Name of the compute (SKU). Name *string // READ-ONLY; The reason for the capability not being available. Reason *string - // READ-ONLY; The value of security profile indicating if its confidential vm + // READ-ONLY; Security profile of the compute. Indicates if it's a Confidential Compute virtual machine. SecurityProfile *string // READ-ONLY; The status of the capability. Status *CapabilityStatus - // READ-ONLY; The supported features. + // READ-ONLY; Features supported. SupportedFeatures []*SupportedFeature - // READ-ONLY; Supported high availability mode - SupportedHaMode []*HaMode + // READ-ONLY; Modes of high availability supported for this compute. + SupportedHaMode []*HighAvailabilityMode - // READ-ONLY; Supported IOPS + // READ-ONLY; Maximum IOPS supported by this compute. SupportedIops *int32 - // READ-ONLY; Supported memory per vCore in MB + // READ-ONLY; Supported memory (in MB) per virtual core assigned to this compute. SupportedMemoryPerVcoreMb *int64 - // READ-ONLY; List of supported Availability Zones. E.g. "1", "2", "3" + // READ-ONLY; List of supported availability zones. E.g. '1', '2', '3' SupportedZones []*string - // READ-ONLY; Supported vCores + // READ-ONLY; vCores available for this compute. VCores *int32 } -// ServerThreatProtectionListResult - A list of the server's Advanced Threat Protection settings. -type ServerThreatProtectionListResult struct { - // READ-ONLY; Link to retrieve next page of results. - NextLink *string - - // READ-ONLY; Array of results. - Value []*ServerThreatProtectionSettingsModel -} - -// ServerThreatProtectionProperties - Properties of server Threat Protection state. -type ServerThreatProtectionProperties struct { - // REQUIRED; Specifies the state of the Threat Protection, whether it is enabled or disabled or a state has not been applied - // yet on the specific server. - State *ThreatProtectionState - - // READ-ONLY; Specifies the UTC creation time of the policy. - CreationTime *time.Time -} - -// ServerThreatProtectionSettingsModel - Server's Advanced Threat Protection settings. -type ServerThreatProtectionSettingsModel struct { - // Advanced Threat Protection properties. - Properties *ServerThreatProtectionProperties - - // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" - ID *string - - // READ-ONLY; The name of the resource - Name *string - - // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. - SystemData *SystemData - - // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string -} - -// ServerVersionCapability - Server version capabilities. +// ServerVersionCapability - Capabilities in terms of major versions of PostgreSQL database engine. type ServerVersionCapability struct { - // READ-ONLY; Server version + // READ-ONLY; Major version of PostgreSQL database engine. Name *string // READ-ONLY; The reason for the capability not being available. @@ -1582,104 +1702,42 @@ type ServerVersionCapability struct { // READ-ONLY; The status of the capability. Status *CapabilityStatus - // READ-ONLY; The supported features. + // READ-ONLY; Features supported. SupportedFeatures []*SupportedFeature - // READ-ONLY; Supported servers versions to upgrade + // READ-ONLY; Major versions of PostgreSQL database engine to which this version can be automatically upgraded. SupportedVersionsToUpgrade []*string } -// SessionDetailsListResult - A list of tuning configuration sessions. -type SessionDetailsListResult struct { - // URL client should use to fetch the next page (per server side paging). It's null for now, added for future use. - NextLink *string - - // A list of details of the session. - Value []*SessionDetailsResource -} - -// SessionDetailsResource - Session details properties. -type SessionDetailsResource struct { - // Applied configuration for the iteration. - AppliedConfiguration *string - - // The aqr for the iteration. - AverageQueryRuntimeMs *string - - // Iteration id. - IterationID *string - - // Iteration start time. - IterationStartTime *string - - // Session id. - SessionID *string - - // The tps for the iteration. - TransactionsPerSecond *string -} - -// SessionResource - Session resource properties. -type SessionResource struct { - // The post tuning aqr. - PostTuningAqr *string - - // The post tuning tps. - PostTuningTps *string - - // The pre tuning aqr. - PreTuningAqr *string - - // The pre tuning tps. - PreTuningTps *string - - // Session id. - SessionID *string - - // the tuning session start time. - SessionStartTime *string - - // The status of the tuning session. - Status *string -} - -// SessionsListResult - A list of tuning configuration sessions. -type SessionsListResult struct { - // URL client should use to fetch the next page (per server side paging). It's null for now, added for future use. - NextLink *string - - // A list of tuning configuration sessions. - Value []*SessionResource -} - -// Storage properties of a server +// Storage properties of a server. type Storage struct { - // Flag to enable / disable Storage Auto grow for flexible server. + // Flag to enable or disable the automatic growth of storage size of a server when available space is nearing zero and conditions + // allow for automatically growing storage size. AutoGrow *StorageAutoGrow - // Storage IOPS quantity. This property is required to be set for storage Type PremiumV2LRS and UltraSSDLRS. + // Maximum IOPS supported for storage. Required when type of storage is PremiumV2LRS or UltraSSDLRS. Iops *int32 - // Max storage allowed for a server. + // Size of storage assigned to a server. StorageSizeGB *int32 - // Storage throughput for the server. This is required to be set for storage Type PremiumV2LRS and UltraSSDLRS. + // Maximum throughput supported for storage. Required when type of storage is PremiumV2LRS or UltraSSDLRS. Throughput *int32 - // Name of storage tier for IOPS. - Tier *AzureManagedDiskPerformanceTiers + // Storage tier of a server. + Tier *AzureManagedDiskPerformanceTier - // Storage type for the server. Allowed values are PremiumLRS, PremiumV2LRS, and UltraSSDLRS. Default is PremiumLRS if not - // specified + // Type of storage assigned to a server. Allowed values are PremiumLRS, PremiumV2LRS, or UltraSSDLRS. If not specified, it + // defaults to PremiumLRS. Type *StorageType } -// StorageEditionCapability - Storage edition capability +// StorageEditionCapability - Capabilities in terms of storage tier. type StorageEditionCapability struct { - // READ-ONLY; Default storage size in MB for storage edition + // READ-ONLY; Default storage size (in MB) for this storage tier. DefaultStorageSizeMb *int64 - // READ-ONLY; Storage edition name + // READ-ONLY; Name of storage tier. Name *string // READ-ONLY; The reason for the capability not being available. @@ -1688,16 +1746,16 @@ type StorageEditionCapability struct { // READ-ONLY; The status of the capability. Status *CapabilityStatus - // READ-ONLY; Flexible server supported storage range in MB + // READ-ONLY; Configurations of storage supported for this storage tier. SupportedStorageMb []*StorageMbCapability } -// StorageMbCapability - storage size in MB capability +// StorageMbCapability - Storage size (in MB) capability. type StorageMbCapability struct { - // READ-ONLY; Default tier for IOPS + // READ-ONLY; Default IOPS for this tier and storage size. DefaultIopsTier *string - // READ-ONLY; Maximum value of Storage size in MB + // READ-ONLY; Maximum supported size (in MB) of storage. MaximumStorageSizeMb *int64 // READ-ONLY; The reason for the capability not being available. @@ -1706,31 +1764,31 @@ type StorageMbCapability struct { // READ-ONLY; The status of the capability. Status *CapabilityStatus - // READ-ONLY; Storage size in MB + // READ-ONLY; Minimum supported size (in MB) of storage. StorageSizeMb *int64 - // READ-ONLY; Supported IOPS + // READ-ONLY; Minimum IOPS supported by the storage size. SupportedIops *int32 - // READ-ONLY; List of available options to upgrade the storage performance + // READ-ONLY; List of all supported storage tiers for this tier and storage size. SupportedIopsTiers []*StorageTierCapability - // READ-ONLY; Maximum IOPS supported by this #Vcores or PremiumV2_LRS Storage Size + // READ-ONLY; Maximum IOPS supported by the storage size. SupportedMaximumIops *int32 - // READ-ONLY; Maximum values of throughput in MB/s + // READ-ONLY; Maximum supported throughput (in MB/s) of storage. SupportedMaximumThroughput *int32 - // READ-ONLY; Values of throughput in MB/s + // READ-ONLY; Minimum supported throughput (in MB/s) of storage. SupportedThroughput *int32 } -// StorageTierCapability - Represents capability of a storage tier +// StorageTierCapability - Capability of a storage tier. type StorageTierCapability struct { - // READ-ONLY; Supported IOPS for this storage tier + // READ-ONLY; Supported IOPS for the storage tier. Iops *int32 - // READ-ONLY; Name to represent Storage tier capability + // READ-ONLY; Name of the storage tier. Name *string // READ-ONLY; The reason for the capability not being available. @@ -1740,13 +1798,13 @@ type StorageTierCapability struct { Status *CapabilityStatus } -// SupportedFeature - The supported features. +// SupportedFeature - Features supported. type SupportedFeature struct { - // READ-ONLY; Name of feature + // READ-ONLY; Name of the feature. Name *string - // READ-ONLY; Status of feature - Status *SupportedFeatureStatusEnum + // READ-ONLY; Status of the feature. Indicates if the feature is enabled or not. + Status *FeatureStatus } // SystemData - Metadata pertaining to creation and last modification of the resource. @@ -1770,17 +1828,8 @@ type SystemData struct { LastModifiedByType *CreatedByType } -// TuningOptionsListResult - A list of server tuning options. -type TuningOptionsListResult struct { - // URL client should use to fetch the next page (per server side paging). It's null for now, added for future use. - NextLink *string - - // A list of available tuning options. - Value []*TuningOptionsResource -} - -// TuningOptionsResource - Stores property that features impact on some metric if this recommended action is applied. -type TuningOptionsResource struct { +// TuningOptions - Impact on some metric if this recommended action is applied. +type TuningOptions struct { // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" ID *string @@ -1794,72 +1843,81 @@ type TuningOptionsResource struct { Type *string } -// UserAssignedIdentity - Information describing the identities associated with this application. +// TuningOptionsList - List of server tuning options. +type TuningOptionsList struct { + // Link used to get the next page of results. + NextLink *string + + // List of available tuning options. + Value []*TuningOptions +} + +// UserAssignedIdentity - Identities associated with a server. type UserAssignedIdentity struct { - // REQUIRED; the types of identities associated with this resource + // REQUIRED; Types of identities associated with a server. Type *IdentityType - // the identity principal Id of the server. + // Identifier of the object of the service principal associated to the user assigned managed identity. PrincipalID *string - // represents user assigned identities map. + // Map of user assigned managed identities. UserAssignedIdentities map[string]*UserIdentity - // READ-ONLY; Tenant id of the server. + // READ-ONLY; Identifier of the tenant of a server. TenantID *string } -// UserIdentity - Describes a single user-assigned identity associated with the application. +// UserIdentity - User assigned managed identity associated with a server. type UserIdentity struct { - // the client identifier of the Service Principal which this identity represents. + // Identifier of the client of the service principal associated to the user assigned managed identity. ClientID *string - // the object identifier of the Service Principal which this identity represents. + // Identifier of the object of the service principal associated to the user assigned managed identity. PrincipalID *string } -// ValidationDetails - Details for the validation for migration +// ValidationDetails - Details for the validation for migration. type ValidationDetails struct { - // Details of server level validations + // Details of server level validations. DbLevelValidationDetails []*DbLevelValidationStatus - // Details of server level validations + // Details of server level validations. ServerLevelValidationDetails []*ValidationSummaryItem - // Validation status for migration + // Validation status for migration. Status *ValidationState - // Validation End date-time in UTC + // End time (UTC) for validation. ValidationEndTimeInUTC *time.Time - // Validation Start date-time in UTC + // Start time (UTC) for validation. ValidationStartTimeInUTC *time.Time } -// ValidationMessage - Validation message object +// ValidationMessage - Validation message object. type ValidationMessage struct { - // Validation message string + // Validation message string. Message *string - // Severity of validation message + // Severity of validation message. State *ValidationState } -// ValidationSummaryItem - Validation summary object +// ValidationSummaryItem - Validation summary object. type ValidationSummaryItem struct { - // Validation messages + // Validation messages. Messages []*ValidationMessage - // Validation status for migration + // Validation status for migration. State *ValidationState - // Validation type + // Validation type. Type *string } -// VirtualEndpointResource - Represents a virtual endpoint for a server. -type VirtualEndpointResource struct { - // Properties of the virtual endpoint resource. +// VirtualEndpoint - Pair of virtual endpoints for a server. +type VirtualEndpoint struct { + // Properties of the pair of virtual endpoints. Properties *VirtualEndpointResourceProperties // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" @@ -1875,41 +1933,35 @@ type VirtualEndpointResource struct { Type *string } -// VirtualEndpointResourceForPatch - Represents a virtual endpoint for a server. +// VirtualEndpointResourceForPatch - Pair of virtual endpoints for a server. type VirtualEndpointResourceForPatch struct { - // Properties of the virtual endpoint resource. + // Properties of the pair of virtual endpoints. Properties *VirtualEndpointResourceProperties } -// VirtualEndpointResourceProperties - The properties of a virtual endpoint. +// VirtualEndpointResourceProperties - Properties of a pair of virtual endpoints. type VirtualEndpointResourceProperties struct { - // The endpoint type for the virtual endpoint. + // Type of endpoint for the virtual endpoints. EndpointType *VirtualEndpointType - // List of members for a virtual endpoint + // List of servers that one of the virtual endpoints can refer to. Members []*string - // READ-ONLY; List of virtual endpoints for a server + // READ-ONLY; List of virtual endpoints for a server. VirtualEndpoints []*string } -// VirtualEndpointsListResult - A list of virtual endpoints. -type VirtualEndpointsListResult struct { - // The link used to get the next page of operations. +// VirtualEndpointsList - List of virtual endpoints. +type VirtualEndpointsList struct { + // Link used to get the next page of results. NextLink *string - // The list of virtual endpoints - Value []*VirtualEndpointResource -} - -// VirtualNetworkSubnetUsageParameter - Virtual network subnet usage parameter -type VirtualNetworkSubnetUsageParameter struct { - // Virtual network resource id. - VirtualNetworkArmResourceID *string + // List of virtual endpoints. + Value []*VirtualEndpoint } -// VirtualNetworkSubnetUsageResult - Virtual network subnet usage data. -type VirtualNetworkSubnetUsageResult struct { +// VirtualNetworkSubnetUsageModel - Virtual network subnet usage data. +type VirtualNetworkSubnetUsageModel struct { // READ-ONLY DelegatedSubnetsUsage []*DelegatedSubnetUsage @@ -1919,3 +1971,9 @@ type VirtualNetworkSubnetUsageResult struct { // READ-ONLY; subscriptionId of the delegated subnet usage SubscriptionID *string } + +// VirtualNetworkSubnetUsageParameter - Virtual network subnet usage parameter +type VirtualNetworkSubnetUsageParameter struct { + // Virtual network resource id. + VirtualNetworkArmResourceID *string +} diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/models_serde.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/models_serde.go index 415738c72b57..a5822822aec9 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/models_serde.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/models_serde.go @@ -12,19 +12,16 @@ import ( "reflect" ) -// MarshalJSON implements the json.Marshaller interface for type ActiveDirectoryAdministrator. -func (a ActiveDirectoryAdministrator) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AdminCredentials. +func (a AdminCredentials) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", a.ID) - populate(objectMap, "name", a.Name) - populate(objectMap, "properties", a.Properties) - populate(objectMap, "systemData", a.SystemData) - populate(objectMap, "type", a.Type) + populate(objectMap, "sourceServerPassword", a.SourceServerPassword) + populate(objectMap, "targetServerPassword", a.TargetServerPassword) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ActiveDirectoryAdministrator. -func (a *ActiveDirectoryAdministrator) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AdminCredentials. +func (a *AdminCredentials) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", a, err) @@ -32,20 +29,42 @@ func (a *ActiveDirectoryAdministrator) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &a.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &a.Name) + case "sourceServerPassword": + err = unpopulate(val, "SourceServerPassword", &a.SourceServerPassword) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &a.Properties) + case "targetServerPassword": + err = unpopulate(val, "TargetServerPassword", &a.TargetServerPassword) delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &a.SystemData) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AdminCredentialsForPatch. +func (a AdminCredentialsForPatch) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "sourceServerPassword", a.SourceServerPassword) + populate(objectMap, "targetServerPassword", a.TargetServerPassword) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AdminCredentialsForPatch. +func (a *AdminCredentialsForPatch) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "sourceServerPassword": + err = unpopulate(val, "SourceServerPassword", &a.SourceServerPassword) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &a.Type) + case "targetServerPassword": + err = unpopulate(val, "TargetServerPassword", &a.TargetServerPassword) delete(rawMsg, key) } if err != nil { @@ -55,15 +74,19 @@ func (a *ActiveDirectoryAdministrator) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ActiveDirectoryAdministratorAdd. -func (a ActiveDirectoryAdministratorAdd) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AdministratorMicrosoftEntra. +func (a AdministratorMicrosoftEntra) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "id", a.ID) + populate(objectMap, "name", a.Name) populate(objectMap, "properties", a.Properties) + populate(objectMap, "systemData", a.SystemData) + populate(objectMap, "type", a.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ActiveDirectoryAdministratorAdd. -func (a *ActiveDirectoryAdministratorAdd) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AdministratorMicrosoftEntra. +func (a *AdministratorMicrosoftEntra) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", a, err) @@ -71,9 +94,21 @@ func (a *ActiveDirectoryAdministratorAdd) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "id": + err = unpopulate(val, "ID", &a.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &a.Name) + delete(rawMsg, key) case "properties": err = unpopulate(val, "Properties", &a.Properties) delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &a.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &a.Type) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", a, err) @@ -82,16 +117,15 @@ func (a *ActiveDirectoryAdministratorAdd) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type AdminCredentials. -func (a AdminCredentials) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AdministratorMicrosoftEntraAdd. +func (a AdministratorMicrosoftEntraAdd) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "sourceServerPassword", a.SourceServerPassword) - populate(objectMap, "targetServerPassword", a.TargetServerPassword) + populate(objectMap, "properties", a.Properties) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type AdminCredentials. -func (a *AdminCredentials) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AdministratorMicrosoftEntraAdd. +func (a *AdministratorMicrosoftEntraAdd) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", a, err) @@ -99,11 +133,8 @@ func (a *AdminCredentials) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "sourceServerPassword": - err = unpopulate(val, "SourceServerPassword", &a.SourceServerPassword) - delete(rawMsg, key) - case "targetServerPassword": - err = unpopulate(val, "TargetServerPassword", &a.TargetServerPassword) + case "properties": + err = unpopulate(val, "Properties", &a.Properties) delete(rawMsg, key) } if err != nil { @@ -113,16 +144,16 @@ func (a *AdminCredentials) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type AdministratorListResult. -func (a AdministratorListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AdministratorMicrosoftEntraList. +func (a AdministratorMicrosoftEntraList) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "nextLink", a.NextLink) populate(objectMap, "value", a.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type AdministratorListResult. -func (a *AdministratorListResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AdministratorMicrosoftEntraList. +func (a *AdministratorMicrosoftEntraList) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", a, err) @@ -144,8 +175,8 @@ func (a *AdministratorListResult) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type AdministratorProperties. -func (a AdministratorProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AdministratorMicrosoftEntraProperties. +func (a AdministratorMicrosoftEntraProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "objectId", a.ObjectID) populate(objectMap, "principalName", a.PrincipalName) @@ -154,8 +185,8 @@ func (a AdministratorProperties) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type AdministratorProperties. -func (a *AdministratorProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AdministratorMicrosoftEntraProperties. +func (a *AdministratorMicrosoftEntraProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", a, err) @@ -183,8 +214,8 @@ func (a *AdministratorProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type AdministratorPropertiesForAdd. -func (a AdministratorPropertiesForAdd) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AdministratorMicrosoftEntraPropertiesForAdd. +func (a AdministratorMicrosoftEntraPropertiesForAdd) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "principalName", a.PrincipalName) populate(objectMap, "principalType", a.PrincipalType) @@ -192,8 +223,8 @@ func (a AdministratorPropertiesForAdd) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type AdministratorPropertiesForAdd. -func (a *AdministratorPropertiesForAdd) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AdministratorMicrosoftEntraPropertiesForAdd. +func (a *AdministratorMicrosoftEntraPropertiesForAdd) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", a, err) @@ -218,17 +249,16 @@ func (a *AdministratorPropertiesForAdd) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type AuthConfig. -func (a AuthConfig) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AdvancedThreatProtectionSettingsList. +func (a AdvancedThreatProtectionSettingsList) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "activeDirectoryAuth", a.ActiveDirectoryAuth) - populate(objectMap, "passwordAuth", a.PasswordAuth) - populate(objectMap, "tenantId", a.TenantID) + populate(objectMap, "nextLink", a.NextLink) + populate(objectMap, "value", a.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type AuthConfig. -func (a *AuthConfig) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AdvancedThreatProtectionSettingsList. +func (a *AdvancedThreatProtectionSettingsList) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", a, err) @@ -236,14 +266,11 @@ func (a *AuthConfig) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "activeDirectoryAuth": - err = unpopulate(val, "ActiveDirectoryAuth", &a.ActiveDirectoryAuth) - delete(rawMsg, key) - case "passwordAuth": - err = unpopulate(val, "PasswordAuth", &a.PasswordAuth) + case "nextLink": + err = unpopulate(val, "NextLink", &a.NextLink) delete(rawMsg, key) - case "tenantId": - err = unpopulate(val, "TenantID", &a.TenantID) + case "value": + err = unpopulate(val, "Value", &a.Value) delete(rawMsg, key) } if err != nil { @@ -253,1627 +280,1603 @@ func (a *AuthConfig) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type Backup. -func (b Backup) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AdvancedThreatProtectionSettingsModel. +func (a AdvancedThreatProtectionSettingsModel) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "backupRetentionDays", b.BackupRetentionDays) - populateDateTimeRFC3339(objectMap, "earliestRestoreDate", b.EarliestRestoreDate) - populate(objectMap, "geoRedundantBackup", b.GeoRedundantBackup) + populate(objectMap, "id", a.ID) + populate(objectMap, "name", a.Name) + populate(objectMap, "properties", a.Properties) + populate(objectMap, "systemData", a.SystemData) + populate(objectMap, "type", a.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type Backup. -func (b *Backup) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AdvancedThreatProtectionSettingsModel. +func (a *AdvancedThreatProtectionSettingsModel) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } for key, val := range rawMsg { var err error switch key { - case "backupRetentionDays": - err = unpopulate(val, "BackupRetentionDays", &b.BackupRetentionDays) + case "id": + err = unpopulate(val, "ID", &a.ID) delete(rawMsg, key) - case "earliestRestoreDate": - err = unpopulateDateTimeRFC3339(val, "EarliestRestoreDate", &b.EarliestRestoreDate) + case "name": + err = unpopulate(val, "Name", &a.Name) delete(rawMsg, key) - case "geoRedundantBackup": - err = unpopulate(val, "GeoRedundantBackup", &b.GeoRedundantBackup) + case "properties": + err = unpopulate(val, "Properties", &a.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &a.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &a.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type BackupSettings. -func (b BackupSettings) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AdvancedThreatProtectionSettingsProperties. +func (a AdvancedThreatProtectionSettingsProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "backupName", b.BackupName) + populateDateTimeRFC3339(objectMap, "creationTime", a.CreationTime) + populate(objectMap, "state", a.State) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type BackupSettings. -func (b *BackupSettings) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AdvancedThreatProtectionSettingsProperties. +func (a *AdvancedThreatProtectionSettingsProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } for key, val := range rawMsg { var err error switch key { - case "backupName": - err = unpopulate(val, "BackupName", &b.BackupName) + case "creationTime": + err = unpopulateDateTimeRFC3339(val, "CreationTime", &a.CreationTime) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &a.State) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type BackupStoreDetails. -func (b BackupStoreDetails) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AuthConfig. +func (a AuthConfig) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "sasUriList", b.SasURIList) + populate(objectMap, "activeDirectoryAuth", a.ActiveDirectoryAuth) + populate(objectMap, "passwordAuth", a.PasswordAuth) + populate(objectMap, "tenantId", a.TenantID) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type BackupStoreDetails. -func (b *BackupStoreDetails) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AuthConfig. +func (a *AuthConfig) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } for key, val := range rawMsg { var err error switch key { - case "sasUriList": - err = unpopulate(val, "SasURIList", &b.SasURIList) + case "activeDirectoryAuth": + err = unpopulate(val, "ActiveDirectoryAuth", &a.ActiveDirectoryAuth) + delete(rawMsg, key) + case "passwordAuth": + err = unpopulate(val, "PasswordAuth", &a.PasswordAuth) + delete(rawMsg, key) + case "tenantId": + err = unpopulate(val, "TenantID", &a.TenantID) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type CapabilitiesListResult. -func (c CapabilitiesListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AuthConfigForPatch. +func (a AuthConfigForPatch) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", c.NextLink) - populate(objectMap, "value", c.Value) + populate(objectMap, "activeDirectoryAuth", a.ActiveDirectoryAuth) + populate(objectMap, "passwordAuth", a.PasswordAuth) + populate(objectMap, "tenantId", a.TenantID) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type CapabilitiesListResult. -func (c *CapabilitiesListResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AuthConfigForPatch. +func (a *AuthConfigForPatch) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &c.NextLink) + case "activeDirectoryAuth": + err = unpopulate(val, "ActiveDirectoryAuth", &a.ActiveDirectoryAuth) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &c.Value) + case "passwordAuth": + err = unpopulate(val, "PasswordAuth", &a.PasswordAuth) + delete(rawMsg, key) + case "tenantId": + err = unpopulate(val, "TenantID", &a.TenantID) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type CheckNameAvailabilityRequest. -func (c CheckNameAvailabilityRequest) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type Backup. +func (b Backup) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "name", c.Name) - populate(objectMap, "type", c.Type) + populate(objectMap, "backupRetentionDays", b.BackupRetentionDays) + populateDateTimeRFC3339(objectMap, "earliestRestoreDate", b.EarliestRestoreDate) + populate(objectMap, "geoRedundantBackup", b.GeoRedundantBackup) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type CheckNameAvailabilityRequest. -func (c *CheckNameAvailabilityRequest) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type Backup. +func (b *Backup) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", b, err) } for key, val := range rawMsg { var err error switch key { - case "name": - err = unpopulate(val, "Name", &c.Name) + case "backupRetentionDays": + err = unpopulate(val, "BackupRetentionDays", &b.BackupRetentionDays) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &c.Type) + case "earliestRestoreDate": + err = unpopulateDateTimeRFC3339(val, "EarliestRestoreDate", &b.EarliestRestoreDate) + delete(rawMsg, key) + case "geoRedundantBackup": + err = unpopulate(val, "GeoRedundantBackup", &b.GeoRedundantBackup) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", b, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type Cluster. -func (c Cluster) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type BackupAutomaticAndOnDemand. +func (b BackupAutomaticAndOnDemand) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "clusterSize", c.ClusterSize) + populate(objectMap, "id", b.ID) + populate(objectMap, "name", b.Name) + populate(objectMap, "properties", b.Properties) + populate(objectMap, "systemData", b.SystemData) + populate(objectMap, "type", b.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type Cluster. -func (c *Cluster) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type BackupAutomaticAndOnDemand. +func (b *BackupAutomaticAndOnDemand) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", b, err) } for key, val := range rawMsg { var err error switch key { - case "clusterSize": - err = unpopulate(val, "ClusterSize", &c.ClusterSize) + case "id": + err = unpopulate(val, "ID", &b.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &b.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &b.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &b.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &b.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", b, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ConfigTuningRequestParameter. -func (c ConfigTuningRequestParameter) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type BackupAutomaticAndOnDemandList. +func (b BackupAutomaticAndOnDemandList) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "allowServerRestarts", c.AllowServerRestarts) - populate(objectMap, "configTuningUsageMode", c.ConfigTuningUsageMode) - populate(objectMap, "serverName", c.ServerName) - populate(objectMap, "targetImprovementMetric", c.TargetImprovementMetric) + populate(objectMap, "nextLink", b.NextLink) + populate(objectMap, "value", b.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ConfigTuningRequestParameter. -func (c *ConfigTuningRequestParameter) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type BackupAutomaticAndOnDemandList. +func (b *BackupAutomaticAndOnDemandList) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", b, err) } for key, val := range rawMsg { var err error switch key { - case "allowServerRestarts": - err = unpopulate(val, "AllowServerRestarts", &c.AllowServerRestarts) - delete(rawMsg, key) - case "configTuningUsageMode": - err = unpopulate(val, "ConfigTuningUsageMode", &c.ConfigTuningUsageMode) - delete(rawMsg, key) - case "serverName": - err = unpopulate(val, "ServerName", &c.ServerName) + case "nextLink": + err = unpopulate(val, "NextLink", &b.NextLink) delete(rawMsg, key) - case "targetImprovementMetric": - err = unpopulate(val, "TargetImprovementMetric", &c.TargetImprovementMetric) + case "value": + err = unpopulate(val, "Value", &b.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", b, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type Configuration. -func (c Configuration) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type BackupAutomaticAndOnDemandProperties. +func (b BackupAutomaticAndOnDemandProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", c.ID) - populate(objectMap, "name", c.Name) - populate(objectMap, "properties", c.Properties) - populate(objectMap, "systemData", c.SystemData) - populate(objectMap, "type", c.Type) + populate(objectMap, "backupType", b.BackupType) + populateDateTimeRFC3339(objectMap, "completedTime", b.CompletedTime) + populate(objectMap, "source", b.Source) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type Configuration. -func (c *Configuration) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type BackupAutomaticAndOnDemandProperties. +func (b *BackupAutomaticAndOnDemandProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", b, err) } for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &c.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &c.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &c.Properties) + case "backupType": + err = unpopulate(val, "BackupType", &b.BackupType) delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &c.SystemData) + case "completedTime": + err = unpopulateDateTimeRFC3339(val, "CompletedTime", &b.CompletedTime) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &c.Type) + case "source": + err = unpopulate(val, "Source", &b.Source) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", b, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ConfigurationForUpdate. -func (c ConfigurationForUpdate) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type BackupForPatch. +func (b BackupForPatch) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "properties", c.Properties) + populate(objectMap, "backupRetentionDays", b.BackupRetentionDays) + populateDateTimeRFC3339(objectMap, "earliestRestoreDate", b.EarliestRestoreDate) + populate(objectMap, "geoRedundantBackup", b.GeoRedundantBackup) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ConfigurationForUpdate. -func (c *ConfigurationForUpdate) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type BackupForPatch. +func (b *BackupForPatch) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", b, err) } for key, val := range rawMsg { var err error switch key { - case "properties": - err = unpopulate(val, "Properties", &c.Properties) + case "backupRetentionDays": + err = unpopulate(val, "BackupRetentionDays", &b.BackupRetentionDays) + delete(rawMsg, key) + case "earliestRestoreDate": + err = unpopulateDateTimeRFC3339(val, "EarliestRestoreDate", &b.EarliestRestoreDate) + delete(rawMsg, key) + case "geoRedundantBackup": + err = unpopulate(val, "GeoRedundantBackup", &b.GeoRedundantBackup) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", b, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ConfigurationListResult. -func (c ConfigurationListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type BackupSettings. +func (b BackupSettings) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", c.NextLink) - populate(objectMap, "value", c.Value) + populate(objectMap, "backupName", b.BackupName) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ConfigurationListResult. -func (c *ConfigurationListResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type BackupSettings. +func (b *BackupSettings) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", b, err) } for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &c.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &c.Value) + case "backupName": + err = unpopulate(val, "BackupName", &b.BackupName) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", b, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ConfigurationProperties. -func (c ConfigurationProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type BackupStoreDetails. +func (b BackupStoreDetails) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "allowedValues", c.AllowedValues) - populate(objectMap, "dataType", c.DataType) - populate(objectMap, "defaultValue", c.DefaultValue) - populate(objectMap, "description", c.Description) - populate(objectMap, "documentationLink", c.DocumentationLink) - populate(objectMap, "isConfigPendingRestart", c.IsConfigPendingRestart) - populate(objectMap, "isDynamicConfig", c.IsDynamicConfig) - populate(objectMap, "isReadOnly", c.IsReadOnly) - populate(objectMap, "source", c.Source) - populate(objectMap, "unit", c.Unit) - populate(objectMap, "value", c.Value) + populate(objectMap, "sasUriList", b.SasURIList) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ConfigurationProperties. -func (c *ConfigurationProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type BackupStoreDetails. +func (b *BackupStoreDetails) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", b, err) } for key, val := range rawMsg { var err error switch key { - case "allowedValues": - err = unpopulate(val, "AllowedValues", &c.AllowedValues) - delete(rawMsg, key) - case "dataType": - err = unpopulate(val, "DataType", &c.DataType) - delete(rawMsg, key) - case "defaultValue": - err = unpopulate(val, "DefaultValue", &c.DefaultValue) - delete(rawMsg, key) - case "description": - err = unpopulate(val, "Description", &c.Description) - delete(rawMsg, key) - case "documentationLink": - err = unpopulate(val, "DocumentationLink", &c.DocumentationLink) - delete(rawMsg, key) - case "isConfigPendingRestart": - err = unpopulate(val, "IsConfigPendingRestart", &c.IsConfigPendingRestart) - delete(rawMsg, key) - case "isDynamicConfig": - err = unpopulate(val, "IsDynamicConfig", &c.IsDynamicConfig) - delete(rawMsg, key) - case "isReadOnly": - err = unpopulate(val, "IsReadOnly", &c.IsReadOnly) - delete(rawMsg, key) - case "source": - err = unpopulate(val, "Source", &c.Source) - delete(rawMsg, key) - case "unit": - err = unpopulate(val, "Unit", &c.Unit) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &c.Value) + case "sasUriList": + err = unpopulate(val, "SasURIList", &b.SasURIList) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", b, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type DataEncryption. -func (d DataEncryption) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type BackupsLongTermRetentionOperation. +func (b BackupsLongTermRetentionOperation) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "geoBackupEncryptionKeyStatus", d.GeoBackupEncryptionKeyStatus) - populate(objectMap, "geoBackupKeyURI", d.GeoBackupKeyURI) - populate(objectMap, "geoBackupUserAssignedIdentityId", d.GeoBackupUserAssignedIdentityID) - populate(objectMap, "primaryEncryptionKeyStatus", d.PrimaryEncryptionKeyStatus) - populate(objectMap, "primaryKeyURI", d.PrimaryKeyURI) - populate(objectMap, "primaryUserAssignedIdentityId", d.PrimaryUserAssignedIdentityID) - populate(objectMap, "type", d.Type) + populate(objectMap, "id", b.ID) + populate(objectMap, "name", b.Name) + populate(objectMap, "properties", b.Properties) + populate(objectMap, "systemData", b.SystemData) + populate(objectMap, "type", b.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DataEncryption. -func (d *DataEncryption) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type BackupsLongTermRetentionOperation. +func (b *BackupsLongTermRetentionOperation) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", b, err) } for key, val := range rawMsg { var err error switch key { - case "geoBackupEncryptionKeyStatus": - err = unpopulate(val, "GeoBackupEncryptionKeyStatus", &d.GeoBackupEncryptionKeyStatus) - delete(rawMsg, key) - case "geoBackupKeyURI": - err = unpopulate(val, "GeoBackupKeyURI", &d.GeoBackupKeyURI) - delete(rawMsg, key) - case "geoBackupUserAssignedIdentityId": - err = unpopulate(val, "GeoBackupUserAssignedIdentityID", &d.GeoBackupUserAssignedIdentityID) + case "id": + err = unpopulate(val, "ID", &b.ID) delete(rawMsg, key) - case "primaryEncryptionKeyStatus": - err = unpopulate(val, "PrimaryEncryptionKeyStatus", &d.PrimaryEncryptionKeyStatus) + case "name": + err = unpopulate(val, "Name", &b.Name) delete(rawMsg, key) - case "primaryKeyURI": - err = unpopulate(val, "PrimaryKeyURI", &d.PrimaryKeyURI) + case "properties": + err = unpopulate(val, "Properties", &b.Properties) delete(rawMsg, key) - case "primaryUserAssignedIdentityId": - err = unpopulate(val, "PrimaryUserAssignedIdentityID", &d.PrimaryUserAssignedIdentityID) + case "systemData": + err = unpopulate(val, "SystemData", &b.SystemData) delete(rawMsg, key) case "type": - err = unpopulate(val, "Type", &d.Type) + err = unpopulate(val, "Type", &b.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", b, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type Database. -func (d Database) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type BackupsLongTermRetentionRequest. +func (b BackupsLongTermRetentionRequest) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", d.ID) - populate(objectMap, "name", d.Name) - populate(objectMap, "properties", d.Properties) - populate(objectMap, "systemData", d.SystemData) - populate(objectMap, "type", d.Type) + populate(objectMap, "backupSettings", b.BackupSettings) + populate(objectMap, "targetDetails", b.TargetDetails) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type Database. -func (d *Database) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type BackupsLongTermRetentionRequest. +func (b *BackupsLongTermRetentionRequest) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", b, err) } for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &d.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &d.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &d.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &d.SystemData) + case "backupSettings": + err = unpopulate(val, "BackupSettings", &b.BackupSettings) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &d.Type) + case "targetDetails": + err = unpopulate(val, "TargetDetails", &b.TargetDetails) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", b, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type DatabaseListResult. -func (d DatabaseListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type BackupsLongTermRetentionResponse. +func (b BackupsLongTermRetentionResponse) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", d.NextLink) - populate(objectMap, "value", d.Value) + populate(objectMap, "properties", b.Properties) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseListResult. -func (d *DatabaseListResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type BackupsLongTermRetentionResponse. +func (b *BackupsLongTermRetentionResponse) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", b, err) } for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &d.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &d.Value) + case "properties": + err = unpopulate(val, "Properties", &b.Properties) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", b, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type DatabaseProperties. -func (d DatabaseProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type BackupsLongTermRetentionResponseProperties. +func (b BackupsLongTermRetentionResponseProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "charset", d.Charset) - populate(objectMap, "collation", d.Collation) + populate(objectMap, "numberOfContainers", b.NumberOfContainers) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseProperties. -func (d *DatabaseProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type BackupsLongTermRetentionResponseProperties. +func (b *BackupsLongTermRetentionResponseProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", b, err) } for key, val := range rawMsg { var err error switch key { - case "charset": - err = unpopulate(val, "Charset", &d.Charset) - delete(rawMsg, key) - case "collation": - err = unpopulate(val, "Collation", &d.Collation) + case "numberOfContainers": + err = unpopulate(val, "NumberOfContainers", &b.NumberOfContainers) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", b, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type DbLevelValidationStatus. -func (d DbLevelValidationStatus) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type Capability. +func (c Capability) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "databaseName", d.DatabaseName) - populateDateTimeRFC3339(objectMap, "endedOn", d.EndedOn) - populateDateTimeRFC3339(objectMap, "startedOn", d.StartedOn) - populate(objectMap, "summary", d.Summary) + populate(objectMap, "fastProvisioningSupported", c.FastProvisioningSupported) + populate(objectMap, "geoBackupSupported", c.GeoBackupSupported) + populate(objectMap, "name", c.Name) + populate(objectMap, "onlineResizeSupported", c.OnlineResizeSupported) + populate(objectMap, "reason", c.Reason) + populate(objectMap, "restricted", c.Restricted) + populate(objectMap, "status", c.Status) + populate(objectMap, "storageAutoGrowthSupported", c.StorageAutoGrowthSupported) + populate(objectMap, "supportedFastProvisioningEditions", c.SupportedFastProvisioningEditions) + populate(objectMap, "supportedFeatures", c.SupportedFeatures) + populate(objectMap, "supportedServerEditions", c.SupportedServerEditions) + populate(objectMap, "supportedServerVersions", c.SupportedServerVersions) + populate(objectMap, "zoneRedundantHaAndGeoBackupSupported", c.ZoneRedundantHaAndGeoBackupSupported) + populate(objectMap, "zoneRedundantHaSupported", c.ZoneRedundantHaSupported) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DbLevelValidationStatus. -func (d *DbLevelValidationStatus) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type Capability. +func (c *Capability) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } for key, val := range rawMsg { var err error switch key { - case "databaseName": - err = unpopulate(val, "DatabaseName", &d.DatabaseName) + case "fastProvisioningSupported": + err = unpopulate(val, "FastProvisioningSupported", &c.FastProvisioningSupported) delete(rawMsg, key) - case "endedOn": - err = unpopulateDateTimeRFC3339(val, "EndedOn", &d.EndedOn) + case "geoBackupSupported": + err = unpopulate(val, "GeoBackupSupported", &c.GeoBackupSupported) delete(rawMsg, key) - case "startedOn": - err = unpopulateDateTimeRFC3339(val, "StartedOn", &d.StartedOn) + case "name": + err = unpopulate(val, "Name", &c.Name) delete(rawMsg, key) - case "summary": - err = unpopulate(val, "Summary", &d.Summary) + case "onlineResizeSupported": + err = unpopulate(val, "OnlineResizeSupported", &c.OnlineResizeSupported) + delete(rawMsg, key) + case "reason": + err = unpopulate(val, "Reason", &c.Reason) + delete(rawMsg, key) + case "restricted": + err = unpopulate(val, "Restricted", &c.Restricted) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &c.Status) + delete(rawMsg, key) + case "storageAutoGrowthSupported": + err = unpopulate(val, "StorageAutoGrowthSupported", &c.StorageAutoGrowthSupported) + delete(rawMsg, key) + case "supportedFastProvisioningEditions": + err = unpopulate(val, "SupportedFastProvisioningEditions", &c.SupportedFastProvisioningEditions) + delete(rawMsg, key) + case "supportedFeatures": + err = unpopulate(val, "SupportedFeatures", &c.SupportedFeatures) + delete(rawMsg, key) + case "supportedServerEditions": + err = unpopulate(val, "SupportedServerEditions", &c.SupportedServerEditions) + delete(rawMsg, key) + case "supportedServerVersions": + err = unpopulate(val, "SupportedServerVersions", &c.SupportedServerVersions) + delete(rawMsg, key) + case "zoneRedundantHaAndGeoBackupSupported": + err = unpopulate(val, "ZoneRedundantHaAndGeoBackupSupported", &c.ZoneRedundantHaAndGeoBackupSupported) + delete(rawMsg, key) + case "zoneRedundantHaSupported": + err = unpopulate(val, "ZoneRedundantHaSupported", &c.ZoneRedundantHaSupported) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type DbMigrationStatus. -func (d DbMigrationStatus) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type CapabilityList. +func (c CapabilityList) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "appliedChanges", d.AppliedChanges) - populate(objectMap, "cdcDeleteCounter", d.CdcDeleteCounter) - populate(objectMap, "cdcInsertCounter", d.CdcInsertCounter) - populate(objectMap, "cdcUpdateCounter", d.CdcUpdateCounter) - populate(objectMap, "databaseName", d.DatabaseName) - populateDateTimeRFC3339(objectMap, "endedOn", d.EndedOn) - populate(objectMap, "fullLoadCompletedTables", d.FullLoadCompletedTables) - populate(objectMap, "fullLoadErroredTables", d.FullLoadErroredTables) - populate(objectMap, "fullLoadLoadingTables", d.FullLoadLoadingTables) - populate(objectMap, "fullLoadQueuedTables", d.FullLoadQueuedTables) - populate(objectMap, "incomingChanges", d.IncomingChanges) - populate(objectMap, "latency", d.Latency) - populate(objectMap, "message", d.Message) - populate(objectMap, "migrationOperation", d.MigrationOperation) - populate(objectMap, "migrationState", d.MigrationState) - populateDateTimeRFC3339(objectMap, "startedOn", d.StartedOn) + populate(objectMap, "nextLink", c.NextLink) + populate(objectMap, "value", c.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DbMigrationStatus. -func (d *DbMigrationStatus) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type CapabilityList. +func (c *CapabilityList) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } for key, val := range rawMsg { var err error switch key { - case "appliedChanges": - err = unpopulate(val, "AppliedChanges", &d.AppliedChanges) - delete(rawMsg, key) - case "cdcDeleteCounter": - err = unpopulate(val, "CdcDeleteCounter", &d.CdcDeleteCounter) - delete(rawMsg, key) - case "cdcInsertCounter": - err = unpopulate(val, "CdcInsertCounter", &d.CdcInsertCounter) - delete(rawMsg, key) - case "cdcUpdateCounter": - err = unpopulate(val, "CdcUpdateCounter", &d.CdcUpdateCounter) - delete(rawMsg, key) - case "databaseName": - err = unpopulate(val, "DatabaseName", &d.DatabaseName) - delete(rawMsg, key) - case "endedOn": - err = unpopulateDateTimeRFC3339(val, "EndedOn", &d.EndedOn) - delete(rawMsg, key) - case "fullLoadCompletedTables": - err = unpopulate(val, "FullLoadCompletedTables", &d.FullLoadCompletedTables) - delete(rawMsg, key) - case "fullLoadErroredTables": - err = unpopulate(val, "FullLoadErroredTables", &d.FullLoadErroredTables) - delete(rawMsg, key) - case "fullLoadLoadingTables": - err = unpopulate(val, "FullLoadLoadingTables", &d.FullLoadLoadingTables) - delete(rawMsg, key) - case "fullLoadQueuedTables": - err = unpopulate(val, "FullLoadQueuedTables", &d.FullLoadQueuedTables) - delete(rawMsg, key) - case "incomingChanges": - err = unpopulate(val, "IncomingChanges", &d.IncomingChanges) - delete(rawMsg, key) - case "latency": - err = unpopulate(val, "Latency", &d.Latency) - delete(rawMsg, key) - case "message": - err = unpopulate(val, "Message", &d.Message) - delete(rawMsg, key) - case "migrationOperation": - err = unpopulate(val, "MigrationOperation", &d.MigrationOperation) - delete(rawMsg, key) - case "migrationState": - err = unpopulate(val, "MigrationState", &d.MigrationState) + case "nextLink": + err = unpopulate(val, "NextLink", &c.NextLink) delete(rawMsg, key) - case "startedOn": - err = unpopulateDateTimeRFC3339(val, "StartedOn", &d.StartedOn) + case "value": + err = unpopulate(val, "Value", &c.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type DbServerMetadata. -func (d DbServerMetadata) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type CapturedLog. +func (c CapturedLog) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "location", d.Location) - populate(objectMap, "sku", d.SKU) - populate(objectMap, "storageMb", d.StorageMb) - populate(objectMap, "version", d.Version) + populate(objectMap, "id", c.ID) + populate(objectMap, "name", c.Name) + populate(objectMap, "properties", c.Properties) + populate(objectMap, "systemData", c.SystemData) + populate(objectMap, "type", c.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DbServerMetadata. -func (d *DbServerMetadata) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type CapturedLog. +func (c *CapturedLog) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } for key, val := range rawMsg { var err error switch key { - case "location": - err = unpopulate(val, "Location", &d.Location) + case "id": + err = unpopulate(val, "ID", &c.ID) delete(rawMsg, key) - case "sku": - err = unpopulate(val, "SKU", &d.SKU) + case "name": + err = unpopulate(val, "Name", &c.Name) delete(rawMsg, key) - case "storageMb": - err = unpopulate(val, "StorageMb", &d.StorageMb) + case "properties": + err = unpopulate(val, "Properties", &c.Properties) delete(rawMsg, key) - case "version": - err = unpopulate(val, "Version", &d.Version) + case "systemData": + err = unpopulate(val, "SystemData", &c.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &c.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type DelegatedSubnetUsage. -func (d DelegatedSubnetUsage) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type CapturedLogList. +func (c CapturedLogList) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "subnetName", d.SubnetName) - populate(objectMap, "usage", d.Usage) + populate(objectMap, "nextLink", c.NextLink) + populate(objectMap, "value", c.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DelegatedSubnetUsage. -func (d *DelegatedSubnetUsage) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type CapturedLogList. +func (c *CapturedLogList) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } for key, val := range rawMsg { var err error switch key { - case "subnetName": - err = unpopulate(val, "SubnetName", &d.SubnetName) + case "nextLink": + err = unpopulate(val, "NextLink", &c.NextLink) delete(rawMsg, key) - case "usage": - err = unpopulate(val, "Usage", &d.Usage) + case "value": + err = unpopulate(val, "Value", &c.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type FastProvisioningEditionCapability. -func (f FastProvisioningEditionCapability) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type CapturedLogProperties. +func (c CapturedLogProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "reason", f.Reason) - populate(objectMap, "serverCount", f.ServerCount) - populate(objectMap, "status", f.Status) - populate(objectMap, "supportedSku", f.SupportedSKU) - populate(objectMap, "supportedServerVersions", f.SupportedServerVersions) - populate(objectMap, "supportedStorageGb", f.SupportedStorageGb) - populate(objectMap, "supportedTier", f.SupportedTier) + populateDateTimeRFC3339(objectMap, "createdTime", c.CreatedTime) + populateDateTimeRFC3339(objectMap, "lastModifiedTime", c.LastModifiedTime) + populate(objectMap, "sizeInKb", c.SizeInKb) + populate(objectMap, "type", c.Type) + populate(objectMap, "url", c.URL) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type FastProvisioningEditionCapability. -func (f *FastProvisioningEditionCapability) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type CapturedLogProperties. +func (c *CapturedLogProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } for key, val := range rawMsg { var err error switch key { - case "reason": - err = unpopulate(val, "Reason", &f.Reason) - delete(rawMsg, key) - case "serverCount": - err = unpopulate(val, "ServerCount", &f.ServerCount) - delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &f.Status) + case "createdTime": + err = unpopulateDateTimeRFC3339(val, "CreatedTime", &c.CreatedTime) delete(rawMsg, key) - case "supportedSku": - err = unpopulate(val, "SupportedSKU", &f.SupportedSKU) + case "lastModifiedTime": + err = unpopulateDateTimeRFC3339(val, "LastModifiedTime", &c.LastModifiedTime) delete(rawMsg, key) - case "supportedServerVersions": - err = unpopulate(val, "SupportedServerVersions", &f.SupportedServerVersions) + case "sizeInKb": + err = unpopulate(val, "SizeInKb", &c.SizeInKb) delete(rawMsg, key) - case "supportedStorageGb": - err = unpopulate(val, "SupportedStorageGb", &f.SupportedStorageGb) + case "type": + err = unpopulate(val, "Type", &c.Type) delete(rawMsg, key) - case "supportedTier": - err = unpopulate(val, "SupportedTier", &f.SupportedTier) + case "url": + err = unpopulate(val, "URL", &c.URL) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type FirewallRule. -func (f FirewallRule) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type CheckNameAvailabilityRequest. +func (c CheckNameAvailabilityRequest) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", f.ID) - populate(objectMap, "name", f.Name) - populate(objectMap, "properties", f.Properties) - populate(objectMap, "systemData", f.SystemData) - populate(objectMap, "type", f.Type) + populate(objectMap, "name", c.Name) + populate(objectMap, "type", c.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type FirewallRule. -func (f *FirewallRule) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type CheckNameAvailabilityRequest. +func (c *CheckNameAvailabilityRequest) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &f.ID) - delete(rawMsg, key) case "name": - err = unpopulate(val, "Name", &f.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &f.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &f.SystemData) + err = unpopulate(val, "Name", &c.Name) delete(rawMsg, key) case "type": - err = unpopulate(val, "Type", &f.Type) + err = unpopulate(val, "Type", &c.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type FirewallRuleListResult. -func (f FirewallRuleListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type Cluster. +func (c Cluster) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", f.NextLink) - populate(objectMap, "value", f.Value) + populate(objectMap, "clusterSize", c.ClusterSize) + populate(objectMap, "defaultDatabaseName", c.DefaultDatabaseName) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type FirewallRuleListResult. -func (f *FirewallRuleListResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type Cluster. +func (c *Cluster) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &f.NextLink) + case "clusterSize": + err = unpopulate(val, "ClusterSize", &c.ClusterSize) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &f.Value) + case "defaultDatabaseName": + err = unpopulate(val, "DefaultDatabaseName", &c.DefaultDatabaseName) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type FirewallRuleProperties. -func (f FirewallRuleProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type Configuration. +func (c Configuration) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "endIpAddress", f.EndIPAddress) - populate(objectMap, "startIpAddress", f.StartIPAddress) + populate(objectMap, "id", c.ID) + populate(objectMap, "name", c.Name) + populate(objectMap, "properties", c.Properties) + populate(objectMap, "systemData", c.SystemData) + populate(objectMap, "type", c.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type FirewallRuleProperties. -func (f *FirewallRuleProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type Configuration. +func (c *Configuration) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } for key, val := range rawMsg { var err error switch key { - case "endIpAddress": - err = unpopulate(val, "EndIPAddress", &f.EndIPAddress) + case "id": + err = unpopulate(val, "ID", &c.ID) delete(rawMsg, key) - case "startIpAddress": - err = unpopulate(val, "StartIPAddress", &f.StartIPAddress) + case "name": + err = unpopulate(val, "Name", &c.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &c.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &c.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &c.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type FlexibleServerCapability. -func (f FlexibleServerCapability) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ConfigurationForUpdate. +func (c ConfigurationForUpdate) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "fastProvisioningSupported", f.FastProvisioningSupported) - populate(objectMap, "geoBackupSupported", f.GeoBackupSupported) - populate(objectMap, "name", f.Name) - populate(objectMap, "onlineResizeSupported", f.OnlineResizeSupported) - populate(objectMap, "reason", f.Reason) - populate(objectMap, "restricted", f.Restricted) - populate(objectMap, "status", f.Status) - populate(objectMap, "storageAutoGrowthSupported", f.StorageAutoGrowthSupported) - populate(objectMap, "supportedFastProvisioningEditions", f.SupportedFastProvisioningEditions) - populate(objectMap, "supportedFeatures", f.SupportedFeatures) - populate(objectMap, "supportedServerEditions", f.SupportedServerEditions) - populate(objectMap, "supportedServerVersions", f.SupportedServerVersions) - populate(objectMap, "zoneRedundantHaAndGeoBackupSupported", f.ZoneRedundantHaAndGeoBackupSupported) - populate(objectMap, "zoneRedundantHaSupported", f.ZoneRedundantHaSupported) + populate(objectMap, "properties", c.Properties) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type FlexibleServerCapability. -func (f *FlexibleServerCapability) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ConfigurationForUpdate. +func (c *ConfigurationForUpdate) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } for key, val := range rawMsg { var err error switch key { - case "fastProvisioningSupported": - err = unpopulate(val, "FastProvisioningSupported", &f.FastProvisioningSupported) - delete(rawMsg, key) - case "geoBackupSupported": - err = unpopulate(val, "GeoBackupSupported", &f.GeoBackupSupported) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &f.Name) - delete(rawMsg, key) - case "onlineResizeSupported": - err = unpopulate(val, "OnlineResizeSupported", &f.OnlineResizeSupported) - delete(rawMsg, key) - case "reason": - err = unpopulate(val, "Reason", &f.Reason) - delete(rawMsg, key) - case "restricted": - err = unpopulate(val, "Restricted", &f.Restricted) - delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &f.Status) - delete(rawMsg, key) - case "storageAutoGrowthSupported": - err = unpopulate(val, "StorageAutoGrowthSupported", &f.StorageAutoGrowthSupported) - delete(rawMsg, key) - case "supportedFastProvisioningEditions": - err = unpopulate(val, "SupportedFastProvisioningEditions", &f.SupportedFastProvisioningEditions) - delete(rawMsg, key) - case "supportedFeatures": - err = unpopulate(val, "SupportedFeatures", &f.SupportedFeatures) - delete(rawMsg, key) - case "supportedServerEditions": - err = unpopulate(val, "SupportedServerEditions", &f.SupportedServerEditions) - delete(rawMsg, key) - case "supportedServerVersions": - err = unpopulate(val, "SupportedServerVersions", &f.SupportedServerVersions) - delete(rawMsg, key) - case "zoneRedundantHaAndGeoBackupSupported": - err = unpopulate(val, "ZoneRedundantHaAndGeoBackupSupported", &f.ZoneRedundantHaAndGeoBackupSupported) - delete(rawMsg, key) - case "zoneRedundantHaSupported": - err = unpopulate(val, "ZoneRedundantHaSupported", &f.ZoneRedundantHaSupported) + case "properties": + err = unpopulate(val, "Properties", &c.Properties) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type FlexibleServerEditionCapability. -func (f FlexibleServerEditionCapability) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ConfigurationList. +func (c ConfigurationList) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "defaultSkuName", f.DefaultSKUName) - populate(objectMap, "name", f.Name) - populate(objectMap, "reason", f.Reason) - populate(objectMap, "status", f.Status) - populate(objectMap, "supportedServerSkus", f.SupportedServerSKUs) - populate(objectMap, "supportedStorageEditions", f.SupportedStorageEditions) + populate(objectMap, "nextLink", c.NextLink) + populate(objectMap, "value", c.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type FlexibleServerEditionCapability. -func (f *FlexibleServerEditionCapability) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ConfigurationList. +func (c *ConfigurationList) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } for key, val := range rawMsg { var err error switch key { - case "defaultSkuName": - err = unpopulate(val, "DefaultSKUName", &f.DefaultSKUName) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &f.Name) - delete(rawMsg, key) - case "reason": - err = unpopulate(val, "Reason", &f.Reason) - delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &f.Status) - delete(rawMsg, key) - case "supportedServerSkus": - err = unpopulate(val, "SupportedServerSKUs", &f.SupportedServerSKUs) + case "nextLink": + err = unpopulate(val, "NextLink", &c.NextLink) delete(rawMsg, key) - case "supportedStorageEditions": - err = unpopulate(val, "SupportedStorageEditions", &f.SupportedStorageEditions) + case "value": + err = unpopulate(val, "Value", &c.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type HighAvailability. -func (h HighAvailability) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ConfigurationProperties. +func (c ConfigurationProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "mode", h.Mode) - populate(objectMap, "standbyAvailabilityZone", h.StandbyAvailabilityZone) - populate(objectMap, "state", h.State) + populate(objectMap, "allowedValues", c.AllowedValues) + populate(objectMap, "dataType", c.DataType) + populate(objectMap, "defaultValue", c.DefaultValue) + populate(objectMap, "description", c.Description) + populate(objectMap, "documentationLink", c.DocumentationLink) + populate(objectMap, "isConfigPendingRestart", c.IsConfigPendingRestart) + populate(objectMap, "isDynamicConfig", c.IsDynamicConfig) + populate(objectMap, "isReadOnly", c.IsReadOnly) + populate(objectMap, "source", c.Source) + populate(objectMap, "unit", c.Unit) + populate(objectMap, "value", c.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type HighAvailability. -func (h *HighAvailability) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ConfigurationProperties. +func (c *ConfigurationProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", h, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } for key, val := range rawMsg { var err error switch key { - case "mode": - err = unpopulate(val, "Mode", &h.Mode) + case "allowedValues": + err = unpopulate(val, "AllowedValues", &c.AllowedValues) delete(rawMsg, key) - case "standbyAvailabilityZone": - err = unpopulate(val, "StandbyAvailabilityZone", &h.StandbyAvailabilityZone) + case "dataType": + err = unpopulate(val, "DataType", &c.DataType) delete(rawMsg, key) - case "state": - err = unpopulate(val, "State", &h.State) + case "defaultValue": + err = unpopulate(val, "DefaultValue", &c.DefaultValue) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &c.Description) + delete(rawMsg, key) + case "documentationLink": + err = unpopulate(val, "DocumentationLink", &c.DocumentationLink) + delete(rawMsg, key) + case "isConfigPendingRestart": + err = unpopulate(val, "IsConfigPendingRestart", &c.IsConfigPendingRestart) + delete(rawMsg, key) + case "isDynamicConfig": + err = unpopulate(val, "IsDynamicConfig", &c.IsDynamicConfig) + delete(rawMsg, key) + case "isReadOnly": + err = unpopulate(val, "IsReadOnly", &c.IsReadOnly) + delete(rawMsg, key) + case "source": + err = unpopulate(val, "Source", &c.Source) + delete(rawMsg, key) + case "unit": + err = unpopulate(val, "Unit", &c.Unit) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &c.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", h, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ImpactRecord. -func (i ImpactRecord) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DataEncryption. +func (d DataEncryption) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "absoluteValue", i.AbsoluteValue) - populate(objectMap, "dimensionName", i.DimensionName) - populate(objectMap, "queryId", i.QueryID) - populate(objectMap, "unit", i.Unit) + populate(objectMap, "geoBackupEncryptionKeyStatus", d.GeoBackupEncryptionKeyStatus) + populate(objectMap, "geoBackupKeyURI", d.GeoBackupKeyURI) + populate(objectMap, "geoBackupUserAssignedIdentityId", d.GeoBackupUserAssignedIdentityID) + populate(objectMap, "primaryEncryptionKeyStatus", d.PrimaryEncryptionKeyStatus) + populate(objectMap, "primaryKeyURI", d.PrimaryKeyURI) + populate(objectMap, "primaryUserAssignedIdentityId", d.PrimaryUserAssignedIdentityID) + populate(objectMap, "type", d.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ImpactRecord. -func (i *ImpactRecord) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DataEncryption. +func (d *DataEncryption) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "absoluteValue": - err = unpopulate(val, "AbsoluteValue", &i.AbsoluteValue) + case "geoBackupEncryptionKeyStatus": + err = unpopulate(val, "GeoBackupEncryptionKeyStatus", &d.GeoBackupEncryptionKeyStatus) delete(rawMsg, key) - case "dimensionName": - err = unpopulate(val, "DimensionName", &i.DimensionName) + case "geoBackupKeyURI": + err = unpopulate(val, "GeoBackupKeyURI", &d.GeoBackupKeyURI) delete(rawMsg, key) - case "queryId": - err = unpopulate(val, "QueryID", &i.QueryID) + case "geoBackupUserAssignedIdentityId": + err = unpopulate(val, "GeoBackupUserAssignedIdentityID", &d.GeoBackupUserAssignedIdentityID) delete(rawMsg, key) - case "unit": - err = unpopulate(val, "Unit", &i.Unit) + case "primaryEncryptionKeyStatus": + err = unpopulate(val, "PrimaryEncryptionKeyStatus", &d.PrimaryEncryptionKeyStatus) + delete(rawMsg, key) + case "primaryKeyURI": + err = unpopulate(val, "PrimaryKeyURI", &d.PrimaryKeyURI) + delete(rawMsg, key) + case "primaryUserAssignedIdentityId": + err = unpopulate(val, "PrimaryUserAssignedIdentityID", &d.PrimaryUserAssignedIdentityID) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &d.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type IndexRecommendationDetails. -func (i IndexRecommendationDetails) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type Database. +func (d Database) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "databaseName", i.DatabaseName) - populate(objectMap, "includedColumns", i.IncludedColumns) - populate(objectMap, "indexColumns", i.IndexColumns) - populate(objectMap, "indexName", i.IndexName) - populate(objectMap, "indexType", i.IndexType) - populate(objectMap, "schema", i.Schema) - populate(objectMap, "table", i.Table) + populate(objectMap, "id", d.ID) + populate(objectMap, "name", d.Name) + populate(objectMap, "properties", d.Properties) + populate(objectMap, "systemData", d.SystemData) + populate(objectMap, "type", d.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type IndexRecommendationDetails. -func (i *IndexRecommendationDetails) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type Database. +func (d *Database) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "databaseName": - err = unpopulate(val, "DatabaseName", &i.DatabaseName) - delete(rawMsg, key) - case "includedColumns": - err = unpopulate(val, "IncludedColumns", &i.IncludedColumns) - delete(rawMsg, key) - case "indexColumns": - err = unpopulate(val, "IndexColumns", &i.IndexColumns) + case "id": + err = unpopulate(val, "ID", &d.ID) delete(rawMsg, key) - case "indexName": - err = unpopulate(val, "IndexName", &i.IndexName) + case "name": + err = unpopulate(val, "Name", &d.Name) delete(rawMsg, key) - case "indexType": - err = unpopulate(val, "IndexType", &i.IndexType) + case "properties": + err = unpopulate(val, "Properties", &d.Properties) delete(rawMsg, key) - case "schema": - err = unpopulate(val, "Schema", &i.Schema) + case "systemData": + err = unpopulate(val, "SystemData", &d.SystemData) delete(rawMsg, key) - case "table": - err = unpopulate(val, "Table", &i.Table) + case "type": + err = unpopulate(val, "Type", &d.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type IndexRecommendationListResult. -func (i IndexRecommendationListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DatabaseList. +func (d DatabaseList) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", i.NextLink) - populate(objectMap, "value", i.Value) + populate(objectMap, "nextLink", d.NextLink) + populate(objectMap, "value", d.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type IndexRecommendationListResult. -func (i *IndexRecommendationListResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseList. +func (d *DatabaseList) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { case "nextLink": - err = unpopulate(val, "NextLink", &i.NextLink) + err = unpopulate(val, "NextLink", &d.NextLink) delete(rawMsg, key) case "value": - err = unpopulate(val, "Value", &i.Value) + err = unpopulate(val, "Value", &d.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type IndexRecommendationResource. -func (i IndexRecommendationResource) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DatabaseMigrationState. +func (d DatabaseMigrationState) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", i.ID) - populate(objectMap, "name", i.Name) - populate(objectMap, "properties", i.Properties) - populate(objectMap, "systemData", i.SystemData) - populate(objectMap, "type", i.Type) + populate(objectMap, "appliedChanges", d.AppliedChanges) + populate(objectMap, "cdcDeleteCounter", d.CdcDeleteCounter) + populate(objectMap, "cdcInsertCounter", d.CdcInsertCounter) + populate(objectMap, "cdcUpdateCounter", d.CdcUpdateCounter) + populate(objectMap, "databaseName", d.DatabaseName) + populateDateTimeRFC3339(objectMap, "endedOn", d.EndedOn) + populate(objectMap, "fullLoadCompletedTables", d.FullLoadCompletedTables) + populate(objectMap, "fullLoadErroredTables", d.FullLoadErroredTables) + populate(objectMap, "fullLoadLoadingTables", d.FullLoadLoadingTables) + populate(objectMap, "fullLoadQueuedTables", d.FullLoadQueuedTables) + populate(objectMap, "incomingChanges", d.IncomingChanges) + populate(objectMap, "latency", d.Latency) + populate(objectMap, "message", d.Message) + populate(objectMap, "migrationOperation", d.MigrationOperation) + populate(objectMap, "migrationState", d.MigrationState) + populateDateTimeRFC3339(objectMap, "startedOn", d.StartedOn) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type IndexRecommendationResource. -func (i *IndexRecommendationResource) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseMigrationState. +func (d *DatabaseMigrationState) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &i.ID) + case "appliedChanges": + err = unpopulate(val, "AppliedChanges", &d.AppliedChanges) delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &i.Name) + case "cdcDeleteCounter": + err = unpopulate(val, "CdcDeleteCounter", &d.CdcDeleteCounter) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &i.Properties) + case "cdcInsertCounter": + err = unpopulate(val, "CdcInsertCounter", &d.CdcInsertCounter) delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &i.SystemData) + case "cdcUpdateCounter": + err = unpopulate(val, "CdcUpdateCounter", &d.CdcUpdateCounter) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &i.Type) + case "databaseName": + err = unpopulate(val, "DatabaseName", &d.DatabaseName) delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type IndexRecommendationResourceProperties. -func (i IndexRecommendationResourceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "analyzedWorkload", i.AnalyzedWorkload) - populate(objectMap, "details", i.Details) - populate(objectMap, "estimatedImpact", i.EstimatedImpact) - populate(objectMap, "implementationDetails", i.ImplementationDetails) - populate(objectMap, "improvedQueryIds", i.ImprovedQueryIDs) - populateDateTimeRFC3339(objectMap, "initialRecommendedTime", i.InitialRecommendedTime) - populateDateTimeRFC3339(objectMap, "lastRecommendedTime", i.LastRecommendedTime) - populate(objectMap, "recommendationReason", i.RecommendationReason) - populate(objectMap, "recommendationType", i.RecommendationType) - populate(objectMap, "timesRecommended", i.TimesRecommended) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type IndexRecommendationResourceProperties. -func (i *IndexRecommendationResourceProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "analyzedWorkload": - err = unpopulate(val, "AnalyzedWorkload", &i.AnalyzedWorkload) + case "endedOn": + err = unpopulateDateTimeRFC3339(val, "EndedOn", &d.EndedOn) delete(rawMsg, key) - case "details": - err = unpopulate(val, "Details", &i.Details) + case "fullLoadCompletedTables": + err = unpopulate(val, "FullLoadCompletedTables", &d.FullLoadCompletedTables) delete(rawMsg, key) - case "estimatedImpact": - err = unpopulate(val, "EstimatedImpact", &i.EstimatedImpact) + case "fullLoadErroredTables": + err = unpopulate(val, "FullLoadErroredTables", &d.FullLoadErroredTables) delete(rawMsg, key) - case "implementationDetails": - err = unpopulate(val, "ImplementationDetails", &i.ImplementationDetails) + case "fullLoadLoadingTables": + err = unpopulate(val, "FullLoadLoadingTables", &d.FullLoadLoadingTables) delete(rawMsg, key) - case "improvedQueryIds": - err = unpopulate(val, "ImprovedQueryIDs", &i.ImprovedQueryIDs) + case "fullLoadQueuedTables": + err = unpopulate(val, "FullLoadQueuedTables", &d.FullLoadQueuedTables) delete(rawMsg, key) - case "initialRecommendedTime": - err = unpopulateDateTimeRFC3339(val, "InitialRecommendedTime", &i.InitialRecommendedTime) + case "incomingChanges": + err = unpopulate(val, "IncomingChanges", &d.IncomingChanges) delete(rawMsg, key) - case "lastRecommendedTime": - err = unpopulateDateTimeRFC3339(val, "LastRecommendedTime", &i.LastRecommendedTime) + case "latency": + err = unpopulate(val, "Latency", &d.Latency) delete(rawMsg, key) - case "recommendationReason": - err = unpopulate(val, "RecommendationReason", &i.RecommendationReason) + case "message": + err = unpopulate(val, "Message", &d.Message) delete(rawMsg, key) - case "recommendationType": - err = unpopulate(val, "RecommendationType", &i.RecommendationType) + case "migrationOperation": + err = unpopulate(val, "MigrationOperation", &d.MigrationOperation) delete(rawMsg, key) - case "timesRecommended": - err = unpopulate(val, "TimesRecommended", &i.TimesRecommended) + case "migrationState": + err = unpopulate(val, "MigrationState", &d.MigrationState) + delete(rawMsg, key) + case "startedOn": + err = unpopulateDateTimeRFC3339(val, "StartedOn", &d.StartedOn) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type IndexRecommendationResourcePropertiesAnalyzedWorkload. -func (i IndexRecommendationResourcePropertiesAnalyzedWorkload) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DatabaseProperties. +func (d DatabaseProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populateDateTimeRFC3339(objectMap, "endTime", i.EndTime) - populate(objectMap, "queryCount", i.QueryCount) - populateDateTimeRFC3339(objectMap, "startTime", i.StartTime) + populate(objectMap, "charset", d.Charset) + populate(objectMap, "collation", d.Collation) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type IndexRecommendationResourcePropertiesAnalyzedWorkload. -func (i *IndexRecommendationResourcePropertiesAnalyzedWorkload) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseProperties. +func (d *DatabaseProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "endTime": - err = unpopulateDateTimeRFC3339(val, "EndTime", &i.EndTime) - delete(rawMsg, key) - case "queryCount": - err = unpopulate(val, "QueryCount", &i.QueryCount) + case "charset": + err = unpopulate(val, "Charset", &d.Charset) delete(rawMsg, key) - case "startTime": - err = unpopulateDateTimeRFC3339(val, "StartTime", &i.StartTime) + case "collation": + err = unpopulate(val, "Collation", &d.Collation) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type IndexRecommendationResourcePropertiesImplementationDetails. -func (i IndexRecommendationResourcePropertiesImplementationDetails) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DbLevelValidationStatus. +func (d DbLevelValidationStatus) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "method", i.Method) - populate(objectMap, "script", i.Script) + populate(objectMap, "databaseName", d.DatabaseName) + populateDateTimeRFC3339(objectMap, "endedOn", d.EndedOn) + populateDateTimeRFC3339(objectMap, "startedOn", d.StartedOn) + populate(objectMap, "summary", d.Summary) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type IndexRecommendationResourcePropertiesImplementationDetails. -func (i *IndexRecommendationResourcePropertiesImplementationDetails) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DbLevelValidationStatus. +func (d *DbLevelValidationStatus) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "method": - err = unpopulate(val, "Method", &i.Method) + case "databaseName": + err = unpopulate(val, "DatabaseName", &d.DatabaseName) delete(rawMsg, key) - case "script": - err = unpopulate(val, "Script", &i.Script) + case "endedOn": + err = unpopulateDateTimeRFC3339(val, "EndedOn", &d.EndedOn) + delete(rawMsg, key) + case "startedOn": + err = unpopulateDateTimeRFC3339(val, "StartedOn", &d.StartedOn) + delete(rawMsg, key) + case "summary": + err = unpopulate(val, "Summary", &d.Summary) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type LogFile. -func (l LogFile) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DbServerMetadata. +func (d DbServerMetadata) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", l.ID) - populate(objectMap, "name", l.Name) - populate(objectMap, "properties", l.Properties) - populate(objectMap, "systemData", l.SystemData) - populate(objectMap, "type", l.Type) + populate(objectMap, "location", d.Location) + populate(objectMap, "sku", d.SKU) + populate(objectMap, "storageMb", d.StorageMb) + populate(objectMap, "version", d.Version) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type LogFile. -func (l *LogFile) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DbServerMetadata. +func (d *DbServerMetadata) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &l.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &l.Name) + case "location": + err = unpopulate(val, "Location", &d.Location) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &l.Properties) + case "sku": + err = unpopulate(val, "SKU", &d.SKU) delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &l.SystemData) + case "storageMb": + err = unpopulate(val, "StorageMb", &d.StorageMb) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &l.Type) + case "version": + err = unpopulate(val, "Version", &d.Version) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type LogFileListResult. -func (l LogFileListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DelegatedSubnetUsage. +func (d DelegatedSubnetUsage) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", l.NextLink) - populate(objectMap, "value", l.Value) + populate(objectMap, "subnetName", d.SubnetName) + populate(objectMap, "usage", d.Usage) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type LogFileListResult. -func (l *LogFileListResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DelegatedSubnetUsage. +func (d *DelegatedSubnetUsage) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &l.NextLink) + case "subnetName": + err = unpopulate(val, "SubnetName", &d.SubnetName) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &l.Value) + case "usage": + err = unpopulate(val, "Usage", &d.Usage) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type LogFileProperties. -func (l LogFileProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type FastProvisioningEditionCapability. +func (f FastProvisioningEditionCapability) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populateDateTimeRFC3339(objectMap, "createdTime", l.CreatedTime) - populateDateTimeRFC3339(objectMap, "lastModifiedTime", l.LastModifiedTime) - populate(objectMap, "sizeInKb", l.SizeInKb) - populate(objectMap, "type", l.Type) - populate(objectMap, "url", l.URL) + populate(objectMap, "reason", f.Reason) + populate(objectMap, "serverCount", f.ServerCount) + populate(objectMap, "status", f.Status) + populate(objectMap, "supportedSku", f.SupportedSKU) + populate(objectMap, "supportedServerVersions", f.SupportedServerVersions) + populate(objectMap, "supportedStorageGb", f.SupportedStorageGb) + populate(objectMap, "supportedTier", f.SupportedTier) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type LogFileProperties. -func (l *LogFileProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type FastProvisioningEditionCapability. +func (f *FastProvisioningEditionCapability) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) + return fmt.Errorf("unmarshalling type %T: %v", f, err) } for key, val := range rawMsg { var err error switch key { - case "createdTime": - err = unpopulateDateTimeRFC3339(val, "CreatedTime", &l.CreatedTime) + case "reason": + err = unpopulate(val, "Reason", &f.Reason) delete(rawMsg, key) - case "lastModifiedTime": - err = unpopulateDateTimeRFC3339(val, "LastModifiedTime", &l.LastModifiedTime) + case "serverCount": + err = unpopulate(val, "ServerCount", &f.ServerCount) delete(rawMsg, key) - case "sizeInKb": - err = unpopulate(val, "SizeInKb", &l.SizeInKb) + case "status": + err = unpopulate(val, "Status", &f.Status) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &l.Type) + case "supportedSku": + err = unpopulate(val, "SupportedSKU", &f.SupportedSKU) delete(rawMsg, key) - case "url": - err = unpopulate(val, "URL", &l.URL) + case "supportedServerVersions": + err = unpopulate(val, "SupportedServerVersions", &f.SupportedServerVersions) + delete(rawMsg, key) + case "supportedStorageGb": + err = unpopulate(val, "SupportedStorageGb", &f.SupportedStorageGb) + delete(rawMsg, key) + case "supportedTier": + err = unpopulate(val, "SupportedTier", &f.SupportedTier) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) + return fmt.Errorf("unmarshalling type %T: %v", f, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type LtrBackupOperationResponseProperties. -func (l LtrBackupOperationResponseProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type FirewallRule. +func (f FirewallRule) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "backupMetadata", l.BackupMetadata) - populate(objectMap, "backupName", l.BackupName) - populate(objectMap, "dataTransferredInBytes", l.DataTransferredInBytes) - populate(objectMap, "datasourceSizeInBytes", l.DatasourceSizeInBytes) - populateDateTimeRFC3339(objectMap, "endTime", l.EndTime) - populate(objectMap, "errorCode", l.ErrorCode) - populate(objectMap, "errorMessage", l.ErrorMessage) - populate(objectMap, "percentComplete", l.PercentComplete) - populateDateTimeRFC3339(objectMap, "startTime", l.StartTime) - populate(objectMap, "status", l.Status) + populate(objectMap, "id", f.ID) + populate(objectMap, "name", f.Name) + populate(objectMap, "properties", f.Properties) + populate(objectMap, "systemData", f.SystemData) + populate(objectMap, "type", f.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type LtrBackupOperationResponseProperties. -func (l *LtrBackupOperationResponseProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type FirewallRule. +func (f *FirewallRule) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) + return fmt.Errorf("unmarshalling type %T: %v", f, err) } for key, val := range rawMsg { var err error switch key { - case "backupMetadata": - err = unpopulate(val, "BackupMetadata", &l.BackupMetadata) - delete(rawMsg, key) - case "backupName": - err = unpopulate(val, "BackupName", &l.BackupName) - delete(rawMsg, key) - case "dataTransferredInBytes": - err = unpopulate(val, "DataTransferredInBytes", &l.DataTransferredInBytes) - delete(rawMsg, key) - case "datasourceSizeInBytes": - err = unpopulate(val, "DatasourceSizeInBytes", &l.DatasourceSizeInBytes) - delete(rawMsg, key) - case "endTime": - err = unpopulateDateTimeRFC3339(val, "EndTime", &l.EndTime) - delete(rawMsg, key) - case "errorCode": - err = unpopulate(val, "ErrorCode", &l.ErrorCode) + case "id": + err = unpopulate(val, "ID", &f.ID) delete(rawMsg, key) - case "errorMessage": - err = unpopulate(val, "ErrorMessage", &l.ErrorMessage) + case "name": + err = unpopulate(val, "Name", &f.Name) delete(rawMsg, key) - case "percentComplete": - err = unpopulate(val, "PercentComplete", &l.PercentComplete) + case "properties": + err = unpopulate(val, "Properties", &f.Properties) delete(rawMsg, key) - case "startTime": - err = unpopulateDateTimeRFC3339(val, "StartTime", &l.StartTime) + case "systemData": + err = unpopulate(val, "SystemData", &f.SystemData) delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &l.Status) + case "type": + err = unpopulate(val, "Type", &f.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) + return fmt.Errorf("unmarshalling type %T: %v", f, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type LtrBackupRequest. -func (l LtrBackupRequest) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type FirewallRuleList. +func (f FirewallRuleList) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "backupSettings", l.BackupSettings) - populate(objectMap, "targetDetails", l.TargetDetails) + populate(objectMap, "nextLink", f.NextLink) + populate(objectMap, "value", f.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type LtrBackupRequest. -func (l *LtrBackupRequest) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type FirewallRuleList. +func (f *FirewallRuleList) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) + return fmt.Errorf("unmarshalling type %T: %v", f, err) } for key, val := range rawMsg { var err error switch key { - case "backupSettings": - err = unpopulate(val, "BackupSettings", &l.BackupSettings) + case "nextLink": + err = unpopulate(val, "NextLink", &f.NextLink) delete(rawMsg, key) - case "targetDetails": - err = unpopulate(val, "TargetDetails", &l.TargetDetails) + case "value": + err = unpopulate(val, "Value", &f.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) + return fmt.Errorf("unmarshalling type %T: %v", f, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type LtrBackupResponse. -func (l LtrBackupResponse) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type FirewallRuleProperties. +func (f FirewallRuleProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "properties", l.Properties) + populate(objectMap, "endIpAddress", f.EndIPAddress) + populate(objectMap, "startIpAddress", f.StartIPAddress) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type LtrBackupResponse. -func (l *LtrBackupResponse) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type FirewallRuleProperties. +func (f *FirewallRuleProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) + return fmt.Errorf("unmarshalling type %T: %v", f, err) } for key, val := range rawMsg { var err error switch key { - case "properties": - err = unpopulate(val, "Properties", &l.Properties) + case "endIpAddress": + err = unpopulate(val, "EndIPAddress", &f.EndIPAddress) + delete(rawMsg, key) + case "startIpAddress": + err = unpopulate(val, "StartIPAddress", &f.StartIPAddress) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) + return fmt.Errorf("unmarshalling type %T: %v", f, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type LtrPreBackupRequest. -func (l LtrPreBackupRequest) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type HighAvailability. +func (h HighAvailability) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "backupSettings", l.BackupSettings) + populate(objectMap, "mode", h.Mode) + populate(objectMap, "standbyAvailabilityZone", h.StandbyAvailabilityZone) + populate(objectMap, "state", h.State) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type LtrPreBackupRequest. -func (l *LtrPreBackupRequest) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type HighAvailability. +func (h *HighAvailability) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) + return fmt.Errorf("unmarshalling type %T: %v", h, err) } for key, val := range rawMsg { var err error switch key { - case "backupSettings": - err = unpopulate(val, "BackupSettings", &l.BackupSettings) + case "mode": + err = unpopulate(val, "Mode", &h.Mode) + delete(rawMsg, key) + case "standbyAvailabilityZone": + err = unpopulate(val, "StandbyAvailabilityZone", &h.StandbyAvailabilityZone) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &h.State) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) + return fmt.Errorf("unmarshalling type %T: %v", h, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type LtrPreBackupResponse. -func (l LtrPreBackupResponse) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type HighAvailabilityForPatch. +func (h HighAvailabilityForPatch) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "properties", l.Properties) + populate(objectMap, "mode", h.Mode) + populate(objectMap, "standbyAvailabilityZone", h.StandbyAvailabilityZone) + populate(objectMap, "state", h.State) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type LtrPreBackupResponse. -func (l *LtrPreBackupResponse) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type HighAvailabilityForPatch. +func (h *HighAvailabilityForPatch) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", h, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "mode": + err = unpopulate(val, "Mode", &h.Mode) + delete(rawMsg, key) + case "standbyAvailabilityZone": + err = unpopulate(val, "StandbyAvailabilityZone", &h.StandbyAvailabilityZone) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &h.State) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", h, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ImpactRecord. +func (i ImpactRecord) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "absoluteValue", i.AbsoluteValue) + populate(objectMap, "dimensionName", i.DimensionName) + populate(objectMap, "queryId", i.QueryID) + populate(objectMap, "unit", i.Unit) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ImpactRecord. +func (i *ImpactRecord) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "absoluteValue": + err = unpopulate(val, "AbsoluteValue", &i.AbsoluteValue) + delete(rawMsg, key) + case "dimensionName": + err = unpopulate(val, "DimensionName", &i.DimensionName) + delete(rawMsg, key) + case "queryId": + err = unpopulate(val, "QueryID", &i.QueryID) + delete(rawMsg, key) + case "unit": + err = unpopulate(val, "Unit", &i.Unit) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type LtrBackupOperationResponseProperties. +func (l LtrBackupOperationResponseProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "backupMetadata", l.BackupMetadata) + populate(objectMap, "backupName", l.BackupName) + populate(objectMap, "dataTransferredInBytes", l.DataTransferredInBytes) + populate(objectMap, "datasourceSizeInBytes", l.DatasourceSizeInBytes) + populateDateTimeRFC3339(objectMap, "endTime", l.EndTime) + populate(objectMap, "errorCode", l.ErrorCode) + populate(objectMap, "errorMessage", l.ErrorMessage) + populate(objectMap, "percentComplete", l.PercentComplete) + populateDateTimeRFC3339(objectMap, "startTime", l.StartTime) + populate(objectMap, "status", l.Status) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LtrBackupOperationResponseProperties. +func (l *LtrBackupOperationResponseProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", l, err) @@ -1881,8 +1884,35 @@ func (l *LtrPreBackupResponse) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "properties": - err = unpopulate(val, "Properties", &l.Properties) + case "backupMetadata": + err = unpopulate(val, "BackupMetadata", &l.BackupMetadata) + delete(rawMsg, key) + case "backupName": + err = unpopulate(val, "BackupName", &l.BackupName) + delete(rawMsg, key) + case "dataTransferredInBytes": + err = unpopulate(val, "DataTransferredInBytes", &l.DataTransferredInBytes) + delete(rawMsg, key) + case "datasourceSizeInBytes": + err = unpopulate(val, "DatasourceSizeInBytes", &l.DatasourceSizeInBytes) + delete(rawMsg, key) + case "endTime": + err = unpopulateDateTimeRFC3339(val, "EndTime", &l.EndTime) + delete(rawMsg, key) + case "errorCode": + err = unpopulate(val, "ErrorCode", &l.ErrorCode) + delete(rawMsg, key) + case "errorMessage": + err = unpopulate(val, "ErrorMessage", &l.ErrorMessage) + delete(rawMsg, key) + case "percentComplete": + err = unpopulate(val, "PercentComplete", &l.PercentComplete) + delete(rawMsg, key) + case "startTime": + err = unpopulateDateTimeRFC3339(val, "StartTime", &l.StartTime) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &l.Status) delete(rawMsg, key) } if err != nil { @@ -1892,15 +1922,15 @@ func (l *LtrPreBackupResponse) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type LtrPreBackupResponseProperties. -func (l LtrPreBackupResponseProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type LtrPreBackupRequest. +func (l LtrPreBackupRequest) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "numberOfContainers", l.NumberOfContainers) + populate(objectMap, "backupSettings", l.BackupSettings) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type LtrPreBackupResponseProperties. -func (l *LtrPreBackupResponseProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type LtrPreBackupRequest. +func (l *LtrPreBackupRequest) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", l, err) @@ -1908,8 +1938,8 @@ func (l *LtrPreBackupResponseProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "numberOfContainers": - err = unpopulate(val, "NumberOfContainers", &l.NumberOfContainers) + case "backupSettings": + err = unpopulate(val, "BackupSettings", &l.BackupSettings) delete(rawMsg, key) } if err != nil { @@ -1919,19 +1949,15 @@ func (l *LtrPreBackupResponseProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type LtrServerBackupOperation. -func (l LtrServerBackupOperation) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type LtrPreBackupResponse. +func (l LtrPreBackupResponse) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", l.ID) - populate(objectMap, "name", l.Name) populate(objectMap, "properties", l.Properties) - populate(objectMap, "systemData", l.SystemData) - populate(objectMap, "type", l.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type LtrServerBackupOperation. -func (l *LtrServerBackupOperation) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type LtrPreBackupResponse. +func (l *LtrPreBackupResponse) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", l, err) @@ -1939,21 +1965,9 @@ func (l *LtrServerBackupOperation) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &l.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &l.Name) - delete(rawMsg, key) case "properties": err = unpopulate(val, "Properties", &l.Properties) delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &l.SystemData) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &l.Type) - delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", l, err) @@ -2032,19 +2046,18 @@ func (m *MaintenanceWindow) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type MigrationNameAvailabilityResource. -func (m MigrationNameAvailabilityResource) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MaintenanceWindowForPatch. +func (m MaintenanceWindowForPatch) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "message", m.Message) - populate(objectMap, "name", m.Name) - populate(objectMap, "nameAvailable", m.NameAvailable) - populate(objectMap, "reason", m.Reason) - populate(objectMap, "type", m.Type) + populate(objectMap, "customWindow", m.CustomWindow) + populate(objectMap, "dayOfWeek", m.DayOfWeek) + populate(objectMap, "startHour", m.StartHour) + populate(objectMap, "startMinute", m.StartMinute) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MigrationNameAvailabilityResource. -func (m *MigrationNameAvailabilityResource) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MaintenanceWindowForPatch. +func (m *MaintenanceWindowForPatch) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -2052,20 +2065,17 @@ func (m *MigrationNameAvailabilityResource) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "message": - err = unpopulate(val, "Message", &m.Message) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &m.Name) + case "customWindow": + err = unpopulate(val, "CustomWindow", &m.CustomWindow) delete(rawMsg, key) - case "nameAvailable": - err = unpopulate(val, "NameAvailable", &m.NameAvailable) + case "dayOfWeek": + err = unpopulate(val, "DayOfWeek", &m.DayOfWeek) delete(rawMsg, key) - case "reason": - err = unpopulate(val, "Reason", &m.Reason) + case "startHour": + err = unpopulate(val, "StartHour", &m.StartHour) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &m.Type) + case "startMinute": + err = unpopulate(val, "StartMinute", &m.StartMinute) delete(rawMsg, key) } if err != nil { @@ -2075,8 +2085,8 @@ func (m *MigrationNameAvailabilityResource) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type MigrationResource. -func (m MigrationResource) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type Migration. +func (m Migration) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", m.ID) populate(objectMap, "location", m.Location) @@ -2088,8 +2098,8 @@ func (m MigrationResource) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MigrationResource. -func (m *MigrationResource) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type Migration. +func (m *Migration) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -2126,16 +2136,16 @@ func (m *MigrationResource) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type MigrationResourceForPatch. -func (m MigrationResourceForPatch) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MigrationList. +func (m MigrationList) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "properties", m.Properties) - populate(objectMap, "tags", m.Tags) + populate(objectMap, "nextLink", m.NextLink) + populate(objectMap, "value", m.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MigrationResourceForPatch. -func (m *MigrationResourceForPatch) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MigrationList. +func (m *MigrationList) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -2143,11 +2153,11 @@ func (m *MigrationResourceForPatch) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "properties": - err = unpopulate(val, "Properties", &m.Properties) + case "nextLink": + err = unpopulate(val, "NextLink", &m.NextLink) delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &m.Tags) + case "value": + err = unpopulate(val, "Value", &m.Value) delete(rawMsg, key) } if err != nil { @@ -2157,16 +2167,19 @@ func (m *MigrationResourceForPatch) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type MigrationResourceListResult. -func (m MigrationResourceListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MigrationNameAvailability. +func (m MigrationNameAvailability) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", m.NextLink) - populate(objectMap, "value", m.Value) + populate(objectMap, "message", m.Message) + populate(objectMap, "name", m.Name) + populate(objectMap, "nameAvailable", m.NameAvailable) + populate(objectMap, "reason", m.Reason) + populate(objectMap, "type", m.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MigrationResourceListResult. -func (m *MigrationResourceListResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MigrationNameAvailability. +func (m *MigrationNameAvailability) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -2174,11 +2187,20 @@ func (m *MigrationResourceListResult) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &m.NextLink) + case "message": + err = unpopulate(val, "Message", &m.Message) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &m.Value) + case "name": + err = unpopulate(val, "Name", &m.Name) + delete(rawMsg, key) + case "nameAvailable": + err = unpopulate(val, "NameAvailable", &m.NameAvailable) + delete(rawMsg, key) + case "reason": + err = unpopulate(val, "Reason", &m.Reason) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &m.Type) delete(rawMsg, key) } if err != nil { @@ -2188,8 +2210,8 @@ func (m *MigrationResourceListResult) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type MigrationResourceProperties. -func (m MigrationResourceProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MigrationProperties. +func (m MigrationProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "cancel", m.Cancel) populate(objectMap, "currentStatus", m.CurrentStatus) @@ -2219,8 +2241,8 @@ func (m MigrationResourceProperties) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MigrationResourceProperties. -func (m *MigrationResourceProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MigrationProperties. +func (m *MigrationProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -2311,8 +2333,8 @@ func (m *MigrationResourceProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type MigrationResourcePropertiesForPatch. -func (m MigrationResourcePropertiesForPatch) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MigrationPropertiesForPatch. +func (m MigrationPropertiesForPatch) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "cancel", m.Cancel) populate(objectMap, "dbsToCancelMigrationOn", m.DbsToCancelMigrationOn) @@ -2332,8 +2354,8 @@ func (m MigrationResourcePropertiesForPatch) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MigrationResourcePropertiesForPatch. -func (m *MigrationResourcePropertiesForPatch) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MigrationPropertiesForPatch. +func (m *MigrationPropertiesForPatch) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -2394,12 +2416,43 @@ func (m *MigrationResourcePropertiesForPatch) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type MigrationSecretParameters. -func (m MigrationSecretParameters) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MigrationResourceForPatch. +func (m MigrationResourceForPatch) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "adminCredentials", m.AdminCredentials) - populate(objectMap, "sourceServerUsername", m.SourceServerUsername) - populate(objectMap, "targetServerUsername", m.TargetServerUsername) + populate(objectMap, "properties", m.Properties) + populate(objectMap, "tags", m.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MigrationResourceForPatch. +func (m *MigrationResourceForPatch) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "properties": + err = unpopulate(val, "Properties", &m.Properties) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &m.Tags) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MigrationSecretParameters. +func (m MigrationSecretParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "adminCredentials", m.AdminCredentials) + populate(objectMap, "sourceServerUsername", m.SourceServerUsername) + populate(objectMap, "targetServerUsername", m.TargetServerUsername) return json.Marshal(objectMap) } @@ -2429,6 +2482,41 @@ func (m *MigrationSecretParameters) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type MigrationSecretParametersForPatch. +func (m MigrationSecretParametersForPatch) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "adminCredentials", m.AdminCredentials) + populate(objectMap, "sourceServerUsername", m.SourceServerUsername) + populate(objectMap, "targetServerUsername", m.TargetServerUsername) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MigrationSecretParametersForPatch. +func (m *MigrationSecretParametersForPatch) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "adminCredentials": + err = unpopulate(val, "AdminCredentials", &m.AdminCredentials) + delete(rawMsg, key) + case "sourceServerUsername": + err = unpopulate(val, "SourceServerUsername", &m.SourceServerUsername) + delete(rawMsg, key) + case "targetServerUsername": + err = unpopulate(val, "TargetServerUsername", &m.TargetServerUsername) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type MigrationStatus. func (m MigrationStatus) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -2464,8 +2552,8 @@ func (m *MigrationStatus) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type MigrationSubStateDetails. -func (m MigrationSubStateDetails) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MigrationSubstateDetails. +func (m MigrationSubstateDetails) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "currentSubState", m.CurrentSubState) populate(objectMap, "dbDetails", m.DbDetails) @@ -2473,8 +2561,8 @@ func (m MigrationSubStateDetails) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MigrationSubStateDetails. -func (m *MigrationSubStateDetails) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MigrationSubstateDetails. +func (m *MigrationSubstateDetails) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -2499,8 +2587,8 @@ func (m *MigrationSubStateDetails) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type NameAvailability. -func (n NameAvailability) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type NameAvailabilityModel. +func (n NameAvailabilityModel) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "message", n.Message) populate(objectMap, "name", n.Name) @@ -2510,8 +2598,8 @@ func (n NameAvailability) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type NameAvailability. -func (n *NameAvailability) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type NameAvailabilityModel. +func (n *NameAvailabilityModel) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", n, err) @@ -2608,6 +2696,268 @@ func (n *Network) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type ObjectRecommendation. +func (o ObjectRecommendation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", o.ID) + populate(objectMap, "kind", o.Kind) + populate(objectMap, "name", o.Name) + populate(objectMap, "properties", o.Properties) + populate(objectMap, "systemData", o.SystemData) + populate(objectMap, "type", o.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ObjectRecommendation. +func (o *ObjectRecommendation) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &o.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &o.Kind) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &o.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &o.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &o.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &o.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ObjectRecommendationDetails. +func (o ObjectRecommendationDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "databaseName", o.DatabaseName) + populate(objectMap, "includedColumns", o.IncludedColumns) + populate(objectMap, "indexColumns", o.IndexColumns) + populate(objectMap, "indexName", o.IndexName) + populate(objectMap, "indexType", o.IndexType) + populate(objectMap, "schema", o.Schema) + populate(objectMap, "table", o.Table) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ObjectRecommendationDetails. +func (o *ObjectRecommendationDetails) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "databaseName": + err = unpopulate(val, "DatabaseName", &o.DatabaseName) + delete(rawMsg, key) + case "includedColumns": + err = unpopulate(val, "IncludedColumns", &o.IncludedColumns) + delete(rawMsg, key) + case "indexColumns": + err = unpopulate(val, "IndexColumns", &o.IndexColumns) + delete(rawMsg, key) + case "indexName": + err = unpopulate(val, "IndexName", &o.IndexName) + delete(rawMsg, key) + case "indexType": + err = unpopulate(val, "IndexType", &o.IndexType) + delete(rawMsg, key) + case "schema": + err = unpopulate(val, "Schema", &o.Schema) + delete(rawMsg, key) + case "table": + err = unpopulate(val, "Table", &o.Table) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ObjectRecommendationList. +func (o ObjectRecommendationList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", o.NextLink) + populate(objectMap, "value", o.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ObjectRecommendationList. +func (o *ObjectRecommendationList) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &o.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &o.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ObjectRecommendationProperties. +func (o ObjectRecommendationProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "analyzedWorkload", o.AnalyzedWorkload) + populate(objectMap, "currentState", o.CurrentState) + populate(objectMap, "details", o.Details) + populate(objectMap, "estimatedImpact", o.EstimatedImpact) + populate(objectMap, "implementationDetails", o.ImplementationDetails) + populate(objectMap, "improvedQueryIds", o.ImprovedQueryIDs) + populateDateTimeRFC3339(objectMap, "initialRecommendedTime", o.InitialRecommendedTime) + populateDateTimeRFC3339(objectMap, "lastRecommendedTime", o.LastRecommendedTime) + populate(objectMap, "recommendationReason", o.RecommendationReason) + populate(objectMap, "recommendationType", o.RecommendationType) + populate(objectMap, "timesRecommended", o.TimesRecommended) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ObjectRecommendationProperties. +func (o *ObjectRecommendationProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "analyzedWorkload": + err = unpopulate(val, "AnalyzedWorkload", &o.AnalyzedWorkload) + delete(rawMsg, key) + case "currentState": + err = unpopulate(val, "CurrentState", &o.CurrentState) + delete(rawMsg, key) + case "details": + err = unpopulate(val, "Details", &o.Details) + delete(rawMsg, key) + case "estimatedImpact": + err = unpopulate(val, "EstimatedImpact", &o.EstimatedImpact) + delete(rawMsg, key) + case "implementationDetails": + err = unpopulate(val, "ImplementationDetails", &o.ImplementationDetails) + delete(rawMsg, key) + case "improvedQueryIds": + err = unpopulate(val, "ImprovedQueryIDs", &o.ImprovedQueryIDs) + delete(rawMsg, key) + case "initialRecommendedTime": + err = unpopulateDateTimeRFC3339(val, "InitialRecommendedTime", &o.InitialRecommendedTime) + delete(rawMsg, key) + case "lastRecommendedTime": + err = unpopulateDateTimeRFC3339(val, "LastRecommendedTime", &o.LastRecommendedTime) + delete(rawMsg, key) + case "recommendationReason": + err = unpopulate(val, "RecommendationReason", &o.RecommendationReason) + delete(rawMsg, key) + case "recommendationType": + err = unpopulate(val, "RecommendationType", &o.RecommendationType) + delete(rawMsg, key) + case "timesRecommended": + err = unpopulate(val, "TimesRecommended", &o.TimesRecommended) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ObjectRecommendationPropertiesAnalyzedWorkload. +func (o ObjectRecommendationPropertiesAnalyzedWorkload) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populateDateTimeRFC3339(objectMap, "endTime", o.EndTime) + populate(objectMap, "queryCount", o.QueryCount) + populateDateTimeRFC3339(objectMap, "startTime", o.StartTime) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ObjectRecommendationPropertiesAnalyzedWorkload. +func (o *ObjectRecommendationPropertiesAnalyzedWorkload) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "endTime": + err = unpopulateDateTimeRFC3339(val, "EndTime", &o.EndTime) + delete(rawMsg, key) + case "queryCount": + err = unpopulate(val, "QueryCount", &o.QueryCount) + delete(rawMsg, key) + case "startTime": + err = unpopulateDateTimeRFC3339(val, "StartTime", &o.StartTime) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ObjectRecommendationPropertiesImplementationDetails. +func (o ObjectRecommendationPropertiesImplementationDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "method", o.Method) + populate(objectMap, "script", o.Script) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ObjectRecommendationPropertiesImplementationDetails. +func (o *ObjectRecommendationPropertiesImplementationDetails) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "method": + err = unpopulate(val, "Method", &o.Method) + delete(rawMsg, key) + case "script": + err = unpopulate(val, "Script", &o.Script) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type Operation. func (o Operation) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -2690,16 +3040,16 @@ func (o *OperationDisplay) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type OperationListResult. -func (o OperationListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type OperationList. +func (o OperationList) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "nextLink", o.NextLink) populate(objectMap, "value", o.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type OperationListResult. -func (o *OperationListResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationList. +func (o *OperationList) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", o, err) @@ -2791,16 +3141,16 @@ func (p *PrivateEndpointConnection) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnectionListResult. -func (p PrivateEndpointConnectionListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnectionList. +func (p PrivateEndpointConnectionList) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "nextLink", p.NextLink) populate(objectMap, "value", p.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnectionListResult. -func (p *PrivateEndpointConnectionListResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnectionList. +func (p *PrivateEndpointConnectionList) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", p, err) @@ -2904,16 +3254,16 @@ func (p *PrivateLinkResource) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type PrivateLinkResourceListResult. -func (p PrivateLinkResourceListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PrivateLinkResourceList. +func (p PrivateLinkResourceList) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "nextLink", p.NextLink) populate(objectMap, "value", p.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkResourceListResult. -func (p *PrivateLinkResourceListResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkResourceList. +func (p *PrivateLinkResourceList) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", p, err) @@ -3048,16 +3398,16 @@ func (q *QuotaUsage) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type QuotaUsagesListResult. -func (q QuotaUsagesListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type QuotaUsageList. +func (q QuotaUsageList) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "nextLink", q.NextLink) populate(objectMap, "value", q.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type QuotaUsagesListResult. -func (q *QuotaUsagesListResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type QuotaUsageList. +func (q *QuotaUsageList) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", q, err) @@ -3184,23 +3534,16 @@ func (s *SKU) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type Server. -func (s Server) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type SKUForPatch. +func (s SKUForPatch) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", s.ID) - populate(objectMap, "identity", s.Identity) - populate(objectMap, "location", s.Location) populate(objectMap, "name", s.Name) - populate(objectMap, "properties", s.Properties) - populate(objectMap, "sku", s.SKU) - populate(objectMap, "systemData", s.SystemData) - populate(objectMap, "tags", s.Tags) - populate(objectMap, "type", s.Type) + populate(objectMap, "tier", s.Tier) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type Server. -func (s *Server) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type SKUForPatch. +func (s *SKUForPatch) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) @@ -3208,32 +3551,11 @@ func (s *Server) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &s.ID) - delete(rawMsg, key) - case "identity": - err = unpopulate(val, "Identity", &s.Identity) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &s.Location) - delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &s.Name) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &s.Properties) - delete(rawMsg, key) - case "sku": - err = unpopulate(val, "SKU", &s.SKU) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &s.SystemData) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &s.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &s.Type) + case "tier": + err = unpopulate(val, "Tier", &s.Tier) delete(rawMsg, key) } if err != nil { @@ -3243,19 +3565,23 @@ func (s *Server) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ServerBackup. -func (s ServerBackup) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type Server. +func (s Server) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", s.ID) + populate(objectMap, "identity", s.Identity) + populate(objectMap, "location", s.Location) populate(objectMap, "name", s.Name) populate(objectMap, "properties", s.Properties) + populate(objectMap, "sku", s.SKU) populate(objectMap, "systemData", s.SystemData) + populate(objectMap, "tags", s.Tags) populate(objectMap, "type", s.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ServerBackup. -func (s *ServerBackup) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type Server. +func (s *Server) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) @@ -3266,15 +3592,27 @@ func (s *ServerBackup) UnmarshalJSON(data []byte) error { case "id": err = unpopulate(val, "ID", &s.ID) delete(rawMsg, key) + case "identity": + err = unpopulate(val, "Identity", &s.Identity) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &s.Location) + delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &s.Name) delete(rawMsg, key) case "properties": err = unpopulate(val, "Properties", &s.Properties) delete(rawMsg, key) + case "sku": + err = unpopulate(val, "SKU", &s.SKU) + delete(rawMsg, key) case "systemData": err = unpopulate(val, "SystemData", &s.SystemData) delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &s.Tags) + delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &s.Type) delete(rawMsg, key) @@ -3286,16 +3624,20 @@ func (s *ServerBackup) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ServerBackupListResult. -func (s ServerBackupListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ServerEditionCapability. +func (s ServerEditionCapability) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", s.NextLink) - populate(objectMap, "value", s.Value) + populate(objectMap, "defaultSkuName", s.DefaultSKUName) + populate(objectMap, "name", s.Name) + populate(objectMap, "reason", s.Reason) + populate(objectMap, "status", s.Status) + populate(objectMap, "supportedServerSkus", s.SupportedServerSKUs) + populate(objectMap, "supportedStorageEditions", s.SupportedStorageEditions) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ServerBackupListResult. -func (s *ServerBackupListResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerEditionCapability. +func (s *ServerEditionCapability) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) @@ -3303,46 +3645,23 @@ func (s *ServerBackupListResult) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &s.NextLink) + case "defaultSkuName": + err = unpopulate(val, "DefaultSKUName", &s.DefaultSKUName) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &s.Value) + case "name": + err = unpopulate(val, "Name", &s.Name) delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ServerBackupProperties. -func (s ServerBackupProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "backupType", s.BackupType) - populateDateTimeRFC3339(objectMap, "completedTime", s.CompletedTime) - populate(objectMap, "source", s.Source) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ServerBackupProperties. -func (s *ServerBackupProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "backupType": - err = unpopulate(val, "BackupType", &s.BackupType) + case "reason": + err = unpopulate(val, "Reason", &s.Reason) delete(rawMsg, key) - case "completedTime": - err = unpopulateDateTimeRFC3339(val, "CompletedTime", &s.CompletedTime) + case "status": + err = unpopulate(val, "Status", &s.Status) delete(rawMsg, key) - case "source": - err = unpopulate(val, "Source", &s.Source) + case "supportedServerSkus": + err = unpopulate(val, "SupportedServerSKUs", &s.SupportedServerSKUs) + delete(rawMsg, key) + case "supportedStorageEditions": + err = unpopulate(val, "SupportedStorageEditions", &s.SupportedStorageEditions) delete(rawMsg, key) } if err != nil { @@ -3352,8 +3671,8 @@ func (s *ServerBackupProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ServerForUpdate. -func (s ServerForUpdate) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ServerForPatch. +func (s ServerForPatch) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "identity", s.Identity) populate(objectMap, "properties", s.Properties) @@ -3362,8 +3681,8 @@ func (s ServerForUpdate) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ServerForUpdate. -func (s *ServerForUpdate) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerForPatch. +func (s *ServerForPatch) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) @@ -3391,16 +3710,16 @@ func (s *ServerForUpdate) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ServerListResult. -func (s ServerListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ServerList. +func (s ServerList) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "nextLink", s.NextLink) populate(objectMap, "value", s.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ServerListResult. -func (s *ServerListResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerList. +func (s *ServerList) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) @@ -3519,289 +3838,11 @@ func (s *ServerProperties) UnmarshalJSON(data []byte) error { case "state": err = unpopulate(val, "State", &s.State) delete(rawMsg, key) - case "storage": - err = unpopulate(val, "Storage", &s.Storage) - delete(rawMsg, key) - case "version": - err = unpopulate(val, "Version", &s.Version) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ServerPropertiesForUpdate. -func (s ServerPropertiesForUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "administratorLogin", s.AdministratorLogin) - populate(objectMap, "administratorLoginPassword", s.AdministratorLoginPassword) - populate(objectMap, "authConfig", s.AuthConfig) - populate(objectMap, "backup", s.Backup) - populate(objectMap, "cluster", s.Cluster) - populate(objectMap, "createMode", s.CreateMode) - populate(objectMap, "dataEncryption", s.DataEncryption) - populate(objectMap, "highAvailability", s.HighAvailability) - populate(objectMap, "maintenanceWindow", s.MaintenanceWindow) - populate(objectMap, "network", s.Network) - populate(objectMap, "replica", s.Replica) - populate(objectMap, "replicationRole", s.ReplicationRole) - populate(objectMap, "storage", s.Storage) - populate(objectMap, "version", s.Version) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ServerPropertiesForUpdate. -func (s *ServerPropertiesForUpdate) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "administratorLogin": - err = unpopulate(val, "AdministratorLogin", &s.AdministratorLogin) - delete(rawMsg, key) - case "administratorLoginPassword": - err = unpopulate(val, "AdministratorLoginPassword", &s.AdministratorLoginPassword) - delete(rawMsg, key) - case "authConfig": - err = unpopulate(val, "AuthConfig", &s.AuthConfig) - delete(rawMsg, key) - case "backup": - err = unpopulate(val, "Backup", &s.Backup) - delete(rawMsg, key) - case "cluster": - err = unpopulate(val, "Cluster", &s.Cluster) - delete(rawMsg, key) - case "createMode": - err = unpopulate(val, "CreateMode", &s.CreateMode) - delete(rawMsg, key) - case "dataEncryption": - err = unpopulate(val, "DataEncryption", &s.DataEncryption) - delete(rawMsg, key) - case "highAvailability": - err = unpopulate(val, "HighAvailability", &s.HighAvailability) - delete(rawMsg, key) - case "maintenanceWindow": - err = unpopulate(val, "MaintenanceWindow", &s.MaintenanceWindow) - delete(rawMsg, key) - case "network": - err = unpopulate(val, "Network", &s.Network) - delete(rawMsg, key) - case "replica": - err = unpopulate(val, "Replica", &s.Replica) - delete(rawMsg, key) - case "replicationRole": - err = unpopulate(val, "ReplicationRole", &s.ReplicationRole) - delete(rawMsg, key) - case "storage": - err = unpopulate(val, "Storage", &s.Storage) - delete(rawMsg, key) - case "version": - err = unpopulate(val, "Version", &s.Version) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ServerSKU. -func (s ServerSKU) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "name", s.Name) - populate(objectMap, "tier", s.Tier) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ServerSKU. -func (s *ServerSKU) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "name": - err = unpopulate(val, "Name", &s.Name) - delete(rawMsg, key) - case "tier": - err = unpopulate(val, "Tier", &s.Tier) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ServerSKUCapability. -func (s ServerSKUCapability) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "name", s.Name) - populate(objectMap, "reason", s.Reason) - populate(objectMap, "securityProfile", s.SecurityProfile) - populate(objectMap, "status", s.Status) - populate(objectMap, "supportedFeatures", s.SupportedFeatures) - populate(objectMap, "supportedHaMode", s.SupportedHaMode) - populate(objectMap, "supportedIops", s.SupportedIops) - populate(objectMap, "supportedMemoryPerVcoreMb", s.SupportedMemoryPerVcoreMb) - populate(objectMap, "supportedZones", s.SupportedZones) - populate(objectMap, "vCores", s.VCores) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ServerSKUCapability. -func (s *ServerSKUCapability) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "name": - err = unpopulate(val, "Name", &s.Name) - delete(rawMsg, key) - case "reason": - err = unpopulate(val, "Reason", &s.Reason) - delete(rawMsg, key) - case "securityProfile": - err = unpopulate(val, "SecurityProfile", &s.SecurityProfile) - delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &s.Status) - delete(rawMsg, key) - case "supportedFeatures": - err = unpopulate(val, "SupportedFeatures", &s.SupportedFeatures) - delete(rawMsg, key) - case "supportedHaMode": - err = unpopulate(val, "SupportedHaMode", &s.SupportedHaMode) - delete(rawMsg, key) - case "supportedIops": - err = unpopulate(val, "SupportedIops", &s.SupportedIops) - delete(rawMsg, key) - case "supportedMemoryPerVcoreMb": - err = unpopulate(val, "SupportedMemoryPerVcoreMb", &s.SupportedMemoryPerVcoreMb) - delete(rawMsg, key) - case "supportedZones": - err = unpopulate(val, "SupportedZones", &s.SupportedZones) - delete(rawMsg, key) - case "vCores": - err = unpopulate(val, "VCores", &s.VCores) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ServerThreatProtectionListResult. -func (s ServerThreatProtectionListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", s.NextLink) - populate(objectMap, "value", s.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ServerThreatProtectionListResult. -func (s *ServerThreatProtectionListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &s.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &s.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ServerThreatProtectionProperties. -func (s ServerThreatProtectionProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populateDateTimeRFC3339(objectMap, "creationTime", s.CreationTime) - populate(objectMap, "state", s.State) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ServerThreatProtectionProperties. -func (s *ServerThreatProtectionProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "creationTime": - err = unpopulateDateTimeRFC3339(val, "CreationTime", &s.CreationTime) - delete(rawMsg, key) - case "state": - err = unpopulate(val, "State", &s.State) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ServerThreatProtectionSettingsModel. -func (s ServerThreatProtectionSettingsModel) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", s.ID) - populate(objectMap, "name", s.Name) - populate(objectMap, "properties", s.Properties) - populate(objectMap, "systemData", s.SystemData) - populate(objectMap, "type", s.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ServerThreatProtectionSettingsModel. -func (s *ServerThreatProtectionSettingsModel) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &s.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &s.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &s.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &s.SystemData) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &s.Type) + case "storage": + err = unpopulate(val, "Storage", &s.Storage) + delete(rawMsg, key) + case "version": + err = unpopulate(val, "Version", &s.Version) delete(rawMsg, key) } if err != nil { @@ -3811,19 +3852,29 @@ func (s *ServerThreatProtectionSettingsModel) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ServerVersionCapability. -func (s ServerVersionCapability) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ServerPropertiesForPatch. +func (s ServerPropertiesForPatch) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "name", s.Name) - populate(objectMap, "reason", s.Reason) - populate(objectMap, "status", s.Status) - populate(objectMap, "supportedFeatures", s.SupportedFeatures) - populate(objectMap, "supportedVersionsToUpgrade", s.SupportedVersionsToUpgrade) + populate(objectMap, "administratorLogin", s.AdministratorLogin) + populate(objectMap, "administratorLoginPassword", s.AdministratorLoginPassword) + populate(objectMap, "authConfig", s.AuthConfig) + populate(objectMap, "availabilityZone", s.AvailabilityZone) + populate(objectMap, "backup", s.Backup) + populate(objectMap, "cluster", s.Cluster) + populate(objectMap, "createMode", s.CreateMode) + populate(objectMap, "dataEncryption", s.DataEncryption) + populate(objectMap, "highAvailability", s.HighAvailability) + populate(objectMap, "maintenanceWindow", s.MaintenanceWindow) + populate(objectMap, "network", s.Network) + populate(objectMap, "replica", s.Replica) + populate(objectMap, "replicationRole", s.ReplicationRole) + populate(objectMap, "storage", s.Storage) + populate(objectMap, "version", s.Version) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ServerVersionCapability. -func (s *ServerVersionCapability) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerPropertiesForPatch. +func (s *ServerPropertiesForPatch) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) @@ -3831,20 +3882,50 @@ func (s *ServerVersionCapability) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "name": - err = unpopulate(val, "Name", &s.Name) + case "administratorLogin": + err = unpopulate(val, "AdministratorLogin", &s.AdministratorLogin) delete(rawMsg, key) - case "reason": - err = unpopulate(val, "Reason", &s.Reason) + case "administratorLoginPassword": + err = unpopulate(val, "AdministratorLoginPassword", &s.AdministratorLoginPassword) delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &s.Status) + case "authConfig": + err = unpopulate(val, "AuthConfig", &s.AuthConfig) delete(rawMsg, key) - case "supportedFeatures": - err = unpopulate(val, "SupportedFeatures", &s.SupportedFeatures) + case "availabilityZone": + err = unpopulate(val, "AvailabilityZone", &s.AvailabilityZone) delete(rawMsg, key) - case "supportedVersionsToUpgrade": - err = unpopulate(val, "SupportedVersionsToUpgrade", &s.SupportedVersionsToUpgrade) + case "backup": + err = unpopulate(val, "Backup", &s.Backup) + delete(rawMsg, key) + case "cluster": + err = unpopulate(val, "Cluster", &s.Cluster) + delete(rawMsg, key) + case "createMode": + err = unpopulate(val, "CreateMode", &s.CreateMode) + delete(rawMsg, key) + case "dataEncryption": + err = unpopulate(val, "DataEncryption", &s.DataEncryption) + delete(rawMsg, key) + case "highAvailability": + err = unpopulate(val, "HighAvailability", &s.HighAvailability) + delete(rawMsg, key) + case "maintenanceWindow": + err = unpopulate(val, "MaintenanceWindow", &s.MaintenanceWindow) + delete(rawMsg, key) + case "network": + err = unpopulate(val, "Network", &s.Network) + delete(rawMsg, key) + case "replica": + err = unpopulate(val, "Replica", &s.Replica) + delete(rawMsg, key) + case "replicationRole": + err = unpopulate(val, "ReplicationRole", &s.ReplicationRole) + delete(rawMsg, key) + case "storage": + err = unpopulate(val, "Storage", &s.Storage) + delete(rawMsg, key) + case "version": + err = unpopulate(val, "Version", &s.Version) delete(rawMsg, key) } if err != nil { @@ -3854,16 +3935,16 @@ func (s *ServerVersionCapability) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type SessionDetailsListResult. -func (s SessionDetailsListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ServerSKU. +func (s ServerSKU) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", s.NextLink) - populate(objectMap, "value", s.Value) + populate(objectMap, "name", s.Name) + populate(objectMap, "tier", s.Tier) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type SessionDetailsListResult. -func (s *SessionDetailsListResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerSKU. +func (s *ServerSKU) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) @@ -3871,11 +3952,11 @@ func (s *SessionDetailsListResult) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &s.NextLink) + case "name": + err = unpopulate(val, "Name", &s.Name) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &s.Value) + case "tier": + err = unpopulate(val, "Tier", &s.Tier) delete(rawMsg, key) } if err != nil { @@ -3885,20 +3966,24 @@ func (s *SessionDetailsListResult) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type SessionDetailsResource. -func (s SessionDetailsResource) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ServerSKUCapability. +func (s ServerSKUCapability) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "appliedConfiguration", s.AppliedConfiguration) - populate(objectMap, "averageQueryRuntimeMs", s.AverageQueryRuntimeMs) - populate(objectMap, "iterationId", s.IterationID) - populate(objectMap, "iterationStartTime", s.IterationStartTime) - populate(objectMap, "sessionId", s.SessionID) - populate(objectMap, "transactionsPerSecond", s.TransactionsPerSecond) + populate(objectMap, "name", s.Name) + populate(objectMap, "reason", s.Reason) + populate(objectMap, "securityProfile", s.SecurityProfile) + populate(objectMap, "status", s.Status) + populate(objectMap, "supportedFeatures", s.SupportedFeatures) + populate(objectMap, "supportedHaMode", s.SupportedHaMode) + populate(objectMap, "supportedIops", s.SupportedIops) + populate(objectMap, "supportedMemoryPerVcoreMb", s.SupportedMemoryPerVcoreMb) + populate(objectMap, "supportedZones", s.SupportedZones) + populate(objectMap, "vCores", s.VCores) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type SessionDetailsResource. -func (s *SessionDetailsResource) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerSKUCapability. +func (s *ServerSKUCapability) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) @@ -3906,23 +3991,35 @@ func (s *SessionDetailsResource) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "appliedConfiguration": - err = unpopulate(val, "AppliedConfiguration", &s.AppliedConfiguration) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "reason": + err = unpopulate(val, "Reason", &s.Reason) + delete(rawMsg, key) + case "securityProfile": + err = unpopulate(val, "SecurityProfile", &s.SecurityProfile) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &s.Status) + delete(rawMsg, key) + case "supportedFeatures": + err = unpopulate(val, "SupportedFeatures", &s.SupportedFeatures) delete(rawMsg, key) - case "averageQueryRuntimeMs": - err = unpopulate(val, "AverageQueryRuntimeMs", &s.AverageQueryRuntimeMs) + case "supportedHaMode": + err = unpopulate(val, "SupportedHaMode", &s.SupportedHaMode) delete(rawMsg, key) - case "iterationId": - err = unpopulate(val, "IterationID", &s.IterationID) + case "supportedIops": + err = unpopulate(val, "SupportedIops", &s.SupportedIops) delete(rawMsg, key) - case "iterationStartTime": - err = unpopulate(val, "IterationStartTime", &s.IterationStartTime) + case "supportedMemoryPerVcoreMb": + err = unpopulate(val, "SupportedMemoryPerVcoreMb", &s.SupportedMemoryPerVcoreMb) delete(rawMsg, key) - case "sessionId": - err = unpopulate(val, "SessionID", &s.SessionID) + case "supportedZones": + err = unpopulate(val, "SupportedZones", &s.SupportedZones) delete(rawMsg, key) - case "transactionsPerSecond": - err = unpopulate(val, "TransactionsPerSecond", &s.TransactionsPerSecond) + case "vCores": + err = unpopulate(val, "VCores", &s.VCores) delete(rawMsg, key) } if err != nil { @@ -3932,21 +4029,19 @@ func (s *SessionDetailsResource) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type SessionResource. -func (s SessionResource) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ServerVersionCapability. +func (s ServerVersionCapability) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "postTuningAqr", s.PostTuningAqr) - populate(objectMap, "postTuningTps", s.PostTuningTps) - populate(objectMap, "preTuningAqr", s.PreTuningAqr) - populate(objectMap, "preTuningTps", s.PreTuningTps) - populate(objectMap, "sessionId", s.SessionID) - populate(objectMap, "sessionStartTime", s.SessionStartTime) + populate(objectMap, "name", s.Name) + populate(objectMap, "reason", s.Reason) populate(objectMap, "status", s.Status) + populate(objectMap, "supportedFeatures", s.SupportedFeatures) + populate(objectMap, "supportedVersionsToUpgrade", s.SupportedVersionsToUpgrade) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type SessionResource. -func (s *SessionResource) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerVersionCapability. +func (s *ServerVersionCapability) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) @@ -3954,57 +4049,20 @@ func (s *SessionResource) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "postTuningAqr": - err = unpopulate(val, "PostTuningAqr", &s.PostTuningAqr) - delete(rawMsg, key) - case "postTuningTps": - err = unpopulate(val, "PostTuningTps", &s.PostTuningTps) - delete(rawMsg, key) - case "preTuningAqr": - err = unpopulate(val, "PreTuningAqr", &s.PreTuningAqr) - delete(rawMsg, key) - case "preTuningTps": - err = unpopulate(val, "PreTuningTps", &s.PreTuningTps) - delete(rawMsg, key) - case "sessionId": - err = unpopulate(val, "SessionID", &s.SessionID) + case "name": + err = unpopulate(val, "Name", &s.Name) delete(rawMsg, key) - case "sessionStartTime": - err = unpopulate(val, "SessionStartTime", &s.SessionStartTime) + case "reason": + err = unpopulate(val, "Reason", &s.Reason) delete(rawMsg, key) case "status": err = unpopulate(val, "Status", &s.Status) delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SessionsListResult. -func (s SessionsListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", s.NextLink) - populate(objectMap, "value", s.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SessionsListResult. -func (s *SessionsListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &s.NextLink) + case "supportedFeatures": + err = unpopulate(val, "SupportedFeatures", &s.SupportedFeatures) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &s.Value) + case "supportedVersionsToUpgrade": + err = unpopulate(val, "SupportedVersionsToUpgrade", &s.SupportedVersionsToUpgrade) delete(rawMsg, key) } if err != nil { @@ -4284,16 +4342,18 @@ func (s *SystemData) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type TuningOptionsListResult. -func (t TuningOptionsListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type TuningOptions. +func (t TuningOptions) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", t.NextLink) - populate(objectMap, "value", t.Value) + populate(objectMap, "id", t.ID) + populate(objectMap, "name", t.Name) + populate(objectMap, "systemData", t.SystemData) + populate(objectMap, "type", t.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type TuningOptionsListResult. -func (t *TuningOptionsListResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type TuningOptions. +func (t *TuningOptions) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", t, err) @@ -4301,11 +4361,17 @@ func (t *TuningOptionsListResult) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &t.NextLink) + case "id": + err = unpopulate(val, "ID", &t.ID) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &t.Value) + case "name": + err = unpopulate(val, "Name", &t.Name) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &t.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &t.Type) delete(rawMsg, key) } if err != nil { @@ -4315,18 +4381,16 @@ func (t *TuningOptionsListResult) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type TuningOptionsResource. -func (t TuningOptionsResource) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type TuningOptionsList. +func (t TuningOptionsList) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", t.ID) - populate(objectMap, "name", t.Name) - populate(objectMap, "systemData", t.SystemData) - populate(objectMap, "type", t.Type) + populate(objectMap, "nextLink", t.NextLink) + populate(objectMap, "value", t.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type TuningOptionsResource. -func (t *TuningOptionsResource) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type TuningOptionsList. +func (t *TuningOptionsList) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", t, err) @@ -4334,17 +4398,11 @@ func (t *TuningOptionsResource) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &t.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &t.Name) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &t.SystemData) + case "nextLink": + err = unpopulate(val, "NextLink", &t.NextLink) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &t.Type) + case "value": + err = unpopulate(val, "Value", &t.Value) delete(rawMsg, key) } if err != nil { @@ -4533,8 +4591,8 @@ func (v *ValidationSummaryItem) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type VirtualEndpointResource. -func (v VirtualEndpointResource) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type VirtualEndpoint. +func (v VirtualEndpoint) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", v.ID) populate(objectMap, "name", v.Name) @@ -4544,8 +4602,8 @@ func (v VirtualEndpointResource) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualEndpointResource. -func (v *VirtualEndpointResource) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualEndpoint. +func (v *VirtualEndpoint) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", v, err) @@ -4638,16 +4696,16 @@ func (v *VirtualEndpointResourceProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type VirtualEndpointsListResult. -func (v VirtualEndpointsListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type VirtualEndpointsList. +func (v VirtualEndpointsList) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "nextLink", v.NextLink) populate(objectMap, "value", v.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualEndpointsListResult. -func (v *VirtualEndpointsListResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualEndpointsList. +func (v *VirtualEndpointsList) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", v, err) @@ -4669,15 +4727,17 @@ func (v *VirtualEndpointsListResult) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type VirtualNetworkSubnetUsageParameter. -func (v VirtualNetworkSubnetUsageParameter) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type VirtualNetworkSubnetUsageModel. +func (v VirtualNetworkSubnetUsageModel) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "virtualNetworkArmResourceId", v.VirtualNetworkArmResourceID) + populate(objectMap, "delegatedSubnetsUsage", v.DelegatedSubnetsUsage) + populate(objectMap, "location", v.Location) + populate(objectMap, "subscriptionId", v.SubscriptionID) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkSubnetUsageParameter. -func (v *VirtualNetworkSubnetUsageParameter) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkSubnetUsageModel. +func (v *VirtualNetworkSubnetUsageModel) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", v, err) @@ -4685,8 +4745,14 @@ func (v *VirtualNetworkSubnetUsageParameter) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "virtualNetworkArmResourceId": - err = unpopulate(val, "VirtualNetworkArmResourceID", &v.VirtualNetworkArmResourceID) + case "delegatedSubnetsUsage": + err = unpopulate(val, "DelegatedSubnetsUsage", &v.DelegatedSubnetsUsage) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &v.Location) + delete(rawMsg, key) + case "subscriptionId": + err = unpopulate(val, "SubscriptionID", &v.SubscriptionID) delete(rawMsg, key) } if err != nil { @@ -4696,17 +4762,15 @@ func (v *VirtualNetworkSubnetUsageParameter) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type VirtualNetworkSubnetUsageResult. -func (v VirtualNetworkSubnetUsageResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type VirtualNetworkSubnetUsageParameter. +func (v VirtualNetworkSubnetUsageParameter) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "delegatedSubnetsUsage", v.DelegatedSubnetsUsage) - populate(objectMap, "location", v.Location) - populate(objectMap, "subscriptionId", v.SubscriptionID) + populate(objectMap, "virtualNetworkArmResourceId", v.VirtualNetworkArmResourceID) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkSubnetUsageResult. -func (v *VirtualNetworkSubnetUsageResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkSubnetUsageParameter. +func (v *VirtualNetworkSubnetUsageParameter) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", v, err) @@ -4714,14 +4778,8 @@ func (v *VirtualNetworkSubnetUsageResult) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "delegatedSubnetsUsage": - err = unpopulate(val, "DelegatedSubnetsUsage", &v.DelegatedSubnetsUsage) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &v.Location) - delete(rawMsg, key) - case "subscriptionId": - err = unpopulate(val, "SubscriptionID", &v.SubscriptionID) + case "virtualNetworkArmResourceId": + err = unpopulate(val, "VirtualNetworkArmResourceID", &v.VirtualNetworkArmResourceID) delete(rawMsg, key) } if err != nil { diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/nameavailability_client.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/nameavailability_client.go new file mode 100644 index 000000000000..1d23a385608e --- /dev/null +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/nameavailability_client.go @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armpostgresqlflexibleservers + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// NameAvailabilityClient contains the methods for the NameAvailability group. +// Don't use this type directly, use NewNameAvailabilityClient() instead. +type NameAvailabilityClient struct { + internal *arm.Client + subscriptionID string +} + +// NewNameAvailabilityClient creates a new instance of NameAvailabilityClient with the specified values. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - Contains optional client configuration. Pass nil to accept the default values. +func NewNameAvailabilityClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*NameAvailabilityClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &NameAvailabilityClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// CheckGlobally - Checks the validity and availability of the given name, to assign it to a new server or to use it as the +// base name of a new pair of virtual endpoints. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2025-08-01 +// - parameters - Parameters required to check if a given name is valid and available to assign it to a new server or to use +// it as the base name of a new pair of virtual endpoints. +// - options - NameAvailabilityClientCheckGloballyOptions contains the optional parameters for the NameAvailabilityClient.CheckGlobally +// method. +func (client *NameAvailabilityClient) CheckGlobally(ctx context.Context, parameters CheckNameAvailabilityRequest, options *NameAvailabilityClientCheckGloballyOptions) (NameAvailabilityClientCheckGloballyResponse, error) { + var err error + const operationName = "NameAvailabilityClient.CheckGlobally" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.checkGloballyCreateRequest(ctx, parameters, options) + if err != nil { + return NameAvailabilityClientCheckGloballyResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return NameAvailabilityClientCheckGloballyResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return NameAvailabilityClientCheckGloballyResponse{}, err + } + resp, err := client.checkGloballyHandleResponse(httpResp) + return resp, err +} + +// checkGloballyCreateRequest creates the CheckGlobally request. +func (client *NameAvailabilityClient) checkGloballyCreateRequest(ctx context.Context, parameters CheckNameAvailabilityRequest, _ *NameAvailabilityClientCheckGloballyOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.DBforPostgreSQL/checkNameAvailability" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2025-08-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} + +// checkGloballyHandleResponse handles the CheckGlobally response. +func (client *NameAvailabilityClient) checkGloballyHandleResponse(resp *http.Response) (NameAvailabilityClientCheckGloballyResponse, error) { + result := NameAvailabilityClientCheckGloballyResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.NameAvailabilityModel); err != nil { + return NameAvailabilityClientCheckGloballyResponse{}, err + } + return result, nil +} + +// CheckWithLocation - Check the availability of name for resource +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2025-08-01 +// - locationName - The name of the location. +// - parameters - Parameters required to check if a given name is valid and available to assign it to a new server or to use +// it as the base name of a new pair of virtual endpoints. +// - options - NameAvailabilityClientCheckWithLocationOptions contains the optional parameters for the NameAvailabilityClient.CheckWithLocation +// method. +func (client *NameAvailabilityClient) CheckWithLocation(ctx context.Context, locationName string, parameters CheckNameAvailabilityRequest, options *NameAvailabilityClientCheckWithLocationOptions) (NameAvailabilityClientCheckWithLocationResponse, error) { + var err error + const operationName = "NameAvailabilityClient.CheckWithLocation" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.checkWithLocationCreateRequest(ctx, locationName, parameters, options) + if err != nil { + return NameAvailabilityClientCheckWithLocationResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return NameAvailabilityClientCheckWithLocationResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return NameAvailabilityClientCheckWithLocationResponse{}, err + } + resp, err := client.checkWithLocationHandleResponse(httpResp) + return resp, err +} + +// checkWithLocationCreateRequest creates the CheckWithLocation request. +func (client *NameAvailabilityClient) checkWithLocationCreateRequest(ctx context.Context, locationName string, parameters CheckNameAvailabilityRequest, _ *NameAvailabilityClientCheckWithLocationOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.DBforPostgreSQL/locations/{locationName}/checkNameAvailability" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if locationName == "" { + return nil, errors.New("parameter locationName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{locationName}", url.PathEscape(locationName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2025-08-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} + +// checkWithLocationHandleResponse handles the CheckWithLocation response. +func (client *NameAvailabilityClient) checkWithLocationHandleResponse(resp *http.Response) (NameAvailabilityClientCheckWithLocationResponse, error) { + result := NameAvailabilityClientCheckWithLocationResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.NameAvailabilityModel); err != nil { + return NameAvailabilityClientCheckWithLocationResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/flexibleserver_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/nameavailability_client_example_test.go similarity index 50% rename from sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/flexibleserver_client_example_test.go rename to sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/nameavailability_client_example_test.go index bf2c4b7e5ce9..4a29547c8112 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/flexibleserver_client_example_test.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/nameavailability_client_example_test.go @@ -18,8 +18,8 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v5" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b1f4d539964453ce8008e4b069e59885e12ba441/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/LongTermRetentionPreBackup.json -func ExampleFlexibleServerClient_TriggerLtrPreBackup() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/735d21dbd7e1cc446babf58860af4cca757d620d/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/NameAvailabilityCheckGlobally.json +func ExampleNameAvailabilityClient_CheckGlobally() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -29,10 +29,9 @@ func ExampleFlexibleServerClient_TriggerLtrPreBackup() { if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewFlexibleServerClient().TriggerLtrPreBackup(ctx, "rgLongTermRetention", "pgsqlltrtestserver", armpostgresqlflexibleservers.LtrPreBackupRequest{ - BackupSettings: &armpostgresqlflexibleservers.BackupSettings{ - BackupName: to.Ptr("backup1"), - }, + res, err := clientFactory.NewNameAvailabilityClient().CheckGlobally(ctx, armpostgresqlflexibleservers.CheckNameAvailabilityRequest{ + Name: to.Ptr("exampleserver"), + Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers"), }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) @@ -40,15 +39,16 @@ func ExampleFlexibleServerClient_TriggerLtrPreBackup() { // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.LtrPreBackupResponse = armpostgresqlflexibleservers.LtrPreBackupResponse{ - // Properties: &armpostgresqlflexibleservers.LtrPreBackupResponseProperties{ - // NumberOfContainers: to.Ptr[int32](1), - // }, + // res.NameAvailabilityModel = armpostgresqlflexibleservers.NameAvailabilityModel{ + // Message: to.Ptr(""), + // NameAvailable: to.Ptr(true), + // Name: to.Ptr("exampleserver"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers"), // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b1f4d539964453ce8008e4b069e59885e12ba441/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/LongTermRetentionBackup.json -func ExampleFlexibleServerClient_BeginStartLtrBackup() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/735d21dbd7e1cc446babf58860af4cca757d620d/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/NameAvailabilityCheckWithLocation.json +func ExampleNameAvailabilityClient_CheckWithLocation() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -58,34 +58,20 @@ func ExampleFlexibleServerClient_BeginStartLtrBackup() { if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewFlexibleServerClient().BeginStartLtrBackup(ctx, "rgLongTermRetention", "pgsqlltrtestserver", armpostgresqlflexibleservers.LtrBackupRequest{ - BackupSettings: &armpostgresqlflexibleservers.BackupSettings{ - BackupName: to.Ptr("backup1"), - }, - TargetDetails: &armpostgresqlflexibleservers.BackupStoreDetails{ - SasURIList: []*string{ - to.Ptr("sasuri")}, - }, + res, err := clientFactory.NewNameAvailabilityClient().CheckWithLocation(ctx, "eastus", armpostgresqlflexibleservers.CheckNameAvailabilityRequest{ + Name: to.Ptr("exampleserver"), + Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers"), }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.LtrBackupResponse = armpostgresqlflexibleservers.LtrBackupResponse{ - // Properties: &armpostgresqlflexibleservers.LtrBackupOperationResponseProperties{ - // BackupMetadata: to.Ptr("backupmetadata"), - // DataTransferredInBytes: to.Ptr[int64](23), - // DatasourceSizeInBytes: to.Ptr[int64](23), - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-04-13T01:32:30.128Z"); return t}()), - // PercentComplete: to.Ptr[float64](100), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-04-13T01:32:30.128Z"); return t}()), - // Status: to.Ptr(armpostgresqlflexibleservers.ExecutionStatusRunning), - // }, + // res.NameAvailabilityModel = armpostgresqlflexibleservers.NameAvailabilityModel{ + // Message: to.Ptr(""), + // NameAvailable: to.Ptr(true), + // Name: to.Ptr("exampleserver"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers"), // } } diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/operations_client.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/operations_client.go index bde3dd3fdf19..ec0205d34439 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/operations_client.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/operations_client.go @@ -22,7 +22,7 @@ type OperationsClient struct { // NewOperationsClient creates a new instance of OperationsClient with the specified values. // - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. +// - options - Contains optional client configuration. Pass nil to accept the default values. func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*OperationsClient, error) { cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) if err != nil { @@ -34,9 +34,9 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO return client, nil } -// NewListPager - Lists all of the available REST API operations. +// NewListPager - Lists all available REST API operations. // -// Generated from API version 2025-01-01-preview +// Generated from API version 2025-08-01 // - options - OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[OperationsClientListResponse]{ @@ -69,7 +69,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, _ *Operat return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-01-01-preview") + reqQP.Set("api-version", "2025-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -78,7 +78,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, _ *Operat // listHandleResponse handles the List response. func (client *OperationsClient) listHandleResponse(resp *http.Response) (OperationsClientListResponse, error) { result := OperationsClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.OperationListResult); err != nil { + if err := runtime.UnmarshalAsJSON(resp, &result.OperationList); err != nil { return OperationsClientListResponse{}, err } return result, nil diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/operations_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/operations_client_example_test.go index 472e9ee0054e..72db4a968938 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/operations_client_example_test.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/operations_client_example_test.go @@ -17,7 +17,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v5" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b1f4d539964453ce8008e4b069e59885e12ba441/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/OperationList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/735d21dbd7e1cc446babf58860af4cca757d620d/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/OperationsList.json func ExampleOperationsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -39,7 +39,7 @@ func ExampleOperationsClient_NewListPager() { _ = v } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.OperationListResult = armpostgresqlflexibleservers.OperationListResult{ + // page.OperationList = armpostgresqlflexibleservers.OperationList{ // Value: []*armpostgresqlflexibleservers.Operation{ // { // Name: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/queryTexts/read"), diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/options.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/options.go index a916ff1c4148..0b7dc0bb1c9d 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/options.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/options.go @@ -5,60 +5,109 @@ package armpostgresqlflexibleservers -// AdministratorsClientBeginCreateOptions contains the optional parameters for the AdministratorsClient.BeginCreate method. -type AdministratorsClientBeginCreateOptions struct { +// AdministratorsMicrosoftEntraClientBeginCreateOrUpdateOptions contains the optional parameters for the AdministratorsMicrosoftEntraClient.BeginCreateOrUpdate +// method. +type AdministratorsMicrosoftEntraClientBeginCreateOrUpdateOptions struct { // Resumes the long-running operation from the provided token. ResumeToken string } -// AdministratorsClientBeginDeleteOptions contains the optional parameters for the AdministratorsClient.BeginDelete method. -type AdministratorsClientBeginDeleteOptions struct { +// AdministratorsMicrosoftEntraClientBeginDeleteOptions contains the optional parameters for the AdministratorsMicrosoftEntraClient.BeginDelete +// method. +type AdministratorsMicrosoftEntraClientBeginDeleteOptions struct { // Resumes the long-running operation from the provided token. ResumeToken string } -// AdministratorsClientGetOptions contains the optional parameters for the AdministratorsClient.Get method. -type AdministratorsClientGetOptions struct { +// AdministratorsMicrosoftEntraClientGetOptions contains the optional parameters for the AdministratorsMicrosoftEntraClient.Get +// method. +type AdministratorsMicrosoftEntraClientGetOptions struct { + // placeholder for future optional parameters +} + +// AdministratorsMicrosoftEntraClientListByServerOptions contains the optional parameters for the AdministratorsMicrosoftEntraClient.NewListByServerPager +// method. +type AdministratorsMicrosoftEntraClientListByServerOptions struct { // placeholder for future optional parameters } -// AdministratorsClientListByServerOptions contains the optional parameters for the AdministratorsClient.NewListByServerPager +// AdvancedThreatProtectionSettingsClientGetOptions contains the optional parameters for the AdvancedThreatProtectionSettingsClient.Get // method. -type AdministratorsClientListByServerOptions struct { +type AdvancedThreatProtectionSettingsClientGetOptions struct { // placeholder for future optional parameters } -// BackupsClientBeginCreateOptions contains the optional parameters for the BackupsClient.BeginCreate method. -type BackupsClientBeginCreateOptions struct { +// AdvancedThreatProtectionSettingsClientListByServerOptions contains the optional parameters for the AdvancedThreatProtectionSettingsClient.NewListByServerPager +// method. +type AdvancedThreatProtectionSettingsClientListByServerOptions struct { + // placeholder for future optional parameters +} + +// BackupsAutomaticAndOnDemandClientBeginCreateOptions contains the optional parameters for the BackupsAutomaticAndOnDemandClient.BeginCreate +// method. +type BackupsAutomaticAndOnDemandClientBeginCreateOptions struct { // Resumes the long-running operation from the provided token. ResumeToken string } -// BackupsClientBeginDeleteOptions contains the optional parameters for the BackupsClient.BeginDelete method. -type BackupsClientBeginDeleteOptions struct { +// BackupsAutomaticAndOnDemandClientBeginDeleteOptions contains the optional parameters for the BackupsAutomaticAndOnDemandClient.BeginDelete +// method. +type BackupsAutomaticAndOnDemandClientBeginDeleteOptions struct { // Resumes the long-running operation from the provided token. ResumeToken string } -// BackupsClientGetOptions contains the optional parameters for the BackupsClient.Get method. -type BackupsClientGetOptions struct { +// BackupsAutomaticAndOnDemandClientGetOptions contains the optional parameters for the BackupsAutomaticAndOnDemandClient.Get +// method. +type BackupsAutomaticAndOnDemandClientGetOptions struct { // placeholder for future optional parameters } -// BackupsClientListByServerOptions contains the optional parameters for the BackupsClient.NewListByServerPager method. -type BackupsClientListByServerOptions struct { +// BackupsAutomaticAndOnDemandClientListByServerOptions contains the optional parameters for the BackupsAutomaticAndOnDemandClient.NewListByServerPager +// method. +type BackupsAutomaticAndOnDemandClientListByServerOptions struct { // placeholder for future optional parameters } -// CheckNameAvailabilityClientExecuteOptions contains the optional parameters for the CheckNameAvailabilityClient.Execute +// BackupsLongTermRetentionClientBeginStartOptions contains the optional parameters for the BackupsLongTermRetentionClient.BeginStart // method. -type CheckNameAvailabilityClientExecuteOptions struct { +type BackupsLongTermRetentionClientBeginStartOptions struct { + // Resumes the long-running operation from the provided token. + ResumeToken string +} + +// BackupsLongTermRetentionClientCheckPrerequisitesOptions contains the optional parameters for the BackupsLongTermRetentionClient.CheckPrerequisites +// method. +type BackupsLongTermRetentionClientCheckPrerequisitesOptions struct { + // placeholder for future optional parameters +} + +// BackupsLongTermRetentionClientGetOptions contains the optional parameters for the BackupsLongTermRetentionClient.Get method. +type BackupsLongTermRetentionClientGetOptions struct { // placeholder for future optional parameters } -// CheckNameAvailabilityWithLocationClientExecuteOptions contains the optional parameters for the CheckNameAvailabilityWithLocationClient.Execute +// BackupsLongTermRetentionClientListByServerOptions contains the optional parameters for the BackupsLongTermRetentionClient.NewListByServerPager // method. -type CheckNameAvailabilityWithLocationClientExecuteOptions struct { +type BackupsLongTermRetentionClientListByServerOptions struct { + // placeholder for future optional parameters +} + +// CapabilitiesByLocationClientListOptions contains the optional parameters for the CapabilitiesByLocationClient.NewListPager +// method. +type CapabilitiesByLocationClientListOptions struct { + // placeholder for future optional parameters +} + +// CapabilitiesByServerClientListOptions contains the optional parameters for the CapabilitiesByServerClient.NewListPager +// method. +type CapabilitiesByServerClientListOptions struct { + // placeholder for future optional parameters +} + +// CapturedLogsClientListByServerOptions contains the optional parameters for the CapturedLogsClient.NewListByServerPager +// method. +type CapturedLogsClientListByServerOptions struct { // placeholder for future optional parameters } @@ -131,44 +180,14 @@ type FirewallRulesClientListByServerOptions struct { // placeholder for future optional parameters } -// FlexibleServerClientBeginStartLtrBackupOptions contains the optional parameters for the FlexibleServerClient.BeginStartLtrBackup -// method. -type FlexibleServerClientBeginStartLtrBackupOptions struct { - // Resumes the long-running operation from the provided token. - ResumeToken string -} - -// FlexibleServerClientTriggerLtrPreBackupOptions contains the optional parameters for the FlexibleServerClient.TriggerLtrPreBackup -// method. -type FlexibleServerClientTriggerLtrPreBackupOptions struct { - // placeholder for future optional parameters -} - -// GetPrivateDNSZoneSuffixClientExecuteOptions contains the optional parameters for the GetPrivateDNSZoneSuffixClient.Execute -// method. -type GetPrivateDNSZoneSuffixClientExecuteOptions struct { - // placeholder for future optional parameters -} - -// LocationBasedCapabilitiesClientExecuteOptions contains the optional parameters for the LocationBasedCapabilitiesClient.NewExecutePager -// method. -type LocationBasedCapabilitiesClientExecuteOptions struct { - // placeholder for future optional parameters -} - -// LogFilesClientListByServerOptions contains the optional parameters for the LogFilesClient.NewListByServerPager method. -type LogFilesClientListByServerOptions struct { +// MigrationsClientCancelOptions contains the optional parameters for the MigrationsClient.Cancel method. +type MigrationsClientCancelOptions struct { // placeholder for future optional parameters } -// LtrBackupOperationsClientGetOptions contains the optional parameters for the LtrBackupOperationsClient.Get method. -type LtrBackupOperationsClientGetOptions struct { - // placeholder for future optional parameters -} - -// LtrBackupOperationsClientListByServerOptions contains the optional parameters for the LtrBackupOperationsClient.NewListByServerPager +// MigrationsClientCheckNameAvailabilityOptions contains the optional parameters for the MigrationsClient.CheckNameAvailability // method. -type LtrBackupOperationsClientListByServerOptions struct { +type MigrationsClientCheckNameAvailabilityOptions struct { // placeholder for future optional parameters } @@ -177,11 +196,6 @@ type MigrationsClientCreateOptions struct { // placeholder for future optional parameters } -// MigrationsClientDeleteOptions contains the optional parameters for the MigrationsClient.Delete method. -type MigrationsClientDeleteOptions struct { - // placeholder for future optional parameters -} - // MigrationsClientGetOptions contains the optional parameters for the MigrationsClient.Get method. type MigrationsClientGetOptions struct { // placeholder for future optional parameters @@ -190,7 +204,7 @@ type MigrationsClientGetOptions struct { // MigrationsClientListByTargetServerOptions contains the optional parameters for the MigrationsClient.NewListByTargetServerPager // method. type MigrationsClientListByTargetServerOptions struct { - // Migration list filter. Retrieves either active migrations or all migrations. + // Migration list filter. Indicates if the request should retrieve only active migrations or all migrations. Defaults to Active. MigrationListFilter *MigrationListFilter } @@ -199,27 +213,38 @@ type MigrationsClientUpdateOptions struct { // placeholder for future optional parameters } +// NameAvailabilityClientCheckGloballyOptions contains the optional parameters for the NameAvailabilityClient.CheckGlobally +// method. +type NameAvailabilityClientCheckGloballyOptions struct { + // placeholder for future optional parameters +} + +// NameAvailabilityClientCheckWithLocationOptions contains the optional parameters for the NameAvailabilityClient.CheckWithLocation +// method. +type NameAvailabilityClientCheckWithLocationOptions struct { + // placeholder for future optional parameters +} + // OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. type OperationsClientListOptions struct { // placeholder for future optional parameters } -// PostgreSQLManagementClientCheckMigrationNameAvailabilityOptions contains the optional parameters for the PostgreSQLManagementClient.CheckMigrationNameAvailability -// method. -type PostgreSQLManagementClientCheckMigrationNameAvailabilityOptions struct { +// PrivateDNSZoneSuffixClientGetOptions contains the optional parameters for the PrivateDNSZoneSuffixClient.Get method. +type PrivateDNSZoneSuffixClientGetOptions struct { // placeholder for future optional parameters } -// PrivateEndpointConnectionClientBeginDeleteOptions contains the optional parameters for the PrivateEndpointConnectionClient.BeginDelete +// PrivateEndpointConnectionsClientBeginDeleteOptions contains the optional parameters for the PrivateEndpointConnectionsClient.BeginDelete // method. -type PrivateEndpointConnectionClientBeginDeleteOptions struct { +type PrivateEndpointConnectionsClientBeginDeleteOptions struct { // Resumes the long-running operation from the provided token. ResumeToken string } -// PrivateEndpointConnectionClientBeginUpdateOptions contains the optional parameters for the PrivateEndpointConnectionClient.BeginUpdate +// PrivateEndpointConnectionsClientBeginUpdateOptions contains the optional parameters for the PrivateEndpointConnectionsClient.BeginUpdate // method. -type PrivateEndpointConnectionClientBeginUpdateOptions struct { +type PrivateEndpointConnectionsClientBeginUpdateOptions struct { // Resumes the long-running operation from the provided token. ResumeToken string } @@ -257,11 +282,6 @@ type ReplicasClientListByServerOptions struct { // placeholder for future optional parameters } -// ServerCapabilitiesClientListOptions contains the optional parameters for the ServerCapabilitiesClient.NewListPager method. -type ServerCapabilitiesClientListOptions struct { - // placeholder for future optional parameters -} - // ServerThreatProtectionSettingsClientBeginCreateOrUpdateOptions contains the optional parameters for the ServerThreatProtectionSettingsClient.BeginCreateOrUpdate // method. type ServerThreatProtectionSettingsClientBeginCreateOrUpdateOptions struct { @@ -269,20 +289,8 @@ type ServerThreatProtectionSettingsClientBeginCreateOrUpdateOptions struct { ResumeToken string } -// ServerThreatProtectionSettingsClientGetOptions contains the optional parameters for the ServerThreatProtectionSettingsClient.Get -// method. -type ServerThreatProtectionSettingsClientGetOptions struct { - // placeholder for future optional parameters -} - -// ServerThreatProtectionSettingsClientListByServerOptions contains the optional parameters for the ServerThreatProtectionSettingsClient.NewListByServerPager -// method. -type ServerThreatProtectionSettingsClientListByServerOptions struct { - // placeholder for future optional parameters -} - -// ServersClientBeginCreateOptions contains the optional parameters for the ServersClient.BeginCreate method. -type ServersClientBeginCreateOptions struct { +// ServersClientBeginCreateOrUpdateOptions contains the optional parameters for the ServersClient.BeginCreateOrUpdate method. +type ServersClientBeginCreateOrUpdateOptions struct { // Resumes the long-running operation from the provided token. ResumeToken string } @@ -295,7 +303,7 @@ type ServersClientBeginDeleteOptions struct { // ServersClientBeginRestartOptions contains the optional parameters for the ServersClient.BeginRestart method. type ServersClientBeginRestartOptions struct { - // The parameters for restarting a server. + // Parameters to restart a server. Parameters *RestartParameter // Resumes the long-running operation from the provided token. @@ -331,58 +339,12 @@ type ServersClientListByResourceGroupOptions struct { // placeholder for future optional parameters } -// ServersClientListOptions contains the optional parameters for the ServersClient.NewListPager method. -type ServersClientListOptions struct { - // placeholder for future optional parameters -} - -// TuningConfigurationClientBeginDisableOptions contains the optional parameters for the TuningConfigurationClient.BeginDisable -// method. -type TuningConfigurationClientBeginDisableOptions struct { - // Resumes the long-running operation from the provided token. - ResumeToken string -} - -// TuningConfigurationClientBeginEnableOptions contains the optional parameters for the TuningConfigurationClient.BeginEnable -// method. -type TuningConfigurationClientBeginEnableOptions struct { - // Resumes the long-running operation from the provided token. - ResumeToken string -} - -// TuningConfigurationClientBeginStartSessionOptions contains the optional parameters for the TuningConfigurationClient.BeginStartSession -// method. -type TuningConfigurationClientBeginStartSessionOptions struct { - // Resumes the long-running operation from the provided token. - ResumeToken string -} - -// TuningConfigurationClientBeginStopSessionOptions contains the optional parameters for the TuningConfigurationClient.BeginStopSession -// method. -type TuningConfigurationClientBeginStopSessionOptions struct { - // Resumes the long-running operation from the provided token. - ResumeToken string -} - -// TuningConfigurationClientListSessionDetailsOptions contains the optional parameters for the TuningConfigurationClient.NewListSessionDetailsPager -// method. -type TuningConfigurationClientListSessionDetailsOptions struct { - // placeholder for future optional parameters -} - -// TuningConfigurationClientListSessionsOptions contains the optional parameters for the TuningConfigurationClient.NewListSessionsPager +// ServersClientListBySubscriptionOptions contains the optional parameters for the ServersClient.NewListBySubscriptionPager // method. -type TuningConfigurationClientListSessionsOptions struct { +type ServersClientListBySubscriptionOptions struct { // placeholder for future optional parameters } -// TuningIndexClientListRecommendationsOptions contains the optional parameters for the TuningIndexClient.NewListRecommendationsPager -// method. -type TuningIndexClientListRecommendationsOptions struct { - // Recommendations list filter. Retrieves recommendations based on type. - RecommendationType *RecommendationType -} - // TuningOptionsClientGetOptions contains the optional parameters for the TuningOptionsClient.Get method. type TuningOptionsClientGetOptions struct { // placeholder for future optional parameters @@ -394,6 +356,13 @@ type TuningOptionsClientListByServerOptions struct { // placeholder for future optional parameters } +// TuningOptionsClientListRecommendationsOptions contains the optional parameters for the TuningOptionsClient.NewListRecommendationsPager +// method. +type TuningOptionsClientListRecommendationsOptions struct { + // Recommendations list filter. Retrieves recommendations based on type. + RecommendationType *RecommendationTypeParameterEnum +} + // VirtualEndpointsClientBeginCreateOptions contains the optional parameters for the VirtualEndpointsClient.BeginCreate method. type VirtualEndpointsClientBeginCreateOptions struct { // Resumes the long-running operation from the provided token. @@ -423,8 +392,8 @@ type VirtualEndpointsClientListByServerOptions struct { // placeholder for future optional parameters } -// VirtualNetworkSubnetUsageClientExecuteOptions contains the optional parameters for the VirtualNetworkSubnetUsageClient.Execute +// VirtualNetworkSubnetUsageClientListOptions contains the optional parameters for the VirtualNetworkSubnetUsageClient.List // method. -type VirtualNetworkSubnetUsageClientExecuteOptions struct { +type VirtualNetworkSubnetUsageClientListOptions struct { // placeholder for future optional parameters } diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/postgresqlmanagement_client.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/postgresqlmanagement_client.go deleted file mode 100644 index d08d387d8ac9..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/postgresqlmanagement_client.go +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armpostgresqlflexibleservers - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// PostgreSQLManagementClient contains the methods for the PostgreSQLManagementClient group. -// Don't use this type directly, use NewPostgreSQLManagementClient() instead. -type PostgreSQLManagementClient struct { - internal *arm.Client -} - -// NewPostgreSQLManagementClient creates a new instance of PostgreSQLManagementClient with the specified values. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewPostgreSQLManagementClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*PostgreSQLManagementClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &PostgreSQLManagementClient{ - internal: cl, - } - return client, nil -} - -// CheckMigrationNameAvailability - This method checks whether a proposed migration name is valid and available. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-01-01-preview -// - subscriptionID - The subscription ID of the target database server. -// - resourceGroupName - The resource group name of the target database server. -// - targetDbServerName - The name of the target database server. -// - parameters - The required parameters for checking if a migration name is available. -// - options - PostgreSQLManagementClientCheckMigrationNameAvailabilityOptions contains the optional parameters for the PostgreSQLManagementClient.CheckMigrationNameAvailability -// method. -func (client *PostgreSQLManagementClient) CheckMigrationNameAvailability(ctx context.Context, subscriptionID string, resourceGroupName string, targetDbServerName string, parameters MigrationNameAvailabilityResource, options *PostgreSQLManagementClientCheckMigrationNameAvailabilityOptions) (PostgreSQLManagementClientCheckMigrationNameAvailabilityResponse, error) { - var err error - const operationName = "PostgreSQLManagementClient.CheckMigrationNameAvailability" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.checkMigrationNameAvailabilityCreateRequest(ctx, subscriptionID, resourceGroupName, targetDbServerName, parameters, options) - if err != nil { - return PostgreSQLManagementClientCheckMigrationNameAvailabilityResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return PostgreSQLManagementClientCheckMigrationNameAvailabilityResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return PostgreSQLManagementClientCheckMigrationNameAvailabilityResponse{}, err - } - resp, err := client.checkMigrationNameAvailabilityHandleResponse(httpResp) - return resp, err -} - -// checkMigrationNameAvailabilityCreateRequest creates the CheckMigrationNameAvailability request. -func (client *PostgreSQLManagementClient) checkMigrationNameAvailabilityCreateRequest(ctx context.Context, subscriptionID string, resourceGroupName string, targetDbServerName string, parameters MigrationNameAvailabilityResource, _ *PostgreSQLManagementClientCheckMigrationNameAvailabilityOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{targetDbServerName}/checkMigrationNameAvailability" - if subscriptionID == "" { - return nil, errors.New("parameter subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if targetDbServerName == "" { - return nil, errors.New("parameter targetDbServerName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{targetDbServerName}", url.PathEscape(targetDbServerName)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-01-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, parameters); err != nil { - return nil, err - } - return req, nil -} - -// checkMigrationNameAvailabilityHandleResponse handles the CheckMigrationNameAvailability response. -func (client *PostgreSQLManagementClient) checkMigrationNameAvailabilityHandleResponse(resp *http.Response) (PostgreSQLManagementClientCheckMigrationNameAvailabilityResponse, error) { - result := PostgreSQLManagementClientCheckMigrationNameAvailabilityResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.MigrationNameAvailabilityResource); err != nil { - return PostgreSQLManagementClientCheckMigrationNameAvailabilityResponse{}, err - } - return result, nil -} diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/postgresqlmanagement_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/postgresqlmanagement_client_example_test.go deleted file mode 100644 index 3f90975bdf5b..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/postgresqlmanagement_client_example_test.go +++ /dev/null @@ -1,47 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armpostgresqlflexibleservers_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v5" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b1f4d539964453ce8008e4b069e59885e12ba441/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/CheckMigrationNameAvailability.json -func ExamplePostgreSQLManagementClient_CheckMigrationNameAvailability() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPostgreSQLManagementClient().CheckMigrationNameAvailability(ctx, "ffffffff-ffff-ffff-ffff-ffffffffffff", "testrg", "testtarget", armpostgresqlflexibleservers.MigrationNameAvailabilityResource{ - Name: to.Ptr("name1"), - Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/migrations"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.MigrationNameAvailabilityResource = armpostgresqlflexibleservers.MigrationNameAvailabilityResource{ - // Name: to.Ptr("name1"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/migrations"), - // NameAvailable: to.Ptr(true), - // } -} diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/privatednszonesuffix_client.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/privatednszonesuffix_client.go new file mode 100644 index 000000000000..709e98bc3475 --- /dev/null +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/privatednszonesuffix_client.go @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armpostgresqlflexibleservers + +import ( + "context" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" +) + +// PrivateDNSZoneSuffixClient contains the methods for the PrivateDNSZoneSuffix group. +// Don't use this type directly, use NewPrivateDNSZoneSuffixClient() instead. +type PrivateDNSZoneSuffixClient struct { + internal *arm.Client +} + +// NewPrivateDNSZoneSuffixClient creates a new instance of PrivateDNSZoneSuffixClient with the specified values. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - Contains optional client configuration. Pass nil to accept the default values. +func NewPrivateDNSZoneSuffixClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*PrivateDNSZoneSuffixClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &PrivateDNSZoneSuffixClient{ + internal: cl, + } + return client, nil +} + +// Get - Gets the private DNS zone suffix. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2025-08-01 +// - options - PrivateDNSZoneSuffixClientGetOptions contains the optional parameters for the PrivateDNSZoneSuffixClient.Get +// method. +func (client *PrivateDNSZoneSuffixClient) Get(ctx context.Context, options *PrivateDNSZoneSuffixClientGetOptions) (PrivateDNSZoneSuffixClientGetResponse, error) { + var err error + const operationName = "PrivateDNSZoneSuffixClient.Get" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.getCreateRequest(ctx, options) + if err != nil { + return PrivateDNSZoneSuffixClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return PrivateDNSZoneSuffixClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return PrivateDNSZoneSuffixClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *PrivateDNSZoneSuffixClient) getCreateRequest(ctx context.Context, _ *PrivateDNSZoneSuffixClientGetOptions) (*policy.Request, error) { + urlPath := "/providers/Microsoft.DBforPostgreSQL/getPrivateDnsZoneSuffix" + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2025-08-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *PrivateDNSZoneSuffixClient) getHandleResponse(resp *http.Response) (PrivateDNSZoneSuffixClientGetResponse, error) { + result := PrivateDNSZoneSuffixClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.Value); err != nil { + return PrivateDNSZoneSuffixClientGetResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/getprivatednszonesuffix_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/privatednszonesuffix_client_example_test.go similarity index 80% rename from sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/getprivatednszonesuffix_client_example_test.go rename to sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/privatednszonesuffix_client_example_test.go index 0a25c59fdf01..fea9fedaf9cb 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/getprivatednszonesuffix_client_example_test.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/privatednszonesuffix_client_example_test.go @@ -17,8 +17,8 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v5" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b1f4d539964453ce8008e4b069e59885e12ba441/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/GetPrivateDnsZoneSuffix.json -func ExampleGetPrivateDNSZoneSuffixClient_Execute() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/735d21dbd7e1cc446babf58860af4cca757d620d/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/PrivateDnsZoneSuffixGet.json +func ExamplePrivateDNSZoneSuffixClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -28,7 +28,7 @@ func ExampleGetPrivateDNSZoneSuffixClient_Execute() { if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewGetPrivateDNSZoneSuffixClient().Execute(ctx, nil) + res, err := clientFactory.NewPrivateDNSZoneSuffixClient().Get(ctx, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/privateendpointconnection_client.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/privateendpointconnection_client.go deleted file mode 100644 index 912b01ad4e60..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/privateendpointconnection_client.go +++ /dev/null @@ -1,208 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armpostgresqlflexibleservers - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// PrivateEndpointConnectionClient contains the methods for the PrivateEndpointConnection group. -// Don't use this type directly, use NewPrivateEndpointConnectionClient() instead. -type PrivateEndpointConnectionClient struct { - internal *arm.Client - subscriptionID string -} - -// NewPrivateEndpointConnectionClient creates a new instance of PrivateEndpointConnectionClient with the specified values. -// - subscriptionID - The ID of the target subscription. The value must be an UUID. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewPrivateEndpointConnectionClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PrivateEndpointConnectionClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &PrivateEndpointConnectionClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// BeginDelete - Deletes a private endpoint connection with a given name. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-01-01-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - serverName - The name of the server. -// - privateEndpointConnectionName - The name of the private endpoint connection. -// - options - PrivateEndpointConnectionClientBeginDeleteOptions contains the optional parameters for the PrivateEndpointConnectionClient.BeginDelete -// method. -func (client *PrivateEndpointConnectionClient) BeginDelete(ctx context.Context, resourceGroupName string, serverName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionClientBeginDeleteOptions) (*runtime.Poller[PrivateEndpointConnectionClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, serverName, privateEndpointConnectionName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[PrivateEndpointConnectionClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[PrivateEndpointConnectionClientDeleteResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Delete - Deletes a private endpoint connection with a given name. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-01-01-preview -func (client *PrivateEndpointConnectionClient) deleteOperation(ctx context.Context, resourceGroupName string, serverName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionClientBeginDeleteOptions) (*http.Response, error) { - var err error - const operationName = "PrivateEndpointConnectionClient.BeginDelete" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.deleteCreateRequest(ctx, resourceGroupName, serverName, privateEndpointConnectionName, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusAccepted, http.StatusNoContent) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *PrivateEndpointConnectionClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, serverName string, privateEndpointConnectionName string, _ *PrivateEndpointConnectionClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/privateEndpointConnections/{privateEndpointConnectionName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if serverName == "" { - return nil, errors.New("parameter serverName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{serverName}", url.PathEscape(serverName)) - if privateEndpointConnectionName == "" { - return nil, errors.New("parameter privateEndpointConnectionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{privateEndpointConnectionName}", url.PathEscape(privateEndpointConnectionName)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-01-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// BeginUpdate - Approve or reject a private endpoint connection with a given name. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-01-01-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - serverName - The name of the server. -// - privateEndpointConnectionName - The name of the private endpoint connection. -// - parameters - The required parameters for updating private endpoint connection. -// - options - PrivateEndpointConnectionClientBeginUpdateOptions contains the optional parameters for the PrivateEndpointConnectionClient.BeginUpdate -// method. -func (client *PrivateEndpointConnectionClient) BeginUpdate(ctx context.Context, resourceGroupName string, serverName string, privateEndpointConnectionName string, parameters PrivateEndpointConnection, options *PrivateEndpointConnectionClientBeginUpdateOptions) (*runtime.Poller[PrivateEndpointConnectionClientUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.update(ctx, resourceGroupName, serverName, privateEndpointConnectionName, parameters, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[PrivateEndpointConnectionClientUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[PrivateEndpointConnectionClientUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Update - Approve or reject a private endpoint connection with a given name. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-01-01-preview -func (client *PrivateEndpointConnectionClient) update(ctx context.Context, resourceGroupName string, serverName string, privateEndpointConnectionName string, parameters PrivateEndpointConnection, options *PrivateEndpointConnectionClientBeginUpdateOptions) (*http.Response, error) { - var err error - const operationName = "PrivateEndpointConnectionClient.BeginUpdate" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.updateCreateRequest(ctx, resourceGroupName, serverName, privateEndpointConnectionName, parameters, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// updateCreateRequest creates the Update request. -func (client *PrivateEndpointConnectionClient) updateCreateRequest(ctx context.Context, resourceGroupName string, serverName string, privateEndpointConnectionName string, parameters PrivateEndpointConnection, _ *PrivateEndpointConnectionClientBeginUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/privateEndpointConnections/{privateEndpointConnectionName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if serverName == "" { - return nil, errors.New("parameter serverName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{serverName}", url.PathEscape(serverName)) - if privateEndpointConnectionName == "" { - return nil, errors.New("parameter privateEndpointConnectionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{privateEndpointConnectionName}", url.PathEscape(privateEndpointConnectionName)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-01-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, parameters); err != nil { - return nil, err - } - return req, nil -} diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/privateendpointconnection_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/privateendpointconnection_client_example_test.go deleted file mode 100644 index 731ef7360884..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/privateendpointconnection_client_example_test.go +++ /dev/null @@ -1,89 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armpostgresqlflexibleservers_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v5" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b1f4d539964453ce8008e4b069e59885e12ba441/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/PrivateEndpointConnectionUpdate.json -func ExamplePrivateEndpointConnectionClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewPrivateEndpointConnectionClient().BeginUpdate(ctx, "Default", "test-svr", "private-endpoint-connection-name.1fa229cd-bf3f-47f0-8c49-afb36723997e", armpostgresqlflexibleservers.PrivateEndpointConnection{ - Properties: &armpostgresqlflexibleservers.PrivateEndpointConnectionProperties{ - PrivateLinkServiceConnectionState: &armpostgresqlflexibleservers.PrivateLinkServiceConnectionState{ - Description: to.Ptr("Approved by johndoe@contoso.com"), - Status: to.Ptr(armpostgresqlflexibleservers.PrivateEndpointServiceConnectionStatusApproved), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PrivateEndpointConnection = armpostgresqlflexibleservers.PrivateEndpointConnection{ - // Name: to.Ptr("private-endpoint-connection-name.1fa229cd-bf3f-47f0-8c49-afb36723997e"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/Default/providers/Microsoft.DBforPostgreSQL/flexibleServers/test-svr/privateEndpointConnections/private-endpoint-connection-name.1fa229cd-bf3f-47f0-8c49-afb36723997e"), - // Properties: &armpostgresqlflexibleservers.PrivateEndpointConnectionProperties{ - // GroupIDs: []*string{ - // to.Ptr("postgresqlServer")}, - // PrivateEndpoint: &armpostgresqlflexibleservers.PrivateEndpoint{ - // ID: to.Ptr("/subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-Network/providers/Microsoft.Network/privateEndpoints/private-endpoint-name"), - // }, - // PrivateLinkServiceConnectionState: &armpostgresqlflexibleservers.PrivateLinkServiceConnectionState{ - // Description: to.Ptr("Approved by johndoe@contoso.com"), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr(armpostgresqlflexibleservers.PrivateEndpointServiceConnectionStatusApproved), - // }, - // ProvisioningState: to.Ptr(armpostgresqlflexibleservers.PrivateEndpointConnectionProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b1f4d539964453ce8008e4b069e59885e12ba441/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/PrivateEndpointConnectionDelete.json -func ExamplePrivateEndpointConnectionClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewPrivateEndpointConnectionClient().BeginDelete(ctx, "Default", "test-svr", "private-endpoint-connection-name.1fa229cd-bf3f-47f0-8c49-afb36723997e", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/privateendpointconnections_client.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/privateendpointconnections_client.go index fbe57aa91d9e..9b431f7a863f 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/privateendpointconnections_client.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/privateendpointconnections_client.go @@ -27,7 +27,7 @@ type PrivateEndpointConnectionsClient struct { // NewPrivateEndpointConnectionsClient creates a new instance of PrivateEndpointConnectionsClient with the specified values. // - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. +// - options - Contains optional client configuration. Pass nil to accept the default values. func NewPrivateEndpointConnectionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PrivateEndpointConnectionsClient, error) { cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) if err != nil { @@ -40,10 +40,92 @@ func NewPrivateEndpointConnectionsClient(subscriptionID string, credential azcor return client, nil } +// BeginDelete - Deletes a private endpoint connection. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2025-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serverName - The name of the server. +// - privateEndpointConnectionName - The name of the private endpoint connection. +// - options - PrivateEndpointConnectionsClientBeginDeleteOptions contains the optional parameters for the PrivateEndpointConnectionsClient.BeginDelete +// method. +func (client *PrivateEndpointConnectionsClient) BeginDelete(ctx context.Context, resourceGroupName string, serverName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientBeginDeleteOptions) (*runtime.Poller[PrivateEndpointConnectionsClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, serverName, privateEndpointConnectionName, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[PrivateEndpointConnectionsClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[PrivateEndpointConnectionsClientDeleteResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// Delete - Deletes a private endpoint connection. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2025-08-01 +func (client *PrivateEndpointConnectionsClient) deleteOperation(ctx context.Context, resourceGroupName string, serverName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientBeginDeleteOptions) (*http.Response, error) { + var err error + const operationName = "PrivateEndpointConnectionsClient.BeginDelete" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.deleteCreateRequest(ctx, resourceGroupName, serverName, privateEndpointConnectionName, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *PrivateEndpointConnectionsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, serverName string, privateEndpointConnectionName string, _ *PrivateEndpointConnectionsClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/privateEndpointConnections/{privateEndpointConnectionName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serverName == "" { + return nil, errors.New("parameter serverName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serverName}", url.PathEscape(serverName)) + if privateEndpointConnectionName == "" { + return nil, errors.New("parameter privateEndpointConnectionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{privateEndpointConnectionName}", url.PathEscape(privateEndpointConnectionName)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2025-08-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + // Get - Gets a private endpoint connection. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-01-01-preview +// Generated from API version 2025-08-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - privateEndpointConnectionName - The name of the private endpoint connection. @@ -95,7 +177,7 @@ func (client *PrivateEndpointConnectionsClient) getCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-01-01-preview") + reqQP.Set("api-version", "2025-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -110,9 +192,9 @@ func (client *PrivateEndpointConnectionsClient) getHandleResponse(resp *http.Res return result, nil } -// NewListByServerPager - Gets all private endpoint connections on a server. +// NewListByServerPager - Lists all private endpoint connections on a server. // -// Generated from API version 2025-01-01-preview +// Generated from API version 2025-08-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - options - PrivateEndpointConnectionsClientListByServerOptions contains the optional parameters for the PrivateEndpointConnectionsClient.NewListByServerPager @@ -160,7 +242,7 @@ func (client *PrivateEndpointConnectionsClient) listByServerCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-01-01-preview") + reqQP.Set("api-version", "2025-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -169,8 +251,93 @@ func (client *PrivateEndpointConnectionsClient) listByServerCreateRequest(ctx co // listByServerHandleResponse handles the ListByServer response. func (client *PrivateEndpointConnectionsClient) listByServerHandleResponse(resp *http.Response) (PrivateEndpointConnectionsClientListByServerResponse, error) { result := PrivateEndpointConnectionsClientListByServerResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.PrivateEndpointConnectionListResult); err != nil { + if err := runtime.UnmarshalAsJSON(resp, &result.PrivateEndpointConnectionList); err != nil { return PrivateEndpointConnectionsClientListByServerResponse{}, err } return result, nil } + +// BeginUpdate - Approves or rejects a private endpoint connection. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2025-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serverName - The name of the server. +// - privateEndpointConnectionName - The name of the private endpoint connection. +// - parameters - Parameters required to update a private endpoint connection. +// - options - PrivateEndpointConnectionsClientBeginUpdateOptions contains the optional parameters for the PrivateEndpointConnectionsClient.BeginUpdate +// method. +func (client *PrivateEndpointConnectionsClient) BeginUpdate(ctx context.Context, resourceGroupName string, serverName string, privateEndpointConnectionName string, parameters PrivateEndpointConnection, options *PrivateEndpointConnectionsClientBeginUpdateOptions) (*runtime.Poller[PrivateEndpointConnectionsClientUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.update(ctx, resourceGroupName, serverName, privateEndpointConnectionName, parameters, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[PrivateEndpointConnectionsClientUpdateResponse]{ + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[PrivateEndpointConnectionsClientUpdateResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// Update - Approves or rejects a private endpoint connection. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2025-08-01 +func (client *PrivateEndpointConnectionsClient) update(ctx context.Context, resourceGroupName string, serverName string, privateEndpointConnectionName string, parameters PrivateEndpointConnection, options *PrivateEndpointConnectionsClientBeginUpdateOptions) (*http.Response, error) { + var err error + const operationName = "PrivateEndpointConnectionsClient.BeginUpdate" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.updateCreateRequest(ctx, resourceGroupName, serverName, privateEndpointConnectionName, parameters, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// updateCreateRequest creates the Update request. +func (client *PrivateEndpointConnectionsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, serverName string, privateEndpointConnectionName string, parameters PrivateEndpointConnection, _ *PrivateEndpointConnectionsClientBeginUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/privateEndpointConnections/{privateEndpointConnectionName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serverName == "" { + return nil, errors.New("parameter serverName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serverName}", url.PathEscape(serverName)) + if privateEndpointConnectionName == "" { + return nil, errors.New("parameter privateEndpointConnectionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{privateEndpointConnectionName}", url.PathEscape(privateEndpointConnectionName)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2025-08-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/privateendpointconnections_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/privateendpointconnections_client_example_test.go index cfb136520db0..5404ee054de8 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/privateendpointconnections_client_example_test.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/privateendpointconnections_client_example_test.go @@ -13,11 +13,12 @@ import ( "context" "log" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v5" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b1f4d539964453ce8008e4b069e59885e12ba441/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/PrivateEndpointConnectionGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/735d21dbd7e1cc446babf58860af4cca757d620d/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/PrivateEndpointConnectionsGet.json func ExamplePrivateEndpointConnectionsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -28,7 +29,7 @@ func ExamplePrivateEndpointConnectionsClient_Get() { if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewPrivateEndpointConnectionsClient().Get(ctx, "Default", "test-svr", "private-endpoint-connection-name.1fa229cd-bf3f-47f0-8c49-afb36723997e", nil) + res, err := clientFactory.NewPrivateEndpointConnectionsClient().Get(ctx, "exampleresourcegroup", "exampleserver", "private-endpoint-connection-name.1fa229cd-bf3f-47f0-8c49-afb36723997e", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -38,12 +39,12 @@ func ExamplePrivateEndpointConnectionsClient_Get() { // res.PrivateEndpointConnection = armpostgresqlflexibleservers.PrivateEndpointConnection{ // Name: to.Ptr("private-endpoint-connection-name.1fa229cd-bf3f-47f0-8c49-afb36723997e"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/Default/providers/Microsoft.DBforPostgreSQL/flexibleServers/test-svr/privateEndpointConnections/private-endpoint-connection-name.1fa229cd-bf3f-47f0-8c49-afb36723997e"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/privateEndpointConnections/private-endpoint-connection-name.1fa229cd-bf3f-47f0-8c49-afb36723997e"), // Properties: &armpostgresqlflexibleservers.PrivateEndpointConnectionProperties{ // GroupIDs: []*string{ // to.Ptr("postgresqlServer")}, // PrivateEndpoint: &armpostgresqlflexibleservers.PrivateEndpoint{ - // ID: to.Ptr("/subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-Network/providers/Microsoft.Network/privateEndpoints/private-endpoint-name"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.Network/privateEndpoints/private-endpoint-name"), // }, // PrivateLinkServiceConnectionState: &armpostgresqlflexibleservers.PrivateLinkServiceConnectionState{ // Description: to.Ptr("Auto-approved"), @@ -55,7 +56,56 @@ func ExamplePrivateEndpointConnectionsClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b1f4d539964453ce8008e4b069e59885e12ba441/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/PrivateEndpointConnectionList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/735d21dbd7e1cc446babf58860af4cca757d620d/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/PrivateEndpointConnectionsUpdate.json +func ExamplePrivateEndpointConnectionsClient_BeginUpdate() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewPrivateEndpointConnectionsClient().BeginUpdate(ctx, "exampleresourcegroup", "exampleserver", "private-endpoint-connection-name.1fa229cd-bf3f-47f0-8c49-afb36723997e", armpostgresqlflexibleservers.PrivateEndpointConnection{ + Properties: &armpostgresqlflexibleservers.PrivateEndpointConnectionProperties{ + PrivateLinkServiceConnectionState: &armpostgresqlflexibleservers.PrivateLinkServiceConnectionState{ + Description: to.Ptr("Approved by johndoe@contoso.com"), + Status: to.Ptr(armpostgresqlflexibleservers.PrivateEndpointServiceConnectionStatusApproved), + }, + }, + }, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + _, err = poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/735d21dbd7e1cc446babf58860af4cca757d620d/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/PrivateEndpointConnectionsDelete.json +func ExamplePrivateEndpointConnectionsClient_BeginDelete() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewPrivateEndpointConnectionsClient().BeginDelete(ctx, "exampleresourcegroup", "exampleserver", "private-endpoint-connection-name.1fa229cd-bf3f-47f0-8c49-afb36723997e", nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + _, err = poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/735d21dbd7e1cc446babf58860af4cca757d620d/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/PrivateEndpointConnectionsList.json func ExamplePrivateEndpointConnectionsClient_NewListByServerPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -66,7 +116,7 @@ func ExamplePrivateEndpointConnectionsClient_NewListByServerPager() { if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewPrivateEndpointConnectionsClient().NewListByServerPager("Default", "test-svr", nil) + pager := clientFactory.NewPrivateEndpointConnectionsClient().NewListByServerPager("exampleresourcegroup", "exampleserver", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -77,17 +127,17 @@ func ExamplePrivateEndpointConnectionsClient_NewListByServerPager() { _ = v } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.PrivateEndpointConnectionListResult = armpostgresqlflexibleservers.PrivateEndpointConnectionListResult{ + // page.PrivateEndpointConnectionList = armpostgresqlflexibleservers.PrivateEndpointConnectionList{ // Value: []*armpostgresqlflexibleservers.PrivateEndpointConnection{ // { // Name: to.Ptr("private-endpoint-connection-name.1fa229cd-bf3f-47f0-8c49-afb36723997e"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.DBforPostgreSQL/flexibleServers/test-svr/privateEndpointConnections/private-endpoint-connection-name.1fa229cd-bf3f-47f0-8c49-afb36723997e"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/privateEndpointConnections/private-endpoint-connection-name.1fa229cd-bf3f-47f0-8c49-afb36723997e"), // Properties: &armpostgresqlflexibleservers.PrivateEndpointConnectionProperties{ // GroupIDs: []*string{ // to.Ptr("postgresqlServer")}, // PrivateEndpoint: &armpostgresqlflexibleservers.PrivateEndpoint{ - // ID: to.Ptr("/subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-Network/providers/Microsoft.Network/privateEndpoints/private-endpoint-name"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.Network/privateEndpoints/private-endpoint-name"), // }, // PrivateLinkServiceConnectionState: &armpostgresqlflexibleservers.PrivateLinkServiceConnectionState{ // Description: to.Ptr("Auto-approved"), @@ -100,12 +150,12 @@ func ExamplePrivateEndpointConnectionsClient_NewListByServerPager() { // { // Name: to.Ptr("private-endpoint-connection-name-2.1fa229cd-bf3f-47f0-8c49-afb36723997e"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.DBforPostgreSQL/flexibleServers/test-svr/privateEndpointConnections/private-endpoint-connection-name-2.1fa229cd-bf3f-47f0-8c49-afb36723997e"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/privateEndpointConnections/private-endpoint-connection-name-2.1fa229cd-bf3f-47f0-8c49-afb36723997e"), // Properties: &armpostgresqlflexibleservers.PrivateEndpointConnectionProperties{ // GroupIDs: []*string{ // to.Ptr("postgresqlServer")}, // PrivateEndpoint: &armpostgresqlflexibleservers.PrivateEndpoint{ - // ID: to.Ptr("/subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-Network/providers/Microsoft.Network/privateEndpoints/private-endpoint-name-2"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.Network/privateEndpoints/private-endpoint-name-2"), // }, // PrivateLinkServiceConnectionState: &armpostgresqlflexibleservers.PrivateLinkServiceConnectionState{ // Description: to.Ptr("Auto-approved"), diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/privatelinkresources_client.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/privatelinkresources_client.go index d53596b2dc8b..d356f2dba8fa 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/privatelinkresources_client.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/privatelinkresources_client.go @@ -27,7 +27,7 @@ type PrivateLinkResourcesClient struct { // NewPrivateLinkResourcesClient creates a new instance of PrivateLinkResourcesClient with the specified values. // - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. +// - options - Contains optional client configuration. Pass nil to accept the default values. func NewPrivateLinkResourcesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PrivateLinkResourcesClient, error) { cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) if err != nil { @@ -43,7 +43,7 @@ func NewPrivateLinkResourcesClient(subscriptionID string, credential azcore.Toke // Get - Gets a private link resource for PostgreSQL server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-01-01-preview +// Generated from API version 2025-08-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - groupName - The name of the private link resource. @@ -95,7 +95,7 @@ func (client *PrivateLinkResourcesClient) getCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-01-01-preview") + reqQP.Set("api-version", "2025-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -112,7 +112,7 @@ func (client *PrivateLinkResourcesClient) getHandleResponse(resp *http.Response) // NewListByServerPager - Gets the private link resources for PostgreSQL server. // -// Generated from API version 2025-01-01-preview +// Generated from API version 2025-08-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - options - PrivateLinkResourcesClientListByServerOptions contains the optional parameters for the PrivateLinkResourcesClient.NewListByServerPager @@ -160,7 +160,7 @@ func (client *PrivateLinkResourcesClient) listByServerCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-01-01-preview") + reqQP.Set("api-version", "2025-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -169,7 +169,7 @@ func (client *PrivateLinkResourcesClient) listByServerCreateRequest(ctx context. // listByServerHandleResponse handles the ListByServer response. func (client *PrivateLinkResourcesClient) listByServerHandleResponse(resp *http.Response) (PrivateLinkResourcesClientListByServerResponse, error) { result := PrivateLinkResourcesClientListByServerResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.PrivateLinkResourceListResult); err != nil { + if err := runtime.UnmarshalAsJSON(resp, &result.PrivateLinkResourceList); err != nil { return PrivateLinkResourcesClientListByServerResponse{}, err } return result, nil diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/privatelinkresources_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/privatelinkresources_client_example_test.go index e482521d3ab6..c11fc36036ec 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/privatelinkresources_client_example_test.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/privatelinkresources_client_example_test.go @@ -17,7 +17,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v5" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b1f4d539964453ce8008e4b069e59885e12ba441/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/PrivateLinkResourcesList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/735d21dbd7e1cc446babf58860af4cca757d620d/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/PrivateLinkResourcesList.json func ExamplePrivateLinkResourcesClient_NewListByServerPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -28,7 +28,7 @@ func ExamplePrivateLinkResourcesClient_NewListByServerPager() { if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewPrivateLinkResourcesClient().NewListByServerPager("Default", "test-svr", nil) + pager := clientFactory.NewPrivateLinkResourcesClient().NewListByServerPager("exampleresourcegroup", "exampleserver", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -39,25 +39,25 @@ func ExamplePrivateLinkResourcesClient_NewListByServerPager() { _ = v } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.PrivateLinkResourceListResult = armpostgresqlflexibleservers.PrivateLinkResourceListResult{ + // page.PrivateLinkResourceList = armpostgresqlflexibleservers.PrivateLinkResourceList{ // Value: []*armpostgresqlflexibleservers.PrivateLinkResource{ // { - // Name: to.Ptr("plr"), + // Name: to.Ptr("exampleprivatelink"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/privateLinkResources"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/Default/providers/Microsoft.DBforPostgreSQL/flexibleServers/test-svr/privateLinkResources/plr"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/privateLinkResources/exampleprivatelink"), // Properties: &armpostgresqlflexibleservers.PrivateLinkResourceProperties{ // GroupID: to.Ptr("postgresqlServer"), // RequiredMembers: []*string{ // to.Ptr("postgresqlServer")}, // RequiredZoneNames: []*string{ - // to.Ptr("privatelink.meru.com")}, + // to.Ptr("privatelink.postgres.database.azure.com")}, // }, // }}, // } } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b1f4d539964453ce8008e4b069e59885e12ba441/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/PrivateLinkResourcesGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/735d21dbd7e1cc446babf58860af4cca757d620d/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/PrivateLinkResourcesGet.json func ExamplePrivateLinkResourcesClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -68,7 +68,7 @@ func ExamplePrivateLinkResourcesClient_Get() { if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewPrivateLinkResourcesClient().Get(ctx, "Default", "test-svr", "plr", nil) + res, err := clientFactory.NewPrivateLinkResourcesClient().Get(ctx, "exampleresourcegroup", "exampleserver", "exampleprivatelink", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -76,15 +76,15 @@ func ExamplePrivateLinkResourcesClient_Get() { _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.PrivateLinkResource = armpostgresqlflexibleservers.PrivateLinkResource{ - // Name: to.Ptr("plr"), + // Name: to.Ptr("exampleprivatelink"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/privateLinkResources"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/Default/providers/Microsoft.DBforPostgreSQL/flexibleServers/test-svr/privateLinkResources/plr"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/privateLinkResources/exampleprivatelink"), // Properties: &armpostgresqlflexibleservers.PrivateLinkResourceProperties{ // GroupID: to.Ptr("postgresqlServer"), // RequiredMembers: []*string{ // to.Ptr("postgresqlServer")}, // RequiredZoneNames: []*string{ - // to.Ptr("privatelink.meru.com")}, + // to.Ptr("privatelink.postgres.database.azure.com")}, // }, // } } diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/quotausages_client.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/quotausages_client.go index 36e33b20fc06..829b1e54032d 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/quotausages_client.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/quotausages_client.go @@ -27,7 +27,7 @@ type QuotaUsagesClient struct { // NewQuotaUsagesClient creates a new instance of QuotaUsagesClient with the specified values. // - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. +// - options - Contains optional client configuration. Pass nil to accept the default values. func NewQuotaUsagesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*QuotaUsagesClient, error) { cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) if err != nil { @@ -42,7 +42,7 @@ func NewQuotaUsagesClient(subscriptionID string, credential azcore.TokenCredenti // NewListPager - Get quota usages at specified location in a given subscription. // -// Generated from API version 2025-01-01-preview +// Generated from API version 2025-08-01 // - locationName - The name of the location. // - options - QuotaUsagesClientListOptions contains the optional parameters for the QuotaUsagesClient.NewListPager method. func (client *QuotaUsagesClient) NewListPager(locationName string, options *QuotaUsagesClientListOptions) *runtime.Pager[QuotaUsagesClientListResponse] { @@ -84,7 +84,7 @@ func (client *QuotaUsagesClient) listCreateRequest(ctx context.Context, location return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-01-01-preview") + reqQP.Set("api-version", "2025-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -93,7 +93,7 @@ func (client *QuotaUsagesClient) listCreateRequest(ctx context.Context, location // listHandleResponse handles the List response. func (client *QuotaUsagesClient) listHandleResponse(resp *http.Response) (QuotaUsagesClientListResponse, error) { result := QuotaUsagesClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.QuotaUsagesListResult); err != nil { + if err := runtime.UnmarshalAsJSON(resp, &result.QuotaUsageList); err != nil { return QuotaUsagesClientListResponse{}, err } return result, nil diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/quotausages_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/quotausages_client_example_test.go index 6e7ff032031d..85cacb4d2f8c 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/quotausages_client_example_test.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/quotausages_client_example_test.go @@ -17,7 +17,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v5" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b1f4d539964453ce8008e4b069e59885e12ba441/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/QuotaUsagesForFlexibleServers.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/735d21dbd7e1cc446babf58860af4cca757d620d/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/QuotaUsagesForFlexibleServers.json func ExampleQuotaUsagesClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -28,7 +28,7 @@ func ExampleQuotaUsagesClient_NewListPager() { if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewQuotaUsagesClient().NewListPager("westus", nil) + pager := clientFactory.NewQuotaUsagesClient().NewListPager("eastus", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -39,7 +39,7 @@ func ExampleQuotaUsagesClient_NewListPager() { _ = v } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.QuotaUsagesListResult = armpostgresqlflexibleservers.QuotaUsagesListResult{ + // page.QuotaUsageList = armpostgresqlflexibleservers.QuotaUsageList{ // Value: []*armpostgresqlflexibleservers.QuotaUsage{ // { // Name: &armpostgresqlflexibleservers.NameProperty{ diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/replicas_client.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/replicas_client.go index a39944459ce4..d585c55720b6 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/replicas_client.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/replicas_client.go @@ -27,7 +27,7 @@ type ReplicasClient struct { // NewReplicasClient creates a new instance of ReplicasClient with the specified values. // - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. +// - options - Contains optional client configuration. Pass nil to accept the default values. func NewReplicasClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ReplicasClient, error) { cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) if err != nil { @@ -40,9 +40,9 @@ func NewReplicasClient(subscriptionID string, credential azcore.TokenCredential, return client, nil } -// NewListByServerPager - List all the replicas for a given server. +// NewListByServerPager - Lists all read replicas of a server. // -// Generated from API version 2025-01-01-preview +// Generated from API version 2025-08-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - options - ReplicasClientListByServerOptions contains the optional parameters for the ReplicasClient.NewListByServerPager @@ -91,7 +91,7 @@ func (client *ReplicasClient) listByServerCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-01-01-preview") + reqQP.Set("api-version", "2025-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -100,7 +100,7 @@ func (client *ReplicasClient) listByServerCreateRequest(ctx context.Context, res // listByServerHandleResponse handles the ListByServer response. func (client *ReplicasClient) listByServerHandleResponse(resp *http.Response) (ReplicasClientListByServerResponse, error) { result := ReplicasClientListByServerResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ServerListResult); err != nil { + if err := runtime.UnmarshalAsJSON(resp, &result.ServerList); err != nil { return ReplicasClientListByServerResponse{}, err } return result, nil diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/replicas_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/replicas_client_example_test.go index dea33c121bbc..42ef6aa93e63 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/replicas_client_example_test.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/replicas_client_example_test.go @@ -17,7 +17,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v5" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b1f4d539964453ce8008e4b069e59885e12ba441/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ReplicasListByServer.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/735d21dbd7e1cc446babf58860af4cca757d620d/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/ReplicasListByServer.json func ExampleReplicasClient_NewListByServerPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -28,7 +28,7 @@ func ExampleReplicasClient_NewListByServerPager() { if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewReplicasClient().NewListByServerPager("testrg", "sourcepgservername", nil) + pager := clientFactory.NewReplicasClient().NewListByServerPager("exampleresourcegroup", "exampleserver", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -39,35 +39,32 @@ func ExampleReplicasClient_NewListByServerPager() { _ = v } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ServerListResult = armpostgresqlflexibleservers.ServerListResult{ + // page.ServerList = armpostgresqlflexibleservers.ServerList{ // Value: []*armpostgresqlflexibleservers.Server{ // { - // Name: to.Ptr("pgtestsvc5rep"), + // Name: to.Ptr("exampleserver"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/pgtestsvc5rep"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "ElasticServer": to.Ptr("1"), - // }, + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver"), + // Location: to.Ptr("eastus"), // Properties: &armpostgresqlflexibleservers.ServerProperties{ - // AdministratorLogin: to.Ptr("login"), + // AdministratorLogin: to.Ptr("exampleadministratorlogin"), // AuthConfig: &armpostgresqlflexibleservers.AuthConfig{ - // ActiveDirectoryAuth: to.Ptr(armpostgresqlflexibleservers.ActiveDirectoryAuthEnumDisabled), - // PasswordAuth: to.Ptr(armpostgresqlflexibleservers.PasswordAuthEnumEnabled), + // ActiveDirectoryAuth: to.Ptr(armpostgresqlflexibleservers.MicrosoftEntraAuthDisabled), + // PasswordAuth: to.Ptr(armpostgresqlflexibleservers.PasswordBasedAuthEnabled), // }, // AvailabilityZone: to.Ptr("2"), // Backup: &armpostgresqlflexibleservers.Backup{ // BackupRetentionDays: to.Ptr[int32](7), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-03-03T00:28:17.727Z"); return t}()), - // GeoRedundantBackup: to.Ptr(armpostgresqlflexibleservers.GeoRedundantBackupEnumDisabled), + // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T18:35:22.123Z"); return t}()), + // GeoRedundantBackup: to.Ptr(armpostgresqlflexibleservers.GeographicallyRedundantBackupDisabled), // }, // DataEncryption: &armpostgresqlflexibleservers.DataEncryption{ - // Type: to.Ptr(armpostgresqlflexibleservers.ArmServerKeyTypeSystemManaged), + // Type: to.Ptr(armpostgresqlflexibleservers.DataEncryptionTypeSystemManaged), // }, - // FullyQualifiedDomainName: to.Ptr("pgtestsvc5rep.postgres.database.azure.com"), + // FullyQualifiedDomainName: to.Ptr("exampleserver.postgres.database.azure.com"), // HighAvailability: &armpostgresqlflexibleservers.HighAvailability{ - // Mode: to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeDisabled), - // State: to.Ptr(armpostgresqlflexibleservers.ServerHAStateNotEnabled), + // Mode: to.Ptr(armpostgresqlflexibleservers.HighAvailabilityMode("Disabled")), + // State: to.Ptr(armpostgresqlflexibleservers.HighAvailabilityStateNotEnabled), // }, // MaintenanceWindow: &armpostgresqlflexibleservers.MaintenanceWindow{ // CustomWindow: to.Ptr("Disabled"), @@ -75,7 +72,7 @@ func ExampleReplicasClient_NewListByServerPager() { // StartHour: to.Ptr[int32](0), // StartMinute: to.Ptr[int32](0), // }, - // MinorVersion: to.Ptr("6"), + // MinorVersion: to.Ptr("5"), // Network: &armpostgresqlflexibleservers.Network{ // PublicNetworkAccess: to.Ptr(armpostgresqlflexibleservers.ServerPublicNetworkAccessStateEnabled), // }, @@ -91,9 +88,9 @@ func ExampleReplicasClient_NewListByServerPager() { // AutoGrow: to.Ptr(armpostgresqlflexibleservers.StorageAutoGrowDisabled), // Iops: to.Ptr[int32](2300), // StorageSizeGB: to.Ptr[int32](512), - // Tier: to.Ptr(armpostgresqlflexibleservers.AzureManagedDiskPerformanceTiersP20), + // Tier: to.Ptr(armpostgresqlflexibleservers.AzureManagedDiskPerformanceTierP20), // }, - // Version: to.Ptr(armpostgresqlflexibleservers.ServerVersionSixteen), + // Version: to.Ptr(armpostgresqlflexibleservers.PostgresMajorVersionSeventeen), // }, // SKU: &armpostgresqlflexibleservers.SKU{ // Name: to.Ptr("Standard_D4ds_v5"), diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/responses.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/responses.go index 419ed6ca67cb..d0724d6e164f 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/responses.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/responses.go @@ -5,92 +5,132 @@ package armpostgresqlflexibleservers -// AdministratorsClientCreateResponse contains the response from method AdministratorsClient.BeginCreate. -type AdministratorsClientCreateResponse struct { - // Represents an Microsoft Entra Administrator. - ActiveDirectoryAdministrator +// AdministratorsMicrosoftEntraClientCreateOrUpdateResponse contains the response from method AdministratorsMicrosoftEntraClient.BeginCreateOrUpdate. +type AdministratorsMicrosoftEntraClientCreateOrUpdateResponse struct { + // placeholder for future response values } -// AdministratorsClientDeleteResponse contains the response from method AdministratorsClient.BeginDelete. -type AdministratorsClientDeleteResponse struct { +// AdministratorsMicrosoftEntraClientDeleteResponse contains the response from method AdministratorsMicrosoftEntraClient.BeginDelete. +type AdministratorsMicrosoftEntraClientDeleteResponse struct { // placeholder for future response values } -// AdministratorsClientGetResponse contains the response from method AdministratorsClient.Get. -type AdministratorsClientGetResponse struct { - // Represents an Microsoft Entra Administrator. - ActiveDirectoryAdministrator +// AdministratorsMicrosoftEntraClientGetResponse contains the response from method AdministratorsMicrosoftEntraClient.Get. +type AdministratorsMicrosoftEntraClientGetResponse struct { + // Server administrator associated to a Microsoft Entra principal. + AdministratorMicrosoftEntra +} + +// AdministratorsMicrosoftEntraClientListByServerResponse contains the response from method AdministratorsMicrosoftEntraClient.NewListByServerPager. +type AdministratorsMicrosoftEntraClientListByServerResponse struct { + // List of server administrators associated to Microsoft Entra principals. + AdministratorMicrosoftEntraList } -// AdministratorsClientListByServerResponse contains the response from method AdministratorsClient.NewListByServerPager. -type AdministratorsClientListByServerResponse struct { - // A list of Microsoft Entra Administrators. - AdministratorListResult +// AdvancedThreatProtectionSettingsClientGetResponse contains the response from method AdvancedThreatProtectionSettingsClient.Get. +type AdvancedThreatProtectionSettingsClientGetResponse struct { + // Advanced threat protection settings of the server. + AdvancedThreatProtectionSettingsModel } -// BackupsClientCreateResponse contains the response from method BackupsClient.BeginCreate. -type BackupsClientCreateResponse struct { - // Server backup properties - ServerBackup +// AdvancedThreatProtectionSettingsClientListByServerResponse contains the response from method AdvancedThreatProtectionSettingsClient.NewListByServerPager. +type AdvancedThreatProtectionSettingsClientListByServerResponse struct { + // List of advanced threat protection settings for a server. + AdvancedThreatProtectionSettingsList } -// BackupsClientDeleteResponse contains the response from method BackupsClient.BeginDelete. -type BackupsClientDeleteResponse struct { +// BackupsAutomaticAndOnDemandClientCreateResponse contains the response from method BackupsAutomaticAndOnDemandClient.BeginCreate. +type BackupsAutomaticAndOnDemandClientCreateResponse struct { // placeholder for future response values } -// BackupsClientGetResponse contains the response from method BackupsClient.Get. -type BackupsClientGetResponse struct { - // Server backup properties - ServerBackup +// BackupsAutomaticAndOnDemandClientDeleteResponse contains the response from method BackupsAutomaticAndOnDemandClient.BeginDelete. +type BackupsAutomaticAndOnDemandClientDeleteResponse struct { + // placeholder for future response values +} + +// BackupsAutomaticAndOnDemandClientGetResponse contains the response from method BackupsAutomaticAndOnDemandClient.Get. +type BackupsAutomaticAndOnDemandClientGetResponse struct { + // Properties of a backup. + BackupAutomaticAndOnDemand +} + +// BackupsAutomaticAndOnDemandClientListByServerResponse contains the response from method BackupsAutomaticAndOnDemandClient.NewListByServerPager. +type BackupsAutomaticAndOnDemandClientListByServerResponse struct { + // List of backups. + BackupAutomaticAndOnDemandList +} + +// BackupsLongTermRetentionClientCheckPrerequisitesResponse contains the response from method BackupsLongTermRetentionClient.CheckPrerequisites. +type BackupsLongTermRetentionClientCheckPrerequisitesResponse struct { + // Response for the LTR pre-backup API call + LtrPreBackupResponse + + // XMSRequestID contains the information returned from the x-ms-request-id header response. + XMSRequestID *string +} + +// BackupsLongTermRetentionClientGetResponse contains the response from method BackupsLongTermRetentionClient.Get. +type BackupsLongTermRetentionClientGetResponse struct { + // Response for the LTR backup Operation API call + BackupsLongTermRetentionOperation } -// BackupsClientListByServerResponse contains the response from method BackupsClient.NewListByServerPager. -type BackupsClientListByServerResponse struct { - // A list of server backups. - ServerBackupListResult +// BackupsLongTermRetentionClientListByServerResponse contains the response from method BackupsLongTermRetentionClient.NewListByServerPager. +type BackupsLongTermRetentionClientListByServerResponse struct { + // A list of long term retention backup operations for server. + LtrServerBackupOperationList } -// CheckNameAvailabilityClientExecuteResponse contains the response from method CheckNameAvailabilityClient.Execute. -type CheckNameAvailabilityClientExecuteResponse struct { - // Represents a resource name availability. - NameAvailability +// BackupsLongTermRetentionClientStartResponse contains the response from method BackupsLongTermRetentionClient.BeginStart. +type BackupsLongTermRetentionClientStartResponse struct { + // Response for the LTR backup API call + BackupsLongTermRetentionResponse +} + +// CapabilitiesByLocationClientListResponse contains the response from method CapabilitiesByLocationClient.NewListPager. +type CapabilitiesByLocationClientListResponse struct { + // List of capabilities for the Azure Database for PostgreSQL flexible server. + CapabilityList } -// CheckNameAvailabilityWithLocationClientExecuteResponse contains the response from method CheckNameAvailabilityWithLocationClient.Execute. -type CheckNameAvailabilityWithLocationClientExecuteResponse struct { - // Represents a resource name availability. - NameAvailability +// CapabilitiesByServerClientListResponse contains the response from method CapabilitiesByServerClient.NewListPager. +type CapabilitiesByServerClientListResponse struct { + // List of capabilities for the Azure Database for PostgreSQL flexible server. + CapabilityList +} + +// CapturedLogsClientListByServerResponse contains the response from method CapturedLogsClient.NewListByServerPager. +type CapturedLogsClientListByServerResponse struct { + // List of log files. + CapturedLogList } // ConfigurationsClientGetResponse contains the response from method ConfigurationsClient.Get. type ConfigurationsClientGetResponse struct { - // Represents a Configuration. + // Configuration (also known as server parameter). Configuration } // ConfigurationsClientListByServerResponse contains the response from method ConfigurationsClient.NewListByServerPager. type ConfigurationsClientListByServerResponse struct { - // A list of server configurations. - ConfigurationListResult + // List of configurations (also known as server parameters). + ConfigurationList } // ConfigurationsClientPutResponse contains the response from method ConfigurationsClient.BeginPut. type ConfigurationsClientPutResponse struct { - // Represents a Configuration. - Configuration + // placeholder for future response values } // ConfigurationsClientUpdateResponse contains the response from method ConfigurationsClient.BeginUpdate. type ConfigurationsClientUpdateResponse struct { - // Represents a Configuration. - Configuration + // placeholder for future response values } // DatabasesClientCreateResponse contains the response from method DatabasesClient.BeginCreate. type DatabasesClientCreateResponse struct { - // Represents a Database. - Database + // placeholder for future response values } // DatabasesClientDeleteResponse contains the response from method DatabasesClient.BeginDelete. @@ -100,20 +140,19 @@ type DatabasesClientDeleteResponse struct { // DatabasesClientGetResponse contains the response from method DatabasesClient.Get. type DatabasesClientGetResponse struct { - // Represents a Database. + // Represents a database. Database } // DatabasesClientListByServerResponse contains the response from method DatabasesClient.NewListByServerPager. type DatabasesClientListByServerResponse struct { - // A List of databases. - DatabaseListResult + // List of all databases in a server. + DatabaseList } // FirewallRulesClientCreateOrUpdateResponse contains the response from method FirewallRulesClient.BeginCreateOrUpdate. type FirewallRulesClientCreateOrUpdateResponse struct { - // Represents a server firewall rule. - FirewallRule + // placeholder for future response values } // FirewallRulesClientDeleteResponse contains the response from method FirewallRulesClient.BeginDelete. @@ -123,113 +162,81 @@ type FirewallRulesClientDeleteResponse struct { // FirewallRulesClientGetResponse contains the response from method FirewallRulesClient.Get. type FirewallRulesClientGetResponse struct { - // Represents a server firewall rule. + // Firewall rule. FirewallRule } // FirewallRulesClientListByServerResponse contains the response from method FirewallRulesClient.NewListByServerPager. type FirewallRulesClientListByServerResponse struct { - // A list of firewall rules. - FirewallRuleListResult + // List of firewall rules. + FirewallRuleList } -// FlexibleServerClientStartLtrBackupResponse contains the response from method FlexibleServerClient.BeginStartLtrBackup. -type FlexibleServerClientStartLtrBackupResponse struct { - // Response for the LTR backup API call - LtrBackupResponse +// MigrationsClientCancelResponse contains the response from method MigrationsClient.Cancel. +type MigrationsClientCancelResponse struct { + // Properties of a migration. + Migration } -// FlexibleServerClientTriggerLtrPreBackupResponse contains the response from method FlexibleServerClient.TriggerLtrPreBackup. -type FlexibleServerClientTriggerLtrPreBackupResponse struct { - // Response for the LTR pre-backup API call - LtrPreBackupResponse - - // XMSRequestID contains the information returned from the x-ms-request-id header response. - XMSRequestID *string -} - -// GetPrivateDNSZoneSuffixClientExecuteResponse contains the response from method GetPrivateDNSZoneSuffixClient.Execute. -type GetPrivateDNSZoneSuffixClientExecuteResponse struct { - // Represents a resource name availability. - Value *string -} - -// LocationBasedCapabilitiesClientExecuteResponse contains the response from method LocationBasedCapabilitiesClient.NewExecutePager. -type LocationBasedCapabilitiesClientExecuteResponse struct { - // Capability for the PostgreSQL server - CapabilitiesListResult -} - -// LogFilesClientListByServerResponse contains the response from method LogFilesClient.NewListByServerPager. -type LogFilesClientListByServerResponse struct { - // A List of logFiles. - LogFileListResult -} - -// LtrBackupOperationsClientGetResponse contains the response from method LtrBackupOperationsClient.Get. -type LtrBackupOperationsClientGetResponse struct { - // Response for the LTR backup Operation API call - LtrServerBackupOperation -} - -// LtrBackupOperationsClientListByServerResponse contains the response from method LtrBackupOperationsClient.NewListByServerPager. -type LtrBackupOperationsClientListByServerResponse struct { - // A list of long term retention backup operations for server. - LtrServerBackupOperationList +// MigrationsClientCheckNameAvailabilityResponse contains the response from method MigrationsClient.CheckNameAvailability. +type MigrationsClientCheckNameAvailabilityResponse struct { + // Availability of a migration name. + MigrationNameAvailability } // MigrationsClientCreateResponse contains the response from method MigrationsClient.Create. type MigrationsClientCreateResponse struct { - // Represents a migration resource. - MigrationResource -} - -// MigrationsClientDeleteResponse contains the response from method MigrationsClient.Delete. -type MigrationsClientDeleteResponse struct { - // placeholder for future response values + // Properties of a migration. + Migration } // MigrationsClientGetResponse contains the response from method MigrationsClient.Get. type MigrationsClientGetResponse struct { - // Represents a migration resource. - MigrationResource + // Properties of a migration. + Migration } // MigrationsClientListByTargetServerResponse contains the response from method MigrationsClient.NewListByTargetServerPager. type MigrationsClientListByTargetServerResponse struct { - // A list of migration resources. - MigrationResourceListResult + // List of migrations. + MigrationList } // MigrationsClientUpdateResponse contains the response from method MigrationsClient.Update. type MigrationsClientUpdateResponse struct { - // Represents a migration resource. - MigrationResource + // Properties of a migration. + Migration +} + +// NameAvailabilityClientCheckGloballyResponse contains the response from method NameAvailabilityClient.CheckGlobally. +type NameAvailabilityClientCheckGloballyResponse struct { + // Availability of a name. + NameAvailabilityModel +} + +// NameAvailabilityClientCheckWithLocationResponse contains the response from method NameAvailabilityClient.CheckWithLocation. +type NameAvailabilityClientCheckWithLocationResponse struct { + // Availability of a name. + NameAvailabilityModel } // OperationsClientListResponse contains the response from method OperationsClient.NewListPager. type OperationsClientListResponse struct { - // A list of resource provider operations. - OperationListResult + // List of resource provider operations. + OperationList } -// PostgreSQLManagementClientCheckMigrationNameAvailabilityResponse contains the response from method PostgreSQLManagementClient.CheckMigrationNameAvailability. -type PostgreSQLManagementClientCheckMigrationNameAvailabilityResponse struct { - // Represents a migration name's availability. - MigrationNameAvailabilityResource +// PrivateDNSZoneSuffixClientGetResponse contains the response from method PrivateDNSZoneSuffixClient.Get. +type PrivateDNSZoneSuffixClientGetResponse struct { + // Private DNS suffix. + Value *string } -// PrivateEndpointConnectionClientDeleteResponse contains the response from method PrivateEndpointConnectionClient.BeginDelete. -type PrivateEndpointConnectionClientDeleteResponse struct { +// PrivateEndpointConnectionsClientDeleteResponse contains the response from method PrivateEndpointConnectionsClient.BeginDelete. +type PrivateEndpointConnectionsClientDeleteResponse struct { // placeholder for future response values } -// PrivateEndpointConnectionClientUpdateResponse contains the response from method PrivateEndpointConnectionClient.BeginUpdate. -type PrivateEndpointConnectionClientUpdateResponse struct { - // The private endpoint connection resource. - PrivateEndpointConnection -} - // PrivateEndpointConnectionsClientGetResponse contains the response from method PrivateEndpointConnectionsClient.Get. type PrivateEndpointConnectionsClientGetResponse struct { // The private endpoint connection resource. @@ -238,8 +245,13 @@ type PrivateEndpointConnectionsClientGetResponse struct { // PrivateEndpointConnectionsClientListByServerResponse contains the response from method PrivateEndpointConnectionsClient.NewListByServerPager. type PrivateEndpointConnectionsClientListByServerResponse struct { - // A list of private endpoint connections. - PrivateEndpointConnectionListResult + // List of private endpoint connections. + PrivateEndpointConnectionList +} + +// PrivateEndpointConnectionsClientUpdateResponse contains the response from method PrivateEndpointConnectionsClient.BeginUpdate. +type PrivateEndpointConnectionsClientUpdateResponse struct { + // placeholder for future response values } // PrivateLinkResourcesClientGetResponse contains the response from method PrivateLinkResourcesClient.Get. @@ -251,49 +263,29 @@ type PrivateLinkResourcesClientGetResponse struct { // PrivateLinkResourcesClientListByServerResponse contains the response from method PrivateLinkResourcesClient.NewListByServerPager. type PrivateLinkResourcesClientListByServerResponse struct { // A list of private link resources - PrivateLinkResourceListResult + PrivateLinkResourceList } // QuotaUsagesClientListResponse contains the response from method QuotaUsagesClient.NewListPager. type QuotaUsagesClientListResponse struct { // Capability for the PostgreSQL server - QuotaUsagesListResult + QuotaUsageList } // ReplicasClientListByServerResponse contains the response from method ReplicasClient.NewListByServerPager. type ReplicasClientListByServerResponse struct { // A list of servers. - ServerListResult -} - -// ServerCapabilitiesClientListResponse contains the response from method ServerCapabilitiesClient.NewListPager. -type ServerCapabilitiesClientListResponse struct { - // Capability for the PostgreSQL server - CapabilitiesListResult + ServerList } // ServerThreatProtectionSettingsClientCreateOrUpdateResponse contains the response from method ServerThreatProtectionSettingsClient.BeginCreateOrUpdate. type ServerThreatProtectionSettingsClientCreateOrUpdateResponse struct { - // Server's Advanced Threat Protection settings. - ServerThreatProtectionSettingsModel -} - -// ServerThreatProtectionSettingsClientGetResponse contains the response from method ServerThreatProtectionSettingsClient.Get. -type ServerThreatProtectionSettingsClientGetResponse struct { - // Server's Advanced Threat Protection settings. - ServerThreatProtectionSettingsModel -} - -// ServerThreatProtectionSettingsClientListByServerResponse contains the response from method ServerThreatProtectionSettingsClient.NewListByServerPager. -type ServerThreatProtectionSettingsClientListByServerResponse struct { - // A list of the server's Advanced Threat Protection settings. - ServerThreatProtectionListResult + // placeholder for future response values } -// ServersClientCreateResponse contains the response from method ServersClient.BeginCreate. -type ServersClientCreateResponse struct { - // Represents a server. - Server +// ServersClientCreateOrUpdateResponse contains the response from method ServersClient.BeginCreateOrUpdate. +type ServersClientCreateOrUpdateResponse struct { + // placeholder for future response values } // ServersClientDeleteResponse contains the response from method ServersClient.BeginDelete. @@ -303,20 +295,20 @@ type ServersClientDeleteResponse struct { // ServersClientGetResponse contains the response from method ServersClient.Get. type ServersClientGetResponse struct { - // Represents a server. + // Properties of a server. Server } // ServersClientListByResourceGroupResponse contains the response from method ServersClient.NewListByResourceGroupPager. type ServersClientListByResourceGroupResponse struct { // A list of servers. - ServerListResult + ServerList } -// ServersClientListResponse contains the response from method ServersClient.NewListPager. -type ServersClientListResponse struct { +// ServersClientListBySubscriptionResponse contains the response from method ServersClient.NewListBySubscriptionPager. +type ServersClientListBySubscriptionResponse struct { // A list of servers. - ServerListResult + ServerList } // ServersClientRestartResponse contains the response from method ServersClient.BeginRestart. @@ -336,64 +328,30 @@ type ServersClientStopResponse struct { // ServersClientUpdateResponse contains the response from method ServersClient.BeginUpdate. type ServersClientUpdateResponse struct { - // Represents a server. - Server -} - -// TuningConfigurationClientDisableResponse contains the response from method TuningConfigurationClient.BeginDisable. -type TuningConfigurationClientDisableResponse struct { // placeholder for future response values } -// TuningConfigurationClientEnableResponse contains the response from method TuningConfigurationClient.BeginEnable. -type TuningConfigurationClientEnableResponse struct { - // placeholder for future response values -} - -// TuningConfigurationClientListSessionDetailsResponse contains the response from method TuningConfigurationClient.NewListSessionDetailsPager. -type TuningConfigurationClientListSessionDetailsResponse struct { - // A list of tuning configuration sessions. - SessionDetailsListResult -} - -// TuningConfigurationClientListSessionsResponse contains the response from method TuningConfigurationClient.NewListSessionsPager. -type TuningConfigurationClientListSessionsResponse struct { - // A list of tuning configuration sessions. - SessionsListResult -} - -// TuningConfigurationClientStartSessionResponse contains the response from method TuningConfigurationClient.BeginStartSession. -type TuningConfigurationClientStartSessionResponse struct { - // placeholder for future response values -} - -// TuningConfigurationClientStopSessionResponse contains the response from method TuningConfigurationClient.BeginStopSession. -type TuningConfigurationClientStopSessionResponse struct { - // placeholder for future response values -} - -// TuningIndexClientListRecommendationsResponse contains the response from method TuningIndexClient.NewListRecommendationsPager. -type TuningIndexClientListRecommendationsResponse struct { - // A list of available index recommendations. - IndexRecommendationListResult -} - // TuningOptionsClientGetResponse contains the response from method TuningOptionsClient.Get. type TuningOptionsClientGetResponse struct { - // Stores property that features impact on some metric if this recommended action is applied. - TuningOptionsResource + // Impact on some metric if this recommended action is applied. + TuningOptions } // TuningOptionsClientListByServerResponse contains the response from method TuningOptionsClient.NewListByServerPager. type TuningOptionsClientListByServerResponse struct { - // A list of server tuning options. - TuningOptionsListResult + // List of server tuning options. + TuningOptionsList +} + +// TuningOptionsClientListRecommendationsResponse contains the response from method TuningOptionsClient.NewListRecommendationsPager. +type TuningOptionsClientListRecommendationsResponse struct { + // List of available object recommendations. + ObjectRecommendationList } // VirtualEndpointsClientCreateResponse contains the response from method VirtualEndpointsClient.BeginCreate. type VirtualEndpointsClientCreateResponse struct { - // Represents a virtual endpoint for a server. - VirtualEndpointResource + // placeholder for future response values } // VirtualEndpointsClientDeleteResponse contains the response from method VirtualEndpointsClient.BeginDelete. @@ -403,24 +361,23 @@ type VirtualEndpointsClientDeleteResponse struct { // VirtualEndpointsClientGetResponse contains the response from method VirtualEndpointsClient.Get. type VirtualEndpointsClientGetResponse struct { - // Represents a virtual endpoint for a server. - VirtualEndpointResource + // Pair of virtual endpoints for a server. + VirtualEndpoint } // VirtualEndpointsClientListByServerResponse contains the response from method VirtualEndpointsClient.NewListByServerPager. type VirtualEndpointsClientListByServerResponse struct { - // A list of virtual endpoints. - VirtualEndpointsListResult + // List of virtual endpoints. + VirtualEndpointsList } // VirtualEndpointsClientUpdateResponse contains the response from method VirtualEndpointsClient.BeginUpdate. type VirtualEndpointsClientUpdateResponse struct { - // Represents a virtual endpoint for a server. - VirtualEndpointResource + // placeholder for future response values } -// VirtualNetworkSubnetUsageClientExecuteResponse contains the response from method VirtualNetworkSubnetUsageClient.Execute. -type VirtualNetworkSubnetUsageClientExecuteResponse struct { +// VirtualNetworkSubnetUsageClientListResponse contains the response from method VirtualNetworkSubnetUsageClient.List. +type VirtualNetworkSubnetUsageClientListResponse struct { // Virtual network subnet usage data. - VirtualNetworkSubnetUsageResult + VirtualNetworkSubnetUsageModel } diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/servers_client.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/servers_client.go index 19b09331722a..1c090518ae84 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/servers_client.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/servers_client.go @@ -27,7 +27,7 @@ type ServersClient struct { // NewServersClient creates a new instance of ServersClient with the specified values. // - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. +// - options - Contains optional client configuration. Pass nil to accept the default values. func NewServersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ServersClient, error) { cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) if err != nil { @@ -40,43 +40,44 @@ func NewServersClient(subscriptionID string, credential azcore.TokenCredential, return client, nil } -// BeginCreate - Creates a new server. +// BeginCreateOrUpdate - Creates a new server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-01-01-preview +// Generated from API version 2025-08-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. -// - parameters - The required parameters for creating or updating a server. -// - options - ServersClientBeginCreateOptions contains the optional parameters for the ServersClient.BeginCreate method. -func (client *ServersClient) BeginCreate(ctx context.Context, resourceGroupName string, serverName string, parameters Server, options *ServersClientBeginCreateOptions) (*runtime.Poller[ServersClientCreateResponse], error) { +// - parameters - Parameters required to create a new server or to update an existing server. +// - options - ServersClientBeginCreateOrUpdateOptions contains the optional parameters for the ServersClient.BeginCreateOrUpdate +// method. +func (client *ServersClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, parameters Server, options *ServersClientBeginCreateOrUpdateOptions) (*runtime.Poller[ServersClientCreateOrUpdateResponse], error) { if options == nil || options.ResumeToken == "" { - resp, err := client.create(ctx, resourceGroupName, serverName, parameters, options) + resp, err := client.createOrUpdate(ctx, resourceGroupName, serverName, parameters, options) if err != nil { return nil, err } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ServersClientCreateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ServersClientCreateOrUpdateResponse]{ FinalStateVia: runtime.FinalStateViaAzureAsyncOp, Tracer: client.internal.Tracer(), }) return poller, err } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ServersClientCreateResponse]{ + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ServersClientCreateOrUpdateResponse]{ Tracer: client.internal.Tracer(), }) } } -// Create - Creates a new server. +// CreateOrUpdate - Creates a new server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-01-01-preview -func (client *ServersClient) create(ctx context.Context, resourceGroupName string, serverName string, parameters Server, options *ServersClientBeginCreateOptions) (*http.Response, error) { +// Generated from API version 2025-08-01 +func (client *ServersClient) createOrUpdate(ctx context.Context, resourceGroupName string, serverName string, parameters Server, options *ServersClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error - const operationName = "ServersClient.BeginCreate" + const operationName = "ServersClient.BeginCreateOrUpdate" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) defer func() { endSpan(err) }() - req, err := client.createCreateRequest(ctx, resourceGroupName, serverName, parameters, options) + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, parameters, options) if err != nil { return nil, err } @@ -84,15 +85,15 @@ func (client *ServersClient) create(ctx context.Context, resourceGroupName strin if err != nil { return nil, err } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { + if !runtime.HasStatusCode(httpResp, http.StatusAccepted) { err = runtime.NewResponseError(httpResp) return nil, err } return httpResp, nil } -// createCreateRequest creates the Create request. -func (client *ServersClient) createCreateRequest(ctx context.Context, resourceGroupName string, serverName string, parameters Server, _ *ServersClientBeginCreateOptions) (*policy.Request, error) { +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *ServersClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, serverName string, parameters Server, _ *ServersClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -111,7 +112,7 @@ func (client *ServersClient) createCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-01-01-preview") + reqQP.Set("api-version", "2025-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -120,10 +121,10 @@ func (client *ServersClient) createCreateRequest(ctx context.Context, resourceGr return req, nil } -// BeginDelete - Deletes a server. +// BeginDelete - Deletes or drops an existing server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-01-01-preview +// Generated from API version 2025-08-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - options - ServersClientBeginDeleteOptions contains the optional parameters for the ServersClient.BeginDelete method. @@ -145,10 +146,10 @@ func (client *ServersClient) BeginDelete(ctx context.Context, resourceGroupName } } -// Delete - Deletes a server. +// Delete - Deletes or drops an existing server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-01-01-preview +// Generated from API version 2025-08-01 func (client *ServersClient) deleteOperation(ctx context.Context, resourceGroupName string, serverName string, options *ServersClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "ServersClient.BeginDelete" @@ -163,7 +164,7 @@ func (client *ServersClient) deleteOperation(ctx context.Context, resourceGroupN if err != nil { return nil, err } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + if !runtime.HasStatusCode(httpResp, http.StatusAccepted, http.StatusNoContent) { err = runtime.NewResponseError(httpResp) return nil, err } @@ -190,16 +191,16 @@ func (client *ServersClient) deleteCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-01-01-preview") + reqQP.Set("api-version", "2025-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } -// Get - Gets information about a server. +// Get - Gets information about an existing server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-01-01-preview +// Generated from API version 2025-08-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - options - ServersClientGetOptions contains the optional parameters for the ServersClient.Get method. @@ -245,7 +246,7 @@ func (client *ServersClient) getCreateRequest(ctx context.Context, resourceGroup return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-01-01-preview") + reqQP.Set("api-version", "2025-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -260,124 +261,125 @@ func (client *ServersClient) getHandleResponse(resp *http.Response) (ServersClie return result, nil } -// NewListPager - List all the servers in a given subscription. +// NewListByResourceGroupPager - Lists all servers in a resource group. // -// Generated from API version 2025-01-01-preview -// - options - ServersClientListOptions contains the optional parameters for the ServersClient.NewListPager method. -func (client *ServersClient) NewListPager(options *ServersClientListOptions) *runtime.Pager[ServersClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[ServersClientListResponse]{ - More: func(page ServersClientListResponse) bool { +// Generated from API version 2025-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - options - ServersClientListByResourceGroupOptions contains the optional parameters for the ServersClient.NewListByResourceGroupPager +// method. +func (client *ServersClient) NewListByResourceGroupPager(resourceGroupName string, options *ServersClientListByResourceGroupOptions) *runtime.Pager[ServersClientListByResourceGroupResponse] { + return runtime.NewPager(runtime.PagingHandler[ServersClientListByResourceGroupResponse]{ + More: func(page ServersClientListByResourceGroupResponse) bool { return page.NextLink != nil && len(*page.NextLink) > 0 }, - Fetcher: func(ctx context.Context, page *ServersClientListResponse) (ServersClientListResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "ServersClient.NewListPager") + Fetcher: func(ctx context.Context, page *ServersClientListByResourceGroupResponse) (ServersClientListByResourceGroupResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "ServersClient.NewListByResourceGroupPager") nextLink := "" if page != nil { nextLink = *page.NextLink } resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listCreateRequest(ctx, options) + return client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) }, nil) if err != nil { - return ServersClientListResponse{}, err + return ServersClientListByResourceGroupResponse{}, err } - return client.listHandleResponse(resp) + return client.listByResourceGroupHandleResponse(resp) }, Tracer: client.internal.Tracer(), }) } -// listCreateRequest creates the List request. -func (client *ServersClient) listCreateRequest(ctx context.Context, _ *ServersClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.DBforPostgreSQL/flexibleServers" +// listByResourceGroupCreateRequest creates the ListByResourceGroup request. +func (client *ServersClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, _ *ServersClientListByResourceGroupOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-01-01-preview") + reqQP.Set("api-version", "2025-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } -// listHandleResponse handles the List response. -func (client *ServersClient) listHandleResponse(resp *http.Response) (ServersClientListResponse, error) { - result := ServersClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ServerListResult); err != nil { - return ServersClientListResponse{}, err +// listByResourceGroupHandleResponse handles the ListByResourceGroup response. +func (client *ServersClient) listByResourceGroupHandleResponse(resp *http.Response) (ServersClientListByResourceGroupResponse, error) { + result := ServersClientListByResourceGroupResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ServerList); err != nil { + return ServersClientListByResourceGroupResponse{}, err } return result, nil } -// NewListByResourceGroupPager - List all the servers in a given resource group. +// NewListBySubscriptionPager - Lists all servers in a subscription. // -// Generated from API version 2025-01-01-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - options - ServersClientListByResourceGroupOptions contains the optional parameters for the ServersClient.NewListByResourceGroupPager +// Generated from API version 2025-08-01 +// - options - ServersClientListBySubscriptionOptions contains the optional parameters for the ServersClient.NewListBySubscriptionPager // method. -func (client *ServersClient) NewListByResourceGroupPager(resourceGroupName string, options *ServersClientListByResourceGroupOptions) *runtime.Pager[ServersClientListByResourceGroupResponse] { - return runtime.NewPager(runtime.PagingHandler[ServersClientListByResourceGroupResponse]{ - More: func(page ServersClientListByResourceGroupResponse) bool { +func (client *ServersClient) NewListBySubscriptionPager(options *ServersClientListBySubscriptionOptions) *runtime.Pager[ServersClientListBySubscriptionResponse] { + return runtime.NewPager(runtime.PagingHandler[ServersClientListBySubscriptionResponse]{ + More: func(page ServersClientListBySubscriptionResponse) bool { return page.NextLink != nil && len(*page.NextLink) > 0 }, - Fetcher: func(ctx context.Context, page *ServersClientListByResourceGroupResponse) (ServersClientListByResourceGroupResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "ServersClient.NewListByResourceGroupPager") + Fetcher: func(ctx context.Context, page *ServersClientListBySubscriptionResponse) (ServersClientListBySubscriptionResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "ServersClient.NewListBySubscriptionPager") nextLink := "" if page != nil { nextLink = *page.NextLink } resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) + return client.listBySubscriptionCreateRequest(ctx, options) }, nil) if err != nil { - return ServersClientListByResourceGroupResponse{}, err + return ServersClientListBySubscriptionResponse{}, err } - return client.listByResourceGroupHandleResponse(resp) + return client.listBySubscriptionHandleResponse(resp) }, Tracer: client.internal.Tracer(), }) } -// listByResourceGroupCreateRequest creates the ListByResourceGroup request. -func (client *ServersClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, _ *ServersClientListByResourceGroupOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers" +// listBySubscriptionCreateRequest creates the ListBySubscription request. +func (client *ServersClient) listBySubscriptionCreateRequest(ctx context.Context, _ *ServersClientListBySubscriptionOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.DBforPostgreSQL/flexibleServers" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-01-01-preview") + reqQP.Set("api-version", "2025-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } -// listByResourceGroupHandleResponse handles the ListByResourceGroup response. -func (client *ServersClient) listByResourceGroupHandleResponse(resp *http.Response) (ServersClientListByResourceGroupResponse, error) { - result := ServersClientListByResourceGroupResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ServerListResult); err != nil { - return ServersClientListByResourceGroupResponse{}, err +// listBySubscriptionHandleResponse handles the ListBySubscription response. +func (client *ServersClient) listBySubscriptionHandleResponse(resp *http.Response) (ServersClientListBySubscriptionResponse, error) { + result := ServersClientListBySubscriptionResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ServerList); err != nil { + return ServersClientListBySubscriptionResponse{}, err } return result, nil } -// BeginRestart - Restarts a server. +// BeginRestart - Restarts PostgreSQL database engine in a server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-01-01-preview +// Generated from API version 2025-08-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - options - ServersClientBeginRestartOptions contains the optional parameters for the ServersClient.BeginRestart method. @@ -399,10 +401,10 @@ func (client *ServersClient) BeginRestart(ctx context.Context, resourceGroupName } } -// Restart - Restarts a server. +// Restart - Restarts PostgreSQL database engine in a server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-01-01-preview +// Generated from API version 2025-08-01 func (client *ServersClient) restart(ctx context.Context, resourceGroupName string, serverName string, options *ServersClientBeginRestartOptions) (*http.Response, error) { var err error const operationName = "ServersClient.BeginRestart" @@ -417,7 +419,7 @@ func (client *ServersClient) restart(ctx context.Context, resourceGroupName stri if err != nil { return nil, err } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + if !runtime.HasStatusCode(httpResp, http.StatusAccepted) { err = runtime.NewResponseError(httpResp) return nil, err } @@ -444,7 +446,7 @@ func (client *ServersClient) restartCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-01-01-preview") + reqQP.Set("api-version", "2025-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.Parameters != nil { @@ -456,10 +458,10 @@ func (client *ServersClient) restartCreateRequest(ctx context.Context, resourceG return req, nil } -// BeginStart - Starts a server. +// BeginStart - Starts a stopped server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-01-01-preview +// Generated from API version 2025-08-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - options - ServersClientBeginStartOptions contains the optional parameters for the ServersClient.BeginStart method. @@ -481,10 +483,10 @@ func (client *ServersClient) BeginStart(ctx context.Context, resourceGroupName s } } -// Start - Starts a server. +// Start - Starts a stopped server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-01-01-preview +// Generated from API version 2025-08-01 func (client *ServersClient) start(ctx context.Context, resourceGroupName string, serverName string, options *ServersClientBeginStartOptions) (*http.Response, error) { var err error const operationName = "ServersClient.BeginStart" @@ -499,7 +501,7 @@ func (client *ServersClient) start(ctx context.Context, resourceGroupName string if err != nil { return nil, err } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + if !runtime.HasStatusCode(httpResp, http.StatusAccepted) { err = runtime.NewResponseError(httpResp) return nil, err } @@ -526,7 +528,7 @@ func (client *ServersClient) startCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-01-01-preview") + reqQP.Set("api-version", "2025-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -535,7 +537,7 @@ func (client *ServersClient) startCreateRequest(ctx context.Context, resourceGro // BeginStop - Stops a server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-01-01-preview +// Generated from API version 2025-08-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - options - ServersClientBeginStopOptions contains the optional parameters for the ServersClient.BeginStop method. @@ -560,7 +562,7 @@ func (client *ServersClient) BeginStop(ctx context.Context, resourceGroupName st // Stop - Stops a server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-01-01-preview +// Generated from API version 2025-08-01 func (client *ServersClient) stop(ctx context.Context, resourceGroupName string, serverName string, options *ServersClientBeginStopOptions) (*http.Response, error) { var err error const operationName = "ServersClient.BeginStop" @@ -575,7 +577,7 @@ func (client *ServersClient) stop(ctx context.Context, resourceGroupName string, if err != nil { return nil, err } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + if !runtime.HasStatusCode(httpResp, http.StatusAccepted) { err = runtime.NewResponseError(httpResp) return nil, err } @@ -602,22 +604,22 @@ func (client *ServersClient) stopCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-01-01-preview") + reqQP.Set("api-version", "2025-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } -// BeginUpdate - Updates an existing server. The request body can contain one to many of the properties present in the normal -// server definition. +// BeginUpdate - Updates an existing server. The request body can contain one or multiple of the properties present in the +// normal server definition. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-01-01-preview +// Generated from API version 2025-08-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. -// - parameters - The required parameters for updating a server. +// - parameters - Parameters required to update a server. // - options - ServersClientBeginUpdateOptions contains the optional parameters for the ServersClient.BeginUpdate method. -func (client *ServersClient) BeginUpdate(ctx context.Context, resourceGroupName string, serverName string, parameters ServerForUpdate, options *ServersClientBeginUpdateOptions) (*runtime.Poller[ServersClientUpdateResponse], error) { +func (client *ServersClient) BeginUpdate(ctx context.Context, resourceGroupName string, serverName string, parameters ServerForPatch, options *ServersClientBeginUpdateOptions) (*runtime.Poller[ServersClientUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.update(ctx, resourceGroupName, serverName, parameters, options) if err != nil { @@ -635,12 +637,12 @@ func (client *ServersClient) BeginUpdate(ctx context.Context, resourceGroupName } } -// Update - Updates an existing server. The request body can contain one to many of the properties present in the normal server -// definition. +// Update - Updates an existing server. The request body can contain one or multiple of the properties present in the normal +// server definition. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-01-01-preview -func (client *ServersClient) update(ctx context.Context, resourceGroupName string, serverName string, parameters ServerForUpdate, options *ServersClientBeginUpdateOptions) (*http.Response, error) { +// Generated from API version 2025-08-01 +func (client *ServersClient) update(ctx context.Context, resourceGroupName string, serverName string, parameters ServerForPatch, options *ServersClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "ServersClient.BeginUpdate" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) @@ -654,7 +656,7 @@ func (client *ServersClient) update(ctx context.Context, resourceGroupName strin if err != nil { return nil, err } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + if !runtime.HasStatusCode(httpResp, http.StatusAccepted) { err = runtime.NewResponseError(httpResp) return nil, err } @@ -662,7 +664,7 @@ func (client *ServersClient) update(ctx context.Context, resourceGroupName strin } // updateCreateRequest creates the Update request. -func (client *ServersClient) updateCreateRequest(ctx context.Context, resourceGroupName string, serverName string, parameters ServerForUpdate, _ *ServersClientBeginUpdateOptions) (*policy.Request, error) { +func (client *ServersClient) updateCreateRequest(ctx context.Context, resourceGroupName string, serverName string, parameters ServerForPatch, _ *ServersClientBeginUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -681,7 +683,7 @@ func (client *ServersClient) updateCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-01-01-preview") + reqQP.Set("api-version", "2025-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/servers_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/servers_client_example_test.go index 6838ee917886..66048f1e225e 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/servers_client_example_test.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/servers_client_example_test.go @@ -20,8 +20,8 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v5" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b1f4d539964453ce8008e4b069e59885e12ba441/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ClusterCreate.json -func ExampleServersClient_BeginCreate_clusterCreate() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/735d21dbd7e1cc446babf58860af4cca757d620d/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/ServersClusterCreate.json +func ExampleServersClient_BeginCreateOrUpdate_createANewElasticCluster() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -31,21 +31,22 @@ func ExampleServersClient_BeginCreate_clusterCreate() { if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewServersClient().BeginCreate(ctx, "testrg", "pgtestcluster", armpostgresqlflexibleservers.Server{ - Location: to.Ptr("westus"), + poller, err := clientFactory.NewServersClient().BeginCreateOrUpdate(ctx, "exampleresourcegroup", "exampleserver", armpostgresqlflexibleservers.Server{ + Location: to.Ptr("eastus"), Properties: &armpostgresqlflexibleservers.ServerProperties{ - AdministratorLogin: to.Ptr("login"), - AdministratorLoginPassword: to.Ptr("Password1"), + AdministratorLogin: to.Ptr("examplelogin"), + AdministratorLoginPassword: to.Ptr("examplepassword"), Backup: &armpostgresqlflexibleservers.Backup{ BackupRetentionDays: to.Ptr[int32](7), - GeoRedundantBackup: to.Ptr(armpostgresqlflexibleservers.GeoRedundantBackupEnumDisabled), + GeoRedundantBackup: to.Ptr(armpostgresqlflexibleservers.GeographicallyRedundantBackupDisabled), }, Cluster: &armpostgresqlflexibleservers.Cluster{ - ClusterSize: to.Ptr[int32](2), + ClusterSize: to.Ptr[int32](2), + DefaultDatabaseName: to.Ptr("clusterdb"), }, CreateMode: to.Ptr(armpostgresqlflexibleservers.CreateModeCreate), HighAvailability: &armpostgresqlflexibleservers.HighAvailability{ - Mode: to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeDisabled), + Mode: to.Ptr(armpostgresqlflexibleservers.HighAvailabilityMode("Disabled")), }, Network: &armpostgresqlflexibleservers.Network{ PublicNetworkAccess: to.Ptr(armpostgresqlflexibleservers.ServerPublicNetworkAccessStateDisabled), @@ -53,9 +54,9 @@ func ExampleServersClient_BeginCreate_clusterCreate() { Storage: &armpostgresqlflexibleservers.Storage{ AutoGrow: to.Ptr(armpostgresqlflexibleservers.StorageAutoGrowDisabled), StorageSizeGB: to.Ptr[int32](256), - Tier: to.Ptr(armpostgresqlflexibleservers.AzureManagedDiskPerformanceTiersP15), + Tier: to.Ptr(armpostgresqlflexibleservers.AzureManagedDiskPerformanceTierP15), }, - Version: to.Ptr(armpostgresqlflexibleservers.ServerVersionSixteen), + Version: to.Ptr(armpostgresqlflexibleservers.PostgresMajorVersionSixteen), }, SKU: &armpostgresqlflexibleservers.SKU{ Name: to.Ptr("Standard_D4ds_v5"), @@ -65,71 +66,14 @@ func ExampleServersClient_BeginCreate_clusterCreate() { if err != nil { log.Fatalf("failed to finish the request: %v", err) } - res, err := poller.PollUntilDone(ctx, nil) + _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Server = armpostgresqlflexibleservers.Server{ - // Name: to.Ptr("pgtestcluster"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/pgtestcluster"), - // SystemData: &armpostgresqlflexibleservers.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-10-10T18:31:50.730Z"); return t}()), - // }, - // Location: to.Ptr("westus"), - // Properties: &armpostgresqlflexibleservers.ServerProperties{ - // AdministratorLogin: to.Ptr("login"), - // Backup: &armpostgresqlflexibleservers.Backup{ - // BackupRetentionDays: to.Ptr[int32](7), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-10-10T18:40:39.045Z"); return t}()), - // GeoRedundantBackup: to.Ptr(armpostgresqlflexibleservers.GeoRedundantBackupEnumDisabled), - // }, - // Cluster: &armpostgresqlflexibleservers.Cluster{ - // ClusterSize: to.Ptr[int32](2), - // }, - // DataEncryption: &armpostgresqlflexibleservers.DataEncryption{ - // Type: to.Ptr(armpostgresqlflexibleservers.ArmServerKeyTypeSystemManaged), - // }, - // HighAvailability: &armpostgresqlflexibleservers.HighAvailability{ - // Mode: to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeDisabled), - // }, - // MaintenanceWindow: &armpostgresqlflexibleservers.MaintenanceWindow{ - // CustomWindow: to.Ptr("Disabled"), - // DayOfWeek: to.Ptr[int32](0), - // StartHour: to.Ptr[int32](0), - // StartMinute: to.Ptr[int32](0), - // }, - // Network: &armpostgresqlflexibleservers.Network{ - // PublicNetworkAccess: to.Ptr(armpostgresqlflexibleservers.ServerPublicNetworkAccessStateDisabled), - // }, - // PrivateEndpointConnections: []*armpostgresqlflexibleservers.PrivateEndpointConnection{ - // }, - // Replica: &armpostgresqlflexibleservers.Replica{ - // ReplicationState: to.Ptr(armpostgresqlflexibleservers.ReplicationStateActive), - // Role: to.Ptr(armpostgresqlflexibleservers.ReplicationRolePrimary), - // }, - // ReplicationRole: to.Ptr(armpostgresqlflexibleservers.ReplicationRolePrimary), - // State: to.Ptr(armpostgresqlflexibleservers.ServerStateReady), - // Storage: &armpostgresqlflexibleservers.Storage{ - // AutoGrow: to.Ptr(armpostgresqlflexibleservers.StorageAutoGrowDisabled), - // Iops: to.Ptr[int32](1100), - // StorageSizeGB: to.Ptr[int32](256), - // Tier: to.Ptr(armpostgresqlflexibleservers.AzureManagedDiskPerformanceTiersP15), - // }, - // Version: to.Ptr(armpostgresqlflexibleservers.ServerVersionSixteen), - // }, - // SKU: &armpostgresqlflexibleservers.SKU{ - // Name: to.Ptr("Standard_D4ds_v5"), - // Tier: to.Ptr(armpostgresqlflexibleservers.SKUTierGeneralPurpose), - // }, - // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b1f4d539964453ce8008e4b069e59885e12ba441/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ServerCreateGeoRestoreWithDataEncryptionEnabled.json -func ExampleServersClient_BeginCreate_createADatabaseAsAGeoRestoreInGeoPairedLocation() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/735d21dbd7e1cc446babf58860af4cca757d620d/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/ServersCreateInMicrosoftOwnedVirtualNetworkWithZoneRedundantHighAvailability.json +func ExampleServersClient_BeginCreateOrUpdate_createANewServerInMicrosoftOwnedVirtualNetworkWithZoneRedundantHighAvailability() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -139,197 +83,50 @@ func ExampleServersClient_BeginCreate_createADatabaseAsAGeoRestoreInGeoPairedLoc if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewServersClient().BeginCreate(ctx, "testrg", "pgtestsvc5geo", armpostgresqlflexibleservers.Server{ + poller, err := clientFactory.NewServersClient().BeginCreateOrUpdate(ctx, "exampleresourcegroup", "exampleserver", armpostgresqlflexibleservers.Server{ Location: to.Ptr("eastus"), - Identity: &armpostgresqlflexibleservers.UserAssignedIdentity{ - Type: to.Ptr(armpostgresqlflexibleservers.IdentityTypeUserAssigned), - UserAssignedIdentities: map[string]*armpostgresqlflexibleservers.UserIdentity{ - "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-geo-usermanagedidentity": {}, - "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-usermanagedidentity": {}, - }, + Tags: map[string]*string{ + "InCustomerVnet": to.Ptr("false"), + "InMicrosoftVnet": to.Ptr("true"), }, Properties: &armpostgresqlflexibleservers.ServerProperties{ - CreateMode: to.Ptr(armpostgresqlflexibleservers.CreateModeGeoRestore), - DataEncryption: &armpostgresqlflexibleservers.DataEncryption{ - Type: to.Ptr(armpostgresqlflexibleservers.ArmServerKeyTypeAzureKeyVault), - GeoBackupKeyURI: to.Ptr("https://test-geo-kv.vault.azure.net/keys/test-key1/yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy"), - GeoBackupUserAssignedIdentityID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-geo-usermanagedidentity"), - PrimaryKeyURI: to.Ptr("https://test-kv.vault.azure.net/keys/test-key1/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"), - PrimaryUserAssignedIdentityID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-usermanagedidentity"), + AdministratorLogin: to.Ptr("exampleadministratorlogin"), + AdministratorLoginPassword: to.Ptr("examplepassword"), + AvailabilityZone: to.Ptr("1"), + Backup: &armpostgresqlflexibleservers.Backup{ + BackupRetentionDays: to.Ptr[int32](7), + GeoRedundantBackup: to.Ptr(armpostgresqlflexibleservers.GeographicallyRedundantBackupEnabled), + }, + CreateMode: to.Ptr(armpostgresqlflexibleservers.CreateModeCreate), + HighAvailability: &armpostgresqlflexibleservers.HighAvailability{ + Mode: to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant), + }, + Network: &armpostgresqlflexibleservers.Network{ + PublicNetworkAccess: to.Ptr(armpostgresqlflexibleservers.ServerPublicNetworkAccessStateEnabled), + }, + Storage: &armpostgresqlflexibleservers.Storage{ + AutoGrow: to.Ptr(armpostgresqlflexibleservers.StorageAutoGrowDisabled), + StorageSizeGB: to.Ptr[int32](512), + Tier: to.Ptr(armpostgresqlflexibleservers.AzureManagedDiskPerformanceTierP20), }, - PointInTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-27T00:04:59.407Z"); return t }()), - SourceServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/sourcepgservername"), + Version: to.Ptr(armpostgresqlflexibleservers.PostgresMajorVersionSeventeen), }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Server = armpostgresqlflexibleservers.Server{ - // Name: to.Ptr("pgtestsvc5geo"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/pgtestsvc5geo"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "ElasticServer": to.Ptr("1"), - // }, - // Identity: &armpostgresqlflexibleservers.UserAssignedIdentity{ - // Type: to.Ptr(armpostgresqlflexibleservers.IdentityTypeUserAssigned), - // TenantID: to.Ptr("cccccccc-cccc-cccc-cccc-cccccccccccc"), - // UserAssignedIdentities: map[string]*armpostgresqlflexibleservers.UserIdentity{ - // "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-geo-usermanagedidentity": &armpostgresqlflexibleservers.UserIdentity{ - // ClientID: to.Ptr("llllllll-llll-llll-llll-llllllllllll"), - // PrincipalID: to.Ptr("rrrrrrrr-rrrr-rrrr-rrrr-rrrrrrrrrrrr"), - // }, - // "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-usermanagedidentity": &armpostgresqlflexibleservers.UserIdentity{ - // ClientID: to.Ptr("cccccccc-cccc-cccc-cccc-cccccccccccc"), - // PrincipalID: to.Ptr("pppppppp-pppp-pppp-pppp-pppppppppppp"), - // }, - // }, - // }, - // Properties: &armpostgresqlflexibleservers.ServerProperties{ - // AdministratorLogin: to.Ptr("login"), - // AuthConfig: &armpostgresqlflexibleservers.AuthConfig{ - // ActiveDirectoryAuth: to.Ptr(armpostgresqlflexibleservers.ActiveDirectoryAuthEnumDisabled), - // PasswordAuth: to.Ptr(armpostgresqlflexibleservers.PasswordAuthEnumEnabled), - // }, - // AvailabilityZone: to.Ptr("2"), - // Backup: &armpostgresqlflexibleservers.Backup{ - // BackupRetentionDays: to.Ptr[int32](7), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-03-03T00:28:17.727Z"); return t}()), - // GeoRedundantBackup: to.Ptr(armpostgresqlflexibleservers.GeoRedundantBackupEnumEnabled), - // }, - // DataEncryption: &armpostgresqlflexibleservers.DataEncryption{ - // Type: to.Ptr(armpostgresqlflexibleservers.ArmServerKeyTypeAzureKeyVault), - // GeoBackupEncryptionKeyStatus: to.Ptr(armpostgresqlflexibleservers.KeyStatusEnumValid), - // GeoBackupKeyURI: to.Ptr("https://test-geo-kv.vault.azure.net/keys/test-key1/yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy"), - // GeoBackupUserAssignedIdentityID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-geo-usermanagedidentity"), - // PrimaryEncryptionKeyStatus: to.Ptr(armpostgresqlflexibleservers.KeyStatusEnumValid), - // PrimaryKeyURI: to.Ptr("https://test-kv.vault.azure.net/keys/test-key1/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"), - // PrimaryUserAssignedIdentityID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-usermanagedidentity"), - // }, - // FullyQualifiedDomainName: to.Ptr("pgtestsvc5geo.postgres.database.azure.com"), - // HighAvailability: &armpostgresqlflexibleservers.HighAvailability{ - // Mode: to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeDisabled), - // State: to.Ptr(armpostgresqlflexibleservers.ServerHAStateNotEnabled), - // }, - // MaintenanceWindow: &armpostgresqlflexibleservers.MaintenanceWindow{ - // CustomWindow: to.Ptr("Disabled"), - // DayOfWeek: to.Ptr[int32](0), - // StartHour: to.Ptr[int32](0), - // StartMinute: to.Ptr[int32](0), - // }, - // MinorVersion: to.Ptr("8"), - // Network: &armpostgresqlflexibleservers.Network{ - // PublicNetworkAccess: to.Ptr(armpostgresqlflexibleservers.ServerPublicNetworkAccessStateEnabled), - // }, - // State: to.Ptr(armpostgresqlflexibleservers.ServerStateReady), - // Storage: &armpostgresqlflexibleservers.Storage{ - // AutoGrow: to.Ptr(armpostgresqlflexibleservers.StorageAutoGrowDisabled), - // Iops: to.Ptr[int32](2300), - // StorageSizeGB: to.Ptr[int32](512), - // Tier: to.Ptr(armpostgresqlflexibleservers.AzureManagedDiskPerformanceTiersP20), - // }, - // Version: to.Ptr(armpostgresqlflexibleservers.ServerVersionSixteen), - // }, - // SKU: &armpostgresqlflexibleservers.SKU{ - // Name: to.Ptr("Standard_D4ds_v5"), - // Tier: to.Ptr(armpostgresqlflexibleservers.SKUTierGeneralPurpose), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b1f4d539964453ce8008e4b069e59885e12ba441/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ServerCreatePointInTimeRestore.json -func ExampleServersClient_BeginCreate_createADatabaseAsAPointInTimeRestore() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServersClient().BeginCreate(ctx, "testrg", "pgtestsvc5", armpostgresqlflexibleservers.Server{ - Location: to.Ptr("westus"), - Properties: &armpostgresqlflexibleservers.ServerProperties{ - CreateMode: to.Ptr(armpostgresqlflexibleservers.CreateModePointInTimeRestore), - PointInTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-27T00:04:59.407Z"); return t }()), - SourceServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/sourcepgservername"), + SKU: &armpostgresqlflexibleservers.SKU{ + Name: to.Ptr("Standard_D4ds_v5"), + Tier: to.Ptr(armpostgresqlflexibleservers.SKUTierGeneralPurpose), }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } - res, err := poller.PollUntilDone(ctx, nil) + _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Server = armpostgresqlflexibleservers.Server{ - // Name: to.Ptr("pgtestsvc5"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/pgtestsvc5"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "ElasticServer": to.Ptr("1"), - // }, - // Properties: &armpostgresqlflexibleservers.ServerProperties{ - // AdministratorLogin: to.Ptr("login"), - // AuthConfig: &armpostgresqlflexibleservers.AuthConfig{ - // ActiveDirectoryAuth: to.Ptr(armpostgresqlflexibleservers.ActiveDirectoryAuthEnumDisabled), - // PasswordAuth: to.Ptr(armpostgresqlflexibleservers.PasswordAuthEnumEnabled), - // }, - // AvailabilityZone: to.Ptr("2"), - // Backup: &armpostgresqlflexibleservers.Backup{ - // BackupRetentionDays: to.Ptr[int32](7), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-03-03T00:28:17.727Z"); return t}()), - // GeoRedundantBackup: to.Ptr(armpostgresqlflexibleservers.GeoRedundantBackupEnumDisabled), - // }, - // DataEncryption: &armpostgresqlflexibleservers.DataEncryption{ - // Type: to.Ptr(armpostgresqlflexibleservers.ArmServerKeyTypeSystemManaged), - // }, - // FullyQualifiedDomainName: to.Ptr("pgtestsvc5.postgres.database.azure.com"), - // HighAvailability: &armpostgresqlflexibleservers.HighAvailability{ - // Mode: to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeDisabled), - // State: to.Ptr(armpostgresqlflexibleservers.ServerHAStateNotEnabled), - // }, - // MaintenanceWindow: &armpostgresqlflexibleservers.MaintenanceWindow{ - // CustomWindow: to.Ptr("Disabled"), - // DayOfWeek: to.Ptr[int32](0), - // StartHour: to.Ptr[int32](0), - // StartMinute: to.Ptr[int32](0), - // }, - // MinorVersion: to.Ptr("8"), - // Network: &armpostgresqlflexibleservers.Network{ - // PublicNetworkAccess: to.Ptr(armpostgresqlflexibleservers.ServerPublicNetworkAccessStateEnabled), - // }, - // State: to.Ptr(armpostgresqlflexibleservers.ServerStateReady), - // Storage: &armpostgresqlflexibleservers.Storage{ - // AutoGrow: to.Ptr(armpostgresqlflexibleservers.StorageAutoGrowDisabled), - // Iops: to.Ptr[int32](2300), - // StorageSizeGB: to.Ptr[int32](512), - // Tier: to.Ptr(armpostgresqlflexibleservers.AzureManagedDiskPerformanceTiersP20), - // }, - // Version: to.Ptr(armpostgresqlflexibleservers.ServerVersionSixteen), - // }, - // SKU: &armpostgresqlflexibleservers.SKU{ - // Name: to.Ptr("Standard_D4ds_v5"), - // Tier: to.Ptr(armpostgresqlflexibleservers.SKUTierGeneralPurpose), - // }, - // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b1f4d539964453ce8008e4b069e59885e12ba441/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ServerCreate.json -func ExampleServersClient_BeginCreate_createANewServer() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/735d21dbd7e1cc446babf58860af4cca757d620d/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/ServersCreateInYourOwnVirtualNetworkWithSameZoneHighAvailability.json +func ExampleServersClient_BeginCreateOrUpdate_createANewServerInYourOwnVirtualNetworkWithSameZoneHighAvailability() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -339,33 +136,34 @@ func ExampleServersClient_BeginCreate_createANewServer() { if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewServersClient().BeginCreate(ctx, "testrg", "testpgflex", armpostgresqlflexibleservers.Server{ + poller, err := clientFactory.NewServersClient().BeginCreateOrUpdate(ctx, "exampleresourcegroup", "exampleserver", armpostgresqlflexibleservers.Server{ Location: to.Ptr("eastus"), Tags: map[string]*string{ - "VNetServer": to.Ptr("1"), + "InCustomerVnet": to.Ptr("true"), + "InMicrosoftVnet": to.Ptr("false"), }, Properties: &armpostgresqlflexibleservers.ServerProperties{ - AdministratorLogin: to.Ptr("login"), - AdministratorLoginPassword: to.Ptr("Password1"), + AdministratorLogin: to.Ptr("exampleadministratorlogin"), + AdministratorLoginPassword: to.Ptr("examplepassword"), AvailabilityZone: to.Ptr("1"), Backup: &armpostgresqlflexibleservers.Backup{ BackupRetentionDays: to.Ptr[int32](7), - GeoRedundantBackup: to.Ptr(armpostgresqlflexibleservers.GeoRedundantBackupEnumEnabled), + GeoRedundantBackup: to.Ptr(armpostgresqlflexibleservers.GeographicallyRedundantBackupEnabled), }, CreateMode: to.Ptr(armpostgresqlflexibleservers.CreateModeCreate), HighAvailability: &armpostgresqlflexibleservers.HighAvailability{ - Mode: to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant), + Mode: to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeSameZone), }, Network: &armpostgresqlflexibleservers.Network{ - DelegatedSubnetResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/test-subnet"), - PrivateDNSZoneArmResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/privateDnsZones/testpgflex.private.postgres.database"), + DelegatedSubnetResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.Network/virtualNetworks/examplevirtualnetwork/subnets/examplesubnet"), + PrivateDNSZoneArmResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.Network/privateDnsZones/exampleprivatednszone.private.postgres.database"), }, Storage: &armpostgresqlflexibleservers.Storage{ AutoGrow: to.Ptr(armpostgresqlflexibleservers.StorageAutoGrowDisabled), StorageSizeGB: to.Ptr[int32](512), - Tier: to.Ptr(armpostgresqlflexibleservers.AzureManagedDiskPerformanceTiersP20), + Tier: to.Ptr(armpostgresqlflexibleservers.AzureManagedDiskPerformanceTierP20), }, - Version: to.Ptr(armpostgresqlflexibleservers.ServerVersionSixteen), + Version: to.Ptr(armpostgresqlflexibleservers.PostgresMajorVersionSeventeen), }, SKU: &armpostgresqlflexibleservers.SKU{ Name: to.Ptr("Standard_D4ds_v5"), @@ -375,82 +173,14 @@ func ExampleServersClient_BeginCreate_createANewServer() { if err != nil { log.Fatalf("failed to finish the request: %v", err) } - res, err := poller.PollUntilDone(ctx, nil) + _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Server = armpostgresqlflexibleservers.Server{ - // Name: to.Ptr("testpgflex"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testpgflex"), - // SystemData: &armpostgresqlflexibleservers.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-03-03T17:44:30.709Z"); return t}()), - // }, - // Location: to.Ptr("East US"), - // Tags: map[string]*string{ - // "VnetServer": to.Ptr("1"), - // }, - // Properties: &armpostgresqlflexibleservers.ServerProperties{ - // AdministratorLogin: to.Ptr("login"), - // AuthConfig: &armpostgresqlflexibleservers.AuthConfig{ - // ActiveDirectoryAuth: to.Ptr(armpostgresqlflexibleservers.ActiveDirectoryAuthEnumDisabled), - // PasswordAuth: to.Ptr(armpostgresqlflexibleservers.PasswordAuthEnumEnabled), - // }, - // AvailabilityZone: to.Ptr("1"), - // Backup: &armpostgresqlflexibleservers.Backup{ - // BackupRetentionDays: to.Ptr[int32](7), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-03-03T17:49:56.940Z"); return t}()), - // GeoRedundantBackup: to.Ptr(armpostgresqlflexibleservers.GeoRedundantBackupEnumEnabled), - // }, - // DataEncryption: &armpostgresqlflexibleservers.DataEncryption{ - // Type: to.Ptr(armpostgresqlflexibleservers.ArmServerKeyTypeSystemManaged), - // }, - // FullyQualifiedDomainName: to.Ptr("testpgflex.postgres.database.azure.com"), - // HighAvailability: &armpostgresqlflexibleservers.HighAvailability{ - // Mode: to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant), - // StandbyAvailabilityZone: to.Ptr("2"), - // State: to.Ptr(armpostgresqlflexibleservers.ServerHAStateHealthy), - // }, - // MaintenanceWindow: &armpostgresqlflexibleservers.MaintenanceWindow{ - // CustomWindow: to.Ptr("Disabled"), - // DayOfWeek: to.Ptr[int32](0), - // StartHour: to.Ptr[int32](0), - // StartMinute: to.Ptr[int32](0), - // }, - // MinorVersion: to.Ptr("8"), - // Network: &armpostgresqlflexibleservers.Network{ - // DelegatedSubnetResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/test-subnet"), - // PrivateDNSZoneArmResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/privateDnsZones/testpgflex.private.postgres.database.azure.com"), - // PublicNetworkAccess: to.Ptr(armpostgresqlflexibleservers.ServerPublicNetworkAccessStateDisabled), - // }, - // Replica: &armpostgresqlflexibleservers.Replica{ - // Capacity: to.Ptr[int32](5), - // Role: to.Ptr(armpostgresqlflexibleservers.ReplicationRolePrimary), - // }, - // ReplicaCapacity: to.Ptr[int32](5), - // ReplicationRole: to.Ptr(armpostgresqlflexibleservers.ReplicationRolePrimary), - // State: to.Ptr(armpostgresqlflexibleservers.ServerStateReady), - // Storage: &armpostgresqlflexibleservers.Storage{ - // Type: to.Ptr(armpostgresqlflexibleservers.StorageType("")), - // AutoGrow: to.Ptr(armpostgresqlflexibleservers.StorageAutoGrowDisabled), - // Iops: to.Ptr[int32](2300), - // StorageSizeGB: to.Ptr[int32](512), - // Tier: to.Ptr(armpostgresqlflexibleservers.AzureManagedDiskPerformanceTiersP20), - // }, - // Version: to.Ptr(armpostgresqlflexibleservers.ServerVersionSixteen), - // }, - // SKU: &armpostgresqlflexibleservers.SKU{ - // Name: to.Ptr("Standard_D4ds_v5"), - // Tier: to.Ptr(armpostgresqlflexibleservers.SKUTierGeneralPurpose), - // }, - // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b1f4d539964453ce8008e4b069e59885e12ba441/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ServerCreateWithMicrosoftEntraEnabled.json -func ExampleServersClient_BeginCreate_createANewServerWithMicrosoftEntraAuthenticationEnabled() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/735d21dbd7e1cc446babf58860af4cca757d620d/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/ServersCreateReviveDropped.json +func ExampleServersClient_BeginCreateOrUpdate_createANewServerUsingABackupOfAServerThatWasDeletedOrDroppedRecently() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -460,118 +190,53 @@ func ExampleServersClient_BeginCreate_createANewServerWithMicrosoftEntraAuthenti if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewServersClient().BeginCreate(ctx, "testrg", "pgtestsvc4", armpostgresqlflexibleservers.Server{ - Location: to.Ptr("westus"), - Tags: map[string]*string{ - "ElasticServer": to.Ptr("1"), - }, + poller, err := clientFactory.NewServersClient().BeginCreateOrUpdate(ctx, "exampleresourcegroup", "exampleserver", armpostgresqlflexibleservers.Server{ + Location: to.Ptr("eastus"), Properties: &armpostgresqlflexibleservers.ServerProperties{ - AdministratorLogin: to.Ptr("login"), - AdministratorLoginPassword: to.Ptr("Password1"), - AuthConfig: &armpostgresqlflexibleservers.AuthConfig{ - ActiveDirectoryAuth: to.Ptr(armpostgresqlflexibleservers.ActiveDirectoryAuthEnumEnabled), - PasswordAuth: to.Ptr(armpostgresqlflexibleservers.PasswordAuthEnumEnabled), - TenantID: to.Ptr("tttttt-tttt-tttt-tttt-tttttttttttt"), - }, - AvailabilityZone: to.Ptr("1"), - Backup: &armpostgresqlflexibleservers.Backup{ - BackupRetentionDays: to.Ptr[int32](7), - GeoRedundantBackup: to.Ptr(armpostgresqlflexibleservers.GeoRedundantBackupEnumDisabled), - }, - CreateMode: to.Ptr(armpostgresqlflexibleservers.CreateModeCreate), - DataEncryption: &armpostgresqlflexibleservers.DataEncryption{ - Type: to.Ptr(armpostgresqlflexibleservers.ArmServerKeyTypeSystemManaged), - }, - HighAvailability: &armpostgresqlflexibleservers.HighAvailability{ - Mode: to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant), - }, - Network: &armpostgresqlflexibleservers.Network{ - DelegatedSubnetResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/test-vnet-subnet"), - PrivateDNSZoneArmResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourcegroups/testrg/providers/Microsoft.Network/privateDnsZones/test-private-dns-zone.postgres.database.azure.com"), - }, - Storage: &armpostgresqlflexibleservers.Storage{ - AutoGrow: to.Ptr(armpostgresqlflexibleservers.StorageAutoGrowDisabled), - StorageSizeGB: to.Ptr[int32](512), - Tier: to.Ptr(armpostgresqlflexibleservers.AzureManagedDiskPerformanceTiersP20), - }, - Version: to.Ptr(armpostgresqlflexibleservers.ServerVersionSixteen), - }, - SKU: &armpostgresqlflexibleservers.SKU{ - Name: to.Ptr("Standard_D4ds_v5"), - Tier: to.Ptr(armpostgresqlflexibleservers.SKUTierGeneralPurpose), + CreateMode: to.Ptr(armpostgresqlflexibleservers.CreateModeReviveDropped), + PointInTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T18:30:22.123Z"); return t }()), + SourceServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampledeletedserver"), }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } - res, err := poller.PollUntilDone(ctx, nil) + _, err = poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/735d21dbd7e1cc446babf58860af4cca757d620d/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/ServersCreatePointInTimeRestore.json +func ExampleServersClient_BeginCreateOrUpdate_createANewServerUsingAPointInTimeRestoreOfABackupOfAnExistingServer() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewServersClient().BeginCreateOrUpdate(ctx, "exampleresourcegroup", "exampleserver", armpostgresqlflexibleservers.Server{ + Location: to.Ptr("eastus"), + Properties: &armpostgresqlflexibleservers.ServerProperties{ + CreateMode: to.Ptr(armpostgresqlflexibleservers.CreateModePointInTimeRestore), + PointInTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T18:35:22.123Z"); return t }()), + SourceServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/examplesourceserver"), + }, + }, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Server = armpostgresqlflexibleservers.Server{ - // Name: to.Ptr("pgtestsvc4"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/pgtestsvc4"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "ElasticServer": to.Ptr("1"), - // }, - // Properties: &armpostgresqlflexibleservers.ServerProperties{ - // AdministratorLogin: to.Ptr("login"), - // AuthConfig: &armpostgresqlflexibleservers.AuthConfig{ - // ActiveDirectoryAuth: to.Ptr(armpostgresqlflexibleservers.ActiveDirectoryAuthEnumEnabled), - // PasswordAuth: to.Ptr(armpostgresqlflexibleservers.PasswordAuthEnumEnabled), - // TenantID: to.Ptr("tttttt-tttt-tttt-tttt-tttttttttttt"), - // }, - // AvailabilityZone: to.Ptr("1"), - // Backup: &armpostgresqlflexibleservers.Backup{ - // BackupRetentionDays: to.Ptr[int32](7), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-02-26T01:08:06.719Z"); return t}()), - // GeoRedundantBackup: to.Ptr(armpostgresqlflexibleservers.GeoRedundantBackupEnumDisabled), - // }, - // FullyQualifiedDomainName: to.Ptr("pgtestsvc4.test-private-dns-zone.postgres.database.azure.com"), - // HighAvailability: &armpostgresqlflexibleservers.HighAvailability{ - // Mode: to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant), - // StandbyAvailabilityZone: to.Ptr("2"), - // State: to.Ptr(armpostgresqlflexibleservers.ServerHAStateHealthy), - // }, - // MaintenanceWindow: &armpostgresqlflexibleservers.MaintenanceWindow{ - // CustomWindow: to.Ptr("Disabled"), - // DayOfWeek: to.Ptr[int32](0), - // StartHour: to.Ptr[int32](0), - // StartMinute: to.Ptr[int32](0), - // }, - // MinorVersion: to.Ptr("6"), - // Network: &armpostgresqlflexibleservers.Network{ - // DelegatedSubnetResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/test-vnet-subnet"), - // PrivateDNSZoneArmResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/privateDnsZones/test-private-dns-zone.postgres.database.azure.com"), - // PublicNetworkAccess: to.Ptr(armpostgresqlflexibleservers.ServerPublicNetworkAccessStateDisabled), - // }, - // Replica: &armpostgresqlflexibleservers.Replica{ - // Capacity: to.Ptr[int32](5), - // Role: to.Ptr(armpostgresqlflexibleservers.ReplicationRolePrimary), - // }, - // State: to.Ptr(armpostgresqlflexibleservers.ServerStateReady), - // Storage: &armpostgresqlflexibleservers.Storage{ - // AutoGrow: to.Ptr(armpostgresqlflexibleservers.StorageAutoGrowDisabled), - // Iops: to.Ptr[int32](2300), - // StorageSizeGB: to.Ptr[int32](512), - // Tier: to.Ptr(armpostgresqlflexibleservers.AzureManagedDiskPerformanceTiersP20), - // }, - // Version: to.Ptr(armpostgresqlflexibleservers.ServerVersionSixteen), - // }, - // SKU: &armpostgresqlflexibleservers.SKU{ - // Name: to.Ptr("Standard_D4ds_v5"), - // Tier: to.Ptr(armpostgresqlflexibleservers.SKUTierGeneralPurpose), - // }, - // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b1f4d539964453ce8008e4b069e59885e12ba441/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ServerCreateReplica.json -func ExampleServersClient_BeginCreate_serverCreateReplica() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/735d21dbd7e1cc446babf58860af4cca757d620d/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/ServersCreateGeoRestoreWithDataEncryptionEnabledAutoUpdate.json +func ExampleServersClient_BeginCreateOrUpdate_createANewServerUsingARestoreOfAGeographicallyRedundantBackupOfAnExistingServerWithDataEncryptionBasedOnCustomerManagedKeyWithAutomaticKeyVersionUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -581,114 +246,39 @@ func ExampleServersClient_BeginCreate_serverCreateReplica() { if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewServersClient().BeginCreate(ctx, "testrg", "pgtestsvc5rep", armpostgresqlflexibleservers.Server{ - Location: to.Ptr("westus"), + poller, err := clientFactory.NewServersClient().BeginCreateOrUpdate(ctx, "exampleresourcegroup", "exampleserver", armpostgresqlflexibleservers.Server{ + Location: to.Ptr("eastus"), Identity: &armpostgresqlflexibleservers.UserAssignedIdentity{ Type: to.Ptr(armpostgresqlflexibleservers.IdentityTypeUserAssigned), UserAssignedIdentities: map[string]*armpostgresqlflexibleservers.UserIdentity{ - "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-usermanagedidentity": {}, + "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/examplegeoredundantidentity": {}, + "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/exampleprimaryidentity": {}, }, }, Properties: &armpostgresqlflexibleservers.ServerProperties{ - CreateMode: to.Ptr(armpostgresqlflexibleservers.CreateModeReplica), + CreateMode: to.Ptr(armpostgresqlflexibleservers.CreateModeGeoRestore), DataEncryption: &armpostgresqlflexibleservers.DataEncryption{ - Type: to.Ptr(armpostgresqlflexibleservers.ArmServerKeyTypeAzureKeyVault), - GeoBackupKeyURI: to.Ptr(""), - GeoBackupUserAssignedIdentityID: to.Ptr(""), - PrimaryKeyURI: to.Ptr("https://test-kv.vault.azure.net/keys/test-key1/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"), - PrimaryUserAssignedIdentityID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-usermanagedidentity"), + Type: to.Ptr(armpostgresqlflexibleservers.DataEncryptionTypeAzureKeyVault), + GeoBackupKeyURI: to.Ptr("https://examplegeoredundantkeyvault.vault.azure.net/keys/examplekey"), + GeoBackupUserAssignedIdentityID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/examplegeoredundantidentity"), + PrimaryKeyURI: to.Ptr("https://exampleprimarykeyvault.vault.azure.net/keys/examplekey"), + PrimaryUserAssignedIdentityID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/exampleprimaryidentity"), }, - PointInTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-27T00:04:59.407Z"); return t }()), - SourceServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/sourcepgservername"), + PointInTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T18:35:22.123Z"); return t }()), + SourceServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/examplesourceserver"), }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } - res, err := poller.PollUntilDone(ctx, nil) + _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Server = armpostgresqlflexibleservers.Server{ - // Name: to.Ptr("pgtestsvc5rep"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/pgtestsvc5rep"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "ElasticServer": to.Ptr("1"), - // }, - // Identity: &armpostgresqlflexibleservers.UserAssignedIdentity{ - // Type: to.Ptr(armpostgresqlflexibleservers.IdentityTypeUserAssigned), - // TenantID: to.Ptr("cccccccc-cccc-cccc-cccc-cccccccccccc"), - // UserAssignedIdentities: map[string]*armpostgresqlflexibleservers.UserIdentity{ - // "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-usermanagedidentity": &armpostgresqlflexibleservers.UserIdentity{ - // ClientID: to.Ptr("cccccccc-cccc-cccc-cccc-cccccccccccc"), - // PrincipalID: to.Ptr("pppppppp-pppp-pppp-pppp-pppppppppppp"), - // }, - // }, - // }, - // Properties: &armpostgresqlflexibleservers.ServerProperties{ - // AdministratorLogin: to.Ptr("login"), - // AuthConfig: &armpostgresqlflexibleservers.AuthConfig{ - // ActiveDirectoryAuth: to.Ptr(armpostgresqlflexibleservers.ActiveDirectoryAuthEnumDisabled), - // PasswordAuth: to.Ptr(armpostgresqlflexibleservers.PasswordAuthEnumEnabled), - // }, - // AvailabilityZone: to.Ptr("2"), - // Backup: &armpostgresqlflexibleservers.Backup{ - // BackupRetentionDays: to.Ptr[int32](7), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-03-03T00:28:17.727Z"); return t}()), - // GeoRedundantBackup: to.Ptr(armpostgresqlflexibleservers.GeoRedundantBackupEnumDisabled), - // }, - // DataEncryption: &armpostgresqlflexibleservers.DataEncryption{ - // Type: to.Ptr(armpostgresqlflexibleservers.ArmServerKeyTypeAzureKeyVault), - // PrimaryEncryptionKeyStatus: to.Ptr(armpostgresqlflexibleservers.KeyStatusEnumValid), - // PrimaryKeyURI: to.Ptr("https://test-kv.vault.azure.net/keys/test-key1/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"), - // PrimaryUserAssignedIdentityID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-usermanagedidentity"), - // }, - // FullyQualifiedDomainName: to.Ptr("pgtestsvc5rep.postgres.database.azure.com"), - // HighAvailability: &armpostgresqlflexibleservers.HighAvailability{ - // Mode: to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeDisabled), - // State: to.Ptr(armpostgresqlflexibleservers.ServerHAStateNotEnabled), - // }, - // MaintenanceWindow: &armpostgresqlflexibleservers.MaintenanceWindow{ - // CustomWindow: to.Ptr("Disabled"), - // DayOfWeek: to.Ptr[int32](0), - // StartHour: to.Ptr[int32](0), - // StartMinute: to.Ptr[int32](0), - // }, - // MinorVersion: to.Ptr("6"), - // Network: &armpostgresqlflexibleservers.Network{ - // PublicNetworkAccess: to.Ptr(armpostgresqlflexibleservers.ServerPublicNetworkAccessStateEnabled), - // }, - // Replica: &armpostgresqlflexibleservers.Replica{ - // Capacity: to.Ptr[int32](0), - // ReplicationState: to.Ptr(armpostgresqlflexibleservers.ReplicationStateActive), - // Role: to.Ptr(armpostgresqlflexibleservers.ReplicationRoleAsyncReplica), - // }, - // ReplicaCapacity: to.Ptr[int32](0), - // ReplicationRole: to.Ptr(armpostgresqlflexibleservers.ReplicationRoleAsyncReplica), - // SourceServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/sourcepgservername"), - // State: to.Ptr(armpostgresqlflexibleservers.ServerStateReady), - // Storage: &armpostgresqlflexibleservers.Storage{ - // AutoGrow: to.Ptr(armpostgresqlflexibleservers.StorageAutoGrowDisabled), - // Iops: to.Ptr[int32](2300), - // StorageSizeGB: to.Ptr[int32](512), - // Tier: to.Ptr(armpostgresqlflexibleservers.AzureManagedDiskPerformanceTiersP20), - // }, - // Version: to.Ptr(armpostgresqlflexibleservers.ServerVersionSixteen), - // }, - // SKU: &armpostgresqlflexibleservers.SKU{ - // Name: to.Ptr("Standard_D4ds_v5"), - // Tier: to.Ptr(armpostgresqlflexibleservers.SKUTierGeneralPurpose), - // }, - // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b1f4d539964453ce8008e4b069e59885e12ba441/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ServerCreateReviveDropped.json -func ExampleServersClient_BeginCreate_serverCreateReviveDropped() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/735d21dbd7e1cc446babf58860af4cca757d620d/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/ServersCreateGeoRestoreWithDataEncryptionEnabled.json +func ExampleServersClient_BeginCreateOrUpdate_createANewServerUsingARestoreOfAGeographicallyRedundantBackupOfAnExistingServerWithDataEncryptionBasedOnCustomerManagedKey() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -698,79 +288,97 @@ func ExampleServersClient_BeginCreate_serverCreateReviveDropped() { if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewServersClient().BeginCreate(ctx, "testrg", "pgtestsvc5-rev", armpostgresqlflexibleservers.Server{ - Location: to.Ptr("westus"), + poller, err := clientFactory.NewServersClient().BeginCreateOrUpdate(ctx, "exampleresourcegroup", "exampleserver", armpostgresqlflexibleservers.Server{ + Location: to.Ptr("eastus"), + Identity: &armpostgresqlflexibleservers.UserAssignedIdentity{ + Type: to.Ptr(armpostgresqlflexibleservers.IdentityTypeUserAssigned), + UserAssignedIdentities: map[string]*armpostgresqlflexibleservers.UserIdentity{ + "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/examplegeoredundantidentity": {}, + "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/exampleprimaryidentity": {}, + }, + }, Properties: &armpostgresqlflexibleservers.ServerProperties{ - CreateMode: to.Ptr(armpostgresqlflexibleservers.CreateModeReviveDropped), - PointInTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-04-27T00:04:59.407Z"); return t }()), - SourceServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/pgtestsvc5"), + CreateMode: to.Ptr(armpostgresqlflexibleservers.CreateModeGeoRestore), + DataEncryption: &armpostgresqlflexibleservers.DataEncryption{ + Type: to.Ptr(armpostgresqlflexibleservers.DataEncryptionTypeAzureKeyVault), + GeoBackupKeyURI: to.Ptr("https://examplegeoredundantkeyvault.vault.azure.net/keys/examplekey/yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy"), + GeoBackupUserAssignedIdentityID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/examplegeoredundantidentity"), + PrimaryKeyURI: to.Ptr("https://exampleprimarykeyvault.vault.azure.net/keys/examplekey/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"), + PrimaryUserAssignedIdentityID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/exampleprimaryidentity"), + }, + PointInTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T18:35:22.123Z"); return t }()), + SourceServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/examplesourceserver"), }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } - res, err := poller.PollUntilDone(ctx, nil) + _, err = poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/735d21dbd7e1cc446babf58860af4cca757d620d/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/ServersCreateWithMicrosoftEntraEnabledInYourOwnVirtualNetworkWithoutHighAvailability.json +func ExampleServersClient_BeginCreateOrUpdate_createANewServerWithMicrosoftEntraAuthenticationEnabledInYourOwnVirtualNetworkAndWithoutHighAvailability() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewServersClient().BeginCreateOrUpdate(ctx, "exampleresourcegroup", "exampleserver", armpostgresqlflexibleservers.Server{ + Location: to.Ptr("eastus"), + Properties: &armpostgresqlflexibleservers.ServerProperties{ + AdministratorLogin: to.Ptr("exampleadministratorlogin"), + AdministratorLoginPassword: to.Ptr("examplepassword"), + AuthConfig: &armpostgresqlflexibleservers.AuthConfig{ + ActiveDirectoryAuth: to.Ptr(armpostgresqlflexibleservers.MicrosoftEntraAuthEnabled), + PasswordAuth: to.Ptr(armpostgresqlflexibleservers.PasswordBasedAuthEnabled), + TenantID: to.Ptr("tttttt-tttt-tttt-tttt-tttttttttttt"), + }, + AvailabilityZone: to.Ptr("1"), + Backup: &armpostgresqlflexibleservers.Backup{ + BackupRetentionDays: to.Ptr[int32](7), + GeoRedundantBackup: to.Ptr(armpostgresqlflexibleservers.GeographicallyRedundantBackupDisabled), + }, + CreateMode: to.Ptr(armpostgresqlflexibleservers.CreateModeCreate), + DataEncryption: &armpostgresqlflexibleservers.DataEncryption{ + Type: to.Ptr(armpostgresqlflexibleservers.DataEncryptionTypeSystemManaged), + }, + HighAvailability: &armpostgresqlflexibleservers.HighAvailability{ + Mode: to.Ptr(armpostgresqlflexibleservers.HighAvailabilityMode("Disabled")), + }, + Network: &armpostgresqlflexibleservers.Network{ + DelegatedSubnetResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.Network/virtualNetworks/examplevirtualnetwork/subnets/examplesubnet"), + PrivateDNSZoneArmResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourcegroups/exampleresourcegroup/providers/Microsoft.Network/privateDnsZones/exampleprivatednszone.postgres.database.azure.com"), + }, + Storage: &armpostgresqlflexibleservers.Storage{ + AutoGrow: to.Ptr(armpostgresqlflexibleservers.StorageAutoGrowDisabled), + StorageSizeGB: to.Ptr[int32](512), + Tier: to.Ptr(armpostgresqlflexibleservers.AzureManagedDiskPerformanceTierP20), + }, + Version: to.Ptr(armpostgresqlflexibleservers.PostgresMajorVersionSeventeen), + }, + SKU: &armpostgresqlflexibleservers.SKU{ + Name: to.Ptr("Standard_D4ds_v5"), + Tier: to.Ptr(armpostgresqlflexibleservers.SKUTierGeneralPurpose), + }, + }, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Server = armpostgresqlflexibleservers.Server{ - // Name: to.Ptr("pgtestsvc5-rev"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/pgtestsvc5-rev"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "ElasticServer": to.Ptr("1"), - // }, - // Properties: &armpostgresqlflexibleservers.ServerProperties{ - // AdministratorLogin: to.Ptr("login"), - // AuthConfig: &armpostgresqlflexibleservers.AuthConfig{ - // ActiveDirectoryAuth: to.Ptr(armpostgresqlflexibleservers.ActiveDirectoryAuthEnumDisabled), - // PasswordAuth: to.Ptr(armpostgresqlflexibleservers.PasswordAuthEnumEnabled), - // }, - // AvailabilityZone: to.Ptr("2"), - // Backup: &armpostgresqlflexibleservers.Backup{ - // BackupRetentionDays: to.Ptr[int32](7), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-03-03T00:28:17.727Z"); return t}()), - // GeoRedundantBackup: to.Ptr(armpostgresqlflexibleservers.GeoRedundantBackupEnumDisabled), - // }, - // FullyQualifiedDomainName: to.Ptr("pgtestsvc5-rev.postgres.database.azure.com"), - // HighAvailability: &armpostgresqlflexibleservers.HighAvailability{ - // Mode: to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeDisabled), - // State: to.Ptr(armpostgresqlflexibleservers.ServerHAStateNotEnabled), - // }, - // MaintenanceWindow: &armpostgresqlflexibleservers.MaintenanceWindow{ - // CustomWindow: to.Ptr("Disabled"), - // DayOfWeek: to.Ptr[int32](0), - // StartHour: to.Ptr[int32](0), - // StartMinute: to.Ptr[int32](0), - // }, - // MinorVersion: to.Ptr("8"), - // Network: &armpostgresqlflexibleservers.Network{ - // PublicNetworkAccess: to.Ptr(armpostgresqlflexibleservers.ServerPublicNetworkAccessStateEnabled), - // }, - // ReplicaCapacity: to.Ptr[int32](0), - // ReplicationRole: to.Ptr(armpostgresqlflexibleservers.ReplicationRolePrimary), - // State: to.Ptr(armpostgresqlflexibleservers.ServerStateReady), - // Storage: &armpostgresqlflexibleservers.Storage{ - // AutoGrow: to.Ptr(armpostgresqlflexibleservers.StorageAutoGrowDisabled), - // Iops: to.Ptr[int32](2300), - // StorageSizeGB: to.Ptr[int32](512), - // Tier: to.Ptr(armpostgresqlflexibleservers.AzureManagedDiskPerformanceTiersP20), - // }, - // Version: to.Ptr(armpostgresqlflexibleservers.ServerVersionSixteen), - // }, - // SKU: &armpostgresqlflexibleservers.SKU{ - // Name: to.Ptr("Standard_D4ds_v5"), - // Tier: to.Ptr(armpostgresqlflexibleservers.SKUTierGeneralPurpose), - // }, - // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b1f4d539964453ce8008e4b069e59885e12ba441/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ServerCreateWithDataEncryptionEnabled.json -func ExampleServersClient_BeginCreate_serverCreateWithDataEncryptionEnabled() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/735d21dbd7e1cc446babf58860af4cca757d620d/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/ServersCreateWithDataEncryptionEnabledAutoUpdate.json +func ExampleServersClient_BeginCreateOrUpdate_createANewServerWithDataEncryptionBasedOnCustomerManagedKeyWithAutomaticKeyVersionUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -780,43 +388,43 @@ func ExampleServersClient_BeginCreate_serverCreateWithDataEncryptionEnabled() { if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewServersClient().BeginCreate(ctx, "testrg", "pgtestsvc4", armpostgresqlflexibleservers.Server{ - Location: to.Ptr("westus"), + poller, err := clientFactory.NewServersClient().BeginCreateOrUpdate(ctx, "exampleresourcegroup", "exampleserver", armpostgresqlflexibleservers.Server{ + Location: to.Ptr("eastus"), Identity: &armpostgresqlflexibleservers.UserAssignedIdentity{ Type: to.Ptr(armpostgresqlflexibleservers.IdentityTypeUserAssigned), UserAssignedIdentities: map[string]*armpostgresqlflexibleservers.UserIdentity{ - "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-usermanagedidentity": {}, + "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/exampleprimaryidentity": {}, }, }, Properties: &armpostgresqlflexibleservers.ServerProperties{ - AdministratorLogin: to.Ptr("login"), - AdministratorLoginPassword: to.Ptr("Password1"), + AdministratorLogin: to.Ptr("exampleadministratorlogin"), + AdministratorLoginPassword: to.Ptr("examplepassword"), AvailabilityZone: to.Ptr("1"), Backup: &armpostgresqlflexibleservers.Backup{ BackupRetentionDays: to.Ptr[int32](7), - GeoRedundantBackup: to.Ptr(armpostgresqlflexibleservers.GeoRedundantBackupEnumDisabled), + GeoRedundantBackup: to.Ptr(armpostgresqlflexibleservers.GeographicallyRedundantBackupDisabled), }, CreateMode: to.Ptr(armpostgresqlflexibleservers.CreateModeCreate), DataEncryption: &armpostgresqlflexibleservers.DataEncryption{ - Type: to.Ptr(armpostgresqlflexibleservers.ArmServerKeyTypeAzureKeyVault), + Type: to.Ptr(armpostgresqlflexibleservers.DataEncryptionTypeAzureKeyVault), GeoBackupKeyURI: to.Ptr(""), GeoBackupUserAssignedIdentityID: to.Ptr(""), - PrimaryKeyURI: to.Ptr("https://test-kv.vault.azure.net/keys/test-key1/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"), - PrimaryUserAssignedIdentityID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-usermanagedidentity"), + PrimaryKeyURI: to.Ptr("https://exampleprimarykeyvault.vault.azure.net/keys/examplekey"), + PrimaryUserAssignedIdentityID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/exampleprimaryidentity"), }, HighAvailability: &armpostgresqlflexibleservers.HighAvailability{ Mode: to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant), }, Network: &armpostgresqlflexibleservers.Network{ - DelegatedSubnetResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/test-vnet-subnet"), - PrivateDNSZoneArmResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourcegroups/testrg/providers/Microsoft.Network/privateDnsZones/test-private-dns-zone.postgres.database.azure.com"), + DelegatedSubnetResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.Network/virtualNetworks/examplevirtualnetwork/subnets/examplesubnet"), + PrivateDNSZoneArmResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourcegroups/exampleresourcegroup/providers/Microsoft.Network/privateDnsZones/exampleprivatednszone.postgres.database.azure.com"), }, Storage: &armpostgresqlflexibleservers.Storage{ AutoGrow: to.Ptr(armpostgresqlflexibleservers.StorageAutoGrowDisabled), StorageSizeGB: to.Ptr[int32](512), - Tier: to.Ptr(armpostgresqlflexibleservers.AzureManagedDiskPerformanceTiersP20), + Tier: to.Ptr(armpostgresqlflexibleservers.AzureManagedDiskPerformanceTierP20), }, - Version: to.Ptr(armpostgresqlflexibleservers.ServerVersionSixteen), + Version: to.Ptr(armpostgresqlflexibleservers.PostgresMajorVersionSeventeen), }, SKU: &armpostgresqlflexibleservers.SKU{ Name: to.Ptr("Standard_D4ds_v5"), @@ -826,85 +434,14 @@ func ExampleServersClient_BeginCreate_serverCreateWithDataEncryptionEnabled() { if err != nil { log.Fatalf("failed to finish the request: %v", err) } - res, err := poller.PollUntilDone(ctx, nil) + _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Server = armpostgresqlflexibleservers.Server{ - // Name: to.Ptr("pgtestsvc4"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/pgtestsvc4"), - // Location: to.Ptr("westus"), - // Identity: &armpostgresqlflexibleservers.UserAssignedIdentity{ - // Type: to.Ptr(armpostgresqlflexibleservers.IdentityTypeUserAssigned), - // TenantID: to.Ptr("cccccccc-cccc-cccc-cccc-cccccccccccc"), - // UserAssignedIdentities: map[string]*armpostgresqlflexibleservers.UserIdentity{ - // "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-usermanagedidentity": &armpostgresqlflexibleservers.UserIdentity{ - // ClientID: to.Ptr("cccccccc-cccc-cccc-cccc-cccccccccccc"), - // PrincipalID: to.Ptr("pppppppp-pppp-pppp-pppp-pppppppppppp"), - // }, - // }, - // }, - // Properties: &armpostgresqlflexibleservers.ServerProperties{ - // AdministratorLogin: to.Ptr("login"), - // AuthConfig: &armpostgresqlflexibleservers.AuthConfig{ - // ActiveDirectoryAuth: to.Ptr(armpostgresqlflexibleservers.ActiveDirectoryAuthEnumEnabled), - // PasswordAuth: to.Ptr(armpostgresqlflexibleservers.PasswordAuthEnumEnabled), - // }, - // AvailabilityZone: to.Ptr("1"), - // Backup: &armpostgresqlflexibleservers.Backup{ - // BackupRetentionDays: to.Ptr[int32](7), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-02-26T01:08:06.719Z"); return t}()), - // GeoRedundantBackup: to.Ptr(armpostgresqlflexibleservers.GeoRedundantBackupEnumDisabled), - // }, - // DataEncryption: &armpostgresqlflexibleservers.DataEncryption{ - // Type: to.Ptr(armpostgresqlflexibleservers.ArmServerKeyTypeAzureKeyVault), - // PrimaryEncryptionKeyStatus: to.Ptr(armpostgresqlflexibleservers.KeyStatusEnumValid), - // PrimaryKeyURI: to.Ptr("https://test-kv.vault.azure.net/keys/test-key1/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"), - // PrimaryUserAssignedIdentityID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-usermanagedidentity"), - // }, - // FullyQualifiedDomainName: to.Ptr("pgtestsvc4.test-private-dns-zone.postgres.database.azure.com"), - // HighAvailability: &armpostgresqlflexibleservers.HighAvailability{ - // Mode: to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant), - // StandbyAvailabilityZone: to.Ptr("2"), - // State: to.Ptr(armpostgresqlflexibleservers.ServerHAStateHealthy), - // }, - // MaintenanceWindow: &armpostgresqlflexibleservers.MaintenanceWindow{ - // CustomWindow: to.Ptr("Disabled"), - // DayOfWeek: to.Ptr[int32](0), - // StartHour: to.Ptr[int32](0), - // StartMinute: to.Ptr[int32](0), - // }, - // MinorVersion: to.Ptr("8"), - // Network: &armpostgresqlflexibleservers.Network{ - // DelegatedSubnetResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/test-vnet-subnet"), - // PrivateDNSZoneArmResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/privateDnsZones/test-private-dns-zone.postgres.database.azure.com"), - // PublicNetworkAccess: to.Ptr(armpostgresqlflexibleservers.ServerPublicNetworkAccessStateDisabled), - // }, - // ReplicaCapacity: to.Ptr[int32](5), - // ReplicationRole: to.Ptr(armpostgresqlflexibleservers.ReplicationRolePrimary), - // State: to.Ptr(armpostgresqlflexibleservers.ServerStateReady), - // Storage: &armpostgresqlflexibleservers.Storage{ - // Type: to.Ptr(armpostgresqlflexibleservers.StorageType("")), - // AutoGrow: to.Ptr(armpostgresqlflexibleservers.StorageAutoGrowDisabled), - // Iops: to.Ptr[int32](2300), - // StorageSizeGB: to.Ptr[int32](512), - // Tier: to.Ptr(armpostgresqlflexibleservers.AzureManagedDiskPerformanceTiersP20), - // }, - // Version: to.Ptr(armpostgresqlflexibleservers.ServerVersionSixteen), - // }, - // SKU: &armpostgresqlflexibleservers.SKU{ - // Name: to.Ptr("Standard_D4ds_v5"), - // Tier: to.Ptr(armpostgresqlflexibleservers.SKUTierGeneralPurpose), - // }, - // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b1f4d539964453ce8008e4b069e59885e12ba441/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/PromoteReplicaAsForcedStandaloneServer.json -func ExampleServersClient_BeginUpdate_promoteAReplicaServerAsAStandaloneServerAsForcedIEItWillPromoteAReplicaServerImmediatelyWithoutWaitingForPrimaryAndReplicaToBeInSync() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/735d21dbd7e1cc446babf58860af4cca757d620d/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/ServersCreateWithDataEncryptionEnabled.json +func ExampleServersClient_BeginCreateOrUpdate_createANewServerWithDataEncryptionBasedOnCustomerManagedKey() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -914,87 +451,60 @@ func ExampleServersClient_BeginUpdate_promoteAReplicaServerAsAStandaloneServerAs if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewServersClient().BeginUpdate(ctx, "testResourceGroup", "pgtestsvc4-replica", armpostgresqlflexibleservers.ServerForUpdate{ - Properties: &armpostgresqlflexibleservers.ServerPropertiesForUpdate{ - Replica: &armpostgresqlflexibleservers.Replica{ - PromoteMode: to.Ptr(armpostgresqlflexibleservers.ReadReplicaPromoteModeStandalone), - PromoteOption: to.Ptr(armpostgresqlflexibleservers.ReplicationPromoteOptionForced), + poller, err := clientFactory.NewServersClient().BeginCreateOrUpdate(ctx, "exampleresourcegroup", "exampleserver", armpostgresqlflexibleservers.Server{ + Location: to.Ptr("eastus"), + Identity: &armpostgresqlflexibleservers.UserAssignedIdentity{ + Type: to.Ptr(armpostgresqlflexibleservers.IdentityTypeUserAssigned), + UserAssignedIdentities: map[string]*armpostgresqlflexibleservers.UserIdentity{ + "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/exampleprimaryidentity": {}, }, }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) + Properties: &armpostgresqlflexibleservers.ServerProperties{ + AdministratorLogin: to.Ptr("exampleadministratorlogin"), + AdministratorLoginPassword: to.Ptr("examplepassword"), + AvailabilityZone: to.Ptr("1"), + Backup: &armpostgresqlflexibleservers.Backup{ + BackupRetentionDays: to.Ptr[int32](7), + GeoRedundantBackup: to.Ptr(armpostgresqlflexibleservers.GeographicallyRedundantBackupDisabled), + }, + CreateMode: to.Ptr(armpostgresqlflexibleservers.CreateModeCreate), + DataEncryption: &armpostgresqlflexibleservers.DataEncryption{ + Type: to.Ptr(armpostgresqlflexibleservers.DataEncryptionTypeAzureKeyVault), + GeoBackupKeyURI: to.Ptr(""), + GeoBackupUserAssignedIdentityID: to.Ptr(""), + PrimaryKeyURI: to.Ptr("https://exampleprimarykeyvault.vault.azure.net/keys/examplekey/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"), + PrimaryUserAssignedIdentityID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/exampleprimaryidentity"), + }, + HighAvailability: &armpostgresqlflexibleservers.HighAvailability{ + Mode: to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant), + }, + Network: &armpostgresqlflexibleservers.Network{ + DelegatedSubnetResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.Network/virtualNetworks/examplevirtualnetwork/subnets/examplesubnet"), + PrivateDNSZoneArmResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourcegroups/exampleresourcegroup/providers/Microsoft.Network/privateDnsZones/exampleprivatednszone.postgres.database.azure.com"), + }, + Storage: &armpostgresqlflexibleservers.Storage{ + AutoGrow: to.Ptr(armpostgresqlflexibleservers.StorageAutoGrowDisabled), + StorageSizeGB: to.Ptr[int32](512), + Tier: to.Ptr(armpostgresqlflexibleservers.AzureManagedDiskPerformanceTierP20), + }, + Version: to.Ptr(armpostgresqlflexibleservers.PostgresMajorVersionSeventeen), + }, + SKU: &armpostgresqlflexibleservers.SKU{ + Name: to.Ptr("Standard_D4ds_v5"), + Tier: to.Ptr(armpostgresqlflexibleservers.SKUTierGeneralPurpose), + }, + }, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) } - res, err := poller.PollUntilDone(ctx, nil) + _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Server = armpostgresqlflexibleservers.Server{ - // Name: to.Ptr("pgtestsvc4-replica"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/pgtestsvc4-replica"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "ElasticServer": to.Ptr("1"), - // }, - // Properties: &armpostgresqlflexibleservers.ServerProperties{ - // AdministratorLogin: to.Ptr("login"), - // AuthConfig: &armpostgresqlflexibleservers.AuthConfig{ - // ActiveDirectoryAuth: to.Ptr(armpostgresqlflexibleservers.ActiveDirectoryAuthEnumDisabled), - // PasswordAuth: to.Ptr(armpostgresqlflexibleservers.PasswordAuthEnumEnabled), - // }, - // AvailabilityZone: to.Ptr("1"), - // Backup: &armpostgresqlflexibleservers.Backup{ - // BackupRetentionDays: to.Ptr[int32](20), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-02-26T01:16:58.372Z"); return t}()), - // GeoRedundantBackup: to.Ptr(armpostgresqlflexibleservers.GeoRedundantBackupEnumDisabled), - // }, - // DataEncryption: &armpostgresqlflexibleservers.DataEncryption{ - // Type: to.Ptr(armpostgresqlflexibleservers.ArmServerKeyTypeSystemManaged), - // }, - // FullyQualifiedDomainName: to.Ptr("pgtestsvc4-replica.postgres.database.azure.com"), - // HighAvailability: &armpostgresqlflexibleservers.HighAvailability{ - // Mode: to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant), - // StandbyAvailabilityZone: to.Ptr("2"), - // State: to.Ptr(armpostgresqlflexibleservers.ServerHAStateHealthy), - // }, - // MaintenanceWindow: &armpostgresqlflexibleservers.MaintenanceWindow{ - // CustomWindow: to.Ptr("Disabled"), - // DayOfWeek: to.Ptr[int32](0), - // StartHour: to.Ptr[int32](0), - // StartMinute: to.Ptr[int32](0), - // }, - // MinorVersion: to.Ptr("6"), - // Network: &armpostgresqlflexibleservers.Network{ - // DelegatedSubnetResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/test-vnet-subnet"), - // PrivateDNSZoneArmResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/privateDnsZones/test-private-dns-zone.postgres.database.azure.com"), - // PublicNetworkAccess: to.Ptr(armpostgresqlflexibleservers.ServerPublicNetworkAccessStateDisabled), - // }, - // Replica: &armpostgresqlflexibleservers.Replica{ - // Capacity: to.Ptr[int32](0), - // Role: to.Ptr(armpostgresqlflexibleservers.ReplicationRoleNone), - // }, - // State: to.Ptr(armpostgresqlflexibleservers.ServerStateReady), - // Storage: &armpostgresqlflexibleservers.Storage{ - // AutoGrow: to.Ptr(armpostgresqlflexibleservers.StorageAutoGrowEnabled), - // Iops: to.Ptr[int32](5000), - // StorageSizeGB: to.Ptr[int32](1024), - // Tier: to.Ptr(armpostgresqlflexibleservers.AzureManagedDiskPerformanceTiersP30), - // }, - // Version: to.Ptr(armpostgresqlflexibleservers.ServerVersionSixteen), - // }, - // SKU: &armpostgresqlflexibleservers.SKU{ - // Name: to.Ptr("Standard_D8s_v3"), - // Tier: to.Ptr(armpostgresqlflexibleservers.SKUTierGeneralPurpose), - // }, - // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b1f4d539964453ce8008e4b069e59885e12ba441/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/PromoteReplicaAsPlannedStandaloneServer.json -func ExampleServersClient_BeginUpdate_promoteAReplicaServerAsAStandaloneServerAsPlannedIEItWillWaitForReplicationToComplete() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/735d21dbd7e1cc446babf58860af4cca757d620d/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/ServersCreateReplica.json +func ExampleServersClient_BeginCreateOrUpdate_createAReadReplicaOfAnExistingServer() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -1004,87 +514,38 @@ func ExampleServersClient_BeginUpdate_promoteAReplicaServerAsAStandaloneServerAs if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewServersClient().BeginUpdate(ctx, "testResourceGroup", "pgtestsvc4-replica", armpostgresqlflexibleservers.ServerForUpdate{ - Properties: &armpostgresqlflexibleservers.ServerPropertiesForUpdate{ - Replica: &armpostgresqlflexibleservers.Replica{ - PromoteMode: to.Ptr(armpostgresqlflexibleservers.ReadReplicaPromoteModeStandalone), - PromoteOption: to.Ptr(armpostgresqlflexibleservers.ReplicationPromoteOptionPlanned), + poller, err := clientFactory.NewServersClient().BeginCreateOrUpdate(ctx, "exampleresourcegroup", "exampleserver", armpostgresqlflexibleservers.Server{ + Location: to.Ptr("eastus"), + Identity: &armpostgresqlflexibleservers.UserAssignedIdentity{ + Type: to.Ptr(armpostgresqlflexibleservers.IdentityTypeUserAssigned), + UserAssignedIdentities: map[string]*armpostgresqlflexibleservers.UserIdentity{ + "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/exampleprimaryidentity": {}, + }, + }, + Properties: &armpostgresqlflexibleservers.ServerProperties{ + CreateMode: to.Ptr(armpostgresqlflexibleservers.CreateModeReplica), + DataEncryption: &armpostgresqlflexibleservers.DataEncryption{ + Type: to.Ptr(armpostgresqlflexibleservers.DataEncryptionTypeAzureKeyVault), + GeoBackupKeyURI: to.Ptr(""), + GeoBackupUserAssignedIdentityID: to.Ptr(""), + PrimaryKeyURI: to.Ptr("https://exampleprimarykeyvault.vault.azure.net/keys/examplekey/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"), + PrimaryUserAssignedIdentityID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/exampleprimaryidentity"), }, + PointInTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T18:35:22.123Z"); return t }()), + SourceServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/examplesourceserver"), }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } - res, err := poller.PollUntilDone(ctx, nil) + _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Server = armpostgresqlflexibleservers.Server{ - // Name: to.Ptr("pgtestsvc4-replica"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/pgtestsvc4-replica"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "ElasticServer": to.Ptr("1"), - // }, - // Properties: &armpostgresqlflexibleservers.ServerProperties{ - // AdministratorLogin: to.Ptr("login"), - // AuthConfig: &armpostgresqlflexibleservers.AuthConfig{ - // ActiveDirectoryAuth: to.Ptr(armpostgresqlflexibleservers.ActiveDirectoryAuthEnumDisabled), - // PasswordAuth: to.Ptr(armpostgresqlflexibleservers.PasswordAuthEnumEnabled), - // }, - // AvailabilityZone: to.Ptr("1"), - // Backup: &armpostgresqlflexibleservers.Backup{ - // BackupRetentionDays: to.Ptr[int32](20), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-02-26T01:16:58.372Z"); return t}()), - // GeoRedundantBackup: to.Ptr(armpostgresqlflexibleservers.GeoRedundantBackupEnumDisabled), - // }, - // DataEncryption: &armpostgresqlflexibleservers.DataEncryption{ - // Type: to.Ptr(armpostgresqlflexibleservers.ArmServerKeyTypeSystemManaged), - // }, - // FullyQualifiedDomainName: to.Ptr("pgtestsvc4-replica.postgres.database.azure.com"), - // HighAvailability: &armpostgresqlflexibleservers.HighAvailability{ - // Mode: to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant), - // StandbyAvailabilityZone: to.Ptr("2"), - // State: to.Ptr(armpostgresqlflexibleservers.ServerHAStateHealthy), - // }, - // MaintenanceWindow: &armpostgresqlflexibleservers.MaintenanceWindow{ - // CustomWindow: to.Ptr("Disabled"), - // DayOfWeek: to.Ptr[int32](0), - // StartHour: to.Ptr[int32](0), - // StartMinute: to.Ptr[int32](0), - // }, - // MinorVersion: to.Ptr("6"), - // Network: &armpostgresqlflexibleservers.Network{ - // DelegatedSubnetResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/test-vnet-subnet"), - // PrivateDNSZoneArmResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/privateDnsZones/test-private-dns-zone.postgres.database.azure.com"), - // PublicNetworkAccess: to.Ptr(armpostgresqlflexibleservers.ServerPublicNetworkAccessStateDisabled), - // }, - // Replica: &armpostgresqlflexibleservers.Replica{ - // Capacity: to.Ptr[int32](0), - // Role: to.Ptr(armpostgresqlflexibleservers.ReplicationRoleNone), - // }, - // State: to.Ptr(armpostgresqlflexibleservers.ServerStateReady), - // Storage: &armpostgresqlflexibleservers.Storage{ - // AutoGrow: to.Ptr(armpostgresqlflexibleservers.StorageAutoGrowEnabled), - // Iops: to.Ptr[int32](5000), - // StorageSizeGB: to.Ptr[int32](1024), - // Tier: to.Ptr(armpostgresqlflexibleservers.AzureManagedDiskPerformanceTiersP30), - // }, - // Version: to.Ptr(armpostgresqlflexibleservers.ServerVersionSixteen), - // }, - // SKU: &armpostgresqlflexibleservers.SKU{ - // Name: to.Ptr("Standard_D8s_v3"), - // Tier: to.Ptr(armpostgresqlflexibleservers.SKUTierGeneralPurpose), - // }, - // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b1f4d539964453ce8008e4b069e59885e12ba441/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ServerUpdate.json -func ExampleServersClient_BeginUpdate_serverUpdate() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/735d21dbd7e1cc446babf58860af4cca757d620d/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/ServersPromoteReplicaAsForcedStandaloneServer.json +func ExampleServersClient_BeginUpdate_promoteAReadReplicaToAStandaloneServerWithForcedDataSynchronizationMeaningThatItDoesntWaitForDataInTheReadReplicaToBeSynchronizedWithItsSourceServerBeforeItInitiatesThePromotionToAStandaloneServer() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -1094,93 +555,25 @@ func ExampleServersClient_BeginUpdate_serverUpdate() { if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewServersClient().BeginUpdate(ctx, "TestGroup", "pgtestsvc4", armpostgresqlflexibleservers.ServerForUpdate{ - Properties: &armpostgresqlflexibleservers.ServerPropertiesForUpdate{ - AdministratorLoginPassword: to.Ptr("newpassword"), - Backup: &armpostgresqlflexibleservers.Backup{ - BackupRetentionDays: to.Ptr[int32](20), - }, - CreateMode: to.Ptr(armpostgresqlflexibleservers.CreateModeForUpdateUpdate), - Storage: &armpostgresqlflexibleservers.Storage{ - AutoGrow: to.Ptr(armpostgresqlflexibleservers.StorageAutoGrowEnabled), - StorageSizeGB: to.Ptr[int32](1024), - Tier: to.Ptr(armpostgresqlflexibleservers.AzureManagedDiskPerformanceTiersP30), + poller, err := clientFactory.NewServersClient().BeginUpdate(ctx, "exampleresourcegroup", "exampleserver", armpostgresqlflexibleservers.ServerForPatch{ + Properties: &armpostgresqlflexibleservers.ServerPropertiesForPatch{ + Replica: &armpostgresqlflexibleservers.Replica{ + PromoteMode: to.Ptr(armpostgresqlflexibleservers.ReadReplicaPromoteModeStandalone), + PromoteOption: to.Ptr(armpostgresqlflexibleservers.ReadReplicaPromoteOptionForced), }, }, - SKU: &armpostgresqlflexibleservers.SKU{ - Name: to.Ptr("Standard_D8s_v3"), - Tier: to.Ptr(armpostgresqlflexibleservers.SKUTierGeneralPurpose), - }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } - res, err := poller.PollUntilDone(ctx, nil) + _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Server = armpostgresqlflexibleservers.Server{ - // Name: to.Ptr("pgtestsvc4"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/pgtestsvc4"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "ElasticServer": to.Ptr("1"), - // }, - // Properties: &armpostgresqlflexibleservers.ServerProperties{ - // AdministratorLogin: to.Ptr("login"), - // AuthConfig: &armpostgresqlflexibleservers.AuthConfig{ - // ActiveDirectoryAuth: to.Ptr(armpostgresqlflexibleservers.ActiveDirectoryAuthEnumDisabled), - // PasswordAuth: to.Ptr(armpostgresqlflexibleservers.PasswordAuthEnumEnabled), - // }, - // AvailabilityZone: to.Ptr("1"), - // Backup: &armpostgresqlflexibleservers.Backup{ - // BackupRetentionDays: to.Ptr[int32](20), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-02-26T01:16:58.372Z"); return t}()), - // GeoRedundantBackup: to.Ptr(armpostgresqlflexibleservers.GeoRedundantBackupEnumDisabled), - // }, - // DataEncryption: &armpostgresqlflexibleservers.DataEncryption{ - // Type: to.Ptr(armpostgresqlflexibleservers.ArmServerKeyTypeSystemManaged), - // }, - // FullyQualifiedDomainName: to.Ptr("pgtestsvc4.test-private-dns-zone.postgres.database.azure.com"), - // HighAvailability: &armpostgresqlflexibleservers.HighAvailability{ - // Mode: to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant), - // StandbyAvailabilityZone: to.Ptr("2"), - // State: to.Ptr(armpostgresqlflexibleservers.ServerHAStateHealthy), - // }, - // MaintenanceWindow: &armpostgresqlflexibleservers.MaintenanceWindow{ - // CustomWindow: to.Ptr("Disabled"), - // DayOfWeek: to.Ptr[int32](0), - // StartHour: to.Ptr[int32](0), - // StartMinute: to.Ptr[int32](0), - // }, - // MinorVersion: to.Ptr("6"), - // Network: &armpostgresqlflexibleservers.Network{ - // DelegatedSubnetResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/test-vnet-subnet"), - // PrivateDNSZoneArmResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/privateDnsZones/test-private-dns-zone.postgres.database.azure.com"), - // PublicNetworkAccess: to.Ptr(armpostgresqlflexibleservers.ServerPublicNetworkAccessStateDisabled), - // }, - // State: to.Ptr(armpostgresqlflexibleservers.ServerStateReady), - // Storage: &armpostgresqlflexibleservers.Storage{ - // AutoGrow: to.Ptr(armpostgresqlflexibleservers.StorageAutoGrowEnabled), - // Iops: to.Ptr[int32](5000), - // StorageSizeGB: to.Ptr[int32](1024), - // Tier: to.Ptr(armpostgresqlflexibleservers.AzureManagedDiskPerformanceTiersP30), - // }, - // Version: to.Ptr(armpostgresqlflexibleservers.ServerVersionSixteen), - // }, - // SKU: &armpostgresqlflexibleservers.SKU{ - // Name: to.Ptr("Standard_D8s_v3"), - // Tier: to.Ptr(armpostgresqlflexibleservers.SKUTierGeneralPurpose), - // }, - // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b1f4d539964453ce8008e4b069e59885e12ba441/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ServerUpdateWithCustomerMaintenanceWindow.json -func ExampleServersClient_BeginUpdate_serverUpdateWithCustomerMaintenanceWindow() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/735d21dbd7e1cc446babf58860af4cca757d620d/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/ServersPromoteReplicaAsPlannedStandaloneServer.json +func ExampleServersClient_BeginUpdate_promoteAReadReplicaToAStandaloneServerWithPlannedDataSynchronizationMeaningThatItWaitsForDataInTheReadReplicaToBeFullySynchronizedWithItsSourceServerBeforeItInitiatesThePromotionToAStandaloneServer() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -1190,86 +583,25 @@ func ExampleServersClient_BeginUpdate_serverUpdateWithCustomerMaintenanceWindow( if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewServersClient().BeginUpdate(ctx, "testrg", "pgtestsvc4", armpostgresqlflexibleservers.ServerForUpdate{ - Properties: &armpostgresqlflexibleservers.ServerPropertiesForUpdate{ - CreateMode: to.Ptr(armpostgresqlflexibleservers.CreateModeForUpdateUpdate), - MaintenanceWindow: &armpostgresqlflexibleservers.MaintenanceWindow{ - CustomWindow: to.Ptr("Enabled"), - DayOfWeek: to.Ptr[int32](0), - StartHour: to.Ptr[int32](8), - StartMinute: to.Ptr[int32](0), + poller, err := clientFactory.NewServersClient().BeginUpdate(ctx, "exampleresourcegroup", "exampleserver", armpostgresqlflexibleservers.ServerForPatch{ + Properties: &armpostgresqlflexibleservers.ServerPropertiesForPatch{ + Replica: &armpostgresqlflexibleservers.Replica{ + PromoteMode: to.Ptr(armpostgresqlflexibleservers.ReadReplicaPromoteModeStandalone), + PromoteOption: to.Ptr(armpostgresqlflexibleservers.ReadReplicaPromoteOptionPlanned), }, }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } - res, err := poller.PollUntilDone(ctx, nil) + _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Server = armpostgresqlflexibleservers.Server{ - // Name: to.Ptr("pgtestsvc4"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/pgtestsvc4"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "ElasticServer": to.Ptr("1"), - // }, - // Properties: &armpostgresqlflexibleservers.ServerProperties{ - // AdministratorLogin: to.Ptr("login"), - // AuthConfig: &armpostgresqlflexibleservers.AuthConfig{ - // ActiveDirectoryAuth: to.Ptr(armpostgresqlflexibleservers.ActiveDirectoryAuthEnumDisabled), - // PasswordAuth: to.Ptr(armpostgresqlflexibleservers.PasswordAuthEnumEnabled), - // }, - // AvailabilityZone: to.Ptr("1"), - // Backup: &armpostgresqlflexibleservers.Backup{ - // BackupRetentionDays: to.Ptr[int32](7), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-02-26T01:16:58.372Z"); return t}()), - // GeoRedundantBackup: to.Ptr(armpostgresqlflexibleservers.GeoRedundantBackupEnumDisabled), - // }, - // DataEncryption: &armpostgresqlflexibleservers.DataEncryption{ - // Type: to.Ptr(armpostgresqlflexibleservers.ArmServerKeyTypeSystemManaged), - // }, - // FullyQualifiedDomainName: to.Ptr("pgtestsvc4.test-private-dns-zone.postgres.database.azure.com"), - // HighAvailability: &armpostgresqlflexibleservers.HighAvailability{ - // Mode: to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant), - // StandbyAvailabilityZone: to.Ptr("2"), - // State: to.Ptr(armpostgresqlflexibleservers.ServerHAStateHealthy), - // }, - // MaintenanceWindow: &armpostgresqlflexibleservers.MaintenanceWindow{ - // CustomWindow: to.Ptr("Enabled"), - // DayOfWeek: to.Ptr[int32](0), - // StartHour: to.Ptr[int32](8), - // StartMinute: to.Ptr[int32](0), - // }, - // MinorVersion: to.Ptr("6"), - // Network: &armpostgresqlflexibleservers.Network{ - // DelegatedSubnetResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/test-vnet-subnet"), - // PrivateDNSZoneArmResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/privateDnsZones/test-private-dns-zone.postgres.database.azure.com"), - // PublicNetworkAccess: to.Ptr(armpostgresqlflexibleservers.ServerPublicNetworkAccessStateDisabled), - // }, - // State: to.Ptr(armpostgresqlflexibleservers.ServerStateReady), - // Storage: &armpostgresqlflexibleservers.Storage{ - // AutoGrow: to.Ptr(armpostgresqlflexibleservers.StorageAutoGrowDisabled), - // Iops: to.Ptr[int32](2300), - // StorageSizeGB: to.Ptr[int32](512), - // Tier: to.Ptr(armpostgresqlflexibleservers.AzureManagedDiskPerformanceTiersP20), - // }, - // Version: to.Ptr(armpostgresqlflexibleservers.ServerVersionSixteen), - // }, - // SKU: &armpostgresqlflexibleservers.SKU{ - // Name: to.Ptr("Standard_D4ds_v5"), - // Tier: to.Ptr(armpostgresqlflexibleservers.SKUTierGeneralPurpose), - // }, - // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b1f4d539964453ce8008e4b069e59885e12ba441/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ServerUpdateWithDataEncryptionEnabled.json -func ExampleServersClient_BeginUpdate_serverUpdateWithDataEncryptionEnabled() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/735d21dbd7e1cc446babf58860af4cca757d620d/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/ServersPromoteReplicaAsForcedSwitchover.json +func ExampleServersClient_BeginUpdate_switchOverAReadReplicaToPrimaryServerWithForcedDataSynchronizationMeaningThatItDoesntWaitForDataInTheReadReplicaToBeSynchronizedWithItsSourceServerBeforeItInitiatesTheSwitchingOfRolesBetweenTheReadReplicaAndThePrimaryServer() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -1279,126 +611,122 @@ func ExampleServersClient_BeginUpdate_serverUpdateWithDataEncryptionEnabled() { if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewServersClient().BeginUpdate(ctx, "TestGroup", "pgtestsvc4", armpostgresqlflexibleservers.ServerForUpdate{ - Identity: &armpostgresqlflexibleservers.UserAssignedIdentity{ - Type: to.Ptr(armpostgresqlflexibleservers.IdentityTypeUserAssigned), - UserAssignedIdentities: map[string]*armpostgresqlflexibleservers.UserIdentity{ - "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-geo-usermanagedidentity": {}, - "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-usermanagedidentity": {}, + poller, err := clientFactory.NewServersClient().BeginUpdate(ctx, "exampleresourcegroup", "exampleserver", armpostgresqlflexibleservers.ServerForPatch{ + Properties: &armpostgresqlflexibleservers.ServerPropertiesForPatch{ + Replica: &armpostgresqlflexibleservers.Replica{ + PromoteMode: to.Ptr(armpostgresqlflexibleservers.ReadReplicaPromoteModeSwitchover), + PromoteOption: to.Ptr(armpostgresqlflexibleservers.ReadReplicaPromoteOptionForced), }, }, - Properties: &armpostgresqlflexibleservers.ServerPropertiesForUpdate{ - AdministratorLoginPassword: to.Ptr("newpassword"), - Backup: &armpostgresqlflexibleservers.Backup{ - BackupRetentionDays: to.Ptr[int32](20), - }, - CreateMode: to.Ptr(armpostgresqlflexibleservers.CreateModeForUpdateUpdate), - DataEncryption: &armpostgresqlflexibleservers.DataEncryption{ - Type: to.Ptr(armpostgresqlflexibleservers.ArmServerKeyTypeAzureKeyVault), - GeoBackupKeyURI: to.Ptr("https://test-geo-kv.vault.azure.net/keys/test-key1/yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy"), - GeoBackupUserAssignedIdentityID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-geo-usermanagedidentity"), - PrimaryKeyURI: to.Ptr("https://test-kv.vault.azure.net/keys/test-key1/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"), - PrimaryUserAssignedIdentityID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-usermanagedidentity"), + }, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + _, err = poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/735d21dbd7e1cc446babf58860af4cca757d620d/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/ServersPromoteReplicaAsPlannedSwitchover.json +func ExampleServersClient_BeginUpdate_switchOverAReadReplicaToPrimaryServerWithPlannedDataSynchronizationMeaningThatItWaitsForDataInTheReadReplicaToBeFullySynchronizedWithItsSourceServerBeforeItInitiatesTheSwitchingOfRolesBetweenTheReadReplicaAndThePrimaryServer() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewServersClient().BeginUpdate(ctx, "exampleresourcegroup", "exampleserver", armpostgresqlflexibleservers.ServerForPatch{ + Properties: &armpostgresqlflexibleservers.ServerPropertiesForPatch{ + Replica: &armpostgresqlflexibleservers.Replica{ + PromoteMode: to.Ptr(armpostgresqlflexibleservers.ReadReplicaPromoteModeSwitchover), + PromoteOption: to.Ptr(armpostgresqlflexibleservers.ReadReplicaPromoteOptionPlanned), }, }, - SKU: &armpostgresqlflexibleservers.SKU{ - Name: to.Ptr("Standard_D8s_v3"), - Tier: to.Ptr(armpostgresqlflexibleservers.SKUTierGeneralPurpose), + }, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + _, err = poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/735d21dbd7e1cc446babf58860af4cca757d620d/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/ServersUpdateWithMajorVersionUpgrade.json +func ExampleServersClient_BeginUpdate_updateAnExistingServerToUpgradeTheMajorVersionOfPostgreSqlDatabaseEngine() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewServersClient().BeginUpdate(ctx, "exampleresourcegroup", "exampleserver", armpostgresqlflexibleservers.ServerForPatch{ + Properties: &armpostgresqlflexibleservers.ServerPropertiesForPatch{ + CreateMode: to.Ptr(armpostgresqlflexibleservers.CreateModeForPatchUpdate), + Version: to.Ptr(armpostgresqlflexibleservers.PostgresMajorVersionSeventeen), }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } - res, err := poller.PollUntilDone(ctx, nil) + _, err = poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/735d21dbd7e1cc446babf58860af4cca757d620d/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/ServersUpdateWithMicrosoftEntraEnabled.json +func ExampleServersClient_BeginUpdate_updateAnExistingServerWithMicrosoftEntraAuthenticationEnabled() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewServersClient().BeginUpdate(ctx, "exampleresourcegroup", "exampleserver", armpostgresqlflexibleservers.ServerForPatch{ + Properties: &armpostgresqlflexibleservers.ServerPropertiesForPatch{ + AdministratorLoginPassword: to.Ptr("examplenewpassword"), + AuthConfig: &armpostgresqlflexibleservers.AuthConfigForPatch{ + ActiveDirectoryAuth: to.Ptr(armpostgresqlflexibleservers.MicrosoftEntraAuthEnabled), + PasswordAuth: to.Ptr(armpostgresqlflexibleservers.PasswordBasedAuthEnabled), + TenantID: to.Ptr("tttttt-tttt-tttt-tttt-tttttttttttt"), + }, + Backup: &armpostgresqlflexibleservers.BackupForPatch{ + BackupRetentionDays: to.Ptr[int32](20), + }, + CreateMode: to.Ptr(armpostgresqlflexibleservers.CreateModeForPatchUpdate), + Storage: &armpostgresqlflexibleservers.Storage{ + AutoGrow: to.Ptr(armpostgresqlflexibleservers.StorageAutoGrowDisabled), + StorageSizeGB: to.Ptr[int32](1024), + Tier: to.Ptr(armpostgresqlflexibleservers.AzureManagedDiskPerformanceTierP30), + }, + }, + SKU: &armpostgresqlflexibleservers.SKUForPatch{ + Name: to.Ptr("Standard_D8s_v3"), + Tier: to.Ptr(armpostgresqlflexibleservers.SKUTierGeneralPurpose), + }, + }, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Server = armpostgresqlflexibleservers.Server{ - // Name: to.Ptr("pgtestsvc4"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/pgtestsvc4"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "ElasticServer": to.Ptr("1"), - // }, - // Identity: &armpostgresqlflexibleservers.UserAssignedIdentity{ - // Type: to.Ptr(armpostgresqlflexibleservers.IdentityTypeUserAssigned), - // TenantID: to.Ptr("cccccccc-cccc-cccc-cccc-cccccccccccc"), - // UserAssignedIdentities: map[string]*armpostgresqlflexibleservers.UserIdentity{ - // "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-geo-usermanagedidentity": &armpostgresqlflexibleservers.UserIdentity{ - // ClientID: to.Ptr("cccccccc-cccc-cccc-cccc-cccccccccccc"), - // PrincipalID: to.Ptr("pppppppp-pppp-pppp-pppp-pppppppppppp"), - // }, - // "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-usermanagedidentity": &armpostgresqlflexibleservers.UserIdentity{ - // ClientID: to.Ptr("cccccccc-cccc-cccc-cccc-cccccccccccc"), - // PrincipalID: to.Ptr("pppppppp-pppp-pppp-pppp-pppppppppppp"), - // }, - // "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-usermanagedidentity-1": &armpostgresqlflexibleservers.UserIdentity{ - // ClientID: to.Ptr("cccccccc-cccc-cccc-cccc-cccccccccccc"), - // PrincipalID: to.Ptr("90008082-e024-4cc3-8fcf-63bcdb9cf6b6"), - // }, - // }, - // }, - // Properties: &armpostgresqlflexibleservers.ServerProperties{ - // AdministratorLogin: to.Ptr("login"), - // AuthConfig: &armpostgresqlflexibleservers.AuthConfig{ - // ActiveDirectoryAuth: to.Ptr(armpostgresqlflexibleservers.ActiveDirectoryAuthEnumDisabled), - // PasswordAuth: to.Ptr(armpostgresqlflexibleservers.PasswordAuthEnumEnabled), - // }, - // AvailabilityZone: to.Ptr("1"), - // Backup: &armpostgresqlflexibleservers.Backup{ - // BackupRetentionDays: to.Ptr[int32](20), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-02-26T01:16:58.372Z"); return t}()), - // GeoRedundantBackup: to.Ptr(armpostgresqlflexibleservers.GeoRedundantBackupEnumEnabled), - // }, - // DataEncryption: &armpostgresqlflexibleservers.DataEncryption{ - // Type: to.Ptr(armpostgresqlflexibleservers.ArmServerKeyTypeAzureKeyVault), - // GeoBackupEncryptionKeyStatus: to.Ptr(armpostgresqlflexibleservers.KeyStatusEnumValid), - // GeoBackupKeyURI: to.Ptr("https://test-geo-kv.vault.azure.net/keys/test-key1/yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy"), - // GeoBackupUserAssignedIdentityID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-geo-usermanagedidentity"), - // PrimaryEncryptionKeyStatus: to.Ptr(armpostgresqlflexibleservers.KeyStatusEnumValid), - // PrimaryKeyURI: to.Ptr("https://test-kv.vault.azure.net/keys/test-key1/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"), - // PrimaryUserAssignedIdentityID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-usermanagedidentity"), - // }, - // FullyQualifiedDomainName: to.Ptr("pgtestsvc4.test-private-dns-zone.postgres.database.azure.com"), - // HighAvailability: &armpostgresqlflexibleservers.HighAvailability{ - // Mode: to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant), - // StandbyAvailabilityZone: to.Ptr("2"), - // State: to.Ptr(armpostgresqlflexibleservers.ServerHAStateHealthy), - // }, - // MaintenanceWindow: &armpostgresqlflexibleservers.MaintenanceWindow{ - // CustomWindow: to.Ptr("Disabled"), - // DayOfWeek: to.Ptr[int32](0), - // StartHour: to.Ptr[int32](0), - // StartMinute: to.Ptr[int32](0), - // }, - // MinorVersion: to.Ptr("6"), - // Network: &armpostgresqlflexibleservers.Network{ - // DelegatedSubnetResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/test-vnet-subnet"), - // PrivateDNSZoneArmResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/privateDnsZones/test-private-dns-zone.postgres.database.azure.com"), - // PublicNetworkAccess: to.Ptr(armpostgresqlflexibleservers.ServerPublicNetworkAccessStateDisabled), - // }, - // State: to.Ptr(armpostgresqlflexibleservers.ServerStateReady), - // Storage: &armpostgresqlflexibleservers.Storage{ - // AutoGrow: to.Ptr(armpostgresqlflexibleservers.StorageAutoGrowDisabled), - // Iops: to.Ptr[int32](5000), - // StorageSizeGB: to.Ptr[int32](1024), - // Tier: to.Ptr(armpostgresqlflexibleservers.AzureManagedDiskPerformanceTiersP30), - // }, - // Version: to.Ptr(armpostgresqlflexibleservers.ServerVersionSixteen), - // }, - // SKU: &armpostgresqlflexibleservers.SKU{ - // Name: to.Ptr("Standard_D8s_v3"), - // Tier: to.Ptr(armpostgresqlflexibleservers.SKUTierGeneralPurpose), - // }, - // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b1f4d539964453ce8008e4b069e59885e12ba441/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ServerUpdateWithMajorVersionUpgrade.json -func ExampleServersClient_BeginUpdate_serverUpdateWithMajorVersionUpgrade() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/735d21dbd7e1cc446babf58860af4cca757d620d/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/ServersUpdateWithCustomMaintenanceWindow.json +func ExampleServersClient_BeginUpdate_updateAnExistingServerWithCustomMaintenanceWindow() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -1408,81 +736,28 @@ func ExampleServersClient_BeginUpdate_serverUpdateWithMajorVersionUpgrade() { if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewServersClient().BeginUpdate(ctx, "testrg", "pgtestsvc4", armpostgresqlflexibleservers.ServerForUpdate{ - Properties: &armpostgresqlflexibleservers.ServerPropertiesForUpdate{ - CreateMode: to.Ptr(armpostgresqlflexibleservers.CreateModeForUpdateUpdate), - Version: to.Ptr(armpostgresqlflexibleservers.ServerVersionSixteen), + poller, err := clientFactory.NewServersClient().BeginUpdate(ctx, "exampleresourcegroup", "exampleserver", armpostgresqlflexibleservers.ServerForPatch{ + Properties: &armpostgresqlflexibleservers.ServerPropertiesForPatch{ + CreateMode: to.Ptr(armpostgresqlflexibleservers.CreateModeForPatchUpdate), + MaintenanceWindow: &armpostgresqlflexibleservers.MaintenanceWindowForPatch{ + CustomWindow: to.Ptr("Enabled"), + DayOfWeek: to.Ptr[int32](0), + StartHour: to.Ptr[int32](8), + StartMinute: to.Ptr[int32](0), + }, }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } - res, err := poller.PollUntilDone(ctx, nil) + _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Server = armpostgresqlflexibleservers.Server{ - // Name: to.Ptr("pgtestsvc4"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/pgtestsvc4"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "ElasticServer": to.Ptr("1"), - // }, - // Properties: &armpostgresqlflexibleservers.ServerProperties{ - // AdministratorLogin: to.Ptr("login"), - // AuthConfig: &armpostgresqlflexibleservers.AuthConfig{ - // ActiveDirectoryAuth: to.Ptr(armpostgresqlflexibleservers.ActiveDirectoryAuthEnumDisabled), - // PasswordAuth: to.Ptr(armpostgresqlflexibleservers.PasswordAuthEnumEnabled), - // }, - // AvailabilityZone: to.Ptr("1"), - // Backup: &armpostgresqlflexibleservers.Backup{ - // BackupRetentionDays: to.Ptr[int32](7), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-02-26T01:16:58.372Z"); return t}()), - // GeoRedundantBackup: to.Ptr(armpostgresqlflexibleservers.GeoRedundantBackupEnumDisabled), - // }, - // DataEncryption: &armpostgresqlflexibleservers.DataEncryption{ - // Type: to.Ptr(armpostgresqlflexibleservers.ArmServerKeyTypeSystemManaged), - // }, - // FullyQualifiedDomainName: to.Ptr("pgtestsvc4.test-private-dns-zone.postgres.database.azure.com"), - // HighAvailability: &armpostgresqlflexibleservers.HighAvailability{ - // Mode: to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant), - // StandbyAvailabilityZone: to.Ptr("2"), - // State: to.Ptr(armpostgresqlflexibleservers.ServerHAStateHealthy), - // }, - // MaintenanceWindow: &armpostgresqlflexibleservers.MaintenanceWindow{ - // CustomWindow: to.Ptr("Disabled"), - // DayOfWeek: to.Ptr[int32](0), - // StartHour: to.Ptr[int32](0), - // StartMinute: to.Ptr[int32](0), - // }, - // MinorVersion: to.Ptr("8"), - // Network: &armpostgresqlflexibleservers.Network{ - // DelegatedSubnetResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/test-vnet-subnet"), - // PrivateDNSZoneArmResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/privateDnsZones/test-private-dns-zone.postgres.database.azure.com"), - // PublicNetworkAccess: to.Ptr(armpostgresqlflexibleservers.ServerPublicNetworkAccessStateDisabled), - // }, - // State: to.Ptr(armpostgresqlflexibleservers.ServerStateReady), - // Storage: &armpostgresqlflexibleservers.Storage{ - // AutoGrow: to.Ptr(armpostgresqlflexibleservers.StorageAutoGrowEnabled), - // Iops: to.Ptr[int32](2300), - // StorageSizeGB: to.Ptr[int32](512), - // Tier: to.Ptr(armpostgresqlflexibleservers.AzureManagedDiskPerformanceTiersP20), - // }, - // Version: to.Ptr(armpostgresqlflexibleservers.ServerVersionSixteen), - // }, - // SKU: &armpostgresqlflexibleservers.SKU{ - // Name: to.Ptr("Standard_D4ds_v5"), - // Tier: to.Ptr(armpostgresqlflexibleservers.SKUTierGeneralPurpose), - // }, - // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b1f4d539964453ce8008e4b069e59885e12ba441/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ServerUpdateWithMicrosoftEntraEnabled.json -func ExampleServersClient_BeginUpdate_serverUpdateWithMicrosoftEntraEnabled() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/735d21dbd7e1cc446babf58860af4cca757d620d/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/ServersUpdateWithDataEncryptionEnabledAutoUpdate.json +func ExampleServersClient_BeginUpdate_updateAnExistingServerWithDataEncryptionBasedOnCustomerManagedKeyWithAutomaticKeyVersionUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -1492,25 +767,29 @@ func ExampleServersClient_BeginUpdate_serverUpdateWithMicrosoftEntraEnabled() { if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewServersClient().BeginUpdate(ctx, "TestGroup", "pgtestsvc4", armpostgresqlflexibleservers.ServerForUpdate{ - Properties: &armpostgresqlflexibleservers.ServerPropertiesForUpdate{ - AdministratorLoginPassword: to.Ptr("newpassword"), - AuthConfig: &armpostgresqlflexibleservers.AuthConfig{ - ActiveDirectoryAuth: to.Ptr(armpostgresqlflexibleservers.ActiveDirectoryAuthEnumEnabled), - PasswordAuth: to.Ptr(armpostgresqlflexibleservers.PasswordAuthEnumEnabled), - TenantID: to.Ptr("tttttt-tttt-tttt-tttt-tttttttttttt"), + poller, err := clientFactory.NewServersClient().BeginUpdate(ctx, "exampleresourcegroup", "exampleserver", armpostgresqlflexibleservers.ServerForPatch{ + Identity: &armpostgresqlflexibleservers.UserAssignedIdentity{ + Type: to.Ptr(armpostgresqlflexibleservers.IdentityTypeUserAssigned), + UserAssignedIdentities: map[string]*armpostgresqlflexibleservers.UserIdentity{ + "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/examplegeoredundantidentity": {}, + "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/exampleprimaryidentity": {}, }, - Backup: &armpostgresqlflexibleservers.Backup{ + }, + Properties: &armpostgresqlflexibleservers.ServerPropertiesForPatch{ + AdministratorLoginPassword: to.Ptr("examplenewpassword"), + Backup: &armpostgresqlflexibleservers.BackupForPatch{ BackupRetentionDays: to.Ptr[int32](20), }, - CreateMode: to.Ptr(armpostgresqlflexibleservers.CreateModeForUpdateUpdate), - Storage: &armpostgresqlflexibleservers.Storage{ - AutoGrow: to.Ptr(armpostgresqlflexibleservers.StorageAutoGrowDisabled), - StorageSizeGB: to.Ptr[int32](1024), - Tier: to.Ptr(armpostgresqlflexibleservers.AzureManagedDiskPerformanceTiersP30), + CreateMode: to.Ptr(armpostgresqlflexibleservers.CreateModeForPatchUpdate), + DataEncryption: &armpostgresqlflexibleservers.DataEncryption{ + Type: to.Ptr(armpostgresqlflexibleservers.DataEncryptionTypeAzureKeyVault), + GeoBackupKeyURI: to.Ptr("https://examplegeoredundantkeyvault.vault.azure.net/keys/examplekey"), + GeoBackupUserAssignedIdentityID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/examplegeoredundantidentity"), + PrimaryKeyURI: to.Ptr("https://exampleprimarykeyvault.vault.azure.net/keys/examplekey"), + PrimaryUserAssignedIdentityID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/exampleprimaryidentity"), }, }, - SKU: &armpostgresqlflexibleservers.SKU{ + SKU: &armpostgresqlflexibleservers.SKUForPatch{ Name: to.Ptr("Standard_D8s_v3"), Tier: to.Ptr(armpostgresqlflexibleservers.SKUTierGeneralPurpose), }, @@ -1518,73 +797,14 @@ func ExampleServersClient_BeginUpdate_serverUpdateWithMicrosoftEntraEnabled() { if err != nil { log.Fatalf("failed to finish the request: %v", err) } - res, err := poller.PollUntilDone(ctx, nil) + _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Server = armpostgresqlflexibleservers.Server{ - // Name: to.Ptr("pgtestsvc4"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/pgtestsvc4"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "ElasticServer": to.Ptr("1"), - // }, - // Properties: &armpostgresqlflexibleservers.ServerProperties{ - // AdministratorLogin: to.Ptr("login"), - // AuthConfig: &armpostgresqlflexibleservers.AuthConfig{ - // ActiveDirectoryAuth: to.Ptr(armpostgresqlflexibleservers.ActiveDirectoryAuthEnumEnabled), - // PasswordAuth: to.Ptr(armpostgresqlflexibleservers.PasswordAuthEnumEnabled), - // TenantID: to.Ptr("tttttt-tttt-tttt-tttt-tttttttttttt"), - // }, - // AvailabilityZone: to.Ptr("1"), - // Backup: &armpostgresqlflexibleservers.Backup{ - // BackupRetentionDays: to.Ptr[int32](20), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-02-26T01:16:58.372Z"); return t}()), - // GeoRedundantBackup: to.Ptr(armpostgresqlflexibleservers.GeoRedundantBackupEnumDisabled), - // }, - // DataEncryption: &armpostgresqlflexibleservers.DataEncryption{ - // Type: to.Ptr(armpostgresqlflexibleservers.ArmServerKeyTypeSystemManaged), - // }, - // FullyQualifiedDomainName: to.Ptr("pgtestsvc4.test-private-dns-zone.postgres.database.azure.com"), - // HighAvailability: &armpostgresqlflexibleservers.HighAvailability{ - // Mode: to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant), - // StandbyAvailabilityZone: to.Ptr("2"), - // State: to.Ptr(armpostgresqlflexibleservers.ServerHAStateHealthy), - // }, - // MaintenanceWindow: &armpostgresqlflexibleservers.MaintenanceWindow{ - // CustomWindow: to.Ptr("Disabled"), - // DayOfWeek: to.Ptr[int32](0), - // StartHour: to.Ptr[int32](0), - // StartMinute: to.Ptr[int32](0), - // }, - // MinorVersion: to.Ptr("6"), - // Network: &armpostgresqlflexibleservers.Network{ - // DelegatedSubnetResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/test-vnet-subnet"), - // PrivateDNSZoneArmResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/privateDnsZones/test-private-dns-zone.postgres.database.azure.com"), - // PublicNetworkAccess: to.Ptr(armpostgresqlflexibleservers.ServerPublicNetworkAccessStateDisabled), - // }, - // State: to.Ptr(armpostgresqlflexibleservers.ServerStateReady), - // Storage: &armpostgresqlflexibleservers.Storage{ - // AutoGrow: to.Ptr(armpostgresqlflexibleservers.StorageAutoGrowDisabled), - // Iops: to.Ptr[int32](5000), - // StorageSizeGB: to.Ptr[int32](1024), - // Tier: to.Ptr(armpostgresqlflexibleservers.AzureManagedDiskPerformanceTiersP30), - // }, - // Version: to.Ptr(armpostgresqlflexibleservers.ServerVersionSixteen), - // }, - // SKU: &armpostgresqlflexibleservers.SKU{ - // Name: to.Ptr("Standard_D8s_v3"), - // Tier: to.Ptr(armpostgresqlflexibleservers.SKUTierGeneralPurpose), - // }, - // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b1f4d539964453ce8008e4b069e59885e12ba441/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/PromoteReplicaAsForcedSwitchover.json -func ExampleServersClient_BeginUpdate_switchOverAReplicaServerAsForcedIEItWillReplicaAsPrimaryAndOriginalPrimaryAsReplicaImmediatelyWithoutWaitingForPrimaryAndReplicaToBeInSync() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/735d21dbd7e1cc446babf58860af4cca757d620d/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/ServersUpdateWithDataEncryptionEnabled.json +func ExampleServersClient_BeginUpdate_updateAnExistingServerWithDataEncryptionBasedOnCustomerManagedKey() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -1594,87 +814,44 @@ func ExampleServersClient_BeginUpdate_switchOverAReplicaServerAsForcedIEItWillRe if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewServersClient().BeginUpdate(ctx, "testResourceGroup", "pgtestsvc4-replica", armpostgresqlflexibleservers.ServerForUpdate{ - Properties: &armpostgresqlflexibleservers.ServerPropertiesForUpdate{ - Replica: &armpostgresqlflexibleservers.Replica{ - PromoteMode: to.Ptr(armpostgresqlflexibleservers.ReadReplicaPromoteModeSwitchover), - PromoteOption: to.Ptr(armpostgresqlflexibleservers.ReplicationPromoteOptionForced), + poller, err := clientFactory.NewServersClient().BeginUpdate(ctx, "exampleresourcegroup", "exampleserver", armpostgresqlflexibleservers.ServerForPatch{ + Identity: &armpostgresqlflexibleservers.UserAssignedIdentity{ + Type: to.Ptr(armpostgresqlflexibleservers.IdentityTypeUserAssigned), + UserAssignedIdentities: map[string]*armpostgresqlflexibleservers.UserIdentity{ + "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/examplegeoredundantidentity": {}, + "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/exampleprimaryidentity": {}, + }, + }, + Properties: &armpostgresqlflexibleservers.ServerPropertiesForPatch{ + AdministratorLoginPassword: to.Ptr("examplenewpassword"), + Backup: &armpostgresqlflexibleservers.BackupForPatch{ + BackupRetentionDays: to.Ptr[int32](20), }, + CreateMode: to.Ptr(armpostgresqlflexibleservers.CreateModeForPatchUpdate), + DataEncryption: &armpostgresqlflexibleservers.DataEncryption{ + Type: to.Ptr(armpostgresqlflexibleservers.DataEncryptionTypeAzureKeyVault), + GeoBackupKeyURI: to.Ptr("https://examplegeoredundantkeyvault.vault.azure.net/keys/examplekey/yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy"), + GeoBackupUserAssignedIdentityID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/examplegeoredundantidentity"), + PrimaryKeyURI: to.Ptr("https://exampleprimarykeyvault.vault.azure.net/keys/examplekey/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"), + PrimaryUserAssignedIdentityID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/exampleprimaryidentity"), + }, + }, + SKU: &armpostgresqlflexibleservers.SKUForPatch{ + Name: to.Ptr("Standard_D8s_v3"), + Tier: to.Ptr(armpostgresqlflexibleservers.SKUTierGeneralPurpose), }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } - res, err := poller.PollUntilDone(ctx, nil) + _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Server = armpostgresqlflexibleservers.Server{ - // Name: to.Ptr("pgtestsvc4-replica"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/pgtestsvc4-replica"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "ElasticServer": to.Ptr("1"), - // }, - // Properties: &armpostgresqlflexibleservers.ServerProperties{ - // AdministratorLogin: to.Ptr("login"), - // AuthConfig: &armpostgresqlflexibleservers.AuthConfig{ - // ActiveDirectoryAuth: to.Ptr(armpostgresqlflexibleservers.ActiveDirectoryAuthEnumDisabled), - // PasswordAuth: to.Ptr(armpostgresqlflexibleservers.PasswordAuthEnumEnabled), - // }, - // AvailabilityZone: to.Ptr("1"), - // Backup: &armpostgresqlflexibleservers.Backup{ - // BackupRetentionDays: to.Ptr[int32](20), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-02-26T01:16:58.372Z"); return t}()), - // GeoRedundantBackup: to.Ptr(armpostgresqlflexibleservers.GeoRedundantBackupEnumDisabled), - // }, - // DataEncryption: &armpostgresqlflexibleservers.DataEncryption{ - // Type: to.Ptr(armpostgresqlflexibleservers.ArmServerKeyTypeSystemManaged), - // }, - // FullyQualifiedDomainName: to.Ptr("pgtestsvc4-replica.postgres.database.azure.com"), - // HighAvailability: &armpostgresqlflexibleservers.HighAvailability{ - // Mode: to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant), - // StandbyAvailabilityZone: to.Ptr("2"), - // State: to.Ptr(armpostgresqlflexibleservers.ServerHAStateHealthy), - // }, - // MaintenanceWindow: &armpostgresqlflexibleservers.MaintenanceWindow{ - // CustomWindow: to.Ptr("Disabled"), - // DayOfWeek: to.Ptr[int32](0), - // StartHour: to.Ptr[int32](0), - // StartMinute: to.Ptr[int32](0), - // }, - // MinorVersion: to.Ptr("6"), - // Network: &armpostgresqlflexibleservers.Network{ - // DelegatedSubnetResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/test-vnet-subnet"), - // PrivateDNSZoneArmResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/privateDnsZones/test-private-dns-zone.postgres.database.azure.com"), - // PublicNetworkAccess: to.Ptr(armpostgresqlflexibleservers.ServerPublicNetworkAccessStateDisabled), - // }, - // Replica: &armpostgresqlflexibleservers.Replica{ - // Capacity: to.Ptr[int32](5), - // Role: to.Ptr(armpostgresqlflexibleservers.ReplicationRolePrimary), - // }, - // State: to.Ptr(armpostgresqlflexibleservers.ServerStateReady), - // Storage: &armpostgresqlflexibleservers.Storage{ - // AutoGrow: to.Ptr(armpostgresqlflexibleservers.StorageAutoGrowEnabled), - // Iops: to.Ptr[int32](5000), - // StorageSizeGB: to.Ptr[int32](1024), - // Tier: to.Ptr(armpostgresqlflexibleservers.AzureManagedDiskPerformanceTiersP30), - // }, - // Version: to.Ptr(armpostgresqlflexibleservers.ServerVersionSixteen), - // }, - // SKU: &armpostgresqlflexibleservers.SKU{ - // Name: to.Ptr("Standard_D8s_v3"), - // Tier: to.Ptr(armpostgresqlflexibleservers.SKUTierGeneralPurpose), - // }, - // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b1f4d539964453ce8008e4b069e59885e12ba441/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/PromoteReplicaAsPlannedSwitchover.json -func ExampleServersClient_BeginUpdate_switchOverAReplicaServerAsPlannedIEItWillWaitForReplicationToCompleteBeforePromotingReplicaAsPrimaryAndOriginalPrimaryAsReplica() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/735d21dbd7e1cc446babf58860af4cca757d620d/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/ServersUpdate.json +func ExampleServersClient_BeginUpdate_updateAnExistingServer() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -1684,86 +861,34 @@ func ExampleServersClient_BeginUpdate_switchOverAReplicaServerAsPlannedIEItWillW if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewServersClient().BeginUpdate(ctx, "testResourceGroup", "pgtestsvc4-replica", armpostgresqlflexibleservers.ServerForUpdate{ - Properties: &armpostgresqlflexibleservers.ServerPropertiesForUpdate{ - Replica: &armpostgresqlflexibleservers.Replica{ - PromoteMode: to.Ptr(armpostgresqlflexibleservers.ReadReplicaPromoteModeSwitchover), - PromoteOption: to.Ptr(armpostgresqlflexibleservers.ReplicationPromoteOptionPlanned), + poller, err := clientFactory.NewServersClient().BeginUpdate(ctx, "exampleresourcegroup", "exampleserver", armpostgresqlflexibleservers.ServerForPatch{ + Properties: &armpostgresqlflexibleservers.ServerPropertiesForPatch{ + AdministratorLoginPassword: to.Ptr("examplenewpassword"), + Backup: &armpostgresqlflexibleservers.BackupForPatch{ + BackupRetentionDays: to.Ptr[int32](20), + }, + CreateMode: to.Ptr(armpostgresqlflexibleservers.CreateModeForPatchUpdate), + Storage: &armpostgresqlflexibleservers.Storage{ + AutoGrow: to.Ptr(armpostgresqlflexibleservers.StorageAutoGrowEnabled), + StorageSizeGB: to.Ptr[int32](1024), + Tier: to.Ptr(armpostgresqlflexibleservers.AzureManagedDiskPerformanceTierP30), }, }, + SKU: &armpostgresqlflexibleservers.SKUForPatch{ + Name: to.Ptr("Standard_D8s_v3"), + Tier: to.Ptr(armpostgresqlflexibleservers.SKUTierGeneralPurpose), + }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } - res, err := poller.PollUntilDone(ctx, nil) + _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Server = armpostgresqlflexibleservers.Server{ - // Name: to.Ptr("pgtestsvc4-replica"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/pgtestsvc4-replica"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "ElasticServer": to.Ptr("1"), - // }, - // Properties: &armpostgresqlflexibleservers.ServerProperties{ - // AdministratorLogin: to.Ptr("login"), - // AuthConfig: &armpostgresqlflexibleservers.AuthConfig{ - // ActiveDirectoryAuth: to.Ptr(armpostgresqlflexibleservers.ActiveDirectoryAuthEnumDisabled), - // PasswordAuth: to.Ptr(armpostgresqlflexibleservers.PasswordAuthEnumEnabled), - // }, - // AvailabilityZone: to.Ptr("1"), - // Backup: &armpostgresqlflexibleservers.Backup{ - // BackupRetentionDays: to.Ptr[int32](20), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-02-26T01:16:58.372Z"); return t}()), - // GeoRedundantBackup: to.Ptr(armpostgresqlflexibleservers.GeoRedundantBackupEnumDisabled), - // }, - // DataEncryption: &armpostgresqlflexibleservers.DataEncryption{ - // Type: to.Ptr(armpostgresqlflexibleservers.ArmServerKeyTypeSystemManaged), - // }, - // FullyQualifiedDomainName: to.Ptr("pgtestsvc4-replica.postgres.database.azure.com"), - // HighAvailability: &armpostgresqlflexibleservers.HighAvailability{ - // Mode: to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant), - // StandbyAvailabilityZone: to.Ptr("2"), - // State: to.Ptr(armpostgresqlflexibleservers.ServerHAStateHealthy), - // }, - // MaintenanceWindow: &armpostgresqlflexibleservers.MaintenanceWindow{ - // CustomWindow: to.Ptr("Disabled"), - // DayOfWeek: to.Ptr[int32](0), - // StartHour: to.Ptr[int32](0), - // StartMinute: to.Ptr[int32](0), - // }, - // MinorVersion: to.Ptr("6"), - // Network: &armpostgresqlflexibleservers.Network{ - // DelegatedSubnetResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/test-vnet-subnet"), - // PrivateDNSZoneArmResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/privateDnsZones/test-private-dns-zone.postgres.database.azure.com"), - // PublicNetworkAccess: to.Ptr(armpostgresqlflexibleservers.ServerPublicNetworkAccessStateDisabled), - // }, - // Replica: &armpostgresqlflexibleservers.Replica{ - // Capacity: to.Ptr[int32](5), - // Role: to.Ptr(armpostgresqlflexibleservers.ReplicationRolePrimary), - // }, - // State: to.Ptr(armpostgresqlflexibleservers.ServerStateReady), - // Storage: &armpostgresqlflexibleservers.Storage{ - // AutoGrow: to.Ptr(armpostgresqlflexibleservers.StorageAutoGrowEnabled), - // Iops: to.Ptr[int32](5000), - // StorageSizeGB: to.Ptr[int32](1024), - // Tier: to.Ptr(armpostgresqlflexibleservers.AzureManagedDiskPerformanceTiersP30), - // }, - // Version: to.Ptr(armpostgresqlflexibleservers.ServerVersionSixteen), - // }, - // SKU: &armpostgresqlflexibleservers.SKU{ - // Name: to.Ptr("Standard_D8s_v3"), - // Tier: to.Ptr(armpostgresqlflexibleservers.SKUTierGeneralPurpose), - // }, - // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b1f4d539964453ce8008e4b069e59885e12ba441/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ServerDelete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/735d21dbd7e1cc446babf58860af4cca757d620d/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/ServersDelete.json func ExampleServersClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1774,7 +899,7 @@ func ExampleServersClient_BeginDelete() { if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewServersClient().BeginDelete(ctx, "testrg", "testserver", nil) + poller, err := clientFactory.NewServersClient().BeginDelete(ctx, "exampleresourcegroup", "exampleserver", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -1784,8 +909,8 @@ func ExampleServersClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b1f4d539964453ce8008e4b069e59885e12ba441/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ServerGet.json -func ExampleServersClient_Get_serverGet() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/735d21dbd7e1cc446babf58860af4cca757d620d/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/ServersGetWithVnet.json +func ExampleServersClient_Get_getInformationAboutAnExistingServerThatIsIntegratedIntoAVirtualNetworkProvidedByCustomer() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -1795,7 +920,7 @@ func ExampleServersClient_Get_serverGet() { if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewServersClient().Get(ctx, "testrg", "testpgflex", nil) + res, err := clientFactory.NewServersClient().Get(ctx, "exampleresourcegroup", "exampleserver", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -1803,32 +928,36 @@ func ExampleServersClient_Get_serverGet() { _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.Server = armpostgresqlflexibleservers.Server{ - // Name: to.Ptr("testpgflex"), + // Name: to.Ptr("exampleserver"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testpgflex"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver"), // SystemData: &armpostgresqlflexibleservers.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-12-02T21:26:40.243Z"); return t}()), + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T18:30:22.123Z"); return t}()), + // }, + // Location: to.Ptr("eastus"), + // Tags: map[string]*string{ + // "VnetServer": to.Ptr("1"), // }, - // Location: to.Ptr("East US"), // Properties: &armpostgresqlflexibleservers.ServerProperties{ - // AdministratorLogin: to.Ptr("login"), + // AdministratorLogin: to.Ptr("exampleadministratorlogin"), // AuthConfig: &armpostgresqlflexibleservers.AuthConfig{ - // ActiveDirectoryAuth: to.Ptr(armpostgresqlflexibleservers.ActiveDirectoryAuthEnumDisabled), - // PasswordAuth: to.Ptr(armpostgresqlflexibleservers.PasswordAuthEnumEnabled), + // ActiveDirectoryAuth: to.Ptr(armpostgresqlflexibleservers.MicrosoftEntraAuthDisabled), + // PasswordAuth: to.Ptr(armpostgresqlflexibleservers.PasswordBasedAuthEnabled), // }, // AvailabilityZone: to.Ptr("1"), // Backup: &armpostgresqlflexibleservers.Backup{ // BackupRetentionDays: to.Ptr[int32](7), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-02-25T02:11:46.457Z"); return t}()), - // GeoRedundantBackup: to.Ptr(armpostgresqlflexibleservers.GeoRedundantBackupEnumEnabled), + // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T18:35:22.123Z"); return t}()), + // GeoRedundantBackup: to.Ptr(armpostgresqlflexibleservers.GeographicallyRedundantBackupEnabled), // }, // DataEncryption: &armpostgresqlflexibleservers.DataEncryption{ - // Type: to.Ptr(armpostgresqlflexibleservers.ArmServerKeyTypeSystemManaged), + // Type: to.Ptr(armpostgresqlflexibleservers.DataEncryptionTypeSystemManaged), // }, - // FullyQualifiedDomainName: to.Ptr("testpgflex.postgres.database.azure.com"), + // FullyQualifiedDomainName: to.Ptr("exampleserver.postgres.database.azure.com"), // HighAvailability: &armpostgresqlflexibleservers.HighAvailability{ - // Mode: to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeDisabled), - // State: to.Ptr(armpostgresqlflexibleservers.ServerHAStateNotEnabled), + // Mode: to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant), + // StandbyAvailabilityZone: to.Ptr("2"), + // State: to.Ptr(armpostgresqlflexibleservers.HighAvailabilityStateHealthy), // }, // MaintenanceWindow: &armpostgresqlflexibleservers.MaintenanceWindow{ // CustomWindow: to.Ptr("Disabled"), @@ -1836,11 +965,11 @@ func ExampleServersClient_Get_serverGet() { // StartHour: to.Ptr[int32](0), // StartMinute: to.Ptr[int32](0), // }, - // MinorVersion: to.Ptr("8"), + // MinorVersion: to.Ptr("5"), // Network: &armpostgresqlflexibleservers.Network{ - // PublicNetworkAccess: to.Ptr(armpostgresqlflexibleservers.ServerPublicNetworkAccessStateEnabled), - // }, - // PrivateEndpointConnections: []*armpostgresqlflexibleservers.PrivateEndpointConnection{ + // DelegatedSubnetResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.Network/virtualNetworks/examplevirtualnetwork/subnets/examplesubnet"), + // PrivateDNSZoneArmResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.Network/privateDnsZones/exampleserver.private.postgres.database.azure.com"), + // PublicNetworkAccess: to.Ptr(armpostgresqlflexibleservers.ServerPublicNetworkAccessStateDisabled), // }, // Replica: &armpostgresqlflexibleservers.Replica{ // Capacity: to.Ptr[int32](5), @@ -1852,11 +981,11 @@ func ExampleServersClient_Get_serverGet() { // Storage: &armpostgresqlflexibleservers.Storage{ // Type: to.Ptr(armpostgresqlflexibleservers.StorageType("")), // AutoGrow: to.Ptr(armpostgresqlflexibleservers.StorageAutoGrowDisabled), - // Iops: to.Ptr[int32](500), - // StorageSizeGB: to.Ptr[int32](128), - // Tier: to.Ptr(armpostgresqlflexibleservers.AzureManagedDiskPerformanceTiersP10), + // Iops: to.Ptr[int32](2300), + // StorageSizeGB: to.Ptr[int32](512), + // Tier: to.Ptr(armpostgresqlflexibleservers.AzureManagedDiskPerformanceTierP20), // }, - // Version: to.Ptr(armpostgresqlflexibleservers.ServerVersionSixteen), + // Version: to.Ptr(armpostgresqlflexibleservers.PostgresMajorVersionSeventeen), // }, // SKU: &armpostgresqlflexibleservers.SKU{ // Name: to.Ptr("Standard_D4ds_v5"), @@ -1865,8 +994,8 @@ func ExampleServersClient_Get_serverGet() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b1f4d539964453ce8008e4b069e59885e12ba441/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ServerGetWithPrivateEndpoints.json -func ExampleServersClient_Get_serverGetWithPrivateEndpoints() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/735d21dbd7e1cc446babf58860af4cca757d620d/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/ServersGetWithPrivateEndpoints.json +func ExampleServersClient_Get_getInformationAboutAnExistingServerThatIsntIntegratedIntoAVirtualNetworkProvidedByCustomerAndHasPrivateEndpointConnections() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -1876,7 +1005,7 @@ func ExampleServersClient_Get_serverGetWithPrivateEndpoints() { if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewServersClient().Get(ctx, "testrg", "pgtestsvc2", nil) + res, err := clientFactory.NewServersClient().Get(ctx, "exampleresourcegroup", "exampleserver", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -1884,29 +1013,26 @@ func ExampleServersClient_Get_serverGetWithPrivateEndpoints() { _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.Server = armpostgresqlflexibleservers.Server{ - // Name: to.Ptr("pgtestsvc1"), + // Name: to.Ptr("exampleserver"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/pgtestsvc2"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "ElasticServer": to.Ptr("1"), - // }, + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver"), + // Location: to.Ptr("eastus"), // Properties: &armpostgresqlflexibleservers.ServerProperties{ - // AdministratorLogin: to.Ptr("login"), + // AdministratorLogin: to.Ptr("exampleadministratorlogin"), // AuthConfig: &armpostgresqlflexibleservers.AuthConfig{ - // ActiveDirectoryAuth: to.Ptr(armpostgresqlflexibleservers.ActiveDirectoryAuthEnumDisabled), - // PasswordAuth: to.Ptr(armpostgresqlflexibleservers.PasswordAuthEnumEnabled), + // ActiveDirectoryAuth: to.Ptr(armpostgresqlflexibleservers.MicrosoftEntraAuthDisabled), + // PasswordAuth: to.Ptr(armpostgresqlflexibleservers.PasswordBasedAuthEnabled), // }, // AvailabilityZone: to.Ptr("1"), // Backup: &armpostgresqlflexibleservers.Backup{ // BackupRetentionDays: to.Ptr[int32](7), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-02-26T23:07:25.816Z"); return t}()), - // GeoRedundantBackup: to.Ptr(armpostgresqlflexibleservers.GeoRedundantBackupEnumDisabled), + // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T18:35:22.123Z"); return t}()), + // GeoRedundantBackup: to.Ptr(armpostgresqlflexibleservers.GeographicallyRedundantBackupDisabled), // }, - // FullyQualifiedDomainName: to.Ptr("pgtestsvc2.postgres.database.azure.com"), + // FullyQualifiedDomainName: to.Ptr("exampleserver.postgres.database.azure.com"), // HighAvailability: &armpostgresqlflexibleservers.HighAvailability{ - // Mode: to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeDisabled), - // State: to.Ptr(armpostgresqlflexibleservers.ServerHAStateNotEnabled), + // Mode: to.Ptr(armpostgresqlflexibleservers.HighAvailabilityMode("Disabled")), + // State: to.Ptr(armpostgresqlflexibleservers.HighAvailabilityStateNotEnabled), // }, // MaintenanceWindow: &armpostgresqlflexibleservers.MaintenanceWindow{ // CustomWindow: to.Ptr("Disabled"), @@ -1914,20 +1040,20 @@ func ExampleServersClient_Get_serverGetWithPrivateEndpoints() { // StartHour: to.Ptr[int32](0), // StartMinute: to.Ptr[int32](0), // }, - // MinorVersion: to.Ptr("6"), + // MinorVersion: to.Ptr("5"), // Network: &armpostgresqlflexibleservers.Network{ // PublicNetworkAccess: to.Ptr(armpostgresqlflexibleservers.ServerPublicNetworkAccessStateEnabled), // }, // PrivateEndpointConnections: []*armpostgresqlflexibleservers.PrivateEndpointConnection{ // { - // Name: to.Ptr("asdfasdfa.40c899c7-5847-493e-9c9e-d0a0c90aaf92"), + // Name: to.Ptr("exampleprivateendpoint.40c899c7-5847-493e-9c9e-d0a0c90aaf92"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/pgtestsvc2/privateEndpointConnections/asdfasdfa.40c899c7-5847-493e-9c9e-d0a0c90aaf92"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/privateEndpointConnections/exampleprivateendpoint.40c899c7-5847-493e-9c9e-d0a0c90aaf92"), // Properties: &armpostgresqlflexibleservers.PrivateEndpointConnectionProperties{ // GroupIDs: []*string{ // to.Ptr("postgresqlServer")}, // PrivateEndpoint: &armpostgresqlflexibleservers.PrivateEndpoint{ - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/pe-test-rg/providers/Microsoft.Network/privateEndpoints/asdfasdfa"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleprivateendpointresourcegroup/providers/Microsoft.Network/privateEndpoints/exampleprivateendpoint"), // }, // PrivateLinkServiceConnectionState: &armpostgresqlflexibleservers.PrivateLinkServiceConnectionState{ // Description: to.Ptr("Auto-Approved"), @@ -1942,9 +1068,9 @@ func ExampleServersClient_Get_serverGetWithPrivateEndpoints() { // AutoGrow: to.Ptr(armpostgresqlflexibleservers.StorageAutoGrowDisabled), // Iops: to.Ptr[int32](2300), // StorageSizeGB: to.Ptr[int32](512), - // Tier: to.Ptr(armpostgresqlflexibleservers.AzureManagedDiskPerformanceTiersP20), + // Tier: to.Ptr(armpostgresqlflexibleservers.AzureManagedDiskPerformanceTierP20), // }, - // Version: to.Ptr(armpostgresqlflexibleservers.ServerVersionSixteen), + // Version: to.Ptr(armpostgresqlflexibleservers.PostgresMajorVersionSeventeen), // }, // SKU: &armpostgresqlflexibleservers.SKU{ // Name: to.Ptr("Standard_D4ds_v5"), @@ -1953,8 +1079,8 @@ func ExampleServersClient_Get_serverGetWithPrivateEndpoints() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b1f4d539964453ce8008e4b069e59885e12ba441/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ServerGetWithVnet.json -func ExampleServersClient_Get_serverGetWithVnet() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/735d21dbd7e1cc446babf58860af4cca757d620d/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/ServersGet.json +func ExampleServersClient_Get_getInformationAboutAnExistingServer() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -1964,7 +1090,7 @@ func ExampleServersClient_Get_serverGetWithVnet() { if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewServersClient().Get(ctx, "testrg", "testpgflex", nil) + res, err := clientFactory.NewServersClient().Get(ctx, "exampleresourcegroup", "exampleserver", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -1972,36 +1098,32 @@ func ExampleServersClient_Get_serverGetWithVnet() { _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.Server = armpostgresqlflexibleservers.Server{ - // Name: to.Ptr("testpgflex"), + // Name: to.Ptr("exampleserver"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testpgflex"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver"), // SystemData: &armpostgresqlflexibleservers.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-03-03T17:44:30.709Z"); return t}()), - // }, - // Location: to.Ptr("East US"), - // Tags: map[string]*string{ - // "VnetServer": to.Ptr("1"), + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T18:30:22.123Z"); return t}()), // }, + // Location: to.Ptr("eastus"), // Properties: &armpostgresqlflexibleservers.ServerProperties{ - // AdministratorLogin: to.Ptr("login"), + // AdministratorLogin: to.Ptr("exampleadministratorlogin"), // AuthConfig: &armpostgresqlflexibleservers.AuthConfig{ - // ActiveDirectoryAuth: to.Ptr(armpostgresqlflexibleservers.ActiveDirectoryAuthEnumDisabled), - // PasswordAuth: to.Ptr(armpostgresqlflexibleservers.PasswordAuthEnumEnabled), + // ActiveDirectoryAuth: to.Ptr(armpostgresqlflexibleservers.MicrosoftEntraAuthDisabled), + // PasswordAuth: to.Ptr(armpostgresqlflexibleservers.PasswordBasedAuthEnabled), // }, // AvailabilityZone: to.Ptr("1"), // Backup: &armpostgresqlflexibleservers.Backup{ // BackupRetentionDays: to.Ptr[int32](7), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-03-03T17:49:56.940Z"); return t}()), - // GeoRedundantBackup: to.Ptr(armpostgresqlflexibleservers.GeoRedundantBackupEnumEnabled), + // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T18:35:22.123Z"); return t}()), + // GeoRedundantBackup: to.Ptr(armpostgresqlflexibleservers.GeographicallyRedundantBackupEnabled), // }, // DataEncryption: &armpostgresqlflexibleservers.DataEncryption{ - // Type: to.Ptr(armpostgresqlflexibleservers.ArmServerKeyTypeSystemManaged), + // Type: to.Ptr(armpostgresqlflexibleservers.DataEncryptionTypeSystemManaged), // }, - // FullyQualifiedDomainName: to.Ptr("testpgflex.postgres.database.azure.com"), + // FullyQualifiedDomainName: to.Ptr("exampleserver.postgres.database.azure.com"), // HighAvailability: &armpostgresqlflexibleservers.HighAvailability{ - // Mode: to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant), - // StandbyAvailabilityZone: to.Ptr("2"), - // State: to.Ptr(armpostgresqlflexibleservers.ServerHAStateHealthy), + // Mode: to.Ptr(armpostgresqlflexibleservers.HighAvailabilityMode("Disabled")), + // State: to.Ptr(armpostgresqlflexibleservers.HighAvailabilityStateNotEnabled), // }, // MaintenanceWindow: &armpostgresqlflexibleservers.MaintenanceWindow{ // CustomWindow: to.Ptr("Disabled"), @@ -2009,11 +1131,11 @@ func ExampleServersClient_Get_serverGetWithVnet() { // StartHour: to.Ptr[int32](0), // StartMinute: to.Ptr[int32](0), // }, - // MinorVersion: to.Ptr("8"), + // MinorVersion: to.Ptr("5"), // Network: &armpostgresqlflexibleservers.Network{ - // DelegatedSubnetResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/test-subnet"), - // PrivateDNSZoneArmResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/privateDnsZones/testpgflex.private.postgres.database.azure.com"), - // PublicNetworkAccess: to.Ptr(armpostgresqlflexibleservers.ServerPublicNetworkAccessStateDisabled), + // PublicNetworkAccess: to.Ptr(armpostgresqlflexibleservers.ServerPublicNetworkAccessStateEnabled), + // }, + // PrivateEndpointConnections: []*armpostgresqlflexibleservers.PrivateEndpointConnection{ // }, // Replica: &armpostgresqlflexibleservers.Replica{ // Capacity: to.Ptr[int32](5), @@ -2025,11 +1147,11 @@ func ExampleServersClient_Get_serverGetWithVnet() { // Storage: &armpostgresqlflexibleservers.Storage{ // Type: to.Ptr(armpostgresqlflexibleservers.StorageType("")), // AutoGrow: to.Ptr(armpostgresqlflexibleservers.StorageAutoGrowDisabled), - // Iops: to.Ptr[int32](2300), - // StorageSizeGB: to.Ptr[int32](512), - // Tier: to.Ptr(armpostgresqlflexibleservers.AzureManagedDiskPerformanceTiersP20), + // Iops: to.Ptr[int32](500), + // StorageSizeGB: to.Ptr[int32](128), + // Tier: to.Ptr(armpostgresqlflexibleservers.AzureManagedDiskPerformanceTierP10), // }, - // Version: to.Ptr(armpostgresqlflexibleservers.ServerVersionSixteen), + // Version: to.Ptr(armpostgresqlflexibleservers.PostgresMajorVersionSeventeen), // }, // SKU: &armpostgresqlflexibleservers.SKU{ // Name: to.Ptr("Standard_D4ds_v5"), @@ -2038,7 +1160,7 @@ func ExampleServersClient_Get_serverGetWithVnet() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b1f4d539964453ce8008e4b069e59885e12ba441/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ServerListByResourceGroup.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/735d21dbd7e1cc446babf58860af4cca757d620d/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/ServersListByResourceGroup.json func ExampleServersClient_NewListByResourceGroupPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -2049,7 +1171,7 @@ func ExampleServersClient_NewListByResourceGroupPager() { if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewServersClient().NewListByResourceGroupPager("testrgn", nil) + pager := clientFactory.NewServersClient().NewListByResourceGroupPager("exampleresourcegroup", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -2060,40 +1182,40 @@ func ExampleServersClient_NewListByResourceGroupPager() { _ = v } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ServerListResult = armpostgresqlflexibleservers.ServerListResult{ + // page.ServerList = armpostgresqlflexibleservers.ServerList{ // Value: []*armpostgresqlflexibleservers.Server{ // { - // Name: to.Ptr("pgtest2"), + // Name: to.Ptr("exampleserver1"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrgn/providers/Microsoft.DBforPostgreSQL/flexibleServers/pgtest2"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver1"), // SystemData: &armpostgresqlflexibleservers.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-03-03T17:44:30.709Z"); return t}()), + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T18:30:22.123Z"); return t}()), // }, - // Location: to.Ptr("East US"), + // Location: to.Ptr("eastus"), // Tags: map[string]*string{ // "VnetServer": to.Ptr("1"), // }, // Properties: &armpostgresqlflexibleservers.ServerProperties{ - // AdministratorLogin: to.Ptr("login"), + // AdministratorLogin: to.Ptr("exampleadministratorlogin"), // AuthConfig: &armpostgresqlflexibleservers.AuthConfig{ - // ActiveDirectoryAuth: to.Ptr(armpostgresqlflexibleservers.ActiveDirectoryAuthEnumEnabled), - // PasswordAuth: to.Ptr(armpostgresqlflexibleservers.PasswordAuthEnumEnabled), + // ActiveDirectoryAuth: to.Ptr(armpostgresqlflexibleservers.MicrosoftEntraAuthEnabled), + // PasswordAuth: to.Ptr(armpostgresqlflexibleservers.PasswordBasedAuthEnabled), // TenantID: to.Ptr("tttttt-tttt-tttt-tttt-tttttttttttt"), // }, // AvailabilityZone: to.Ptr("1"), // Backup: &armpostgresqlflexibleservers.Backup{ // BackupRetentionDays: to.Ptr[int32](7), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-03-03T17:49:56.940Z"); return t}()), - // GeoRedundantBackup: to.Ptr(armpostgresqlflexibleservers.GeoRedundantBackupEnumEnabled), + // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T18:35:22.123Z"); return t}()), + // GeoRedundantBackup: to.Ptr(armpostgresqlflexibleservers.GeographicallyRedundantBackupEnabled), // }, // DataEncryption: &armpostgresqlflexibleservers.DataEncryption{ - // Type: to.Ptr(armpostgresqlflexibleservers.ArmServerKeyTypeSystemManaged), + // Type: to.Ptr(armpostgresqlflexibleservers.DataEncryptionTypeSystemManaged), // }, - // FullyQualifiedDomainName: to.Ptr("pgtest2.postgres.database.azure.com"), + // FullyQualifiedDomainName: to.Ptr("exampleserver1.postgres.database.azure.com"), // HighAvailability: &armpostgresqlflexibleservers.HighAvailability{ // Mode: to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant), // StandbyAvailabilityZone: to.Ptr("2"), - // State: to.Ptr(armpostgresqlflexibleservers.ServerHAStateHealthy), + // State: to.Ptr(armpostgresqlflexibleservers.HighAvailabilityStateHealthy), // }, // MaintenanceWindow: &armpostgresqlflexibleservers.MaintenanceWindow{ // CustomWindow: to.Ptr("Disabled"), @@ -2101,10 +1223,10 @@ func ExampleServersClient_NewListByResourceGroupPager() { // StartHour: to.Ptr[int32](0), // StartMinute: to.Ptr[int32](0), // }, - // MinorVersion: to.Ptr("8"), + // MinorVersion: to.Ptr("5"), // Network: &armpostgresqlflexibleservers.Network{ - // DelegatedSubnetResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrgn/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/test-subnet"), - // PrivateDNSZoneArmResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrgn/providers/Microsoft.Network/privateDnsZones/pgtest2.private.postgres.database.azure.com"), + // DelegatedSubnetResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.Network/virtualNetworks/examplevirtualnetwork/subnets/examplesubnet"), + // PrivateDNSZoneArmResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.Network/privateDnsZones/exampleserver1.private.postgres.database.azure.com"), // PublicNetworkAccess: to.Ptr(armpostgresqlflexibleservers.ServerPublicNetworkAccessStateDisabled), // }, // Replica: &armpostgresqlflexibleservers.Replica{ @@ -2119,9 +1241,9 @@ func ExampleServersClient_NewListByResourceGroupPager() { // AutoGrow: to.Ptr(armpostgresqlflexibleservers.StorageAutoGrowDisabled), // Iops: to.Ptr[int32](2300), // StorageSizeGB: to.Ptr[int32](512), - // Tier: to.Ptr(armpostgresqlflexibleservers.AzureManagedDiskPerformanceTiersP20), + // Tier: to.Ptr(armpostgresqlflexibleservers.AzureManagedDiskPerformanceTierP20), // }, - // Version: to.Ptr(armpostgresqlflexibleservers.ServerVersionSixteen), + // Version: to.Ptr(armpostgresqlflexibleservers.PostgresMajorVersionSeventeen), // }, // SKU: &armpostgresqlflexibleservers.SKU{ // Name: to.Ptr("Standard_D4ds_v5"), @@ -2129,13 +1251,13 @@ func ExampleServersClient_NewListByResourceGroupPager() { // }, // }, // { - // Name: to.Ptr("pgtest6"), + // Name: to.Ptr("exampleserver2"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrgn/providers/Microsoft.DBforPostgreSQL/flexibleServers/pgtest6"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver2"), // SystemData: &armpostgresqlflexibleservers.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-11-23T00:13:34.864Z"); return t}()), + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T19:30:22.123Z"); return t}()), // }, - // Location: to.Ptr("East US 2"), + // Location: to.Ptr("eastus"), // Tags: map[string]*string{ // }, // Identity: &armpostgresqlflexibleservers.UserAssignedIdentity{ @@ -2143,35 +1265,35 @@ func ExampleServersClient_NewListByResourceGroupPager() { // PrincipalID: to.Ptr("rrrrrrrr-rrrr-rrrr-rrrr-rrrrrrrrrrrr"), // TenantID: to.Ptr("tttttt-tttt-tttt-tttt-tttttttttttt"), // UserAssignedIdentities: map[string]*armpostgresqlflexibleservers.UserIdentity{ - // "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrgn/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-user": &armpostgresqlflexibleservers.UserIdentity{ + // "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/exampleprimaryidentity": &armpostgresqlflexibleservers.UserIdentity{ // ClientID: to.Ptr("tttttt-tttt-tttt-tttt-tttttttttttt"), // PrincipalID: to.Ptr("pppppppp-pppp-pppp-pppp-pppppppppppp"), // }, // }, // }, // Properties: &armpostgresqlflexibleservers.ServerProperties{ - // AdministratorLogin: to.Ptr("login"), + // AdministratorLogin: to.Ptr("exampleadministratorlogin"), // AuthConfig: &armpostgresqlflexibleservers.AuthConfig{ - // ActiveDirectoryAuth: to.Ptr(armpostgresqlflexibleservers.ActiveDirectoryAuthEnumEnabled), - // PasswordAuth: to.Ptr(armpostgresqlflexibleservers.PasswordAuthEnumEnabled), + // ActiveDirectoryAuth: to.Ptr(armpostgresqlflexibleservers.MicrosoftEntraAuthEnabled), + // PasswordAuth: to.Ptr(armpostgresqlflexibleservers.PasswordBasedAuthEnabled), // TenantID: to.Ptr("tttttt-tttt-tttt-tttt-tttttttttttt"), // }, // AvailabilityZone: to.Ptr("1"), // Backup: &armpostgresqlflexibleservers.Backup{ // BackupRetentionDays: to.Ptr[int32](7), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-02-25T01:24:56.297Z"); return t}()), - // GeoRedundantBackup: to.Ptr(armpostgresqlflexibleservers.GeoRedundantBackupEnumDisabled), + // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T19:35:22.123Z"); return t}()), + // GeoRedundantBackup: to.Ptr(armpostgresqlflexibleservers.GeographicallyRedundantBackupDisabled), // }, // DataEncryption: &armpostgresqlflexibleservers.DataEncryption{ - // Type: to.Ptr(armpostgresqlflexibleservers.ArmServerKeyTypeAzureKeyVault), - // PrimaryEncryptionKeyStatus: to.Ptr(armpostgresqlflexibleservers.KeyStatusEnumValid), - // PrimaryKeyURI: to.Ptr("https://test-vault1.vault.azure.net/keys/test-key1/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"), - // PrimaryUserAssignedIdentityID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg2/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-user"), + // Type: to.Ptr(armpostgresqlflexibleservers.DataEncryptionTypeAzureKeyVault), + // PrimaryEncryptionKeyStatus: to.Ptr(armpostgresqlflexibleservers.EncryptionKeyStatusValid), + // PrimaryKeyURI: to.Ptr("https://examplekeyvault.vault.azure.net/keys/examplekey/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"), + // PrimaryUserAssignedIdentityID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/exampleprimaryidentity"), // }, - // FullyQualifiedDomainName: to.Ptr("pgtest6.postgres.database.azure.com"), + // FullyQualifiedDomainName: to.Ptr("exampleserver2.postgres.database.azure.com"), // HighAvailability: &armpostgresqlflexibleservers.HighAvailability{ - // Mode: to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeDisabled), - // State: to.Ptr(armpostgresqlflexibleservers.ServerHAStateNotEnabled), + // Mode: to.Ptr(armpostgresqlflexibleservers.HighAvailabilityMode("Disabled")), + // State: to.Ptr(armpostgresqlflexibleservers.HighAvailabilityStateNotEnabled), // }, // MaintenanceWindow: &armpostgresqlflexibleservers.MaintenanceWindow{ // CustomWindow: to.Ptr("Disabled"), @@ -2179,7 +1301,7 @@ func ExampleServersClient_NewListByResourceGroupPager() { // StartHour: to.Ptr[int32](0), // StartMinute: to.Ptr[int32](0), // }, - // MinorVersion: to.Ptr("8"), + // MinorVersion: to.Ptr("5"), // Network: &armpostgresqlflexibleservers.Network{ // PublicNetworkAccess: to.Ptr(armpostgresqlflexibleservers.ServerPublicNetworkAccessStateEnabled), // }, @@ -2197,9 +1319,9 @@ func ExampleServersClient_NewListByResourceGroupPager() { // AutoGrow: to.Ptr(armpostgresqlflexibleservers.StorageAutoGrowDisabled), // Iops: to.Ptr[int32](500), // StorageSizeGB: to.Ptr[int32](128), - // Tier: to.Ptr(armpostgresqlflexibleservers.AzureManagedDiskPerformanceTiersP10), + // Tier: to.Ptr(armpostgresqlflexibleservers.AzureManagedDiskPerformanceTierP10), // }, - // Version: to.Ptr(armpostgresqlflexibleservers.ServerVersionSixteen), + // Version: to.Ptr(armpostgresqlflexibleservers.PostgresMajorVersionSeventeen), // }, // SKU: &armpostgresqlflexibleservers.SKU{ // Name: to.Ptr("Standard_D4ds_v5"), @@ -2210,8 +1332,8 @@ func ExampleServersClient_NewListByResourceGroupPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b1f4d539964453ce8008e4b069e59885e12ba441/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ServerList.json -func ExampleServersClient_NewListPager() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/735d21dbd7e1cc446babf58860af4cca757d620d/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/ServersListBySubscription.json +func ExampleServersClient_NewListBySubscriptionPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -2221,7 +1343,7 @@ func ExampleServersClient_NewListPager() { if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewServersClient().NewListPager(nil) + pager := clientFactory.NewServersClient().NewListBySubscriptionPager(nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -2232,40 +1354,40 @@ func ExampleServersClient_NewListPager() { _ = v } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ServerListResult = armpostgresqlflexibleservers.ServerListResult{ + // page.ServerList = armpostgresqlflexibleservers.ServerList{ // Value: []*armpostgresqlflexibleservers.Server{ // { - // Name: to.Ptr("pgtest2"), + // Name: to.Ptr("exampleserver1"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrgn/providers/Microsoft.DBforPostgreSQL/flexibleServers/pgtest2"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup1/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver1"), // SystemData: &armpostgresqlflexibleservers.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-03-03T17:44:30.709Z"); return t}()), + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T18:30:22.123Z"); return t}()), // }, - // Location: to.Ptr("East US"), + // Location: to.Ptr("eastus"), // Tags: map[string]*string{ // "VnetServer": to.Ptr("1"), // }, // Properties: &armpostgresqlflexibleservers.ServerProperties{ - // AdministratorLogin: to.Ptr("login"), + // AdministratorLogin: to.Ptr("exampleadministratorlogin"), // AuthConfig: &armpostgresqlflexibleservers.AuthConfig{ - // ActiveDirectoryAuth: to.Ptr(armpostgresqlflexibleservers.ActiveDirectoryAuthEnumEnabled), - // PasswordAuth: to.Ptr(armpostgresqlflexibleservers.PasswordAuthEnumEnabled), + // ActiveDirectoryAuth: to.Ptr(armpostgresqlflexibleservers.MicrosoftEntraAuthEnabled), + // PasswordAuth: to.Ptr(armpostgresqlflexibleservers.PasswordBasedAuthEnabled), // TenantID: to.Ptr("tttttt-tttt-tttt-tttt-tttttttttttt"), // }, // AvailabilityZone: to.Ptr("1"), // Backup: &armpostgresqlflexibleservers.Backup{ // BackupRetentionDays: to.Ptr[int32](7), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-03-03T17:49:56.940Z"); return t}()), - // GeoRedundantBackup: to.Ptr(armpostgresqlflexibleservers.GeoRedundantBackupEnumEnabled), + // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T18:35:22.123Z"); return t}()), + // GeoRedundantBackup: to.Ptr(armpostgresqlflexibleservers.GeographicallyRedundantBackupEnabled), // }, // DataEncryption: &armpostgresqlflexibleservers.DataEncryption{ - // Type: to.Ptr(armpostgresqlflexibleservers.ArmServerKeyTypeSystemManaged), + // Type: to.Ptr(armpostgresqlflexibleservers.DataEncryptionTypeSystemManaged), // }, - // FullyQualifiedDomainName: to.Ptr("pgtest2.postgres.database.azure.com"), + // FullyQualifiedDomainName: to.Ptr("exampleserver1.postgres.database.azure.com"), // HighAvailability: &armpostgresqlflexibleservers.HighAvailability{ // Mode: to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant), // StandbyAvailabilityZone: to.Ptr("2"), - // State: to.Ptr(armpostgresqlflexibleservers.ServerHAStateHealthy), + // State: to.Ptr(armpostgresqlflexibleservers.HighAvailabilityStateHealthy), // }, // MaintenanceWindow: &armpostgresqlflexibleservers.MaintenanceWindow{ // CustomWindow: to.Ptr("Disabled"), @@ -2273,10 +1395,10 @@ func ExampleServersClient_NewListPager() { // StartHour: to.Ptr[int32](0), // StartMinute: to.Ptr[int32](0), // }, - // MinorVersion: to.Ptr("8"), + // MinorVersion: to.Ptr("5"), // Network: &armpostgresqlflexibleservers.Network{ - // DelegatedSubnetResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrgn/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/test-subnet"), - // PrivateDNSZoneArmResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrgn/providers/Microsoft.Network/privateDnsZones/pgtest2.private.postgres.database.azure.com"), + // DelegatedSubnetResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup1/providers/Microsoft.Network/virtualNetworks/examplevirtualnetwork1/subnets/examplesubnet1"), + // PrivateDNSZoneArmResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup1/providers/Microsoft.Network/privateDnsZones/exampleprivatednszone1.postgres.database.azure.com"), // PublicNetworkAccess: to.Ptr(armpostgresqlflexibleservers.ServerPublicNetworkAccessStateDisabled), // }, // Replica: &armpostgresqlflexibleservers.Replica{ @@ -2291,9 +1413,9 @@ func ExampleServersClient_NewListPager() { // AutoGrow: to.Ptr(armpostgresqlflexibleservers.StorageAutoGrowDisabled), // Iops: to.Ptr[int32](2300), // StorageSizeGB: to.Ptr[int32](512), - // Tier: to.Ptr(armpostgresqlflexibleservers.AzureManagedDiskPerformanceTiersP20), + // Tier: to.Ptr(armpostgresqlflexibleservers.AzureManagedDiskPerformanceTierP20), // }, - // Version: to.Ptr(armpostgresqlflexibleservers.ServerVersionSixteen), + // Version: to.Ptr(armpostgresqlflexibleservers.PostgresMajorVersionSeventeen), // }, // SKU: &armpostgresqlflexibleservers.SKU{ // Name: to.Ptr("Standard_D4ds_v5"), @@ -2301,36 +1423,36 @@ func ExampleServersClient_NewListPager() { // }, // }, // { - // Name: to.Ptr("pgtest3"), + // Name: to.Ptr("exampleserver2"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg6/providers/Microsoft.DBforPostgreSQL/flexibleServers/pgtest3"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup2/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver2"), // SystemData: &armpostgresqlflexibleservers.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-03-03T23:41:01.102Z"); return t}()), + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T19:30:22.123Z"); return t}()), // }, - // Location: to.Ptr("East US"), + // Location: to.Ptr("eastus"), // Tags: map[string]*string{ // }, // Properties: &armpostgresqlflexibleservers.ServerProperties{ - // AdministratorLogin: to.Ptr("login"), + // AdministratorLogin: to.Ptr("exampleadministratorlogin"), // AuthConfig: &armpostgresqlflexibleservers.AuthConfig{ - // ActiveDirectoryAuth: to.Ptr(armpostgresqlflexibleservers.ActiveDirectoryAuthEnumEnabled), - // PasswordAuth: to.Ptr(armpostgresqlflexibleservers.PasswordAuthEnumEnabled), + // ActiveDirectoryAuth: to.Ptr(armpostgresqlflexibleservers.MicrosoftEntraAuthEnabled), + // PasswordAuth: to.Ptr(armpostgresqlflexibleservers.PasswordBasedAuthEnabled), // TenantID: to.Ptr("tttttt-tttt-tttt-tttt-tttttttttttt"), // }, // AvailabilityZone: to.Ptr("2"), // Backup: &armpostgresqlflexibleservers.Backup{ // BackupRetentionDays: to.Ptr[int32](7), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-03-03T23:48:24.491Z"); return t}()), - // GeoRedundantBackup: to.Ptr(armpostgresqlflexibleservers.GeoRedundantBackupEnumEnabled), + // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T19:35:22.123Z"); return t}()), + // GeoRedundantBackup: to.Ptr(armpostgresqlflexibleservers.GeographicallyRedundantBackupEnabled), // }, // DataEncryption: &armpostgresqlflexibleservers.DataEncryption{ - // Type: to.Ptr(armpostgresqlflexibleservers.ArmServerKeyTypeSystemManaged), + // Type: to.Ptr(armpostgresqlflexibleservers.DataEncryptionTypeSystemManaged), // }, - // FullyQualifiedDomainName: to.Ptr("pgtest3.postgres.database.azure.com"), + // FullyQualifiedDomainName: to.Ptr("exampleserver2.postgres.database.azure.com"), // HighAvailability: &armpostgresqlflexibleservers.HighAvailability{ // Mode: to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant), // StandbyAvailabilityZone: to.Ptr("1"), - // State: to.Ptr(armpostgresqlflexibleservers.ServerHAStateHealthy), + // State: to.Ptr(armpostgresqlflexibleservers.HighAvailabilityStateHealthy), // }, // MaintenanceWindow: &armpostgresqlflexibleservers.MaintenanceWindow{ // CustomWindow: to.Ptr("Disabled"), @@ -2338,7 +1460,7 @@ func ExampleServersClient_NewListPager() { // StartHour: to.Ptr[int32](0), // StartMinute: to.Ptr[int32](0), // }, - // MinorVersion: to.Ptr("8"), + // MinorVersion: to.Ptr("5"), // Network: &armpostgresqlflexibleservers.Network{ // PublicNetworkAccess: to.Ptr(armpostgresqlflexibleservers.ServerPublicNetworkAccessStateEnabled), // }, @@ -2356,9 +1478,9 @@ func ExampleServersClient_NewListPager() { // AutoGrow: to.Ptr(armpostgresqlflexibleservers.StorageAutoGrowDisabled), // Iops: to.Ptr[int32](500), // StorageSizeGB: to.Ptr[int32](128), - // Tier: to.Ptr(armpostgresqlflexibleservers.AzureManagedDiskPerformanceTiersP10), + // Tier: to.Ptr(armpostgresqlflexibleservers.AzureManagedDiskPerformanceTierP10), // }, - // Version: to.Ptr(armpostgresqlflexibleservers.ServerVersionSixteen), + // Version: to.Ptr(armpostgresqlflexibleservers.PostgresMajorVersionSeventeen), // }, // SKU: &armpostgresqlflexibleservers.SKU{ // Name: to.Ptr("Standard_D4ds_v5"), @@ -2366,13 +1488,13 @@ func ExampleServersClient_NewListPager() { // }, // }, // { - // Name: to.Ptr("pgtest6"), + // Name: to.Ptr("exampleserver3"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrgn/providers/Microsoft.DBforPostgreSQL/flexibleServers/pgtest6"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup3/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver3"), // SystemData: &armpostgresqlflexibleservers.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-11-23T00:13:34.864Z"); return t}()), + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T20:30:22.123Z"); return t}()), // }, - // Location: to.Ptr("East US 2"), + // Location: to.Ptr("eastus"), // Tags: map[string]*string{ // }, // Identity: &armpostgresqlflexibleservers.UserAssignedIdentity{ @@ -2380,35 +1502,35 @@ func ExampleServersClient_NewListPager() { // PrincipalID: to.Ptr("rrrrrrrr-rrrr-rrrr-rrrr-rrrrrrrrrrrr"), // TenantID: to.Ptr("tttttt-tttt-tttt-tttt-tttttttttttt"), // UserAssignedIdentities: map[string]*armpostgresqlflexibleservers.UserIdentity{ - // "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrgn/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-user": &armpostgresqlflexibleservers.UserIdentity{ + // "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup3/providers/Microsoft.ManagedIdentity/userAssignedIdentities/exampleprimaryidentity3": &armpostgresqlflexibleservers.UserIdentity{ // ClientID: to.Ptr("tttttt-tttt-tttt-tttt-tttttttttttt"), // PrincipalID: to.Ptr("pppppppp-pppp-pppp-pppp-pppppppppppp"), // }, // }, // }, // Properties: &armpostgresqlflexibleservers.ServerProperties{ - // AdministratorLogin: to.Ptr("login"), + // AdministratorLogin: to.Ptr("exampleadministratorlogin"), // AuthConfig: &armpostgresqlflexibleservers.AuthConfig{ - // ActiveDirectoryAuth: to.Ptr(armpostgresqlflexibleservers.ActiveDirectoryAuthEnumEnabled), - // PasswordAuth: to.Ptr(armpostgresqlflexibleservers.PasswordAuthEnumEnabled), + // ActiveDirectoryAuth: to.Ptr(armpostgresqlflexibleservers.MicrosoftEntraAuthEnabled), + // PasswordAuth: to.Ptr(armpostgresqlflexibleservers.PasswordBasedAuthEnabled), // TenantID: to.Ptr("tttttt-tttt-tttt-tttt-tttttttttttt"), // }, // AvailabilityZone: to.Ptr("1"), // Backup: &armpostgresqlflexibleservers.Backup{ // BackupRetentionDays: to.Ptr[int32](7), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-02-25T01:24:56.297Z"); return t}()), - // GeoRedundantBackup: to.Ptr(armpostgresqlflexibleservers.GeoRedundantBackupEnumDisabled), + // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T20:35:22.123Z"); return t}()), + // GeoRedundantBackup: to.Ptr(armpostgresqlflexibleservers.GeographicallyRedundantBackupDisabled), // }, // DataEncryption: &armpostgresqlflexibleservers.DataEncryption{ - // Type: to.Ptr(armpostgresqlflexibleservers.ArmServerKeyTypeAzureKeyVault), - // PrimaryEncryptionKeyStatus: to.Ptr(armpostgresqlflexibleservers.KeyStatusEnumValid), - // PrimaryKeyURI: to.Ptr("https://test-vault1.vault.azure.net/keys/test-key1/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"), - // PrimaryUserAssignedIdentityID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg2/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-user"), + // Type: to.Ptr(armpostgresqlflexibleservers.DataEncryptionTypeAzureKeyVault), + // PrimaryEncryptionKeyStatus: to.Ptr(armpostgresqlflexibleservers.EncryptionKeyStatusValid), + // PrimaryKeyURI: to.Ptr("https://examplekeyvault3.vault.azure.net/keys/examplekey/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"), + // PrimaryUserAssignedIdentityID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup3/providers/Microsoft.ManagedIdentity/userAssignedIdentities/exampleprimaryidentity3"), // }, - // FullyQualifiedDomainName: to.Ptr("pgtest6.postgres.database.azure.com"), + // FullyQualifiedDomainName: to.Ptr("exampleserver3.postgres.database.azure.com"), // HighAvailability: &armpostgresqlflexibleservers.HighAvailability{ - // Mode: to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeDisabled), - // State: to.Ptr(armpostgresqlflexibleservers.ServerHAStateNotEnabled), + // Mode: to.Ptr(armpostgresqlflexibleservers.HighAvailabilityMode("Disabled")), + // State: to.Ptr(armpostgresqlflexibleservers.HighAvailabilityStateNotEnabled), // }, // MaintenanceWindow: &armpostgresqlflexibleservers.MaintenanceWindow{ // CustomWindow: to.Ptr("Disabled"), @@ -2416,7 +1538,7 @@ func ExampleServersClient_NewListPager() { // StartHour: to.Ptr[int32](0), // StartMinute: to.Ptr[int32](0), // }, - // MinorVersion: to.Ptr("8"), + // MinorVersion: to.Ptr("5"), // Network: &armpostgresqlflexibleservers.Network{ // PublicNetworkAccess: to.Ptr(armpostgresqlflexibleservers.ServerPublicNetworkAccessStateEnabled), // }, @@ -2434,9 +1556,9 @@ func ExampleServersClient_NewListPager() { // AutoGrow: to.Ptr(armpostgresqlflexibleservers.StorageAutoGrowDisabled), // Iops: to.Ptr[int32](500), // StorageSizeGB: to.Ptr[int32](128), - // Tier: to.Ptr(armpostgresqlflexibleservers.AzureManagedDiskPerformanceTiersP10), + // Tier: to.Ptr(armpostgresqlflexibleservers.AzureManagedDiskPerformanceTierP10), // }, - // Version: to.Ptr(armpostgresqlflexibleservers.ServerVersionSixteen), + // Version: to.Ptr(armpostgresqlflexibleservers.PostgresMajorVersionSeventeen), // }, // SKU: &armpostgresqlflexibleservers.SKU{ // Name: to.Ptr("Standard_D4ds_v5"), @@ -2444,34 +1566,34 @@ func ExampleServersClient_NewListPager() { // }, // }, // { - // Name: to.Ptr("pgtest9"), + // Name: to.Ptr("exampleserver4"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg9/providers/Microsoft.DBforPostgreSQL/flexibleServers/pgtest9"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup4/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver4"), // SystemData: &armpostgresqlflexibleservers.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-02-26T21:17:37.501Z"); return t}()), + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T21:30:22.123Z"); return t}()), // }, - // Location: to.Ptr("East US 2"), + // Location: to.Ptr("eastus"), // Tags: map[string]*string{ // }, // Properties: &armpostgresqlflexibleservers.ServerProperties{ - // AdministratorLogin: to.Ptr("login"), + // AdministratorLogin: to.Ptr("exampleadministratorlogin"), // AuthConfig: &armpostgresqlflexibleservers.AuthConfig{ - // ActiveDirectoryAuth: to.Ptr(armpostgresqlflexibleservers.ActiveDirectoryAuthEnumDisabled), - // PasswordAuth: to.Ptr(armpostgresqlflexibleservers.PasswordAuthEnumEnabled), + // ActiveDirectoryAuth: to.Ptr(armpostgresqlflexibleservers.MicrosoftEntraAuthDisabled), + // PasswordAuth: to.Ptr(armpostgresqlflexibleservers.PasswordBasedAuthEnabled), // }, // AvailabilityZone: to.Ptr("2"), // Backup: &armpostgresqlflexibleservers.Backup{ // BackupRetentionDays: to.Ptr[int32](7), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-02-26T21:41:19.335Z"); return t}()), - // GeoRedundantBackup: to.Ptr(armpostgresqlflexibleservers.GeoRedundantBackupEnumDisabled), + // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T21:35:22.123Z"); return t}()), + // GeoRedundantBackup: to.Ptr(armpostgresqlflexibleservers.GeographicallyRedundantBackupDisabled), // }, // DataEncryption: &armpostgresqlflexibleservers.DataEncryption{ - // Type: to.Ptr(armpostgresqlflexibleservers.ArmServerKeyTypeSystemManaged), + // Type: to.Ptr(armpostgresqlflexibleservers.DataEncryptionTypeSystemManaged), // }, - // FullyQualifiedDomainName: to.Ptr("pgtest9.postgres.database.azure.com"), + // FullyQualifiedDomainName: to.Ptr("exampleserver4.postgres.database.azure.com"), // HighAvailability: &armpostgresqlflexibleservers.HighAvailability{ - // Mode: to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeDisabled), - // State: to.Ptr(armpostgresqlflexibleservers.ServerHAStateNotEnabled), + // Mode: to.Ptr(armpostgresqlflexibleservers.HighAvailabilityMode("Disabled")), + // State: to.Ptr(armpostgresqlflexibleservers.HighAvailabilityStateNotEnabled), // }, // MaintenanceWindow: &armpostgresqlflexibleservers.MaintenanceWindow{ // CustomWindow: to.Ptr("Disabled"), @@ -2479,7 +1601,7 @@ func ExampleServersClient_NewListPager() { // StartHour: to.Ptr[int32](0), // StartMinute: to.Ptr[int32](0), // }, - // MinorVersion: to.Ptr("8"), + // MinorVersion: to.Ptr("5"), // Network: &armpostgresqlflexibleservers.Network{ // PublicNetworkAccess: to.Ptr(armpostgresqlflexibleservers.ServerPublicNetworkAccessStateEnabled), // }, @@ -2499,7 +1621,7 @@ func ExampleServersClient_NewListPager() { // StorageSizeGB: to.Ptr[int32](512), // Throughput: to.Ptr[int32](125), // }, - // Version: to.Ptr(armpostgresqlflexibleservers.ServerVersionSixteen), + // Version: to.Ptr(armpostgresqlflexibleservers.PostgresMajorVersionSeventeen), // }, // SKU: &armpostgresqlflexibleservers.SKU{ // Name: to.Ptr("Standard_D4ds_v5"), @@ -2510,8 +1632,8 @@ func ExampleServersClient_NewListPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b1f4d539964453ce8008e4b069e59885e12ba441/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ServerRestart.json -func ExampleServersClient_BeginRestart_serverRestart() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/735d21dbd7e1cc446babf58860af4cca757d620d/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/ServersRestartWithFailover.json +func ExampleServersClient_BeginRestart_restartPostgreSqlDatabaseEngineInAServerWithAForcedFailoverToStandbyServer() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -2521,7 +1643,11 @@ func ExampleServersClient_BeginRestart_serverRestart() { if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewServersClient().BeginRestart(ctx, "testrg", "testserver", &armpostgresqlflexibleservers.ServersClientBeginRestartOptions{Parameters: nil}) + poller, err := clientFactory.NewServersClient().BeginRestart(ctx, "exampleresourcegroup", "exampleserver", &armpostgresqlflexibleservers.ServersClientBeginRestartOptions{Parameters: &armpostgresqlflexibleservers.RestartParameter{ + FailoverMode: to.Ptr(armpostgresqlflexibleservers.FailoverModeForcedFailover), + RestartWithFailover: to.Ptr(true), + }, + }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -2531,8 +1657,8 @@ func ExampleServersClient_BeginRestart_serverRestart() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b1f4d539964453ce8008e4b069e59885e12ba441/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ServerRestartWithFailover.json -func ExampleServersClient_BeginRestart_serverRestartWithFailover() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/735d21dbd7e1cc446babf58860af4cca757d620d/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/ServersRestart.json +func ExampleServersClient_BeginRestart_restartPostgreSqlDatabaseEngineInAServer() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -2542,11 +1668,7 @@ func ExampleServersClient_BeginRestart_serverRestartWithFailover() { if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewServersClient().BeginRestart(ctx, "testrg", "testserver", &armpostgresqlflexibleservers.ServersClientBeginRestartOptions{Parameters: &armpostgresqlflexibleservers.RestartParameter{ - FailoverMode: to.Ptr(armpostgresqlflexibleservers.FailoverModeForcedFailover), - RestartWithFailover: to.Ptr(true), - }, - }) + poller, err := clientFactory.NewServersClient().BeginRestart(ctx, "exampleresourcegroup", "exampleserver", &armpostgresqlflexibleservers.ServersClientBeginRestartOptions{Parameters: nil}) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -2556,7 +1678,7 @@ func ExampleServersClient_BeginRestart_serverRestartWithFailover() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b1f4d539964453ce8008e4b069e59885e12ba441/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ServerStart.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/735d21dbd7e1cc446babf58860af4cca757d620d/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/ServersStart.json func ExampleServersClient_BeginStart() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -2567,7 +1689,7 @@ func ExampleServersClient_BeginStart() { if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewServersClient().BeginStart(ctx, "testrg", "testserver", nil) + poller, err := clientFactory.NewServersClient().BeginStart(ctx, "exampleresourcegroup", "exampleserver", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -2577,7 +1699,7 @@ func ExampleServersClient_BeginStart() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b1f4d539964453ce8008e4b069e59885e12ba441/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ServerStop.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/735d21dbd7e1cc446babf58860af4cca757d620d/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/ServersStop.json func ExampleServersClient_BeginStop() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -2588,7 +1710,7 @@ func ExampleServersClient_BeginStop() { if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewServersClient().BeginStop(ctx, "testrg", "testserver", nil) + poller, err := clientFactory.NewServersClient().BeginStop(ctx, "exampleresourcegroup", "exampleserver", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/serverthreatprotectionsettings_client.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/serverthreatprotectionsettings_client.go index 0e8dc46633db..c7354e94e6f3 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/serverthreatprotectionsettings_client.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/serverthreatprotectionsettings_client.go @@ -27,7 +27,7 @@ type ServerThreatProtectionSettingsClient struct { // NewServerThreatProtectionSettingsClient creates a new instance of ServerThreatProtectionSettingsClient with the specified values. // - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. +// - options - Contains optional client configuration. Pass nil to accept the default values. func NewServerThreatProtectionSettingsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ServerThreatProtectionSettingsClient, error) { cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) if err != nil { @@ -43,14 +43,14 @@ func NewServerThreatProtectionSettingsClient(subscriptionID string, credential a // BeginCreateOrUpdate - Creates or updates a server's Advanced Threat Protection settings. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-01-01-preview +// Generated from API version 2025-08-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. -// - threatProtectionName - The name of the Threat Protection state. -// - parameters - The Advanced Threat Protection state for the flexible server. +// - threatProtectionName - Name of the advanced threat protection settings. +// - parameters - The Advanced Threat Protection state for the server. // - options - ServerThreatProtectionSettingsClientBeginCreateOrUpdateOptions contains the optional parameters for the ServerThreatProtectionSettingsClient.BeginCreateOrUpdate // method. -func (client *ServerThreatProtectionSettingsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, threatProtectionName ThreatProtectionName, parameters ServerThreatProtectionSettingsModel, options *ServerThreatProtectionSettingsClientBeginCreateOrUpdateOptions) (*runtime.Poller[ServerThreatProtectionSettingsClientCreateOrUpdateResponse], error) { +func (client *ServerThreatProtectionSettingsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, threatProtectionName ThreatProtectionName, parameters AdvancedThreatProtectionSettingsModel, options *ServerThreatProtectionSettingsClientBeginCreateOrUpdateOptions) (*runtime.Poller[ServerThreatProtectionSettingsClientCreateOrUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.createOrUpdate(ctx, resourceGroupName, serverName, threatProtectionName, parameters, options) if err != nil { @@ -71,8 +71,8 @@ func (client *ServerThreatProtectionSettingsClient) BeginCreateOrUpdate(ctx cont // CreateOrUpdate - Creates or updates a server's Advanced Threat Protection settings. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-01-01-preview -func (client *ServerThreatProtectionSettingsClient) createOrUpdate(ctx context.Context, resourceGroupName string, serverName string, threatProtectionName ThreatProtectionName, parameters ServerThreatProtectionSettingsModel, options *ServerThreatProtectionSettingsClientBeginCreateOrUpdateOptions) (*http.Response, error) { +// Generated from API version 2025-08-01 +func (client *ServerThreatProtectionSettingsClient) createOrUpdate(ctx context.Context, resourceGroupName string, serverName string, threatProtectionName ThreatProtectionName, parameters AdvancedThreatProtectionSettingsModel, options *ServerThreatProtectionSettingsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "ServerThreatProtectionSettingsClient.BeginCreateOrUpdate" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) @@ -86,7 +86,7 @@ func (client *ServerThreatProtectionSettingsClient) createOrUpdate(ctx context.C if err != nil { return nil, err } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { + if !runtime.HasStatusCode(httpResp, http.StatusAccepted) { err = runtime.NewResponseError(httpResp) return nil, err } @@ -94,7 +94,7 @@ func (client *ServerThreatProtectionSettingsClient) createOrUpdate(ctx context.C } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *ServerThreatProtectionSettingsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, serverName string, threatProtectionName ThreatProtectionName, parameters ServerThreatProtectionSettingsModel, _ *ServerThreatProtectionSettingsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { +func (client *ServerThreatProtectionSettingsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, serverName string, threatProtectionName ThreatProtectionName, parameters AdvancedThreatProtectionSettingsModel, _ *ServerThreatProtectionSettingsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/advancedThreatProtectionSettings/{threatProtectionName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -117,7 +117,7 @@ func (client *ServerThreatProtectionSettingsClient) createOrUpdateCreateRequest( return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-01-01-preview") + reqQP.Set("api-version", "2025-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -125,138 +125,3 @@ func (client *ServerThreatProtectionSettingsClient) createOrUpdateCreateRequest( } return req, nil } - -// Get - Get a server's Advanced Threat Protection settings. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-01-01-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - serverName - The name of the server. -// - threatProtectionName - The name of the Threat Protection state. -// - options - ServerThreatProtectionSettingsClientGetOptions contains the optional parameters for the ServerThreatProtectionSettingsClient.Get -// method. -func (client *ServerThreatProtectionSettingsClient) Get(ctx context.Context, resourceGroupName string, serverName string, threatProtectionName ThreatProtectionName, options *ServerThreatProtectionSettingsClientGetOptions) (ServerThreatProtectionSettingsClientGetResponse, error) { - var err error - const operationName = "ServerThreatProtectionSettingsClient.Get" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, threatProtectionName, options) - if err != nil { - return ServerThreatProtectionSettingsClientGetResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return ServerThreatProtectionSettingsClientGetResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return ServerThreatProtectionSettingsClientGetResponse{}, err - } - resp, err := client.getHandleResponse(httpResp) - return resp, err -} - -// getCreateRequest creates the Get request. -func (client *ServerThreatProtectionSettingsClient) getCreateRequest(ctx context.Context, resourceGroupName string, serverName string, threatProtectionName ThreatProtectionName, _ *ServerThreatProtectionSettingsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/advancedThreatProtectionSettings/{threatProtectionName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if serverName == "" { - return nil, errors.New("parameter serverName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{serverName}", url.PathEscape(serverName)) - if threatProtectionName == "" { - return nil, errors.New("parameter threatProtectionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{threatProtectionName}", url.PathEscape(string(threatProtectionName))) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-01-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *ServerThreatProtectionSettingsClient) getHandleResponse(resp *http.Response) (ServerThreatProtectionSettingsClientGetResponse, error) { - result := ServerThreatProtectionSettingsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ServerThreatProtectionSettingsModel); err != nil { - return ServerThreatProtectionSettingsClientGetResponse{}, err - } - return result, nil -} - -// NewListByServerPager - Get a list of server's Threat Protection state. -// -// Generated from API version 2025-01-01-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - serverName - The name of the server. -// - options - ServerThreatProtectionSettingsClientListByServerOptions contains the optional parameters for the ServerThreatProtectionSettingsClient.NewListByServerPager -// method. -func (client *ServerThreatProtectionSettingsClient) NewListByServerPager(resourceGroupName string, serverName string, options *ServerThreatProtectionSettingsClientListByServerOptions) *runtime.Pager[ServerThreatProtectionSettingsClientListByServerResponse] { - return runtime.NewPager(runtime.PagingHandler[ServerThreatProtectionSettingsClientListByServerResponse]{ - More: func(page ServerThreatProtectionSettingsClientListByServerResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *ServerThreatProtectionSettingsClientListByServerResponse) (ServerThreatProtectionSettingsClientListByServerResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "ServerThreatProtectionSettingsClient.NewListByServerPager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listByServerCreateRequest(ctx, resourceGroupName, serverName, options) - }, nil) - if err != nil { - return ServerThreatProtectionSettingsClientListByServerResponse{}, err - } - return client.listByServerHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listByServerCreateRequest creates the ListByServer request. -func (client *ServerThreatProtectionSettingsClient) listByServerCreateRequest(ctx context.Context, resourceGroupName string, serverName string, _ *ServerThreatProtectionSettingsClientListByServerOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/advancedThreatProtectionSettings" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if serverName == "" { - return nil, errors.New("parameter serverName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{serverName}", url.PathEscape(serverName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-01-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listByServerHandleResponse handles the ListByServer response. -func (client *ServerThreatProtectionSettingsClient) listByServerHandleResponse(resp *http.Response) (ServerThreatProtectionSettingsClientListByServerResponse, error) { - result := ServerThreatProtectionSettingsClientListByServerResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ServerThreatProtectionListResult); err != nil { - return ServerThreatProtectionSettingsClientListByServerResponse{}, err - } - return result, nil -} diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/serverthreatprotectionsettings_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/serverthreatprotectionsettings_client_example_test.go index d05e0e29cf00..4be0502caaa4 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/serverthreatprotectionsettings_client_example_test.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/serverthreatprotectionsettings_client_example_test.go @@ -18,73 +18,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v5" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b1f4d539964453ce8008e4b069e59885e12ba441/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ServerThreatProtectionSettingsListByServer.json -func ExampleServerThreatProtectionSettingsClient_NewListByServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewServerThreatProtectionSettingsClient().NewListByServerPager("threatprotection-6852", "threatprotection-2080", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ServerThreatProtectionListResult = armpostgresqlflexibleservers.ServerThreatProtectionListResult{ - // Value: []*armpostgresqlflexibleservers.ServerThreatProtectionSettingsModel{ - // { - // Name: to.Ptr("Default"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/advancedThreatProtectionSettings"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/threatprotection-6852/providers/Microsoft.DBforPostgreSQL/flexibleServers/threatprotection-2080/advancedThreatProtectionSettings/Default"), - // Properties: &armpostgresqlflexibleservers.ServerThreatProtectionProperties{ - // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-09-03T04:41:33.937Z"); return t}()), - // State: to.Ptr(armpostgresqlflexibleservers.ThreatProtectionStateEnabled), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b1f4d539964453ce8008e4b069e59885e12ba441/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ServerThreatProtectionSettingsGet.json -func ExampleServerThreatProtectionSettingsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewServerThreatProtectionSettingsClient().Get(ctx, "threatprotection-6852", "threatprotection-2080", armpostgresqlflexibleservers.ThreatProtectionNameDefault, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ServerThreatProtectionSettingsModel = armpostgresqlflexibleservers.ServerThreatProtectionSettingsModel{ - // Name: to.Ptr("Default"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/advancedThreatProtectionSettings"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/threatprotection-4799/providers/Microsoft.DBforPostgreSQL/flexibleServers/threatprotection-6440/advancedThreatProtectionSettings/Default"), - // Properties: &armpostgresqlflexibleservers.ServerThreatProtectionProperties{ - // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-09-03T04:41:33.937Z"); return t}()), - // State: to.Ptr(armpostgresqlflexibleservers.ThreatProtectionStateEnabled), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b1f4d539964453ce8008e4b069e59885e12ba441/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/ServerThreatProtectionSettingsCreateOrUpdate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/735d21dbd7e1cc446babf58860af4cca757d620d/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/AdvancedThreatProtectionSettingsCreateOrUpdate.json func ExampleServerThreatProtectionSettingsClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -95,28 +29,16 @@ func ExampleServerThreatProtectionSettingsClient_BeginCreateOrUpdate() { if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewServerThreatProtectionSettingsClient().BeginCreateOrUpdate(ctx, "threatprotection-4799", "threatprotection-6440", armpostgresqlflexibleservers.ThreatProtectionNameDefault, armpostgresqlflexibleservers.ServerThreatProtectionSettingsModel{ - Properties: &armpostgresqlflexibleservers.ServerThreatProtectionProperties{ + poller, err := clientFactory.NewServerThreatProtectionSettingsClient().BeginCreateOrUpdate(ctx, "exampleresourcegroup", "exampleserver", armpostgresqlflexibleservers.ThreatProtectionNameDefault, armpostgresqlflexibleservers.AdvancedThreatProtectionSettingsModel{ + Properties: &armpostgresqlflexibleservers.AdvancedThreatProtectionSettingsProperties{ State: to.Ptr(armpostgresqlflexibleservers.ThreatProtectionStateEnabled), }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } - res, err := poller.PollUntilDone(ctx, nil) + _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ServerThreatProtectionSettingsModel = armpostgresqlflexibleservers.ServerThreatProtectionSettingsModel{ - // Name: to.Ptr("Default"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/advancedThreatProtectionSettings"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/threatprotection-4799/providers/Microsoft.DBforPostgreSQL/flexibleServers/threatprotection-6440/advancedThreatProtectionSettings/Default"), - // Properties: &armpostgresqlflexibleservers.ServerThreatProtectionProperties{ - // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-09-03T04:41:33.937Z"); return t}()), - // State: to.Ptr(armpostgresqlflexibleservers.ThreatProtectionStateEnabled), - // }, - // } } diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/tuningconfiguration_client.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/tuningconfiguration_client.go deleted file mode 100644 index 6346da3d9318..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/tuningconfiguration_client.go +++ /dev/null @@ -1,515 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armpostgresqlflexibleservers - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// TuningConfigurationClient contains the methods for the TuningConfiguration group. -// Don't use this type directly, use NewTuningConfigurationClient() instead. -type TuningConfigurationClient struct { - internal *arm.Client - subscriptionID string -} - -// NewTuningConfigurationClient creates a new instance of TuningConfigurationClient with the specified values. -// - subscriptionID - The ID of the target subscription. The value must be an UUID. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewTuningConfigurationClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*TuningConfigurationClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &TuningConfigurationClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// BeginDisable - Disables the config tuning. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-01-01-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - serverName - The name of the server. -// - tuningOption - The name of the tuning option. -// - options - TuningConfigurationClientBeginDisableOptions contains the optional parameters for the TuningConfigurationClient.BeginDisable -// method. -func (client *TuningConfigurationClient) BeginDisable(ctx context.Context, resourceGroupName string, serverName string, tuningOption TuningOptionEnum, options *TuningConfigurationClientBeginDisableOptions) (*runtime.Poller[TuningConfigurationClientDisableResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.disable(ctx, resourceGroupName, serverName, tuningOption, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[TuningConfigurationClientDisableResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[TuningConfigurationClientDisableResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Disable - Disables the config tuning. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-01-01-preview -func (client *TuningConfigurationClient) disable(ctx context.Context, resourceGroupName string, serverName string, tuningOption TuningOptionEnum, options *TuningConfigurationClientBeginDisableOptions) (*http.Response, error) { - var err error - const operationName = "TuningConfigurationClient.BeginDisable" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.disableCreateRequest(ctx, resourceGroupName, serverName, tuningOption, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// disableCreateRequest creates the Disable request. -func (client *TuningConfigurationClient) disableCreateRequest(ctx context.Context, resourceGroupName string, serverName string, tuningOption TuningOptionEnum, _ *TuningConfigurationClientBeginDisableOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/tuningOptions/{tuningOption}/disable" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if serverName == "" { - return nil, errors.New("parameter serverName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{serverName}", url.PathEscape(serverName)) - if tuningOption == "" { - return nil, errors.New("parameter tuningOption cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{tuningOption}", url.PathEscape(string(tuningOption))) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-01-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// BeginEnable - Enables the config tuning. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-01-01-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - serverName - The name of the server. -// - tuningOption - The name of the tuning option. -// - options - TuningConfigurationClientBeginEnableOptions contains the optional parameters for the TuningConfigurationClient.BeginEnable -// method. -func (client *TuningConfigurationClient) BeginEnable(ctx context.Context, resourceGroupName string, serverName string, tuningOption TuningOptionEnum, options *TuningConfigurationClientBeginEnableOptions) (*runtime.Poller[TuningConfigurationClientEnableResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.enable(ctx, resourceGroupName, serverName, tuningOption, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[TuningConfigurationClientEnableResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[TuningConfigurationClientEnableResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Enable - Enables the config tuning. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-01-01-preview -func (client *TuningConfigurationClient) enable(ctx context.Context, resourceGroupName string, serverName string, tuningOption TuningOptionEnum, options *TuningConfigurationClientBeginEnableOptions) (*http.Response, error) { - var err error - const operationName = "TuningConfigurationClient.BeginEnable" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.enableCreateRequest(ctx, resourceGroupName, serverName, tuningOption, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// enableCreateRequest creates the Enable request. -func (client *TuningConfigurationClient) enableCreateRequest(ctx context.Context, resourceGroupName string, serverName string, tuningOption TuningOptionEnum, _ *TuningConfigurationClientBeginEnableOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/tuningOptions/{tuningOption}/enable" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if serverName == "" { - return nil, errors.New("parameter serverName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{serverName}", url.PathEscape(serverName)) - if tuningOption == "" { - return nil, errors.New("parameter tuningOption cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{tuningOption}", url.PathEscape(string(tuningOption))) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-01-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// NewListSessionDetailsPager - Gets the session details of a config tuning session. -// -// Generated from API version 2025-01-01-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - serverName - The name of the server. -// - tuningOption - The name of the tuning option. -// - sessionID - Guid of the objectId for the session. -// - options - TuningConfigurationClientListSessionDetailsOptions contains the optional parameters for the TuningConfigurationClient.NewListSessionDetailsPager -// method. -func (client *TuningConfigurationClient) NewListSessionDetailsPager(resourceGroupName string, serverName string, tuningOption TuningOptionEnum, sessionID string, options *TuningConfigurationClientListSessionDetailsOptions) *runtime.Pager[TuningConfigurationClientListSessionDetailsResponse] { - return runtime.NewPager(runtime.PagingHandler[TuningConfigurationClientListSessionDetailsResponse]{ - More: func(page TuningConfigurationClientListSessionDetailsResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *TuningConfigurationClientListSessionDetailsResponse) (TuningConfigurationClientListSessionDetailsResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "TuningConfigurationClient.NewListSessionDetailsPager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listSessionDetailsCreateRequest(ctx, resourceGroupName, serverName, tuningOption, sessionID, options) - }, nil) - if err != nil { - return TuningConfigurationClientListSessionDetailsResponse{}, err - } - return client.listSessionDetailsHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listSessionDetailsCreateRequest creates the ListSessionDetails request. -func (client *TuningConfigurationClient) listSessionDetailsCreateRequest(ctx context.Context, resourceGroupName string, serverName string, tuningOption TuningOptionEnum, sessionID string, _ *TuningConfigurationClientListSessionDetailsOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/tuningOptions/{tuningOption}/sessionDetails" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if serverName == "" { - return nil, errors.New("parameter serverName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{serverName}", url.PathEscape(serverName)) - if tuningOption == "" { - return nil, errors.New("parameter tuningOption cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{tuningOption}", url.PathEscape(string(tuningOption))) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-01-01-preview") - reqQP.Set("sessionId", sessionID) - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listSessionDetailsHandleResponse handles the ListSessionDetails response. -func (client *TuningConfigurationClient) listSessionDetailsHandleResponse(resp *http.Response) (TuningConfigurationClientListSessionDetailsResponse, error) { - result := TuningConfigurationClientListSessionDetailsResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.SessionDetailsListResult); err != nil { - return TuningConfigurationClientListSessionDetailsResponse{}, err - } - return result, nil -} - -// NewListSessionsPager - Gets up the config tuning session status. -// -// Generated from API version 2025-01-01-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - serverName - The name of the server. -// - tuningOption - The name of the tuning option. -// - options - TuningConfigurationClientListSessionsOptions contains the optional parameters for the TuningConfigurationClient.NewListSessionsPager -// method. -func (client *TuningConfigurationClient) NewListSessionsPager(resourceGroupName string, serverName string, tuningOption TuningOptionEnum, options *TuningConfigurationClientListSessionsOptions) *runtime.Pager[TuningConfigurationClientListSessionsResponse] { - return runtime.NewPager(runtime.PagingHandler[TuningConfigurationClientListSessionsResponse]{ - More: func(page TuningConfigurationClientListSessionsResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *TuningConfigurationClientListSessionsResponse) (TuningConfigurationClientListSessionsResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "TuningConfigurationClient.NewListSessionsPager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listSessionsCreateRequest(ctx, resourceGroupName, serverName, tuningOption, options) - }, nil) - if err != nil { - return TuningConfigurationClientListSessionsResponse{}, err - } - return client.listSessionsHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listSessionsCreateRequest creates the ListSessions request. -func (client *TuningConfigurationClient) listSessionsCreateRequest(ctx context.Context, resourceGroupName string, serverName string, tuningOption TuningOptionEnum, _ *TuningConfigurationClientListSessionsOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/tuningOptions/{tuningOption}/sessions" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if serverName == "" { - return nil, errors.New("parameter serverName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{serverName}", url.PathEscape(serverName)) - if tuningOption == "" { - return nil, errors.New("parameter tuningOption cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{tuningOption}", url.PathEscape(string(tuningOption))) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-01-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listSessionsHandleResponse handles the ListSessions response. -func (client *TuningConfigurationClient) listSessionsHandleResponse(resp *http.Response) (TuningConfigurationClientListSessionsResponse, error) { - result := TuningConfigurationClientListSessionsResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.SessionsListResult); err != nil { - return TuningConfigurationClientListSessionsResponse{}, err - } - return result, nil -} - -// BeginStartSession - Starts up the config tuning session. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-01-01-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - serverName - The name of the server. -// - tuningOption - The name of the tuning option. -// - configTuningRequest - The parameters for tuning request. -// - options - TuningConfigurationClientBeginStartSessionOptions contains the optional parameters for the TuningConfigurationClient.BeginStartSession -// method. -func (client *TuningConfigurationClient) BeginStartSession(ctx context.Context, resourceGroupName string, serverName string, tuningOption TuningOptionEnum, configTuningRequest ConfigTuningRequestParameter, options *TuningConfigurationClientBeginStartSessionOptions) (*runtime.Poller[TuningConfigurationClientStartSessionResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.startSession(ctx, resourceGroupName, serverName, tuningOption, configTuningRequest, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[TuningConfigurationClientStartSessionResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[TuningConfigurationClientStartSessionResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// StartSession - Starts up the config tuning session. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-01-01-preview -func (client *TuningConfigurationClient) startSession(ctx context.Context, resourceGroupName string, serverName string, tuningOption TuningOptionEnum, configTuningRequest ConfigTuningRequestParameter, options *TuningConfigurationClientBeginStartSessionOptions) (*http.Response, error) { - var err error - const operationName = "TuningConfigurationClient.BeginStartSession" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.startSessionCreateRequest(ctx, resourceGroupName, serverName, tuningOption, configTuningRequest, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// startSessionCreateRequest creates the StartSession request. -func (client *TuningConfigurationClient) startSessionCreateRequest(ctx context.Context, resourceGroupName string, serverName string, tuningOption TuningOptionEnum, configTuningRequest ConfigTuningRequestParameter, _ *TuningConfigurationClientBeginStartSessionOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/tuningOptions/{tuningOption}/startSession" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if serverName == "" { - return nil, errors.New("parameter serverName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{serverName}", url.PathEscape(serverName)) - if tuningOption == "" { - return nil, errors.New("parameter tuningOption cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{tuningOption}", url.PathEscape(string(tuningOption))) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-01-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, configTuningRequest); err != nil { - return nil, err - } - return req, nil -} - -// BeginStopSession - Stops the config tuning session. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-01-01-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - serverName - The name of the server. -// - tuningOption - The name of the tuning option. -// - options - TuningConfigurationClientBeginStopSessionOptions contains the optional parameters for the TuningConfigurationClient.BeginStopSession -// method. -func (client *TuningConfigurationClient) BeginStopSession(ctx context.Context, resourceGroupName string, serverName string, tuningOption TuningOptionEnum, options *TuningConfigurationClientBeginStopSessionOptions) (*runtime.Poller[TuningConfigurationClientStopSessionResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.stopSession(ctx, resourceGroupName, serverName, tuningOption, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[TuningConfigurationClientStopSessionResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[TuningConfigurationClientStopSessionResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// StopSession - Stops the config tuning session. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-01-01-preview -func (client *TuningConfigurationClient) stopSession(ctx context.Context, resourceGroupName string, serverName string, tuningOption TuningOptionEnum, options *TuningConfigurationClientBeginStopSessionOptions) (*http.Response, error) { - var err error - const operationName = "TuningConfigurationClient.BeginStopSession" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.stopSessionCreateRequest(ctx, resourceGroupName, serverName, tuningOption, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// stopSessionCreateRequest creates the StopSession request. -func (client *TuningConfigurationClient) stopSessionCreateRequest(ctx context.Context, resourceGroupName string, serverName string, tuningOption TuningOptionEnum, _ *TuningConfigurationClientBeginStopSessionOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/tuningOptions/{tuningOption}/stopSession" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if serverName == "" { - return nil, errors.New("parameter serverName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{serverName}", url.PathEscape(serverName)) - if tuningOption == "" { - return nil, errors.New("parameter tuningOption cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{tuningOption}", url.PathEscape(string(tuningOption))) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-01-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/tuningconfiguration_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/tuningconfiguration_client_example_test.go deleted file mode 100644 index 1209fe4a47fa..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/tuningconfiguration_client_example_test.go +++ /dev/null @@ -1,195 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armpostgresqlflexibleservers_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v5" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b1f4d539964453ce8008e4b069e59885e12ba441/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/TuningConfiguration_Enable.json -func ExampleTuningConfigurationClient_BeginEnable() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewTuningConfigurationClient().BeginEnable(ctx, "testrg", "testserver", armpostgresqlflexibleservers.TuningOptionEnumConfiguration, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b1f4d539964453ce8008e4b069e59885e12ba441/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/TuningConfiguration_Disable.json -func ExampleTuningConfigurationClient_BeginDisable() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewTuningConfigurationClient().BeginDisable(ctx, "testrg", "testserver", armpostgresqlflexibleservers.TuningOptionEnumConfiguration, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b1f4d539964453ce8008e4b069e59885e12ba441/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/TuningConfiguration_StartSession.json -func ExampleTuningConfigurationClient_BeginStartSession() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewTuningConfigurationClient().BeginStartSession(ctx, "testrg", "testserver", armpostgresqlflexibleservers.TuningOptionEnumConfiguration, armpostgresqlflexibleservers.ConfigTuningRequestParameter{ - AllowServerRestarts: to.Ptr(false), - TargetImprovementMetric: to.Ptr("targetImprovementMetric"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b1f4d539964453ce8008e4b069e59885e12ba441/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/TuningConfiguration_StopSession.json -func ExampleTuningConfigurationClient_BeginStopSession() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewTuningConfigurationClient().BeginStopSession(ctx, "testrg", "testserver", armpostgresqlflexibleservers.TuningOptionEnumConfiguration, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b1f4d539964453ce8008e4b069e59885e12ba441/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/TuningConfiguration_ListSessions.json -func ExampleTuningConfigurationClient_NewListSessionsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewTuningConfigurationClient().NewListSessionsPager("testrg", "testserver", armpostgresqlflexibleservers.TuningOptionEnumConfiguration, nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.SessionsListResult = armpostgresqlflexibleservers.SessionsListResult{ - // Value: []*armpostgresqlflexibleservers.SessionResource{ - // { - // PostTuningAqr: to.Ptr("1.818203395454569"), - // PostTuningTps: to.Ptr("2.594203762997024"), - // PreTuningAqr: to.Ptr("1.9069379374999662"), - // PreTuningTps: to.Ptr("2.592924534523614"), - // SessionID: to.Ptr("29f70be5-74ac-498b-949c-38b0997b4290"), - // SessionStartTime: to.Ptr("09/26/2024 02:13:05"), - // Status: to.Ptr("completed"), - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b1f4d539964453ce8008e4b069e59885e12ba441/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/TuningConfiguration_ListSessionDetails.json -func ExampleTuningConfigurationClient_NewListSessionDetailsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewTuningConfigurationClient().NewListSessionDetailsPager("testrg", "testserver", armpostgresqlflexibleservers.TuningOptionEnumConfiguration, "oooooooo-oooo-oooo-oooo-oooooooooooo", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.SessionDetailsListResult = armpostgresqlflexibleservers.SessionDetailsListResult{ - // Value: []*armpostgresqlflexibleservers.SessionDetailsResource{ - // { - // AppliedConfiguration: to.Ptr("{\"work_mem\": 4096, \"max_wal_size\": 12288, \"min_wal_size\": 80, \"seq_page_cost\": 1, \"bgwriter_delay\": 20, \"random_page_cost\": 2, \"max_parallel_workers\": 8, \"bgwriter_lru_maxpages\": 100, \"effective_io_concurrency\": 1, \"max_parallel_workers_per_gather\": 2}"), - // AverageQueryRuntimeMs: to.Ptr("0.38"), - // IterationID: to.Ptr("1"), - // IterationStartTime: to.Ptr("02/26/2025 22:57:30"), - // SessionID: to.Ptr("7fb4b3c1-8d77-4fae-82d8-fcd26c892d75"), - // TransactionsPerSecond: to.Ptr("2.86"), - // }, - // { - // AppliedConfiguration: to.Ptr("{\"work_mem\": 53566, \"max_wal_size\": 24576, \"min_wal_size\": 6144, \"seq_page_cost\": 1, \"bgwriter_delay\": 200, \"random_page_cost\": 3.5, \"max_parallel_workers\": 2, \"bgwriter_lru_maxpages\": 100, \"effective_io_concurrency\": 300, \"max_parallel_workers_per_gather\": 2}"), - // AverageQueryRuntimeMs: to.Ptr("0.40"), - // IterationID: to.Ptr("2"), - // IterationStartTime: to.Ptr("02/26/2025 23:02:32"), - // SessionID: to.Ptr("7fb4b3c1-8d77-4fae-82d8-fcd26c892d75"), - // TransactionsPerSecond: to.Ptr("2.81"), - // }, - // { - // AppliedConfiguration: to.Ptr("{\"work_mem\": 9681, \"max_wal_size\": 4096, \"min_wal_size\": 1024, \"seq_page_cost\": 1, \"bgwriter_delay\": 150, \"random_page_cost\": 1.5, \"max_parallel_workers\": 6, \"bgwriter_lru_maxpages\": 300, \"effective_io_concurrency\": 400, \"max_parallel_workers_per_gather\": 2}"), - // AverageQueryRuntimeMs: to.Ptr("0.42"), - // IterationID: to.Ptr("3"), - // IterationStartTime: to.Ptr("02/26/2025 23:07:33"), - // SessionID: to.Ptr("7fb4b3c1-8d77-4fae-82d8-fcd26c892d75"), - // TransactionsPerSecond: to.Ptr("2.67"), - // }}, - // } - } -} diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/tuningindex_client.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/tuningindex_client.go deleted file mode 100644 index b8bd8f23141d..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/tuningindex_client.go +++ /dev/null @@ -1,114 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armpostgresqlflexibleservers - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// TuningIndexClient contains the methods for the TuningIndex group. -// Don't use this type directly, use NewTuningIndexClient() instead. -type TuningIndexClient struct { - internal *arm.Client - subscriptionID string -} - -// NewTuningIndexClient creates a new instance of TuningIndexClient with the specified values. -// - subscriptionID - The ID of the target subscription. The value must be an UUID. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewTuningIndexClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*TuningIndexClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &TuningIndexClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// NewListRecommendationsPager - Retrieve the list of available tuning index recommendations. -// -// Generated from API version 2025-01-01-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - serverName - The name of the server. -// - tuningOption - The name of the tuning option. -// - options - TuningIndexClientListRecommendationsOptions contains the optional parameters for the TuningIndexClient.NewListRecommendationsPager -// method. -func (client *TuningIndexClient) NewListRecommendationsPager(resourceGroupName string, serverName string, tuningOption TuningOptionEnum, options *TuningIndexClientListRecommendationsOptions) *runtime.Pager[TuningIndexClientListRecommendationsResponse] { - return runtime.NewPager(runtime.PagingHandler[TuningIndexClientListRecommendationsResponse]{ - More: func(page TuningIndexClientListRecommendationsResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *TuningIndexClientListRecommendationsResponse) (TuningIndexClientListRecommendationsResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "TuningIndexClient.NewListRecommendationsPager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listRecommendationsCreateRequest(ctx, resourceGroupName, serverName, tuningOption, options) - }, nil) - if err != nil { - return TuningIndexClientListRecommendationsResponse{}, err - } - return client.listRecommendationsHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listRecommendationsCreateRequest creates the ListRecommendations request. -func (client *TuningIndexClient) listRecommendationsCreateRequest(ctx context.Context, resourceGroupName string, serverName string, tuningOption TuningOptionEnum, options *TuningIndexClientListRecommendationsOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/tuningOptions/{tuningOption}/recommendations" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if serverName == "" { - return nil, errors.New("parameter serverName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{serverName}", url.PathEscape(serverName)) - if tuningOption == "" { - return nil, errors.New("parameter tuningOption cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{tuningOption}", url.PathEscape(string(tuningOption))) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-01-01-preview") - if options != nil && options.RecommendationType != nil { - reqQP.Set("recommendationType", string(*options.RecommendationType)) - } - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listRecommendationsHandleResponse handles the ListRecommendations response. -func (client *TuningIndexClient) listRecommendationsHandleResponse(resp *http.Response) (TuningIndexClientListRecommendationsResponse, error) { - result := TuningIndexClientListRecommendationsResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.IndexRecommendationListResult); err != nil { - return TuningIndexClientListRecommendationsResponse{}, err - } - return result, nil -} diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/tuningindex_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/tuningindex_client_example_test.go deleted file mode 100644 index ac13077798ca..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/tuningindex_client_example_test.go +++ /dev/null @@ -1,359 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armpostgresqlflexibleservers_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v5" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b1f4d539964453ce8008e4b069e59885e12ba441/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/TuningIndex_GetFilteredRecommendations.json -func ExampleTuningIndexClient_NewListRecommendationsPager_tuningIndexListFilteredRecommendations() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewTuningIndexClient().NewListRecommendationsPager("testrg", "pgtestrecs", armpostgresqlflexibleservers.TuningOptionEnumIndex, &armpostgresqlflexibleservers.TuningIndexClientListRecommendationsOptions{RecommendationType: to.Ptr(armpostgresqlflexibleservers.RecommendationTypeCreateIndex)}) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.IndexRecommendationListResult = armpostgresqlflexibleservers.IndexRecommendationListResult{ - // Value: []*armpostgresqlflexibleservers.IndexRecommendationResource{ - // { - // Name: to.Ptr("CreateIndex_ecommerce_public_ps_suppkey_idx"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/tuningOptions/index"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/pgtestrecs/tuningOptions/index/recommendations/1"), - // Properties: &armpostgresqlflexibleservers.IndexRecommendationResourceProperties{ - // AnalyzedWorkload: &armpostgresqlflexibleservers.IndexRecommendationResourcePropertiesAnalyzedWorkload{ - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-10-12T16:31:12.063Z"); return t}()), - // QueryCount: to.Ptr[int32](25), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-10-12T04:31:12.063Z"); return t}()), - // }, - // EstimatedImpact: []*armpostgresqlflexibleservers.ImpactRecord{ - // { - // AbsoluteValue: to.Ptr[float64](15.3671875), - // DimensionName: to.Ptr("IndexSize"), - // Unit: to.Ptr("MB"), - // }, - // { - // AbsoluteValue: to.Ptr[float64](99.67668452400453), - // DimensionName: to.Ptr("QueryCostImprovement"), - // QueryID: to.Ptr[int64](-3775242682326862300), - // Unit: to.Ptr("Percentage"), - // }, - // { - // AbsoluteValue: to.Ptr[float64](85.56742436827899), - // DimensionName: to.Ptr("QueryCostImprovement"), - // QueryID: to.Ptr[int64](6829938984138799000), - // Unit: to.Ptr("Percentage"), - // }}, - // ImplementationDetails: &armpostgresqlflexibleservers.IndexRecommendationResourcePropertiesImplementationDetails{ - // Method: to.Ptr("SQL"), - // Script: to.Ptr("create index concurrently ps_suppkey_idx on public.partsupp(ps_suppkey)"), - // }, - // ImprovedQueryIDs: []*int64{ - // to.Ptr[int64](-3775242682326862300), - // to.Ptr[int64](6829938984138799000)}, - // InitialRecommendedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-10-12T16:31:32.306Z"); return t}()), - // LastRecommendedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-10-12T16:31:32.306Z"); return t}()), - // RecommendationReason: to.Ptr("Column \"partsupp\".\"ps_suppkey\" appear in Join On clause(s) in query -3775242682326862475; Column \"partsupp\".\"ps_suppkey\" appear in Join On clause(s) in query 6829938984138799352;"), - // RecommendationType: to.Ptr(armpostgresqlflexibleservers.RecommendationTypeEnumCreateIndex), - // TimesRecommended: to.Ptr[int32](1), - // Details: &armpostgresqlflexibleservers.IndexRecommendationDetails{ - // Schema: to.Ptr("public"), - // DatabaseName: to.Ptr("ecommerce"), - // IndexColumns: []*string{ - // to.Ptr("\"partsupp\".\"ps_suppkey\"")}, - // IndexName: to.Ptr("ps_suppkey_idx"), - // IndexType: to.Ptr("BTREE"), - // Table: to.Ptr("partsupp"), - // }, - // }, - // }, - // { - // Name: to.Ptr("CreateIndex_ecommerce_public_ps_partkey_idx"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/tuningOptions/index"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/pgtestrecs/tuningOptions/index/recommendations/2"), - // Properties: &armpostgresqlflexibleservers.IndexRecommendationResourceProperties{ - // AnalyzedWorkload: &armpostgresqlflexibleservers.IndexRecommendationResourcePropertiesAnalyzedWorkload{ - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-10-12T16:31:12.063Z"); return t}()), - // QueryCount: to.Ptr[int32](25), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-10-12T04:31:12.063Z"); return t}()), - // }, - // EstimatedImpact: []*armpostgresqlflexibleservers.ImpactRecord{ - // { - // AbsoluteValue: to.Ptr[float64](15.3671875), - // DimensionName: to.Ptr("IndexSize"), - // Unit: to.Ptr("MB"), - // }, - // { - // AbsoluteValue: to.Ptr[float64](99.67668452400453), - // DimensionName: to.Ptr("QueryCostImprovement"), - // QueryID: to.Ptr[int64](-3775242682326862300), - // Unit: to.Ptr("Percentage"), - // }, - // { - // AbsoluteValue: to.Ptr[float64](79.06603712430707), - // DimensionName: to.Ptr("QueryCostImprovement"), - // QueryID: to.Ptr[int64](4735984994430715000), - // Unit: to.Ptr("Percentage"), - // }}, - // ImplementationDetails: &armpostgresqlflexibleservers.IndexRecommendationResourcePropertiesImplementationDetails{ - // Method: to.Ptr("SQL"), - // Script: to.Ptr("create index concurrently ps_partkey_idx on public.partsupp(ps_partkey)"), - // }, - // ImprovedQueryIDs: []*int64{ - // to.Ptr[int64](-3775242682326862300), - // to.Ptr[int64](4735984994430715000)}, - // InitialRecommendedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-10-12T16:31:32.311Z"); return t}()), - // LastRecommendedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-10-12T16:31:32.311Z"); return t}()), - // RecommendationReason: to.Ptr("Column \"partsupp\".\"ps_partkey\" appear in Equal Predicate clause(s) in query -3775242682326862475; Column \"partsupp\".\"ps_partkey\" appear in Join On clause(s) in query 4735984994430714735;"), - // RecommendationType: to.Ptr(armpostgresqlflexibleservers.RecommendationTypeEnumCreateIndex), - // TimesRecommended: to.Ptr[int32](1), - // Details: &armpostgresqlflexibleservers.IndexRecommendationDetails{ - // Schema: to.Ptr("public"), - // DatabaseName: to.Ptr("ecommerce"), - // IndexColumns: []*string{ - // to.Ptr("\"partsupp\".\"ps_partkey\"")}, - // IndexName: to.Ptr("ps_partkey_idx"), - // IndexType: to.Ptr("BTREE"), - // Table: to.Ptr("partsupp"), - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b1f4d539964453ce8008e4b069e59885e12ba441/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/TuningIndex_GetRecommendations.json -func ExampleTuningIndexClient_NewListRecommendationsPager_tuningIndexListRecommendations() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewTuningIndexClient().NewListRecommendationsPager("testrg", "pgtestsvc4", armpostgresqlflexibleservers.TuningOptionEnumIndex, &armpostgresqlflexibleservers.TuningIndexClientListRecommendationsOptions{RecommendationType: nil}) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.IndexRecommendationListResult = armpostgresqlflexibleservers.IndexRecommendationListResult{ - // Value: []*armpostgresqlflexibleservers.IndexRecommendationResource{ - // { - // Name: to.Ptr("CreateIndex_ecommerce_public_c_custkey_idx"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/tuningOptions/index"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/pgtestsvc4/tuningOptions/index/recommendations/14"), - // Properties: &armpostgresqlflexibleservers.IndexRecommendationResourceProperties{ - // AnalyzedWorkload: &armpostgresqlflexibleservers.IndexRecommendationResourcePropertiesAnalyzedWorkload{ - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-05-31T19:14:34.412Z"); return t}()), - // QueryCount: to.Ptr[int32](25), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-05-31T07:14:34.412Z"); return t}()), - // }, - // EstimatedImpact: []*armpostgresqlflexibleservers.ImpactRecord{ - // { - // AbsoluteValue: to.Ptr[float64](2.890625), - // DimensionName: to.Ptr("IndexSize"), - // Unit: to.Ptr("MB"), - // }, - // { - // AbsoluteValue: to.Ptr[float64](56.75424930485546), - // DimensionName: to.Ptr("QueryCostImprovement"), - // QueryID: to.Ptr[int64](-5265741861999699000), - // Unit: to.Ptr("Percentage"), - // }, - // { - // AbsoluteValue: to.Ptr[float64](43.67826245896799), - // DimensionName: to.Ptr("QueryCostImprovement"), - // QueryID: to.Ptr[int64](234118651516953380), - // Unit: to.Ptr("Percentage"), - // }, - // { - // AbsoluteValue: to.Ptr[float64](10.176593636567572), - // DimensionName: to.Ptr("QueryCostImprovement"), - // QueryID: to.Ptr[int64](-632598438706436700), - // Unit: to.Ptr("Percentage"), - // }}, - // ImplementationDetails: &armpostgresqlflexibleservers.IndexRecommendationResourcePropertiesImplementationDetails{ - // Method: to.Ptr("SQL"), - // Script: to.Ptr("create index concurrently c_custkey_idx on public.customer(c_custkey)"), - // }, - // ImprovedQueryIDs: []*int64{ - // to.Ptr[int64](-5265741861999699000), - // to.Ptr[int64](-632598438706436700), - // to.Ptr[int64](234118651516953380)}, - // InitialRecommendedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-05-31T08:13:55.382Z"); return t}()), - // LastRecommendedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-05-31T19:14:34.412Z"); return t}()), - // RecommendationReason: to.Ptr("Column \"customer\".\"c_custkey\" appear in Join On clause(s) in query -5265741861999699191; Column \"customer\".\"c_custkey\" appear in Join On clause(s) in query -632598438706436788; Column \"customer\".\"c_custkey\" appear in Join On clause(s) in query 234118651516953391;"), - // RecommendationType: to.Ptr(armpostgresqlflexibleservers.RecommendationTypeEnumCreateIndex), - // TimesRecommended: to.Ptr[int32](2), - // Details: &armpostgresqlflexibleservers.IndexRecommendationDetails{ - // Schema: to.Ptr("public"), - // DatabaseName: to.Ptr("ecommerce"), - // IndexColumns: []*string{ - // to.Ptr("\"customer\".\"c_custkey\"")}, - // IndexName: to.Ptr("c_custkey_idx"), - // IndexType: to.Ptr("BTREE"), - // Table: to.Ptr("customer"), - // }, - // }, - // }, - // { - // Name: to.Ptr("CreateIndex_ecommerce_public_l_orderkey_idx"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/tuningOptions/index"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/pgtestsvc4/tuningOptions/index/recommendations/11"), - // Properties: &armpostgresqlflexibleservers.IndexRecommendationResourceProperties{ - // AnalyzedWorkload: &armpostgresqlflexibleservers.IndexRecommendationResourcePropertiesAnalyzedWorkload{ - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-05-31T19:14:34.412Z"); return t}()), - // QueryCount: to.Ptr[int32](25), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-05-31T07:14:34.412Z"); return t}()), - // }, - // EstimatedImpact: []*armpostgresqlflexibleservers.ImpactRecord{ - // { - // AbsoluteValue: to.Ptr[float64](115.21875), - // DimensionName: to.Ptr("IndexSize"), - // Unit: to.Ptr("MB"), - // }, - // { - // AbsoluteValue: to.Ptr[float64](63.42250763539086), - // DimensionName: to.Ptr("QueryCostImprovement"), - // QueryID: to.Ptr[int64](-1887467119476231700), - // Unit: to.Ptr("Percentage"), - // }, - // { - // AbsoluteValue: to.Ptr[float64](56.75424930485546), - // DimensionName: to.Ptr("QueryCostImprovement"), - // QueryID: to.Ptr[int64](-5265741861999699000), - // Unit: to.Ptr("Percentage"), - // }, - // { - // AbsoluteValue: to.Ptr[float64](77.23764140869261), - // DimensionName: to.Ptr("QueryCostImprovement"), - // QueryID: to.Ptr[int64](-5259344436787616000), - // Unit: to.Ptr("Percentage"), - // }, - // { - // AbsoluteValue: to.Ptr[float64](43.67826245896799), - // DimensionName: to.Ptr("QueryCostImprovement"), - // QueryID: to.Ptr[int64](234118651516953380), - // Unit: to.Ptr("Percentage"), - // }, - // { - // AbsoluteValue: to.Ptr[float64](75.73857546652877), - // DimensionName: to.Ptr("QueryCostImprovement"), - // QueryID: to.Ptr[int64](-2174336608863105800), - // Unit: to.Ptr("Percentage"), - // }}, - // ImplementationDetails: &armpostgresqlflexibleservers.IndexRecommendationResourcePropertiesImplementationDetails{ - // Method: to.Ptr("SQL"), - // Script: to.Ptr("create index concurrently l_orderkey_idx on public.lineitem(l_orderkey)"), - // }, - // ImprovedQueryIDs: []*int64{ - // to.Ptr[int64](-5265741861999699000), - // to.Ptr[int64](-5259344436787616000), - // to.Ptr[int64](-2174336608863105800), - // to.Ptr[int64](-1887467119476231700), - // to.Ptr[int64](234118651516953380)}, - // InitialRecommendedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-05-31T08:13:55.382Z"); return t}()), - // LastRecommendedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-05-31T19:14:34.412Z"); return t}()), - // RecommendationReason: to.Ptr("Column \"lineitem\".\"l_orderkey\" appear in Join On clause(s) in query -5265741861999699191; Column \"lineitem\".\"l_orderkey\" appear in Join On clause(s) in query -5259344436787615838; Column \"lineitem\".\"l_orderkey\" appear in Join On clause(s) in query -2174336608863105762; Column \"lineitem\".\"l_orderkey\" appear in Equal Predicate clause(s) in query -1887467119476231661; Column \"lineitem\".\"l_orderkey\" appear in Join On clause(s) in query 234118651516953391;"), - // RecommendationType: to.Ptr(armpostgresqlflexibleservers.RecommendationTypeEnumCreateIndex), - // TimesRecommended: to.Ptr[int32](2), - // Details: &armpostgresqlflexibleservers.IndexRecommendationDetails{ - // Schema: to.Ptr("public"), - // DatabaseName: to.Ptr("ecommerce"), - // IndexColumns: []*string{ - // to.Ptr("\"lineitem\".\"l_orderkey\"")}, - // IndexName: to.Ptr("l_orderkey_idx"), - // IndexType: to.Ptr("BTREE"), - // Table: to.Ptr("lineitem"), - // }, - // }, - // }, - // { - // Name: to.Ptr("CreateIndex_ecommerce_public_l_orderkey_l_shipdate_idx"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/tuningOptions/index"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/pgtestsvc4/tuningOptions/index/recommendations/18"), - // Properties: &armpostgresqlflexibleservers.IndexRecommendationResourceProperties{ - // AnalyzedWorkload: &armpostgresqlflexibleservers.IndexRecommendationResourcePropertiesAnalyzedWorkload{ - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-05-31T19:14:34.412Z"); return t}()), - // QueryCount: to.Ptr[int32](25), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-05-31T07:14:34.412Z"); return t}()), - // }, - // EstimatedImpact: []*armpostgresqlflexibleservers.ImpactRecord{ - // { - // AbsoluteValue: to.Ptr[float64](161.140625), - // DimensionName: to.Ptr("IndexSize"), - // Unit: to.Ptr("MB"), - // }, - // { - // AbsoluteValue: to.Ptr[float64](43.07835695205126), - // DimensionName: to.Ptr("QueryCostImprovement"), - // QueryID: to.Ptr[int64](-6263488632059809000), - // Unit: to.Ptr("Percentage"), - // }, - // { - // AbsoluteValue: to.Ptr[float64](83.06572136980492), - // DimensionName: to.Ptr("QueryCostImprovement"), - // QueryID: to.Ptr[int64](-2436244725743338500), - // Unit: to.Ptr("Percentage"), - // }}, - // ImplementationDetails: &armpostgresqlflexibleservers.IndexRecommendationResourcePropertiesImplementationDetails{ - // Method: to.Ptr("SQL"), - // Script: to.Ptr("create index concurrently l_orderkey_l_shipdate_idx on public.lineitem(l_orderkey,l_shipdate)"), - // }, - // ImprovedQueryIDs: []*int64{ - // to.Ptr[int64](-6263488632059809000), - // to.Ptr[int64](-2436244725743338500)}, - // InitialRecommendedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-05-31T08:13:55.382Z"); return t}()), - // LastRecommendedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-05-31T19:14:34.412Z"); return t}()), - // RecommendationReason: to.Ptr("Column \"lineitem\".\"l_orderkey\" appear in Join On clause(s) in query -6263488632059808423; Column \"lineitem\".\"l_shipdate\" appear in Non-Equal Predicate clause(s) in query -6263488632059808423;"), - // RecommendationType: to.Ptr(armpostgresqlflexibleservers.RecommendationTypeEnumCreateIndex), - // TimesRecommended: to.Ptr[int32](2), - // Details: &armpostgresqlflexibleservers.IndexRecommendationDetails{ - // Schema: to.Ptr("public"), - // DatabaseName: to.Ptr("ecommerce"), - // IndexColumns: []*string{ - // to.Ptr("\"lineitem\".\"l_orderkey\""), - // to.Ptr("\"lineitem\".\"l_shipdate\"")}, - // IndexName: to.Ptr("l_orderkey_l_shipdate_idx"), - // IndexType: to.Ptr("BTREE"), - // Table: to.Ptr("lineitem"), - // }, - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/tuningoptions_client.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/tuningoptions_client.go index 0cddb6bb8967..098da7948e26 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/tuningoptions_client.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/tuningoptions_client.go @@ -27,7 +27,7 @@ type TuningOptionsClient struct { // NewTuningOptionsClient creates a new instance of TuningOptionsClient with the specified values. // - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. +// - options - Contains optional client configuration. Pass nil to accept the default values. func NewTuningOptionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*TuningOptionsClient, error) { cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) if err != nil { @@ -40,15 +40,15 @@ func NewTuningOptionsClient(subscriptionID string, credential azcore.TokenCreden return client, nil } -// Get - Retrieve the tuning option on a server. +// Get - Gets the tuning options of a server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-01-01-preview +// Generated from API version 2025-08-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - tuningOption - The name of the tuning option. // - options - TuningOptionsClientGetOptions contains the optional parameters for the TuningOptionsClient.Get method. -func (client *TuningOptionsClient) Get(ctx context.Context, resourceGroupName string, serverName string, tuningOption TuningOptionEnum, options *TuningOptionsClientGetOptions) (TuningOptionsClientGetResponse, error) { +func (client *TuningOptionsClient) Get(ctx context.Context, resourceGroupName string, serverName string, tuningOption TuningOptionParameterEnum, options *TuningOptionsClientGetOptions) (TuningOptionsClientGetResponse, error) { var err error const operationName = "TuningOptionsClient.Get" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) @@ -71,7 +71,7 @@ func (client *TuningOptionsClient) Get(ctx context.Context, resourceGroupName st } // getCreateRequest creates the Get request. -func (client *TuningOptionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, serverName string, tuningOption TuningOptionEnum, _ *TuningOptionsClientGetOptions) (*policy.Request, error) { +func (client *TuningOptionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, serverName string, tuningOption TuningOptionParameterEnum, _ *TuningOptionsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/tuningOptions/{tuningOption}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -94,7 +94,7 @@ func (client *TuningOptionsClient) getCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-01-01-preview") + reqQP.Set("api-version", "2025-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -103,15 +103,15 @@ func (client *TuningOptionsClient) getCreateRequest(ctx context.Context, resourc // getHandleResponse handles the Get response. func (client *TuningOptionsClient) getHandleResponse(resp *http.Response) (TuningOptionsClientGetResponse, error) { result := TuningOptionsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.TuningOptionsResource); err != nil { + if err := runtime.UnmarshalAsJSON(resp, &result.TuningOptions); err != nil { return TuningOptionsClientGetResponse{}, err } return result, nil } -// NewListByServerPager - Retrieve the list of available tuning options. +// NewListByServerPager - Lists the tuning options of a server. // -// Generated from API version 2025-01-01-preview +// Generated from API version 2025-08-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - options - TuningOptionsClientListByServerOptions contains the optional parameters for the TuningOptionsClient.NewListByServerPager @@ -159,7 +159,7 @@ func (client *TuningOptionsClient) listByServerCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-01-01-preview") + reqQP.Set("api-version", "2025-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -168,8 +168,81 @@ func (client *TuningOptionsClient) listByServerCreateRequest(ctx context.Context // listByServerHandleResponse handles the ListByServer response. func (client *TuningOptionsClient) listByServerHandleResponse(resp *http.Response) (TuningOptionsClientListByServerResponse, error) { result := TuningOptionsClientListByServerResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.TuningOptionsListResult); err != nil { + if err := runtime.UnmarshalAsJSON(resp, &result.TuningOptionsList); err != nil { return TuningOptionsClientListByServerResponse{}, err } return result, nil } + +// NewListRecommendationsPager - Lists available object recommendations. +// +// Generated from API version 2025-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serverName - The name of the server. +// - tuningOption - The name of the tuning option. +// - options - TuningOptionsClientListRecommendationsOptions contains the optional parameters for the TuningOptionsClient.NewListRecommendationsPager +// method. +func (client *TuningOptionsClient) NewListRecommendationsPager(resourceGroupName string, serverName string, tuningOption TuningOptionParameterEnum, options *TuningOptionsClientListRecommendationsOptions) *runtime.Pager[TuningOptionsClientListRecommendationsResponse] { + return runtime.NewPager(runtime.PagingHandler[TuningOptionsClientListRecommendationsResponse]{ + More: func(page TuningOptionsClientListRecommendationsResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *TuningOptionsClientListRecommendationsResponse) (TuningOptionsClientListRecommendationsResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "TuningOptionsClient.NewListRecommendationsPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink + } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listRecommendationsCreateRequest(ctx, resourceGroupName, serverName, tuningOption, options) + }, nil) + if err != nil { + return TuningOptionsClientListRecommendationsResponse{}, err + } + return client.listRecommendationsHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listRecommendationsCreateRequest creates the ListRecommendations request. +func (client *TuningOptionsClient) listRecommendationsCreateRequest(ctx context.Context, resourceGroupName string, serverName string, tuningOption TuningOptionParameterEnum, options *TuningOptionsClientListRecommendationsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/tuningOptions/{tuningOption}/recommendations" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serverName == "" { + return nil, errors.New("parameter serverName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serverName}", url.PathEscape(serverName)) + if tuningOption == "" { + return nil, errors.New("parameter tuningOption cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{tuningOption}", url.PathEscape(string(tuningOption))) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2025-08-01") + if options != nil && options.RecommendationType != nil { + reqQP.Set("recommendationType", string(*options.RecommendationType)) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listRecommendationsHandleResponse handles the ListRecommendations response. +func (client *TuningOptionsClient) listRecommendationsHandleResponse(resp *http.Response) (TuningOptionsClientListRecommendationsResponse, error) { + result := TuningOptionsClientListRecommendationsResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ObjectRecommendationList); err != nil { + return TuningOptionsClientListRecommendationsResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/tuningoptions_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/tuningoptions_client_example_test.go index f7d0933a2785..43b721f53740 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/tuningoptions_client_example_test.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/tuningoptions_client_example_test.go @@ -13,11 +13,12 @@ import ( "context" "log" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v5" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b1f4d539964453ce8008e4b069e59885e12ba441/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/Tuning_GetTuningOption.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/735d21dbd7e1cc446babf58860af4cca757d620d/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/TuningOptionsGet.json func ExampleTuningOptionsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -28,21 +29,485 @@ func ExampleTuningOptionsClient_Get() { if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewTuningOptionsClient().Get(ctx, "testrg", "testserver", armpostgresqlflexibleservers.TuningOptionEnumIndex, nil) + res, err := clientFactory.NewTuningOptionsClient().Get(ctx, "exampleresourcegroup", "exampleserver", armpostgresqlflexibleservers.TuningOptionParameterEnumIndex, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.TuningOptionsResource = armpostgresqlflexibleservers.TuningOptionsResource{ + // res.TuningOptions = armpostgresqlflexibleservers.TuningOptions{ // Name: to.Ptr("index"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/tuningoptions"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/tuningoptions/index"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/tuningoptions/index"), // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b1f4d539964453ce8008e4b069e59885e12ba441/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/Tuning_ListTuningOptions.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/735d21dbd7e1cc446babf58860af4cca757d620d/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/TuningOptionsListIndexRecommendationsFilteredForCreateIndex.json +func ExampleTuningOptionsClient_NewListRecommendationsPager_listAvailableIndexRecommendationsFilteredToExclusivelyGetThoseOfCreateIndexType() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewTuningOptionsClient().NewListRecommendationsPager("exampleresourcegroup", "exampleserver", armpostgresqlflexibleservers.TuningOptionParameterEnumIndex, &armpostgresqlflexibleservers.TuningOptionsClientListRecommendationsOptions{RecommendationType: to.Ptr(armpostgresqlflexibleservers.RecommendationTypeParameterEnumCreateIndex)}) + for pager.More() { + page, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range page.Value { + // You could use page here. We use blank identifier for just demo purposes. + _ = v + } + // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // page.ObjectRecommendationList = armpostgresqlflexibleservers.ObjectRecommendationList{ + // Value: []*armpostgresqlflexibleservers.ObjectRecommendation{ + // { + // Name: to.Ptr("CreateIndex_ecommerce_public_ps_suppkey_idx"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/tuningOptions/index"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/tuningOptions/index/recommendations/1"), + // Kind: to.Ptr(""), + // Properties: &armpostgresqlflexibleservers.ObjectRecommendationProperties{ + // AnalyzedWorkload: &armpostgresqlflexibleservers.ObjectRecommendationPropertiesAnalyzedWorkload{ + // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T20:30:22.123Z"); return t}()), + // QueryCount: to.Ptr[int32](25), + // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T19:30:22.123Z"); return t}()), + // }, + // EstimatedImpact: []*armpostgresqlflexibleservers.ImpactRecord{ + // { + // AbsoluteValue: to.Ptr[float64](15.3671875), + // DimensionName: to.Ptr("IndexSize"), + // Unit: to.Ptr("MB"), + // }, + // { + // AbsoluteValue: to.Ptr[float64](99.67668452400453), + // DimensionName: to.Ptr("QueryCostImprovement"), + // QueryID: to.Ptr[int64](-3775242682326862300), + // Unit: to.Ptr("Percentage"), + // }, + // { + // AbsoluteValue: to.Ptr[float64](85.56742436827899), + // DimensionName: to.Ptr("QueryCostImprovement"), + // QueryID: to.Ptr[int64](6829938984138799000), + // Unit: to.Ptr("Percentage"), + // }}, + // ImplementationDetails: &armpostgresqlflexibleservers.ObjectRecommendationPropertiesImplementationDetails{ + // Method: to.Ptr("SQL"), + // Script: to.Ptr("create index concurrently ps_suppkey_idx on public.partsupp(ps_suppkey)"), + // }, + // ImprovedQueryIDs: []*int64{ + // to.Ptr[int64](-3775242682326862300), + // to.Ptr[int64](6829938984138799000)}, + // InitialRecommendedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T20:30:22.123Z"); return t}()), + // LastRecommendedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T20:30:22.123Z"); return t}()), + // RecommendationReason: to.Ptr("Column \"partsupp\".\"ps_suppkey\" appear in Join On clause(s) in query -3775242682326862475; Column \"partsupp\".\"ps_suppkey\" appear in Join On clause(s) in query 6829938984138799352;"), + // RecommendationType: to.Ptr(armpostgresqlflexibleservers.RecommendationTypeEnumCreateIndex), + // TimesRecommended: to.Ptr[int32](1), + // Details: &armpostgresqlflexibleservers.ObjectRecommendationDetails{ + // Schema: to.Ptr("public"), + // DatabaseName: to.Ptr("ecommerce"), + // IndexColumns: []*string{ + // to.Ptr("\"partsupp\".\"ps_suppkey\"")}, + // IndexName: to.Ptr("ps_suppkey_idx"), + // IndexType: to.Ptr("BTREE"), + // Table: to.Ptr("partsupp"), + // }, + // }, + // }, + // { + // Name: to.Ptr("CreateIndex_ecommerce_public_ps_partkey_idx"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/tuningOptions/index"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/tuningOptions/index/recommendations/2"), + // Kind: to.Ptr(""), + // Properties: &armpostgresqlflexibleservers.ObjectRecommendationProperties{ + // AnalyzedWorkload: &armpostgresqlflexibleservers.ObjectRecommendationPropertiesAnalyzedWorkload{ + // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T20:30:22.123Z"); return t}()), + // QueryCount: to.Ptr[int32](25), + // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T19:30:22.123Z"); return t}()), + // }, + // EstimatedImpact: []*armpostgresqlflexibleservers.ImpactRecord{ + // { + // AbsoluteValue: to.Ptr[float64](15.3671875), + // DimensionName: to.Ptr("IndexSize"), + // Unit: to.Ptr("MB"), + // }, + // { + // AbsoluteValue: to.Ptr[float64](99.67668452400453), + // DimensionName: to.Ptr("QueryCostImprovement"), + // QueryID: to.Ptr[int64](-3775242682326862300), + // Unit: to.Ptr("Percentage"), + // }, + // { + // AbsoluteValue: to.Ptr[float64](79.06603712430707), + // DimensionName: to.Ptr("QueryCostImprovement"), + // QueryID: to.Ptr[int64](4735984994430715000), + // Unit: to.Ptr("Percentage"), + // }}, + // ImplementationDetails: &armpostgresqlflexibleservers.ObjectRecommendationPropertiesImplementationDetails{ + // Method: to.Ptr("SQL"), + // Script: to.Ptr("create index concurrently ps_partkey_idx on public.partsupp(ps_partkey)"), + // }, + // ImprovedQueryIDs: []*int64{ + // to.Ptr[int64](-3775242682326862300), + // to.Ptr[int64](4735984994430715000)}, + // InitialRecommendedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T20:30:22.123Z"); return t}()), + // LastRecommendedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T20:30:22.123Z"); return t}()), + // RecommendationReason: to.Ptr("Column \"partsupp\".\"ps_partkey\" appear in Equal Predicate clause(s) in query -3775242682326862475; Column \"partsupp\".\"ps_partkey\" appear in Join On clause(s) in query 4735984994430714735;"), + // RecommendationType: to.Ptr(armpostgresqlflexibleservers.RecommendationTypeEnumCreateIndex), + // TimesRecommended: to.Ptr[int32](1), + // Details: &armpostgresqlflexibleservers.ObjectRecommendationDetails{ + // Schema: to.Ptr("public"), + // DatabaseName: to.Ptr("ecommerce"), + // IndexColumns: []*string{ + // to.Ptr("\"partsupp\".\"ps_partkey\"")}, + // IndexName: to.Ptr("ps_partkey_idx"), + // IndexType: to.Ptr("BTREE"), + // Table: to.Ptr("partsupp"), + // }, + // }, + // }}, + // } + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/735d21dbd7e1cc446babf58860af4cca757d620d/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/TuningOptionsListIndexRecommendations.json +func ExampleTuningOptionsClient_NewListRecommendationsPager_listAvailableIndexRecommendations() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewTuningOptionsClient().NewListRecommendationsPager("exampleresourcegroup", "exampleserver", armpostgresqlflexibleservers.TuningOptionParameterEnumIndex, &armpostgresqlflexibleservers.TuningOptionsClientListRecommendationsOptions{RecommendationType: nil}) + for pager.More() { + page, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range page.Value { + // You could use page here. We use blank identifier for just demo purposes. + _ = v + } + // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // page.ObjectRecommendationList = armpostgresqlflexibleservers.ObjectRecommendationList{ + // Value: []*armpostgresqlflexibleservers.ObjectRecommendation{ + // { + // Name: to.Ptr("CreateIndex_ecommerce_public_ps_suppkey_idx"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/tuningOptions/index"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/tuningOptions/index/recommendations/1"), + // Kind: to.Ptr(""), + // Properties: &armpostgresqlflexibleservers.ObjectRecommendationProperties{ + // AnalyzedWorkload: &armpostgresqlflexibleservers.ObjectRecommendationPropertiesAnalyzedWorkload{ + // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T20:30:22.123Z"); return t}()), + // QueryCount: to.Ptr[int32](25), + // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T19:30:22.123Z"); return t}()), + // }, + // EstimatedImpact: []*armpostgresqlflexibleservers.ImpactRecord{ + // { + // AbsoluteValue: to.Ptr[float64](15.3671875), + // DimensionName: to.Ptr("IndexSize"), + // Unit: to.Ptr("MB"), + // }, + // { + // AbsoluteValue: to.Ptr[float64](99.67668452400453), + // DimensionName: to.Ptr("QueryCostImprovement"), + // QueryID: to.Ptr[int64](-3775242682326862300), + // Unit: to.Ptr("Percentage"), + // }, + // { + // AbsoluteValue: to.Ptr[float64](85.56742436827899), + // DimensionName: to.Ptr("QueryCostImprovement"), + // QueryID: to.Ptr[int64](6829938984138799000), + // Unit: to.Ptr("Percentage"), + // }}, + // ImplementationDetails: &armpostgresqlflexibleservers.ObjectRecommendationPropertiesImplementationDetails{ + // Method: to.Ptr("SQL"), + // Script: to.Ptr("create index concurrently ps_suppkey_idx on public.partsupp(ps_suppkey)"), + // }, + // ImprovedQueryIDs: []*int64{ + // to.Ptr[int64](-3775242682326862300), + // to.Ptr[int64](6829938984138799000)}, + // InitialRecommendedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T20:30:22.123Z"); return t}()), + // LastRecommendedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T20:30:22.123Z"); return t}()), + // RecommendationReason: to.Ptr("Column \"partsupp\".\"ps_suppkey\" appear in Join On clause(s) in query -3775242682326862475; Column \"partsupp\".\"ps_suppkey\" appear in Join On clause(s) in query 6829938984138799352;"), + // RecommendationType: to.Ptr(armpostgresqlflexibleservers.RecommendationTypeEnumCreateIndex), + // TimesRecommended: to.Ptr[int32](1), + // Details: &armpostgresqlflexibleservers.ObjectRecommendationDetails{ + // Schema: to.Ptr("public"), + // DatabaseName: to.Ptr("ecommerce"), + // IndexColumns: []*string{ + // to.Ptr("\"partsupp\".\"ps_suppkey\"")}, + // IndexName: to.Ptr("ps_suppkey_idx"), + // IndexType: to.Ptr("BTREE"), + // Table: to.Ptr("partsupp"), + // }, + // }, + // }, + // { + // Name: to.Ptr("CreateIndex_ecommerce_public_ps_partkey_idx"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/tuningOptions/index"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/tuningOptions/index/recommendations/2"), + // Kind: to.Ptr(""), + // Properties: &armpostgresqlflexibleservers.ObjectRecommendationProperties{ + // AnalyzedWorkload: &armpostgresqlflexibleservers.ObjectRecommendationPropertiesAnalyzedWorkload{ + // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T20:30:22.123Z"); return t}()), + // QueryCount: to.Ptr[int32](25), + // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T19:30:22.123Z"); return t}()), + // }, + // EstimatedImpact: []*armpostgresqlflexibleservers.ImpactRecord{ + // { + // AbsoluteValue: to.Ptr[float64](15.3671875), + // DimensionName: to.Ptr("IndexSize"), + // Unit: to.Ptr("MB"), + // }, + // { + // AbsoluteValue: to.Ptr[float64](99.67668452400453), + // DimensionName: to.Ptr("QueryCostImprovement"), + // QueryID: to.Ptr[int64](-3775242682326862300), + // Unit: to.Ptr("Percentage"), + // }, + // { + // AbsoluteValue: to.Ptr[float64](79.06603712430707), + // DimensionName: to.Ptr("QueryCostImprovement"), + // QueryID: to.Ptr[int64](4735984994430715000), + // Unit: to.Ptr("Percentage"), + // }}, + // ImplementationDetails: &armpostgresqlflexibleservers.ObjectRecommendationPropertiesImplementationDetails{ + // Method: to.Ptr("SQL"), + // Script: to.Ptr("create index concurrently ps_partkey_idx on public.partsupp(ps_partkey)"), + // }, + // ImprovedQueryIDs: []*int64{ + // to.Ptr[int64](-3775242682326862300), + // to.Ptr[int64](4735984994430715000)}, + // InitialRecommendedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T20:30:22.123Z"); return t}()), + // LastRecommendedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T20:30:22.123Z"); return t}()), + // RecommendationReason: to.Ptr("Column \"partsupp\".\"ps_partkey\" appear in Equal Predicate clause(s) in query -3775242682326862475; Column \"partsupp\".\"ps_partkey\" appear in Join On clause(s) in query 4735984994430714735;"), + // RecommendationType: to.Ptr(armpostgresqlflexibleservers.RecommendationTypeEnumCreateIndex), + // TimesRecommended: to.Ptr[int32](1), + // Details: &armpostgresqlflexibleservers.ObjectRecommendationDetails{ + // Schema: to.Ptr("public"), + // DatabaseName: to.Ptr("ecommerce"), + // IndexColumns: []*string{ + // to.Ptr("\"partsupp\".\"ps_partkey\"")}, + // IndexName: to.Ptr("ps_partkey_idx"), + // IndexType: to.Ptr("BTREE"), + // Table: to.Ptr("partsupp"), + // }, + // }, + // }}, + // } + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/735d21dbd7e1cc446babf58860af4cca757d620d/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/TuningOptionsListTableRecommendationsFilteredForAnalyzeTable.json +func ExampleTuningOptionsClient_NewListRecommendationsPager_listAvailableTableRecommendationsFilteredToExclusivelyGetThoseOfAnalyzeTableType() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewTuningOptionsClient().NewListRecommendationsPager("exampleresourcegroup", "exampleserver", armpostgresqlflexibleservers.TuningOptionParameterEnumTable, &armpostgresqlflexibleservers.TuningOptionsClientListRecommendationsOptions{RecommendationType: to.Ptr(armpostgresqlflexibleservers.RecommendationTypeParameterEnumAnalyzeTable)}) + for pager.More() { + page, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range page.Value { + // You could use page here. We use blank identifier for just demo purposes. + _ = v + } + // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // page.ObjectRecommendationList = armpostgresqlflexibleservers.ObjectRecommendationList{ + // Value: []*armpostgresqlflexibleservers.ObjectRecommendation{ + // { + // Name: to.Ptr("Analyze_postgres_public_nation"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/tuningOptions/table"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/tuningOptions/table/recommendations/1"), + // Kind: to.Ptr(""), + // Properties: &armpostgresqlflexibleservers.ObjectRecommendationProperties{ + // AnalyzedWorkload: &armpostgresqlflexibleservers.ObjectRecommendationPropertiesAnalyzedWorkload{ + // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T20:30:22.123Z"); return t}()), + // QueryCount: to.Ptr[int32](22), + // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T19:30:22.123Z"); return t}()), + // }, + // EstimatedImpact: []*armpostgresqlflexibleservers.ImpactRecord{ + // }, + // ImplementationDetails: &armpostgresqlflexibleservers.ObjectRecommendationPropertiesImplementationDetails{ + // Method: to.Ptr("SQL"), + // Script: to.Ptr("analyze table public.nation"), + // }, + // ImprovedQueryIDs: []*int64{ + // to.Ptr[int64](2071439792137543700), + // to.Ptr[int64](7860150533486302000), + // to.Ptr[int64](6411979446509506000), + // to.Ptr[int64](3219604056681277400), + // to.Ptr[int64](-360410933364310600), + // to.Ptr[int64](6171467644166225000), + // to.Ptr[int64](3548728559597612500), + // to.Ptr[int64](-4753875211349607000), + // to.Ptr[int64](-8711548294430095000)}, + // InitialRecommendedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T20:30:22.123Z"); return t}()), + // LastRecommendedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T20:30:22.123Z"); return t}()), + // RecommendationReason: to.Ptr("Table \"nation\" in schema \"public\" is unanalyzed and appears in the following queries: 2071439792137543669, 7860150533486301820, 6411979446509505239, 3219604056681277471, -360410933364310591, 6171467644166224729, 3548728559597612316, -4753875211349607298, -8711548294430094920"), + // RecommendationType: to.Ptr(armpostgresqlflexibleservers.RecommendationTypeEnum("Analyze")), + // TimesRecommended: to.Ptr[int32](1), + // Details: &armpostgresqlflexibleservers.ObjectRecommendationDetails{ + // Schema: to.Ptr("public"), + // DatabaseName: to.Ptr("postgres"), + // Table: to.Ptr("nation"), + // }, + // }, + // }, + // { + // Name: to.Ptr("Analyze_postgres_public_region"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/tuningOptions/table"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/tuningOptions/table/recommendations/2"), + // Kind: to.Ptr(""), + // Properties: &armpostgresqlflexibleservers.ObjectRecommendationProperties{ + // AnalyzedWorkload: &armpostgresqlflexibleservers.ObjectRecommendationPropertiesAnalyzedWorkload{ + // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T20:30:22.123Z"); return t}()), + // QueryCount: to.Ptr[int32](22), + // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T19:30:22.123Z"); return t}()), + // }, + // EstimatedImpact: []*armpostgresqlflexibleservers.ImpactRecord{ + // }, + // ImplementationDetails: &armpostgresqlflexibleservers.ObjectRecommendationPropertiesImplementationDetails{ + // Method: to.Ptr("SQL"), + // Script: to.Ptr("analyze table public.region"), + // }, + // ImprovedQueryIDs: []*int64{ + // to.Ptr[int64](3219604056681277400), + // to.Ptr[int64](6171467644166225000), + // to.Ptr[int64](-4753875211349607000)}, + // InitialRecommendedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T20:30:22.123Z"); return t}()), + // LastRecommendedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T20:30:22.123Z"); return t}()), + // RecommendationReason: to.Ptr("Table \"region\" in schema \"public\" is unanalyzed and appears in the following queries: 3219604056681277471, 6171467644166224729, -4753875211349607298"), + // RecommendationType: to.Ptr(armpostgresqlflexibleservers.RecommendationTypeEnum("Analyze")), + // TimesRecommended: to.Ptr[int32](1), + // Details: &armpostgresqlflexibleservers.ObjectRecommendationDetails{ + // Schema: to.Ptr("public"), + // DatabaseName: to.Ptr("postgres"), + // Table: to.Ptr("region"), + // }, + // }, + // }}, + // } + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/735d21dbd7e1cc446babf58860af4cca757d620d/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/TuningOptionsListTableRecommendations.json +func ExampleTuningOptionsClient_NewListRecommendationsPager_listAvailableTableRecommendations() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewTuningOptionsClient().NewListRecommendationsPager("exampleresourcegroup", "exampleserver", armpostgresqlflexibleservers.TuningOptionParameterEnumTable, &armpostgresqlflexibleservers.TuningOptionsClientListRecommendationsOptions{RecommendationType: nil}) + for pager.More() { + page, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range page.Value { + // You could use page here. We use blank identifier for just demo purposes. + _ = v + } + // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // page.ObjectRecommendationList = armpostgresqlflexibleservers.ObjectRecommendationList{ + // Value: []*armpostgresqlflexibleservers.ObjectRecommendation{ + // { + // Name: to.Ptr("Analyze_postgres_public_nation"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/tuningOptions/table"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/tuningOptions/table/recommendations/1"), + // Kind: to.Ptr(""), + // Properties: &armpostgresqlflexibleservers.ObjectRecommendationProperties{ + // AnalyzedWorkload: &armpostgresqlflexibleservers.ObjectRecommendationPropertiesAnalyzedWorkload{ + // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T20:30:22.123Z"); return t}()), + // QueryCount: to.Ptr[int32](22), + // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T19:30:22.123Z"); return t}()), + // }, + // EstimatedImpact: []*armpostgresqlflexibleservers.ImpactRecord{ + // }, + // ImplementationDetails: &armpostgresqlflexibleservers.ObjectRecommendationPropertiesImplementationDetails{ + // Method: to.Ptr("SQL"), + // Script: to.Ptr("analyze table public.nation"), + // }, + // ImprovedQueryIDs: []*int64{ + // to.Ptr[int64](2071439792137543700), + // to.Ptr[int64](7860150533486302000), + // to.Ptr[int64](6411979446509506000), + // to.Ptr[int64](3219604056681277400), + // to.Ptr[int64](-360410933364310600), + // to.Ptr[int64](6171467644166225000), + // to.Ptr[int64](3548728559597612500), + // to.Ptr[int64](-4753875211349607000), + // to.Ptr[int64](-8711548294430095000)}, + // InitialRecommendedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T20:30:22.123Z"); return t}()), + // LastRecommendedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T20:30:22.123Z"); return t}()), + // RecommendationReason: to.Ptr("Table \"nation\" in schema \"public\" is unanalyzed and appears in the following queries: 2071439792137543669, 7860150533486301820, 6411979446509505239, 3219604056681277471, -360410933364310591, 6171467644166224729, 3548728559597612316, -4753875211349607298, -8711548294430094920"), + // RecommendationType: to.Ptr(armpostgresqlflexibleservers.RecommendationTypeEnum("Analyze")), + // TimesRecommended: to.Ptr[int32](1), + // Details: &armpostgresqlflexibleservers.ObjectRecommendationDetails{ + // Schema: to.Ptr("public"), + // DatabaseName: to.Ptr("postgres"), + // Table: to.Ptr("nation"), + // }, + // }, + // }, + // { + // Name: to.Ptr("Analyze_postgres_public_region"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/tuningOptions/table"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/tuningOptions/table/recommendations/2"), + // Kind: to.Ptr(""), + // Properties: &armpostgresqlflexibleservers.ObjectRecommendationProperties{ + // AnalyzedWorkload: &armpostgresqlflexibleservers.ObjectRecommendationPropertiesAnalyzedWorkload{ + // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T20:30:22.123Z"); return t}()), + // QueryCount: to.Ptr[int32](22), + // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T19:30:22.123Z"); return t}()), + // }, + // EstimatedImpact: []*armpostgresqlflexibleservers.ImpactRecord{ + // }, + // ImplementationDetails: &armpostgresqlflexibleservers.ObjectRecommendationPropertiesImplementationDetails{ + // Method: to.Ptr("SQL"), + // Script: to.Ptr("analyze table public.region"), + // }, + // ImprovedQueryIDs: []*int64{ + // to.Ptr[int64](3219604056681277400), + // to.Ptr[int64](6171467644166225000), + // to.Ptr[int64](-4753875211349607000)}, + // InitialRecommendedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T20:30:22.123Z"); return t}()), + // LastRecommendedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T20:30:22.123Z"); return t}()), + // RecommendationReason: to.Ptr("Table \"region\" in schema \"public\" is unanalyzed and appears in the following queries: 3219604056681277471, 6171467644166224729, -4753875211349607298"), + // RecommendationType: to.Ptr(armpostgresqlflexibleservers.RecommendationTypeEnum("Analyze")), + // TimesRecommended: to.Ptr[int32](1), + // Details: &armpostgresqlflexibleservers.ObjectRecommendationDetails{ + // Schema: to.Ptr("public"), + // DatabaseName: to.Ptr("postgres"), + // Table: to.Ptr("region"), + // }, + // }, + // }}, + // } + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/735d21dbd7e1cc446babf58860af4cca757d620d/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/TuningOptionsListByServer.json func ExampleTuningOptionsClient_NewListByServerPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -53,7 +518,7 @@ func ExampleTuningOptionsClient_NewListByServerPager() { if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewTuningOptionsClient().NewListByServerPager("testrg", "testserver", nil) + pager := clientFactory.NewTuningOptionsClient().NewListByServerPager("exampleresourcegroup", "exampleserver", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -64,12 +529,17 @@ func ExampleTuningOptionsClient_NewListByServerPager() { _ = v } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.TuningOptionsListResult = armpostgresqlflexibleservers.TuningOptionsListResult{ - // Value: []*armpostgresqlflexibleservers.TuningOptionsResource{ + // page.TuningOptionsList = armpostgresqlflexibleservers.TuningOptionsList{ + // Value: []*armpostgresqlflexibleservers.TuningOptions{ // { // Name: to.Ptr("index"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/tuningoptions"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/tuningoptions/index"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/tuningoptions/index"), + // }, + // { + // Name: to.Ptr("table"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/tuningoptions"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/tuningoptions/table"), // }}, // } } diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/version.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/version.go new file mode 100644 index 000000000000..425be20861e2 --- /dev/null +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/version.go @@ -0,0 +1,10 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package armpostgresqlflexibleservers + +const ( + moduleName = "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers" + moduleVersion = "v5.0.0" +) diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/virtualendpoints_client.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/virtualendpoints_client.go index 63451de0b409..150081cc840e 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/virtualendpoints_client.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/virtualendpoints_client.go @@ -27,7 +27,7 @@ type VirtualEndpointsClient struct { // NewVirtualEndpointsClient creates a new instance of VirtualEndpointsClient with the specified values. // - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. +// - options - Contains optional client configuration. Pass nil to accept the default values. func NewVirtualEndpointsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VirtualEndpointsClient, error) { cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) if err != nil { @@ -40,17 +40,17 @@ func NewVirtualEndpointsClient(subscriptionID string, credential azcore.TokenCre return client, nil } -// BeginCreate - Creates a new virtual endpoint for PostgreSQL flexible server. +// BeginCreate - Creates a pair of virtual endpoints for a server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-01-01-preview +// Generated from API version 2025-08-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. -// - virtualEndpointName - The name of the virtual endpoint. -// - parameters - The required parameters for creating or updating virtual endpoints. +// - virtualEndpointName - Base name of the virtual endpoints. +// - parameters - Parameters required to create or update a pair of virtual endpoints. // - options - VirtualEndpointsClientBeginCreateOptions contains the optional parameters for the VirtualEndpointsClient.BeginCreate // method. -func (client *VirtualEndpointsClient) BeginCreate(ctx context.Context, resourceGroupName string, serverName string, virtualEndpointName string, parameters VirtualEndpointResource, options *VirtualEndpointsClientBeginCreateOptions) (*runtime.Poller[VirtualEndpointsClientCreateResponse], error) { +func (client *VirtualEndpointsClient) BeginCreate(ctx context.Context, resourceGroupName string, serverName string, virtualEndpointName string, parameters VirtualEndpoint, options *VirtualEndpointsClientBeginCreateOptions) (*runtime.Poller[VirtualEndpointsClientCreateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.create(ctx, resourceGroupName, serverName, virtualEndpointName, parameters, options) if err != nil { @@ -68,11 +68,11 @@ func (client *VirtualEndpointsClient) BeginCreate(ctx context.Context, resourceG } } -// Create - Creates a new virtual endpoint for PostgreSQL flexible server. +// Create - Creates a pair of virtual endpoints for a server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-01-01-preview -func (client *VirtualEndpointsClient) create(ctx context.Context, resourceGroupName string, serverName string, virtualEndpointName string, parameters VirtualEndpointResource, options *VirtualEndpointsClientBeginCreateOptions) (*http.Response, error) { +// Generated from API version 2025-08-01 +func (client *VirtualEndpointsClient) create(ctx context.Context, resourceGroupName string, serverName string, virtualEndpointName string, parameters VirtualEndpoint, options *VirtualEndpointsClientBeginCreateOptions) (*http.Response, error) { var err error const operationName = "VirtualEndpointsClient.BeginCreate" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) @@ -86,7 +86,7 @@ func (client *VirtualEndpointsClient) create(ctx context.Context, resourceGroupN if err != nil { return nil, err } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { + if !runtime.HasStatusCode(httpResp, http.StatusAccepted) { err = runtime.NewResponseError(httpResp) return nil, err } @@ -94,7 +94,7 @@ func (client *VirtualEndpointsClient) create(ctx context.Context, resourceGroupN } // createCreateRequest creates the Create request. -func (client *VirtualEndpointsClient) createCreateRequest(ctx context.Context, resourceGroupName string, serverName string, virtualEndpointName string, parameters VirtualEndpointResource, _ *VirtualEndpointsClientBeginCreateOptions) (*policy.Request, error) { +func (client *VirtualEndpointsClient) createCreateRequest(ctx context.Context, resourceGroupName string, serverName string, virtualEndpointName string, parameters VirtualEndpoint, _ *VirtualEndpointsClientBeginCreateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/virtualendpoints/{virtualEndpointName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -117,7 +117,7 @@ func (client *VirtualEndpointsClient) createCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-01-01-preview") + reqQP.Set("api-version", "2025-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -126,13 +126,13 @@ func (client *VirtualEndpointsClient) createCreateRequest(ctx context.Context, r return req, nil } -// BeginDelete - Deletes a virtual endpoint. +// BeginDelete - Deletes a pair of virtual endpoints. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-01-01-preview +// Generated from API version 2025-08-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. -// - virtualEndpointName - The name of the virtual endpoint. +// - virtualEndpointName - Base name of the virtual endpoints. // - options - VirtualEndpointsClientBeginDeleteOptions contains the optional parameters for the VirtualEndpointsClient.BeginDelete // method. func (client *VirtualEndpointsClient) BeginDelete(ctx context.Context, resourceGroupName string, serverName string, virtualEndpointName string, options *VirtualEndpointsClientBeginDeleteOptions) (*runtime.Poller[VirtualEndpointsClientDeleteResponse], error) { @@ -153,10 +153,10 @@ func (client *VirtualEndpointsClient) BeginDelete(ctx context.Context, resourceG } } -// Delete - Deletes a virtual endpoint. +// Delete - Deletes a pair of virtual endpoints. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-01-01-preview +// Generated from API version 2025-08-01 func (client *VirtualEndpointsClient) deleteOperation(ctx context.Context, resourceGroupName string, serverName string, virtualEndpointName string, options *VirtualEndpointsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "VirtualEndpointsClient.BeginDelete" @@ -202,19 +202,19 @@ func (client *VirtualEndpointsClient) deleteCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-01-01-preview") + reqQP.Set("api-version", "2025-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } -// Get - Gets information about a virtual endpoint. +// Get - Gets information about a pair of virtual endpoints. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-01-01-preview +// Generated from API version 2025-08-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. -// - virtualEndpointName - The name of the virtual endpoint. +// - virtualEndpointName - Base name of the virtual endpoints. // - options - VirtualEndpointsClientGetOptions contains the optional parameters for the VirtualEndpointsClient.Get method. func (client *VirtualEndpointsClient) Get(ctx context.Context, resourceGroupName string, serverName string, virtualEndpointName string, options *VirtualEndpointsClientGetOptions) (VirtualEndpointsClientGetResponse, error) { var err error @@ -262,7 +262,7 @@ func (client *VirtualEndpointsClient) getCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-01-01-preview") + reqQP.Set("api-version", "2025-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -271,15 +271,15 @@ func (client *VirtualEndpointsClient) getCreateRequest(ctx context.Context, reso // getHandleResponse handles the Get response. func (client *VirtualEndpointsClient) getHandleResponse(resp *http.Response) (VirtualEndpointsClientGetResponse, error) { result := VirtualEndpointsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualEndpointResource); err != nil { + if err := runtime.UnmarshalAsJSON(resp, &result.VirtualEndpoint); err != nil { return VirtualEndpointsClientGetResponse{}, err } return result, nil } -// NewListByServerPager - List all the servers in a given resource group. +// NewListByServerPager - Lists pair of virtual endpoints associated to a server. // -// Generated from API version 2025-01-01-preview +// Generated from API version 2025-08-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - options - VirtualEndpointsClientListByServerOptions contains the optional parameters for the VirtualEndpointsClient.NewListByServerPager @@ -327,7 +327,7 @@ func (client *VirtualEndpointsClient) listByServerCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-01-01-preview") + reqQP.Set("api-version", "2025-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -336,21 +336,20 @@ func (client *VirtualEndpointsClient) listByServerCreateRequest(ctx context.Cont // listByServerHandleResponse handles the ListByServer response. func (client *VirtualEndpointsClient) listByServerHandleResponse(resp *http.Response) (VirtualEndpointsClientListByServerResponse, error) { result := VirtualEndpointsClientListByServerResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualEndpointsListResult); err != nil { + if err := runtime.UnmarshalAsJSON(resp, &result.VirtualEndpointsList); err != nil { return VirtualEndpointsClientListByServerResponse{}, err } return result, nil } -// BeginUpdate - Updates an existing virtual endpoint. The request body can contain one to many of the properties present -// in the normal virtual endpoint definition. +// BeginUpdate - Updates a pair of virtual endpoints for a server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-01-01-preview +// Generated from API version 2025-08-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. -// - virtualEndpointName - The name of the virtual endpoint. -// - parameters - The required parameters for updating a server. +// - virtualEndpointName - Base name of the virtual endpoints. +// - parameters - Parameters required to update a pair of virtual endpoints. // - options - VirtualEndpointsClientBeginUpdateOptions contains the optional parameters for the VirtualEndpointsClient.BeginUpdate // method. func (client *VirtualEndpointsClient) BeginUpdate(ctx context.Context, resourceGroupName string, serverName string, virtualEndpointName string, parameters VirtualEndpointResourceForPatch, options *VirtualEndpointsClientBeginUpdateOptions) (*runtime.Poller[VirtualEndpointsClientUpdateResponse], error) { @@ -371,11 +370,10 @@ func (client *VirtualEndpointsClient) BeginUpdate(ctx context.Context, resourceG } } -// Update - Updates an existing virtual endpoint. The request body can contain one to many of the properties present in the -// normal virtual endpoint definition. +// Update - Updates a pair of virtual endpoints for a server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-01-01-preview +// Generated from API version 2025-08-01 func (client *VirtualEndpointsClient) update(ctx context.Context, resourceGroupName string, serverName string, virtualEndpointName string, parameters VirtualEndpointResourceForPatch, options *VirtualEndpointsClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "VirtualEndpointsClient.BeginUpdate" @@ -390,7 +388,7 @@ func (client *VirtualEndpointsClient) update(ctx context.Context, resourceGroupN if err != nil { return nil, err } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + if !runtime.HasStatusCode(httpResp, http.StatusAccepted) { err = runtime.NewResponseError(httpResp) return nil, err } @@ -421,7 +419,7 @@ func (client *VirtualEndpointsClient) updateCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-01-01-preview") + reqQP.Set("api-version", "2025-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/virtualendpoints_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/virtualendpoints_client_example_test.go index f10f0e706a7a..e8f07d2201aa 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/virtualendpoints_client_example_test.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/virtualendpoints_client_example_test.go @@ -18,7 +18,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v5" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b1f4d539964453ce8008e4b069e59885e12ba441/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/VirtualEndpointCreate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/735d21dbd7e1cc446babf58860af4cca757d620d/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/VirtualEndpointCreate.json func ExampleVirtualEndpointsClient_BeginCreate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -29,39 +29,23 @@ func ExampleVirtualEndpointsClient_BeginCreate() { if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewVirtualEndpointsClient().BeginCreate(ctx, "testrg", "pgtestsvc4", "pgVirtualEndpoint1", armpostgresqlflexibleservers.VirtualEndpointResource{ + poller, err := clientFactory.NewVirtualEndpointsClient().BeginCreate(ctx, "exampleresourcegroup", "exampleserver", "examplebasename", armpostgresqlflexibleservers.VirtualEndpoint{ Properties: &armpostgresqlflexibleservers.VirtualEndpointResourceProperties{ EndpointType: to.Ptr(armpostgresqlflexibleservers.VirtualEndpointTypeReadWrite), Members: []*string{ - to.Ptr("testPrimary1")}, + to.Ptr("exampleprimaryserver")}, }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } - res, err := poller.PollUntilDone(ctx, nil) + _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualEndpointResource = armpostgresqlflexibleservers.VirtualEndpointResource{ - // Name: to.Ptr("pgVirtualEndpoint1"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/virtualEndpoints"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/pgtestsvc4/virtualEndpoints/pgVirtualEndpoint1"), - // Properties: &armpostgresqlflexibleservers.VirtualEndpointResourceProperties{ - // EndpointType: to.Ptr(armpostgresqlflexibleservers.VirtualEndpointTypeReadWrite), - // Members: []*string{ - // to.Ptr("testPrimary1")}, - // VirtualEndpoints: []*string{ - // to.Ptr("pgVirtualEndpoint1.reader.postgres.database.azure.com"), - // to.Ptr("pgVirtualEndpoint1.writer.postgres.database.azure.com")}, - // }, - // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b1f4d539964453ce8008e4b069e59885e12ba441/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/VirtualEndpointUpdate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/735d21dbd7e1cc446babf58860af4cca757d620d/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/VirtualEndpointUpdate.json func ExampleVirtualEndpointsClient_BeginUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -72,39 +56,23 @@ func ExampleVirtualEndpointsClient_BeginUpdate() { if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewVirtualEndpointsClient().BeginUpdate(ctx, "testrg", "pgtestsvc4", "pgVirtualEndpoint1", armpostgresqlflexibleservers.VirtualEndpointResourceForPatch{ + poller, err := clientFactory.NewVirtualEndpointsClient().BeginUpdate(ctx, "exampleresourcegroup", "exampleserver", "examplebasename", armpostgresqlflexibleservers.VirtualEndpointResourceForPatch{ Properties: &armpostgresqlflexibleservers.VirtualEndpointResourceProperties{ EndpointType: to.Ptr(armpostgresqlflexibleservers.VirtualEndpointTypeReadWrite), Members: []*string{ - to.Ptr("testReplica1")}, + to.Ptr("exampleprimaryserver")}, }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } - res, err := poller.PollUntilDone(ctx, nil) + _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualEndpointResource = armpostgresqlflexibleservers.VirtualEndpointResource{ - // Name: to.Ptr("pgVirtualEndpoint1"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/virtualEndpoints"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/pgtestsvc4/virtualEndpoints/pgVirtualEndpoint1"), - // Properties: &armpostgresqlflexibleservers.VirtualEndpointResourceProperties{ - // EndpointType: to.Ptr(armpostgresqlflexibleservers.VirtualEndpointTypeReadWrite), - // Members: []*string{ - // to.Ptr("testReplica1")}, - // VirtualEndpoints: []*string{ - // to.Ptr("pgVirtualEndpoint1.reader.postgres.database.azure.com"), - // to.Ptr("pgVirtualEndpoint1.writer.postgres.database.azure.com")}, - // }, - // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b1f4d539964453ce8008e4b069e59885e12ba441/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/VirtualEndpointDelete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/735d21dbd7e1cc446babf58860af4cca757d620d/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/VirtualEndpointDelete.json func ExampleVirtualEndpointsClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -115,7 +83,7 @@ func ExampleVirtualEndpointsClient_BeginDelete() { if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewVirtualEndpointsClient().BeginDelete(ctx, "testrg", "pgtestsvc4", "pgVirtualEndpoint1", nil) + poller, err := clientFactory.NewVirtualEndpointsClient().BeginDelete(ctx, "exampleresourcegroup", "exampleserver", "examplebasename", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -125,7 +93,7 @@ func ExampleVirtualEndpointsClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b1f4d539964453ce8008e4b069e59885e12ba441/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/VirtualEndpointsGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/735d21dbd7e1cc446babf58860af4cca757d620d/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/VirtualEndpointsGet.json func ExampleVirtualEndpointsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -136,29 +104,29 @@ func ExampleVirtualEndpointsClient_Get() { if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewVirtualEndpointsClient().Get(ctx, "testrg", "pgtestsvc4", "pgVirtualEndpoint1", nil) + res, err := clientFactory.NewVirtualEndpointsClient().Get(ctx, "exampleresourcegroup", "exampleserver", "examplebasename", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualEndpointResource = armpostgresqlflexibleservers.VirtualEndpointResource{ - // Name: to.Ptr("pgVirtualEndpoint1"), + // res.VirtualEndpoint = armpostgresqlflexibleservers.VirtualEndpoint{ + // Name: to.Ptr("examplebasename"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/virtualEndpoints"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/pgtestsvc4/virtualEndpoints/pgVirtualEndpoint1"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/virtualEndpoints/examplebasename"), // Properties: &armpostgresqlflexibleservers.VirtualEndpointResourceProperties{ // EndpointType: to.Ptr(armpostgresqlflexibleservers.VirtualEndpointTypeReadWrite), // Members: []*string{ - // to.Ptr("testReplica1")}, + // to.Ptr("exampleprimaryserver")}, // VirtualEndpoints: []*string{ - // to.Ptr("pgVirtualEndpoint1.reader.postgres.database.azure.com"), - // to.Ptr("pgVirtualEndpoint1.writer.postgres.database.azure.com")}, + // to.Ptr("examplebasename.reader.postgres.database.azure.com"), + // to.Ptr("examplebasename.writer.postgres.database.azure.com")}, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b1f4d539964453ce8008e4b069e59885e12ba441/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/VirtualEndpointsListByServer.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/735d21dbd7e1cc446babf58860af4cca757d620d/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/VirtualEndpointsListByServer.json func ExampleVirtualEndpointsClient_NewListByServerPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -169,7 +137,7 @@ func ExampleVirtualEndpointsClient_NewListByServerPager() { if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewVirtualEndpointsClient().NewListByServerPager("testrg", "pgtestsvc4", nil) + pager := clientFactory.NewVirtualEndpointsClient().NewListByServerPager("exampleresourcegroup", "exampleserver", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -180,19 +148,19 @@ func ExampleVirtualEndpointsClient_NewListByServerPager() { _ = v } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.VirtualEndpointsListResult = armpostgresqlflexibleservers.VirtualEndpointsListResult{ - // Value: []*armpostgresqlflexibleservers.VirtualEndpointResource{ + // page.VirtualEndpointsList = armpostgresqlflexibleservers.VirtualEndpointsList{ + // Value: []*armpostgresqlflexibleservers.VirtualEndpoint{ // { - // Name: to.Ptr("pgVirtualEndpoint1"), + // Name: to.Ptr("examplebasename"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/virtualEndpoints"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/pgtestsvc4/virtualEndpoints/pgVirtualEndpoint1"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/virtualEndpoints/examplebasename"), // Properties: &armpostgresqlflexibleservers.VirtualEndpointResourceProperties{ // EndpointType: to.Ptr(armpostgresqlflexibleservers.VirtualEndpointTypeReadWrite), // Members: []*string{ - // to.Ptr("testReplica1")}, + // to.Ptr("examplebasename")}, // VirtualEndpoints: []*string{ - // to.Ptr("pgVirtualEndpoint1.reader.postgres.database.azure.com"), - // to.Ptr("pgVirtualEndpoint1.writer.postgres.database.azure.com")}, + // to.Ptr("examplebasename.reader.postgres.database.azure.com"), + // to.Ptr("examplebasename.writer.postgres.database.azure.com")}, // }, // }}, // } diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/virtualnetworksubnetusage_client.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/virtualnetworksubnetusage_client.go index 6481aa4c4b76..c75adeb2c161 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/virtualnetworksubnetusage_client.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/virtualnetworksubnetusage_client.go @@ -27,7 +27,7 @@ type VirtualNetworkSubnetUsageClient struct { // NewVirtualNetworkSubnetUsageClient creates a new instance of VirtualNetworkSubnetUsageClient with the specified values. // - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. +// - options - Contains optional client configuration. Pass nil to accept the default values. func NewVirtualNetworkSubnetUsageClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VirtualNetworkSubnetUsageClient, error) { cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) if err != nil { @@ -40,38 +40,38 @@ func NewVirtualNetworkSubnetUsageClient(subscriptionID string, credential azcore return client, nil } -// Execute - Get virtual network subnet usage for a given vNet resource id. +// List - Lists the virtual network subnet usage for a given virtual network. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-01-01-preview +// Generated from API version 2025-08-01 // - locationName - The name of the location. // - parameters - The required parameters for creating or updating a server. -// - options - VirtualNetworkSubnetUsageClientExecuteOptions contains the optional parameters for the VirtualNetworkSubnetUsageClient.Execute +// - options - VirtualNetworkSubnetUsageClientListOptions contains the optional parameters for the VirtualNetworkSubnetUsageClient.List // method. -func (client *VirtualNetworkSubnetUsageClient) Execute(ctx context.Context, locationName string, parameters VirtualNetworkSubnetUsageParameter, options *VirtualNetworkSubnetUsageClientExecuteOptions) (VirtualNetworkSubnetUsageClientExecuteResponse, error) { +func (client *VirtualNetworkSubnetUsageClient) List(ctx context.Context, locationName string, parameters VirtualNetworkSubnetUsageParameter, options *VirtualNetworkSubnetUsageClientListOptions) (VirtualNetworkSubnetUsageClientListResponse, error) { var err error - const operationName = "VirtualNetworkSubnetUsageClient.Execute" + const operationName = "VirtualNetworkSubnetUsageClient.List" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) defer func() { endSpan(err) }() - req, err := client.executeCreateRequest(ctx, locationName, parameters, options) + req, err := client.listCreateRequest(ctx, locationName, parameters, options) if err != nil { - return VirtualNetworkSubnetUsageClientExecuteResponse{}, err + return VirtualNetworkSubnetUsageClientListResponse{}, err } httpResp, err := client.internal.Pipeline().Do(req) if err != nil { - return VirtualNetworkSubnetUsageClientExecuteResponse{}, err + return VirtualNetworkSubnetUsageClientListResponse{}, err } if !runtime.HasStatusCode(httpResp, http.StatusOK) { err = runtime.NewResponseError(httpResp) - return VirtualNetworkSubnetUsageClientExecuteResponse{}, err + return VirtualNetworkSubnetUsageClientListResponse{}, err } - resp, err := client.executeHandleResponse(httpResp) + resp, err := client.listHandleResponse(httpResp) return resp, err } -// executeCreateRequest creates the Execute request. -func (client *VirtualNetworkSubnetUsageClient) executeCreateRequest(ctx context.Context, locationName string, parameters VirtualNetworkSubnetUsageParameter, _ *VirtualNetworkSubnetUsageClientExecuteOptions) (*policy.Request, error) { +// listCreateRequest creates the List request. +func (client *VirtualNetworkSubnetUsageClient) listCreateRequest(ctx context.Context, locationName string, parameters VirtualNetworkSubnetUsageParameter, _ *VirtualNetworkSubnetUsageClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.DBforPostgreSQL/locations/{locationName}/checkVirtualNetworkSubnetUsage" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -86,7 +86,7 @@ func (client *VirtualNetworkSubnetUsageClient) executeCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-01-01-preview") + reqQP.Set("api-version", "2025-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -95,11 +95,11 @@ func (client *VirtualNetworkSubnetUsageClient) executeCreateRequest(ctx context. return req, nil } -// executeHandleResponse handles the Execute response. -func (client *VirtualNetworkSubnetUsageClient) executeHandleResponse(resp *http.Response) (VirtualNetworkSubnetUsageClientExecuteResponse, error) { - result := VirtualNetworkSubnetUsageClientExecuteResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualNetworkSubnetUsageResult); err != nil { - return VirtualNetworkSubnetUsageClientExecuteResponse{}, err +// listHandleResponse handles the List response. +func (client *VirtualNetworkSubnetUsageClient) listHandleResponse(resp *http.Response) (VirtualNetworkSubnetUsageClientListResponse, error) { + result := VirtualNetworkSubnetUsageClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.VirtualNetworkSubnetUsageModel); err != nil { + return VirtualNetworkSubnetUsageClientListResponse{}, err } return result, nil } diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/virtualnetworksubnetusage_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/virtualnetworksubnetusage_client_example_test.go index 905ae94f4c00..54f2c005fd77 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/virtualnetworksubnetusage_client_example_test.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/virtualnetworksubnetusage_client_example_test.go @@ -18,8 +18,8 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v5" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b1f4d539964453ce8008e4b069e59885e12ba441/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2025-01-01-preview/examples/VirtualNetworkSubnetUsage.json -func ExampleVirtualNetworkSubnetUsageClient_Execute() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/735d21dbd7e1cc446babf58860af4cca757d620d/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/VirtualNetworkSubnetUsageList.json +func ExampleVirtualNetworkSubnetUsageClient_List() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -29,8 +29,8 @@ func ExampleVirtualNetworkSubnetUsageClient_Execute() { if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewVirtualNetworkSubnetUsageClient().Execute(ctx, "westus", armpostgresqlflexibleservers.VirtualNetworkSubnetUsageParameter{ - VirtualNetworkArmResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/testvnet"), + res, err := clientFactory.NewVirtualNetworkSubnetUsageClient().List(ctx, "eastus", armpostgresqlflexibleservers.VirtualNetworkSubnetUsageParameter{ + VirtualNetworkArmResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.Network/virtualNetworks/examplevirtualnetwork"), }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) @@ -38,17 +38,17 @@ func ExampleVirtualNetworkSubnetUsageClient_Execute() { // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualNetworkSubnetUsageResult = armpostgresqlflexibleservers.VirtualNetworkSubnetUsageResult{ + // res.VirtualNetworkSubnetUsageModel = armpostgresqlflexibleservers.VirtualNetworkSubnetUsageModel{ // DelegatedSubnetsUsage: []*armpostgresqlflexibleservers.DelegatedSubnetUsage{ // { - // SubnetName: to.Ptr("test-subnet-1"), + // SubnetName: to.Ptr("examplesubnet1"), // Usage: to.Ptr[int64](2), // }, // { - // SubnetName: to.Ptr("test-subnet-2"), + // SubnetName: to.Ptr("examplesubnet2"), // Usage: to.Ptr[int64](3), // }}, - // Location: to.Ptr("westus"), + // Location: to.Ptr("eastus"), // SubscriptionID: to.Ptr("ffffffff-ffff-ffff-ffff-ffffffffffff"), // } }