diff --git a/sdk/resourcemanager/postgresql/armpostgresql/CHANGELOG.md b/sdk/resourcemanager/postgresql/armpostgresql/CHANGELOG.md index 377dcb234dd7..9e21c36f5850 100644 --- a/sdk/resourcemanager/postgresql/armpostgresql/CHANGELOG.md +++ b/sdk/resourcemanager/postgresql/armpostgresql/CHANGELOG.md @@ -1,5 +1,408 @@ # Release History +## 2.0.0 (2025-12-05) +### Breaking Changes + +- Function `*ServersClient.BeginUpdate` parameter(s) have been changed from `(ctx context.Context, resourceGroupName string, serverName string, parameters ServerUpdateParameters, options *ServersClientBeginUpdateOptions)` to `(ctx context.Context, resourceGroupName string, serverName string, parameters ServerForPatch, options *ServersClientBeginUpdateOptions)` +- Type of `ConfigurationProperties.DataType` has been changed from `*string` to `*ConfigurationDataType` +- Type of `PrivateEndpointConnectionProperties.PrivateEndpoint` has been changed from `*PrivateEndpointProperty` to `*PrivateEndpoint` +- Type of `PrivateEndpointConnectionProperties.PrivateLinkServiceConnectionState` has been changed from `*PrivateLinkServiceConnectionStateProperty` to `*PrivateLinkServiceConnectionState` +- Type of `PrivateEndpointConnectionProperties.ProvisioningState` has been changed from `*string` to `*PrivateEndpointConnectionProvisioningState` +- Type of `Server.Identity` has been changed from `*ResourceIdentity` to `*UserAssignedIdentity` +- Type of `ServerProperties.PrivateEndpointConnections` has been changed from `[]*ServerPrivateEndpointConnection` to `[]*PrivateEndpointConnection` +- Type of `ServerProperties.ReplicationRole` has been changed from `*string` to `*ReplicationRole` +- Type of `ServerProperties.Version` has been changed from `*ServerVersion` to `*PostgresMajorVersion` +- `SKUTierBasic` from enum `SKUTier` has been removed +- Enum `GeoRedundantBackup` has been removed +- Enum `InfrastructureEncryption` has been removed +- Enum `MinimalTLSVersionEnum` has been removed +- Enum `PrivateEndpointProvisioningState` has been removed +- Enum `PrivateLinkServiceConnectionStateActionsRequire` has been removed +- Enum `PrivateLinkServiceConnectionStateStatus` has been removed +- Enum `PublicNetworkAccessEnum` has been removed +- Enum `SSLEnforcementEnum` has been removed +- Enum `SecurityAlertPolicyName` has been removed +- Enum `ServerKeyType` has been removed +- Enum `ServerSecurityAlertPolicyState` has been removed +- Enum `ServerVersion` has been removed +- Enum `StorageAutogrow` has been removed +- Enum `VirtualNetworkRuleState` has been removed +- Function `NewCheckNameAvailabilityClient` has been removed +- Function `*CheckNameAvailabilityClient.Execute` has been removed +- Function `*ClientFactory.NewCheckNameAvailabilityClient` has been removed +- Function `*ClientFactory.NewLocationBasedPerformanceTierClient` has been removed +- Function `*ClientFactory.NewLogFilesClient` has been removed +- Function `*ClientFactory.NewRecoverableServersClient` has been removed +- Function `*ClientFactory.NewServerAdministratorsClient` has been removed +- Function `*ClientFactory.NewServerBasedPerformanceTierClient` has been removed +- Function `*ClientFactory.NewServerKeysClient` has been removed +- Function `*ClientFactory.NewServerParametersClient` has been removed +- Function `*ClientFactory.NewServerSecurityAlertPoliciesClient` has been removed +- Function `*ClientFactory.NewVirtualNetworkRulesClient` has been removed +- Function `*ConfigurationsClient.BeginCreateOrUpdate` has been removed +- Function `*DatabasesClient.BeginCreateOrUpdate` has been removed +- Function `NewLocationBasedPerformanceTierClient` has been removed +- Function `*LocationBasedPerformanceTierClient.NewListPager` has been removed +- Function `NewLogFilesClient` has been removed +- Function `*LogFilesClient.NewListByServerPager` has been removed +- Function `*PrivateEndpointConnectionsClient.BeginCreateOrUpdate` has been removed +- Function `*PrivateEndpointConnectionsClient.BeginUpdateTags` has been removed +- Function `NewRecoverableServersClient` has been removed +- Function `*RecoverableServersClient.Get` has been removed +- Function `NewServerAdministratorsClient` has been removed +- Function `*ServerAdministratorsClient.BeginCreateOrUpdate` has been removed +- Function `*ServerAdministratorsClient.BeginDelete` has been removed +- Function `*ServerAdministratorsClient.Get` has been removed +- Function `*ServerAdministratorsClient.NewListPager` has been removed +- Function `NewServerBasedPerformanceTierClient` has been removed +- Function `*ServerBasedPerformanceTierClient.NewListPager` has been removed +- Function `NewServerKeysClient` has been removed +- Function `*ServerKeysClient.BeginCreateOrUpdate` has been removed +- Function `*ServerKeysClient.BeginDelete` has been removed +- Function `*ServerKeysClient.Get` has been removed +- Function `*ServerKeysClient.NewListPager` has been removed +- Function `NewServerParametersClient` has been removed +- Function `*ServerParametersClient.BeginListUpdateConfigurations` has been removed +- Function `*ServerPropertiesForCreate.GetServerPropertiesForCreate` has been removed +- Function `*ServerPropertiesForDefaultCreate.GetServerPropertiesForCreate` has been removed +- Function `*ServerPropertiesForGeoRestore.GetServerPropertiesForCreate` has been removed +- Function `*ServerPropertiesForReplica.GetServerPropertiesForCreate` has been removed +- Function `*ServerPropertiesForRestore.GetServerPropertiesForCreate` has been removed +- Function `NewServerSecurityAlertPoliciesClient` has been removed +- Function `*ServerSecurityAlertPoliciesClient.BeginCreateOrUpdate` has been removed +- Function `*ServerSecurityAlertPoliciesClient.Get` has been removed +- Function `*ServerSecurityAlertPoliciesClient.NewListByServerPager` has been removed +- Function `*ServersClient.BeginCreate` has been removed +- Function `*ServersClient.NewListPager` has been removed +- Function `NewVirtualNetworkRulesClient` has been removed +- Function `*VirtualNetworkRulesClient.BeginCreateOrUpdate` has been removed +- Function `*VirtualNetworkRulesClient.BeginDelete` has been removed +- Function `*VirtualNetworkRulesClient.Get` has been removed +- Function `*VirtualNetworkRulesClient.NewListByServerPager` has been removed +- Operation `*OperationsClient.List` has supported pagination, use `*OperationsClient.NewListPager` instead. +- Struct `ConfigurationListResult` has been removed +- Struct `DatabaseListResult` has been removed +- Struct `ErrorAdditionalInfo` has been removed +- Struct `ErrorResponse` has been removed +- Struct `FirewallRuleListResult` has been removed +- Struct `LogFile` has been removed +- Struct `LogFileListResult` has been removed +- Struct `LogFileProperties` has been removed +- Struct `NameAvailability` has been removed +- Struct `NameAvailabilityRequest` has been removed +- Struct `OperationListResult` has been removed +- Struct `PerformanceTierListResult` has been removed +- Struct `PerformanceTierProperties` has been removed +- Struct `PerformanceTierServiceLevelObjectives` has been removed +- Struct `PrivateEndpointConnectionListResult` has been removed +- Struct `PrivateEndpointProperty` has been removed +- Struct `PrivateLinkResourceListResult` has been removed +- Struct `PrivateLinkServiceConnectionStateProperty` has been removed +- Struct `ProxyResource` has been removed +- Struct `RecoverableServerProperties` has been removed +- Struct `RecoverableServerResource` has been removed +- Struct `Resource` has been removed +- Struct `ResourceIdentity` has been removed +- Struct `SecurityAlertPolicyProperties` has been removed +- Struct `ServerAdministratorProperties` has been removed +- Struct `ServerAdministratorResource` has been removed +- Struct `ServerAdministratorResourceListResult` has been removed +- Struct `ServerForCreate` has been removed +- Struct `ServerKey` has been removed +- Struct `ServerKeyListResult` has been removed +- Struct `ServerKeyProperties` has been removed +- Struct `ServerListResult` has been removed +- Struct `ServerPrivateEndpointConnection` has been removed +- Struct `ServerPrivateEndpointConnectionProperties` has been removed +- Struct `ServerPrivateLinkServiceConnectionStateProperty` has been removed +- Struct `ServerPropertiesForDefaultCreate` has been removed +- Struct `ServerPropertiesForGeoRestore` has been removed +- Struct `ServerPropertiesForReplica` has been removed +- Struct `ServerPropertiesForRestore` has been removed +- Struct `ServerSecurityAlertPolicy` has been removed +- Struct `ServerSecurityAlertPolicyListResult` has been removed +- Struct `ServerUpdateParameters` has been removed +- Struct `ServerUpdateParametersProperties` has been removed +- Struct `StorageProfile` has been removed +- Struct `TagsObject` has been removed +- Struct `TrackedResource` has been removed +- Struct `VirtualNetworkRule` has been removed +- Struct `VirtualNetworkRuleListResult` has been removed +- Struct `VirtualNetworkRuleProperties` has been removed +- Field `ConfigurationListResult` of struct `ConfigurationsClientListByServerResponse` has been removed +- Field `DatabaseListResult` of struct `DatabasesClientListByServerResponse` has been removed +- Field `FirewallRuleListResult` of struct `FirewallRulesClientListByServerResponse` 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 `Capacity`, `Family`, `Size` of struct `SKU` has been removed +- Field `ByokEnforcement`, `EarliestRestoreDate`, `InfrastructureEncryption`, `MasterServerID`, `MinimalTLSVersion`, `PublicNetworkAccess`, `SSLEnforcement`, `StorageProfile`, `UserVisibleState` of struct `ServerProperties` has been removed +- Field `ServerListResult` of struct `ServersClientListByResourceGroupResponse` has been removed + +### Features Added + +- New value `CreateModeCreate`, `CreateModeReviveDropped`, `CreateModeUpdate` added to enum type `CreateMode` +- New value `IdentityTypeNone`, `IdentityTypeSystemAssignedUserAssigned`, `IdentityTypeUserAssigned` added to enum type `IdentityType` +- New value `SKUTierBurstable` added to enum type `SKUTier` +- New value `ServerStateProvisioning`, `ServerStateRestarting`, `ServerStateStarting`, `ServerStateStopped`, `ServerStateStopping`, `ServerStateUpdating` added to enum type `ServerState` +- 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 `CapabilityStatus` with values `CapabilityStatusAvailable`, `CapabilityStatusDefault`, `CapabilityStatusDisabled`, `CapabilityStatusVisible` +- New enum type `CheckNameAvailabilityReason` with values `CheckNameAvailabilityReasonAlreadyExists`, `CheckNameAvailabilityReasonInvalid` +- New enum type `ConfigurationDataType` with values `ConfigurationDataTypeBoolean`, `ConfigurationDataTypeEnumeration`, `ConfigurationDataTypeInteger`, `ConfigurationDataTypeNumeric`, `ConfigurationDataTypeSet`, `ConfigurationDataTypeString` +- New enum type `CreateModeForPatch` with values `CreateModeForPatchDefault`, `CreateModeForPatchUpdate` +- New enum type `CreatedByType` with values `CreatedByTypeApplication`, `CreatedByTypeKey`, `CreatedByTypeManagedIdentity`, `CreatedByTypeUser` +- New enum type `DataEncryptionType` with values `DataEncryptionTypeAzureKeyVault`, `DataEncryptionTypeSystemManaged` +- New enum type `EncryptionKeyStatus` with values `EncryptionKeyStatusInvalid`, `EncryptionKeyStatusValid` +- New enum type `ExecutionStatus` with values `ExecutionStatusCancelled`, `ExecutionStatusFailed`, `ExecutionStatusRunning`, `ExecutionStatusSucceeded` +- New enum type `FailoverMode` with values `FailoverModeForcedFailover`, `FailoverModeForcedSwitchover`, `FailoverModePlannedFailover`, `FailoverModePlannedSwitchover` +- New enum type `FastProvisioningSupport` with values `FastProvisioningSupportDisabled`, `FastProvisioningSupportEnabled` +- New enum type `FeatureStatus` with values `FeatureStatusDisabled`, `FeatureStatusEnabled` +- New enum type `FlexibleServerHighAvailabilityMode` with values `FlexibleServerHighAvailabilityModeDisabled`, `FlexibleServerHighAvailabilityModeSameZone`, `FlexibleServerHighAvailabilityModeZoneRedundant` +- New enum type `GeographicallyRedundantBackup` with values `GeographicallyRedundantBackupDisabled`, `GeographicallyRedundantBackupEnabled` +- New enum type `GeographicallyRedundantBackupSupport` with values `GeographicallyRedundantBackupSupportDisabled`, `GeographicallyRedundantBackupSupportEnabled` +- New enum type `HighAvailabilityMode` with values `HighAvailabilityModeSameZone`, `HighAvailabilityModeZoneRedundant` +- 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 `MigrationListFilter` with values `MigrationListFilterActive`, `MigrationListFilterAll` +- New enum type `MigrationMode` with values `MigrationModeOffline`, `MigrationModeOnline` +- New enum type `MigrationNameAvailabilityReason` with values `MigrationNameAvailabilityReasonAlreadyExists`, `MigrationNameAvailabilityReasonInvalid` +- New enum type `MigrationOption` with values `MigrationOptionMigrate`, `MigrationOptionValidate`, `MigrationOptionValidateAndMigrate` +- New enum type `MigrationState` with values `MigrationStateCanceled`, `MigrationStateCleaningUp`, `MigrationStateFailed`, `MigrationStateInProgress`, `MigrationStateSucceeded`, `MigrationStateValidationFailed`, `MigrationStateWaitingForUserAction` +- 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 `PostgresMajorVersion11`, `PostgresMajorVersion12`, `PostgresMajorVersion13`, `PostgresMajorVersion14`, `PostgresMajorVersion15`, `PostgresMajorVersion16`, `PostgresMajorVersion17`, `PostgresMajorVersion18` +- New enum type `PrincipalType` with values `PrincipalTypeGroup`, `PrincipalTypeServicePrincipal`, `PrincipalTypeUnknown`, `PrincipalTypeUser` +- New enum type `PrivateEndpointConnectionProvisioningState` with values `PrivateEndpointConnectionProvisioningStateCreating`, `PrivateEndpointConnectionProvisioningStateDeleting`, `PrivateEndpointConnectionProvisioningStateFailed`, `PrivateEndpointConnectionProvisioningStateSucceeded` +- New enum type `PrivateEndpointServiceConnectionStatus` with values `PrivateEndpointServiceConnectionStatusApproved`, `PrivateEndpointServiceConnectionStatusPending`, `PrivateEndpointServiceConnectionStatusRejected` +- New enum type `ReadReplicaPromoteMode` with values `ReadReplicaPromoteModeStandalone`, `ReadReplicaPromoteModeSwitchover` +- 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 `ReplicationRole` with values `ReplicationRoleAsyncReplica`, `ReplicationRoleGeoAsyncReplica`, `ReplicationRoleNone`, `ReplicationRolePrimary` +- New enum type `ReplicationState` with values `ReplicationStateActive`, `ReplicationStateBroken`, `ReplicationStateCatchup`, `ReplicationStateProvisioning`, `ReplicationStateReconfiguring`, `ReplicationStateUpdating` +- New enum type `SSLMode` with values `SSLModePrefer`, `SSLModeRequire`, `SSLModeVerifyCA`, `SSLModeVerifyFull` +- New enum type `ServerPublicNetworkAccessState` with values `ServerPublicNetworkAccessStateDisabled`, `ServerPublicNetworkAccessStateEnabled` +- New enum type `SourceType` with values `SourceTypeAWS`, `SourceTypeAWSAURORA`, `SourceTypeAWSEC2`, `SourceTypeAWSRDS`, `SourceTypeApsaraDBRDS`, `SourceTypeAzureVM`, `SourceTypeCrunchyPostgreSQL`, `SourceTypeDigitalOceanDroplets`, `SourceTypeDigitalOceanPostgreSQL`, `SourceTypeEDB`, `SourceTypeEDBOracleServer`, `SourceTypeEDBPostgreSQL`, `SourceTypeGCP`, `SourceTypeGCPAlloyDB`, `SourceTypeGCPCloudSQL`, `SourceTypeGCPCompute`, `SourceTypeHerokuPostgreSQL`, `SourceTypeHuaweiCompute`, `SourceTypeHuaweiRDS`, `SourceTypeOnPremises`, `SourceTypePostgreSQLCosmosDB`, `SourceTypePostgreSQLFlexibleServer`, `SourceTypePostgreSQLSingleServer`, `SourceTypeSupabasePostgreSQL` +- New enum type `StartDataMigration` with values `StartDataMigrationFalse`, `StartDataMigrationTrue` +- New enum type `StorageAutoGrow` with values `StorageAutoGrowDisabled`, `StorageAutoGrowEnabled` +- New enum type `StorageAutoGrowthSupport` with values `StorageAutoGrowthSupportDisabled`, `StorageAutoGrowthSupportEnabled` +- New enum type `StorageType` with values `StorageTypePremiumLRS`, `StorageTypePremiumV2LRS`, `StorageTypeUltraSSDLRS` +- New enum type `ThreatProtectionName` with values `ThreatProtectionNameDefault` +- New enum type `ThreatProtectionState` with values `ThreatProtectionStateDisabled`, `ThreatProtectionStateEnabled` +- New enum type `TriggerCutover` with values `TriggerCutoverFalse`, `TriggerCutoverTrue` +- New enum type `TuningOptionParameterEnum` with values `TuningOptionParameterEnumIndex`, `TuningOptionParameterEnumTable` +- New enum type `ValidationState` with values `ValidationStateFailed`, `ValidationStateSucceeded`, `ValidationStateWarning` +- New enum type `VirtualEndpointType` with values `VirtualEndpointTypeReadWrite` +- New enum type `ZoneRedundantHighAvailabilityAndGeographicallyRedundantBackupSupport` with values `ZoneRedundantHighAvailabilityAndGeographicallyRedundantBackupSupportDisabled`, `ZoneRedundantHighAvailabilityAndGeographicallyRedundantBackupSupportEnabled` +- New enum type `ZoneRedundantHighAvailabilitySupport` with values `ZoneRedundantHighAvailabilitySupportDisabled`, `ZoneRedundantHighAvailabilitySupportEnabled` +- New function `NewAdministratorsMicrosoftEntraClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AdministratorsMicrosoftEntraClient, error)` +- New function `*AdministratorsMicrosoftEntraClient.BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, objectID string, parameters AdministratorMicrosoftEntraAdd, options *AdministratorsMicrosoftEntraClientBeginCreateOrUpdateOptions) (*runtime.Poller[AdministratorsMicrosoftEntraClientCreateOrUpdateResponse], error)` +- New function `*AdministratorsMicrosoftEntraClient.BeginDelete(ctx context.Context, resourceGroupName string, serverName string, objectID string, options *AdministratorsMicrosoftEntraClientBeginDeleteOptions) (*runtime.Poller[AdministratorsMicrosoftEntraClientDeleteResponse], error)` +- New function `*AdministratorsMicrosoftEntraClient.Get(ctx context.Context, resourceGroupName string, serverName string, objectID string, options *AdministratorsMicrosoftEntraClientGetOptions) (AdministratorsMicrosoftEntraClientGetResponse, error)` +- New function `*AdministratorsMicrosoftEntraClient.NewListByServerPager(resourceGroupName string, serverName string, options *AdministratorsMicrosoftEntraClientListByServerOptions) *runtime.Pager[AdministratorsMicrosoftEntraClientListByServerResponse]` +- New function `NewAdvancedThreatProtectionSettingsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AdvancedThreatProtectionSettingsClient, error)` +- New function `*AdvancedThreatProtectionSettingsClient.Get(ctx context.Context, resourceGroupName string, serverName string, threatProtectionName ThreatProtectionName, options *AdvancedThreatProtectionSettingsClientGetOptions) (AdvancedThreatProtectionSettingsClientGetResponse, error)` +- New function `*AdvancedThreatProtectionSettingsClient.NewListByServerPager(resourceGroupName string, serverName string, options *AdvancedThreatProtectionSettingsClientListByServerOptions) *runtime.Pager[AdvancedThreatProtectionSettingsClientListByServerResponse]` +- New function `NewBackupsAutomaticAndOnDemandClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*BackupsAutomaticAndOnDemandClient, error)` +- New function `*BackupsAutomaticAndOnDemandClient.BeginCreate(ctx context.Context, resourceGroupName string, serverName string, backupName string, options *BackupsAutomaticAndOnDemandClientBeginCreateOptions) (*runtime.Poller[BackupsAutomaticAndOnDemandClientCreateResponse], error)` +- New function `*BackupsAutomaticAndOnDemandClient.BeginDelete(ctx context.Context, resourceGroupName string, serverName string, backupName string, options *BackupsAutomaticAndOnDemandClientBeginDeleteOptions) (*runtime.Poller[BackupsAutomaticAndOnDemandClientDeleteResponse], error)` +- New function `*BackupsAutomaticAndOnDemandClient.Get(ctx context.Context, resourceGroupName string, serverName string, backupName string, options *BackupsAutomaticAndOnDemandClientGetOptions) (BackupsAutomaticAndOnDemandClientGetResponse, error)` +- New function `*BackupsAutomaticAndOnDemandClient.NewListByServerPager(resourceGroupName string, serverName string, options *BackupsAutomaticAndOnDemandClientListByServerOptions) *runtime.Pager[BackupsAutomaticAndOnDemandClientListByServerResponse]` +- New function `NewBackupsLongTermRetentionClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*BackupsLongTermRetentionClient, error)` +- New function `*BackupsLongTermRetentionClient.CheckPrerequisites(ctx context.Context, resourceGroupName string, serverName string, parameters LtrPreBackupRequest, options *BackupsLongTermRetentionClientCheckPrerequisitesOptions) (BackupsLongTermRetentionClientCheckPrerequisitesResponse, error)` +- New function `*BackupsLongTermRetentionClient.Get(ctx context.Context, resourceGroupName string, serverName string, backupName string, options *BackupsLongTermRetentionClientGetOptions) (BackupsLongTermRetentionClientGetResponse, error)` +- New function `*BackupsLongTermRetentionClient.NewListByServerPager(resourceGroupName string, serverName string, options *BackupsLongTermRetentionClientListByServerOptions) *runtime.Pager[BackupsLongTermRetentionClientListByServerResponse]` +- New function `*BackupsLongTermRetentionClient.BeginStart(ctx context.Context, resourceGroupName string, serverName string, parameters BackupsLongTermRetentionRequest, options *BackupsLongTermRetentionClientBeginStartOptions) (*runtime.Poller[BackupsLongTermRetentionClientStartResponse], error)` +- New function `NewCapabilitiesByLocationClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*CapabilitiesByLocationClient, error)` +- New function `*CapabilitiesByLocationClient.NewListPager(locationName string, options *CapabilitiesByLocationClientListOptions) *runtime.Pager[CapabilitiesByLocationClientListResponse]` +- New function `NewCapabilitiesByServerClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*CapabilitiesByServerClient, error)` +- New function `*CapabilitiesByServerClient.NewListPager(resourceGroupName string, serverName string, options *CapabilitiesByServerClientListOptions) *runtime.Pager[CapabilitiesByServerClientListResponse]` +- New function `NewCapturedLogsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*CapturedLogsClient, error)` +- New function `*CapturedLogsClient.NewListByServerPager(resourceGroupName string, serverName string, options *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.NewMigrationsClient() *MigrationsClient` +- New function `*ClientFactory.NewNameAvailabilityClient() *NameAvailabilityClient` +- New function `*ClientFactory.NewPrivateDNSZoneSuffixClient() *PrivateDNSZoneSuffixClient` +- New function `*ClientFactory.NewQuotaUsagesClient() *QuotaUsagesClient` +- New function `*ClientFactory.NewServerThreatProtectionSettingsClient() *ServerThreatProtectionSettingsClient` +- New function `*ClientFactory.NewTuningOptionsClient() *TuningOptionsClient` +- New function `*ClientFactory.NewVirtualEndpointsClient() *VirtualEndpointsClient` +- New function `*ClientFactory.NewVirtualNetworkSubnetUsageClient() *VirtualNetworkSubnetUsageClient` +- New function `*ConfigurationsClient.BeginPut(ctx context.Context, resourceGroupName string, serverName string, configurationName string, parameters ConfigurationForUpdate, options *ConfigurationsClientBeginPutOptions) (*runtime.Poller[ConfigurationsClientPutResponse], error)` +- New function `*ConfigurationsClient.BeginUpdate(ctx context.Context, resourceGroupName string, serverName string, configurationName string, parameters ConfigurationForUpdate, options *ConfigurationsClientBeginUpdateOptions) (*runtime.Poller[ConfigurationsClientUpdateResponse], error)` +- New function `*DatabasesClient.BeginCreate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters Database, options *DatabasesClientBeginCreateOptions) (*runtime.Poller[DatabasesClientCreateResponse], error)` +- New function `NewMigrationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*MigrationsClient, error)` +- New function `*MigrationsClient.Cancel(ctx context.Context, resourceGroupName string, serverName string, migrationName string, options *MigrationsClientCancelOptions) (MigrationsClientCancelResponse, error)` +- New function `*MigrationsClient.CheckNameAvailability(ctx context.Context, resourceGroupName string, serverName string, parameters MigrationNameAvailability, options *MigrationsClientCheckNameAvailabilityOptions) (MigrationsClientCheckNameAvailabilityResponse, error)` +- New function `*MigrationsClient.Create(ctx context.Context, resourceGroupName string, serverName string, migrationName string, parameters Migration, options *MigrationsClientCreateOptions) (MigrationsClientCreateResponse, error)` +- New function `*MigrationsClient.Get(ctx context.Context, resourceGroupName string, serverName string, migrationName string, options *MigrationsClientGetOptions) (MigrationsClientGetResponse, error)` +- New function `*MigrationsClient.NewListByTargetServerPager(resourceGroupName string, serverName string, options *MigrationsClientListByTargetServerOptions) *runtime.Pager[MigrationsClientListByTargetServerResponse]` +- New function `*MigrationsClient.Update(ctx context.Context, resourceGroupName string, serverName string, migrationName string, parameters MigrationResourceForPatch, options *MigrationsClientUpdateOptions) (MigrationsClientUpdateResponse, error)` +- New function `NewPrivateDNSZoneSuffixClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*PrivateDNSZoneSuffixClient, error)` +- New function `*PrivateDNSZoneSuffixClient.Get(ctx context.Context, options *PrivateDNSZoneSuffixClientGetOptions) (PrivateDNSZoneSuffixClientGetResponse, error)` +- New function `*PrivateEndpointConnectionsClient.BeginUpdate(ctx context.Context, resourceGroupName string, serverName string, privateEndpointConnectionName string, parameters PrivateEndpointConnection, options *PrivateEndpointConnectionsClientBeginUpdateOptions) (*runtime.Poller[PrivateEndpointConnectionsClientUpdateResponse], error)` +- New function `NewQuotaUsagesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*QuotaUsagesClient, error)` +- New function `*QuotaUsagesClient.NewListPager(locationName string, options *QuotaUsagesClientListOptions) *runtime.Pager[QuotaUsagesClientListResponse]` +- New function `NewServerThreatProtectionSettingsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ServerThreatProtectionSettingsClient, error)` +- New function `*ServerThreatProtectionSettingsClient.BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, threatProtectionName ThreatProtectionName, parameters AdvancedThreatProtectionSettingsModel, options *ServerThreatProtectionSettingsClientBeginCreateOrUpdateOptions) (*runtime.Poller[ServerThreatProtectionSettingsClientCreateOrUpdateResponse], error)` +- New function `*ServersClient.BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, parameters Server, options *ServersClientBeginCreateOrUpdateOptions) (*runtime.Poller[ServersClientCreateOrUpdateResponse], error)` +- New function `*ServersClient.NewListBySubscriptionPager(options *ServersClientListBySubscriptionOptions) *runtime.Pager[ServersClientListBySubscriptionResponse]` +- New function `*ServersClient.BeginStart(ctx context.Context, resourceGroupName string, serverName string, options *ServersClientBeginStartOptions) (*runtime.Poller[ServersClientStartResponse], error)` +- New function `*ServersClient.BeginStop(ctx context.Context, resourceGroupName string, serverName string, options *ServersClientBeginStopOptions) (*runtime.Poller[ServersClientStopResponse], error)` +- New function `NewTuningOptionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*TuningOptionsClient, error)` +- New function `*TuningOptionsClient.Get(ctx context.Context, resourceGroupName string, serverName string, tuningOption TuningOptionParameterEnum, options *TuningOptionsClientGetOptions) (TuningOptionsClientGetResponse, error)` +- New function `*TuningOptionsClient.NewListByServerPager(resourceGroupName string, serverName string, options *TuningOptionsClientListByServerOptions) *runtime.Pager[TuningOptionsClientListByServerResponse]` +- New function `*TuningOptionsClient.NewListRecommendationsPager(resourceGroupName string, serverName string, tuningOption TuningOptionParameterEnum, options *TuningOptionsClientListRecommendationsOptions) *runtime.Pager[TuningOptionsClientListRecommendationsResponse]` +- New function `NewVirtualEndpointsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VirtualEndpointsClient, error)` +- New function `*VirtualEndpointsClient.BeginCreate(ctx context.Context, resourceGroupName string, serverName string, virtualEndpointName string, parameters VirtualEndpoint, options *VirtualEndpointsClientBeginCreateOptions) (*runtime.Poller[VirtualEndpointsClientCreateResponse], error)` +- New function `*VirtualEndpointsClient.BeginDelete(ctx context.Context, resourceGroupName string, serverName string, virtualEndpointName string, options *VirtualEndpointsClientBeginDeleteOptions) (*runtime.Poller[VirtualEndpointsClientDeleteResponse], error)` +- New function `*VirtualEndpointsClient.Get(ctx context.Context, resourceGroupName string, serverName string, virtualEndpointName string, options *VirtualEndpointsClientGetOptions) (VirtualEndpointsClientGetResponse, error)` +- New function `*VirtualEndpointsClient.NewListByServerPager(resourceGroupName string, serverName string, options *VirtualEndpointsClientListByServerOptions) *runtime.Pager[VirtualEndpointsClientListByServerResponse]` +- New function `*VirtualEndpointsClient.BeginUpdate(ctx context.Context, resourceGroupName string, serverName string, virtualEndpointName string, parameters VirtualEndpointResourceForPatch, options *VirtualEndpointsClientBeginUpdateOptions) (*runtime.Poller[VirtualEndpointsClientUpdateResponse], error)` +- New function `NewVirtualNetworkSubnetUsageClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VirtualNetworkSubnetUsageClient, error)` +- New function `*VirtualNetworkSubnetUsageClient.List(ctx context.Context, locationName string, parameters VirtualNetworkSubnetUsageParameter, options *VirtualNetworkSubnetUsageClientListOptions) (VirtualNetworkSubnetUsageClientListResponse, error)` +- New function `NewNameAvailabilityClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*NameAvailabilityClient, error)` +- New function `*NameAvailabilityClient.CheckGlobally(ctx context.Context, parameters CheckNameAvailabilityRequest, options *NameAvailabilityClientCheckGloballyOptions) (NameAvailabilityClientCheckGloballyResponse, error)` +- New function `*NameAvailabilityClient.CheckWithLocation(ctx context.Context, locationName string, parameters CheckNameAvailabilityRequest, options *NameAvailabilityClientCheckWithLocationOptions) (NameAvailabilityClientCheckWithLocationResponse, error)` +- New struct `AdminCredentials` +- 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 `AuthConfig` +- New struct `AuthConfigForPatch` +- New struct `Backup` +- New struct `BackupAutomaticAndOnDemand` +- New struct `BackupAutomaticAndOnDemandList` +- New struct `BackupAutomaticAndOnDemandProperties` +- New struct `BackupForPatch` +- New struct `BackupSettings` +- New struct `BackupStoreDetails` +- 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 `CheckNameAvailabilityRequest` +- New struct `Cluster` +- New struct `ConfigurationForUpdate` +- New struct `ConfigurationList` +- New struct `DataEncryption` +- New struct `DatabaseList` +- New struct `DatabaseMigrationState` +- New struct `DbLevelValidationStatus` +- New struct `DbServerMetadata` +- New struct `DelegatedSubnetUsage` +- New struct `FastProvisioningEditionCapability` +- New struct `FirewallRuleList` +- New struct `HighAvailability` +- New struct `HighAvailabilityForPatch` +- New struct `ImpactRecord` +- New struct `LtrBackupOperationResponseProperties` +- New struct `LtrPreBackupRequest` +- New struct `LtrPreBackupResponse` +- New struct `LtrServerBackupOperationList` +- New struct `MaintenanceWindow` +- New struct `MaintenanceWindowForPatch` +- New struct `Migration` +- New struct `MigrationList` +- New struct `MigrationNameAvailability` +- New struct `MigrationProperties` +- New struct `MigrationPropertiesForPatch` +- New struct `MigrationResourceForPatch` +- New struct `MigrationSecretParameters` +- New struct `MigrationSecretParametersForPatch` +- New struct `MigrationStatus` +- New struct `MigrationSubstateDetails` +- New struct `NameAvailabilityModel` +- New struct `NameProperty` +- New struct `Network` +- New struct `ObjectRecommendation` +- New struct `ObjectRecommendationDetails` +- New struct `ObjectRecommendationList` +- New struct `ObjectRecommendationProperties` +- New struct `ObjectRecommendationPropertiesAnalyzedWorkload` +- New struct `ObjectRecommendationPropertiesImplementationDetails` +- New struct `OperationList` +- New struct `PrivateEndpoint` +- New struct `PrivateEndpointConnectionList` +- New struct `PrivateLinkResourceList` +- New struct `PrivateLinkServiceConnectionState` +- New struct `QuotaUsage` +- New struct `QuotaUsageList` +- New struct `Replica` +- New struct `RestartParameter` +- New struct `SKUForPatch` +- New struct `ServerEditionCapability` +- New struct `ServerForPatch` +- New struct `ServerList` +- New struct `ServerPropertiesForPatch` +- New struct `ServerSKU` +- New struct `ServerSKUCapability` +- New struct `ServerVersionCapability` +- New struct `Storage` +- New struct `StorageEditionCapability` +- New struct `StorageMbCapability` +- New struct `StorageTierCapability` +- New struct `SupportedFeature` +- New struct `SystemData` +- New struct `TuningOptions` +- New struct `TuningOptionsList` +- New struct `UserAssignedIdentity` +- New struct `UserIdentity` +- New struct `ValidationDetails` +- New struct `ValidationMessage` +- New struct `ValidationSummaryItem` +- New struct `VirtualEndpoint` +- New struct `VirtualEndpointResourceForPatch` +- New struct `VirtualEndpointResourceProperties` +- New struct `VirtualEndpointsList` +- New struct `VirtualNetworkSubnetUsageModel` +- New struct `VirtualNetworkSubnetUsageParameter` +- New field `SystemData` in struct `Configuration` +- New field `DocumentationLink`, `IsConfigPendingRestart`, `IsDynamicConfig`, `IsReadOnly`, `Unit` in struct `ConfigurationProperties` +- New anonymous field `ConfigurationList` in struct `ConfigurationsClientListByServerResponse` +- New field `SystemData` in struct `Database` +- New anonymous field `DatabaseList` in struct `DatabasesClientListByServerResponse` +- New field `SystemData` in struct `FirewallRule` +- New anonymous field `FirewallRuleList` in struct `FirewallRulesClientListByServerResponse` +- New field `IsDataAction` in struct `Operation` +- New field `SystemData` in struct `PrivateEndpointConnection` +- New field `GroupIDs` in struct `PrivateEndpointConnectionProperties` +- New anonymous field `PrivateEndpointConnectionList` in struct `PrivateEndpointConnectionsClientListByServerResponse` +- New field `SystemData` in struct `PrivateLinkResource` +- New field `RequiredZoneNames` in struct `PrivateLinkResourceProperties` +- New anonymous field `PrivateLinkResourceList` in struct `PrivateLinkResourcesClientListByServerResponse` +- New anonymous field `ServerList` in struct `ReplicasClientListByServerResponse` +- New field `SystemData` in struct `Server` +- New field `AdministratorLoginPassword`, `AuthConfig`, `AvailabilityZone`, `Backup`, `Cluster`, `CreateMode`, `DataEncryption`, `HighAvailability`, `MaintenanceWindow`, `MinorVersion`, `Network`, `PointInTimeUTC`, `Replica`, `SourceServerResourceID`, `State`, `Storage` in struct `ServerProperties` +- New field `Parameters` in struct `ServersClientBeginRestartOptions` +- New anonymous field `ServerList` in struct `ServersClientListByResourceGroupResponse` + + ## 1.2.0 (2023-11-30) ### Features Added diff --git a/sdk/resourcemanager/postgresql/armpostgresql/README.md b/sdk/resourcemanager/postgresql/armpostgresql/README.md index 1f22024da97a..a6de89f9f8b7 100644 --- a/sdk/resourcemanager/postgresql/armpostgresql/README.md +++ b/sdk/resourcemanager/postgresql/armpostgresql/README.md @@ -18,7 +18,7 @@ This project uses [Go modules](https://github.com/golang/go/wiki/Modules) for ve Install the Azure Database for PostgreSQL module: ```sh -go get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresql +go get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresql/v2 ``` ## Authorization @@ -55,7 +55,7 @@ clientFactory, err := armpostgresql.NewClientFactory(, cred, &o A client groups a set of related APIs, providing access to its functionality. Create one or more clients to access the APIs you require using client factory. ```go -client := clientFactory.NewServersClient() +client := clientFactory.NewAdministratorsMicrosoftEntraClient() ``` ## Fakes diff --git a/sdk/resourcemanager/postgresql/armpostgresql/virtualnetworkrules_client.go b/sdk/resourcemanager/postgresql/armpostgresql/administratorsmicrosoftentra_client.go similarity index 50% rename from sdk/resourcemanager/postgresql/armpostgresql/virtualnetworkrules_client.go rename to sdk/resourcemanager/postgresql/armpostgresql/administratorsmicrosoftentra_client.go index 60cef5b548de..feb2142a2c23 100644 --- a/sdk/resourcemanager/postgresql/armpostgresql/virtualnetworkrules_client.go +++ b/sdk/resourcemanager/postgresql/armpostgresql/administratorsmicrosoftentra_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armpostgresql @@ -17,67 +16,68 @@ import ( "strings" ) -// VirtualNetworkRulesClient contains the methods for the VirtualNetworkRules group. -// Don't use this type directly, use NewVirtualNetworkRulesClient() instead. -type VirtualNetworkRulesClient struct { +// AdministratorsMicrosoftEntraClient contains the methods for the AdministratorsMicrosoftEntra group. +// Don't use this type directly, use NewAdministratorsMicrosoftEntraClient() instead. +type AdministratorsMicrosoftEntraClient struct { internal *arm.Client subscriptionID string } -// NewVirtualNetworkRulesClient creates a new instance of VirtualNetworkRulesClient with the specified values. -// - subscriptionID - The ID of the target subscription. +// NewAdministratorsMicrosoftEntraClient creates a new instance of AdministratorsMicrosoftEntraClient 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 NewVirtualNetworkRulesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VirtualNetworkRulesClient, error) { +// - options - Contains optional client configuration. Pass nil to accept the default values. +func NewAdministratorsMicrosoftEntraClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AdministratorsMicrosoftEntraClient, error) { cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) if err != nil { return nil, err } - client := &VirtualNetworkRulesClient{ + client := &AdministratorsMicrosoftEntraClient{ subscriptionID: subscriptionID, internal: cl, } return client, nil } -// BeginCreateOrUpdate - Creates or updates an existing virtual network rule. +// BeginCreateOrUpdate - Creates a new server administrator associated to a Microsoft Entra principal. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2017-12-01 +// 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. -// - virtualNetworkRuleName - The name of the virtual network rule. -// - parameters - The requested virtual Network Rule Resource state. -// - options - VirtualNetworkRulesClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualNetworkRulesClient.BeginCreateOrUpdate +// - objectID - Object identifier of the Microsoft Entra principal. +// - parameters - Required parameters for adding a server administrator associated to a Microsoft Entra principal. +// - options - AdministratorsMicrosoftEntraClientBeginCreateOrUpdateOptions contains the optional parameters for the AdministratorsMicrosoftEntraClient.BeginCreateOrUpdate // method. -func (client *VirtualNetworkRulesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, virtualNetworkRuleName string, parameters VirtualNetworkRule, options *VirtualNetworkRulesClientBeginCreateOrUpdateOptions) (*runtime.Poller[VirtualNetworkRulesClientCreateOrUpdateResponse], error) { +func (client *AdministratorsMicrosoftEntraClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, objectID string, parameters AdministratorMicrosoftEntraAdd, options *AdministratorsMicrosoftEntraClientBeginCreateOrUpdateOptions) (*runtime.Poller[AdministratorsMicrosoftEntraClientCreateOrUpdateResponse], error) { if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, serverName, virtualNetworkRuleName, parameters, options) + resp, err := client.createOrUpdate(ctx, resourceGroupName, serverName, objectID, parameters, options) if err != nil { return nil, err } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualNetworkRulesClientCreateOrUpdateResponse]{ - Tracer: client.internal.Tracer(), + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[AdministratorsMicrosoftEntraClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + Tracer: client.internal.Tracer(), }) return poller, err } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualNetworkRulesClientCreateOrUpdateResponse]{ + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[AdministratorsMicrosoftEntraClientCreateOrUpdateResponse]{ Tracer: client.internal.Tracer(), }) } } -// CreateOrUpdate - Creates or updates an existing virtual network rule. +// CreateOrUpdate - Creates a new server administrator associated to a Microsoft Entra principal. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2017-12-01 -func (client *VirtualNetworkRulesClient) createOrUpdate(ctx context.Context, resourceGroupName string, serverName string, virtualNetworkRuleName string, parameters VirtualNetworkRule, options *VirtualNetworkRulesClientBeginCreateOrUpdateOptions) (*http.Response, error) { +// Generated from API version 2025-08-01 +func (client *AdministratorsMicrosoftEntraClient) createOrUpdate(ctx context.Context, resourceGroupName string, serverName string, objectID string, parameters AdministratorMicrosoftEntraAdd, options *AdministratorsMicrosoftEntraClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error - const operationName = "VirtualNetworkRulesClient.BeginCreateOrUpdate" + const operationName = "AdministratorsMicrosoftEntraClient.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.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, virtualNetworkRuleName, parameters, options) + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, objectID, parameters, options) if err != nil { return nil, err } @@ -85,7 +85,7 @@ func (client *VirtualNetworkRulesClient) createOrUpdate(ctx context.Context, res 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 } @@ -93,8 +93,12 @@ func (client *VirtualNetworkRulesClient) createOrUpdate(ctx context.Context, res } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *VirtualNetworkRulesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, serverName string, virtualNetworkRuleName string, parameters VirtualNetworkRule, options *VirtualNetworkRulesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/virtualNetworkRules/{virtualNetworkRuleName}" +func (client *AdministratorsMicrosoftEntraClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, serverName string, objectID string, parameters AdministratorMicrosoftEntraAdd, _ *AdministratorsMicrosoftEntraClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/administrators/{objectId}" + 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") } @@ -103,65 +107,61 @@ func (client *VirtualNetworkRulesClient) createOrUpdateCreateRequest(ctx context return nil, errors.New("parameter serverName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{serverName}", url.PathEscape(serverName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if virtualNetworkRuleName == "" { - return nil, errors.New("parameter virtualNetworkRuleName cannot be empty") + if objectID == "" { + return nil, errors.New("parameter objectID cannot be empty") } - urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkRuleName}", url.PathEscape(virtualNetworkRuleName)) + urlPath = strings.ReplaceAll(urlPath, "{objectId}", url.PathEscape(objectID)) 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", "2017-12-01") + reqQP.Set("api-version", "2025-08-01") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } return req, nil } -// BeginDelete - Deletes the virtual network rule with the given name. +// BeginDelete - Deletes an existing server administrator associated to a Microsoft Entra principal. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2017-12-01 +// 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. -// - virtualNetworkRuleName - The name of the virtual network rule. -// - options - VirtualNetworkRulesClientBeginDeleteOptions contains the optional parameters for the VirtualNetworkRulesClient.BeginDelete +// - objectID - Object identifier of the Microsoft Entra principal. +// - options - AdministratorsMicrosoftEntraClientBeginDeleteOptions contains the optional parameters for the AdministratorsMicrosoftEntraClient.BeginDelete // method. -func (client *VirtualNetworkRulesClient) BeginDelete(ctx context.Context, resourceGroupName string, serverName string, virtualNetworkRuleName string, options *VirtualNetworkRulesClientBeginDeleteOptions) (*runtime.Poller[VirtualNetworkRulesClientDeleteResponse], error) { +func (client *AdministratorsMicrosoftEntraClient) BeginDelete(ctx context.Context, resourceGroupName string, serverName string, objectID string, options *AdministratorsMicrosoftEntraClientBeginDeleteOptions) (*runtime.Poller[AdministratorsMicrosoftEntraClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, serverName, virtualNetworkRuleName, options) + resp, err := client.deleteOperation(ctx, resourceGroupName, serverName, objectID, options) if err != nil { return nil, err } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualNetworkRulesClientDeleteResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[AdministratorsMicrosoftEntraClientDeleteResponse]{ Tracer: client.internal.Tracer(), }) return poller, err } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualNetworkRulesClientDeleteResponse]{ + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[AdministratorsMicrosoftEntraClientDeleteResponse]{ Tracer: client.internal.Tracer(), }) } } -// Delete - Deletes the virtual network rule with the given name. +// Delete - Deletes an existing server administrator associated to a Microsoft Entra principal. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2017-12-01 -func (client *VirtualNetworkRulesClient) deleteOperation(ctx context.Context, resourceGroupName string, serverName string, virtualNetworkRuleName string, options *VirtualNetworkRulesClientBeginDeleteOptions) (*http.Response, error) { +// Generated from API version 2025-08-01 +func (client *AdministratorsMicrosoftEntraClient) deleteOperation(ctx context.Context, resourceGroupName string, serverName string, objectID string, options *AdministratorsMicrosoftEntraClientBeginDeleteOptions) (*http.Response, error) { var err error - const operationName = "VirtualNetworkRulesClient.BeginDelete" + const operationName = "AdministratorsMicrosoftEntraClient.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, virtualNetworkRuleName, options) + req, err := client.deleteCreateRequest(ctx, resourceGroupName, serverName, objectID, options) if err != nil { return nil, err } @@ -169,7 +169,7 @@ func (client *VirtualNetworkRulesClient) deleteOperation(ctx context.Context, re 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 } @@ -177,8 +177,12 @@ func (client *VirtualNetworkRulesClient) deleteOperation(ctx context.Context, re } // deleteCreateRequest creates the Delete request. -func (client *VirtualNetworkRulesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, serverName string, virtualNetworkRuleName string, options *VirtualNetworkRulesClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/virtualNetworkRules/{virtualNetworkRuleName}" +func (client *AdministratorsMicrosoftEntraClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, serverName string, objectID string, _ *AdministratorsMicrosoftEntraClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/administrators/{objectId}" + 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") } @@ -187,57 +191,58 @@ func (client *VirtualNetworkRulesClient) deleteCreateRequest(ctx context.Context return nil, errors.New("parameter serverName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{serverName}", url.PathEscape(serverName)) - if virtualNetworkRuleName == "" { - return nil, errors.New("parameter virtualNetworkRuleName cannot be empty") + if objectID == "" { + return nil, errors.New("parameter objectID cannot be empty") } - urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkRuleName}", url.PathEscape(virtualNetworkRuleName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + urlPath = strings.ReplaceAll(urlPath, "{objectId}", url.PathEscape(objectID)) 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", "2017-12-01") + reqQP.Set("api-version", "2025-08-01") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } -// Get - Gets a virtual network rule. +// Get - Gets information about a server administrator associated to a Microsoft Entra principal. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2017-12-01 +// 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. -// - virtualNetworkRuleName - The name of the virtual network rule. -// - options - VirtualNetworkRulesClientGetOptions contains the optional parameters for the VirtualNetworkRulesClient.Get method. -func (client *VirtualNetworkRulesClient) Get(ctx context.Context, resourceGroupName string, serverName string, virtualNetworkRuleName string, options *VirtualNetworkRulesClientGetOptions) (VirtualNetworkRulesClientGetResponse, error) { +// - objectID - Object identifier of the Microsoft Entra principal. +// - options - AdministratorsMicrosoftEntraClientGetOptions contains the optional parameters for the AdministratorsMicrosoftEntraClient.Get +// method. +func (client *AdministratorsMicrosoftEntraClient) Get(ctx context.Context, resourceGroupName string, serverName string, objectID string, options *AdministratorsMicrosoftEntraClientGetOptions) (AdministratorsMicrosoftEntraClientGetResponse, error) { var err error - const operationName = "VirtualNetworkRulesClient.Get" + const operationName = "AdministratorsMicrosoftEntraClient.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, virtualNetworkRuleName, options) + req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, objectID, options) if err != nil { - return VirtualNetworkRulesClientGetResponse{}, err + return AdministratorsMicrosoftEntraClientGetResponse{}, err } httpResp, err := client.internal.Pipeline().Do(req) if err != nil { - return VirtualNetworkRulesClientGetResponse{}, err + return AdministratorsMicrosoftEntraClientGetResponse{}, err } if !runtime.HasStatusCode(httpResp, http.StatusOK) { err = runtime.NewResponseError(httpResp) - return VirtualNetworkRulesClientGetResponse{}, err + return AdministratorsMicrosoftEntraClientGetResponse{}, err } resp, err := client.getHandleResponse(httpResp) return resp, err } // getCreateRequest creates the Get request. -func (client *VirtualNetworkRulesClient) getCreateRequest(ctx context.Context, resourceGroupName string, serverName string, virtualNetworkRuleName string, options *VirtualNetworkRulesClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/virtualNetworkRules/{virtualNetworkRuleName}" +func (client *AdministratorsMicrosoftEntraClient) getCreateRequest(ctx context.Context, resourceGroupName string, serverName string, objectID string, _ *AdministratorsMicrosoftEntraClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/administrators/{objectId}" + 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") } @@ -246,48 +251,44 @@ func (client *VirtualNetworkRulesClient) getCreateRequest(ctx context.Context, r return nil, errors.New("parameter serverName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{serverName}", url.PathEscape(serverName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if virtualNetworkRuleName == "" { - return nil, errors.New("parameter virtualNetworkRuleName cannot be empty") + if objectID == "" { + return nil, errors.New("parameter objectID cannot be empty") } - urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkRuleName}", url.PathEscape(virtualNetworkRuleName)) + urlPath = strings.ReplaceAll(urlPath, "{objectId}", url.PathEscape(objectID)) 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", "2017-12-01") + 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 *VirtualNetworkRulesClient) getHandleResponse(resp *http.Response) (VirtualNetworkRulesClientGetResponse, error) { - result := VirtualNetworkRulesClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualNetworkRule); err != nil { - return VirtualNetworkRulesClientGetResponse{}, err +func (client *AdministratorsMicrosoftEntraClient) getHandleResponse(resp *http.Response) (AdministratorsMicrosoftEntraClientGetResponse, error) { + result := AdministratorsMicrosoftEntraClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.AdministratorMicrosoftEntra); err != nil { + return AdministratorsMicrosoftEntraClientGetResponse{}, err } return result, nil } -// NewListByServerPager - Gets a list of virtual network rules in a server. +// NewListByServerPager - List all server administrators associated to a Microsoft Entra principal. // -// Generated from API version 2017-12-01 +// 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 - VirtualNetworkRulesClientListByServerOptions contains the optional parameters for the VirtualNetworkRulesClient.NewListByServerPager +// - options - AdministratorsMicrosoftEntraClientListByServerOptions contains the optional parameters for the AdministratorsMicrosoftEntraClient.NewListByServerPager // method. -func (client *VirtualNetworkRulesClient) NewListByServerPager(resourceGroupName string, serverName string, options *VirtualNetworkRulesClientListByServerOptions) *runtime.Pager[VirtualNetworkRulesClientListByServerResponse] { - return runtime.NewPager(runtime.PagingHandler[VirtualNetworkRulesClientListByServerResponse]{ - More: func(page VirtualNetworkRulesClientListByServerResponse) bool { +func (client *AdministratorsMicrosoftEntraClient) NewListByServerPager(resourceGroupName string, serverName string, options *AdministratorsMicrosoftEntraClientListByServerOptions) *runtime.Pager[AdministratorsMicrosoftEntraClientListByServerResponse] { + return runtime.NewPager(runtime.PagingHandler[AdministratorsMicrosoftEntraClientListByServerResponse]{ + More: func(page AdministratorsMicrosoftEntraClientListByServerResponse) bool { return page.NextLink != nil && len(*page.NextLink) > 0 }, - Fetcher: func(ctx context.Context, page *VirtualNetworkRulesClientListByServerResponse) (VirtualNetworkRulesClientListByServerResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "VirtualNetworkRulesClient.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 @@ -296,7 +297,7 @@ func (client *VirtualNetworkRulesClient) NewListByServerPager(resourceGroupName return client.listByServerCreateRequest(ctx, resourceGroupName, serverName, options) }, nil) if err != nil { - return VirtualNetworkRulesClientListByServerResponse{}, err + return AdministratorsMicrosoftEntraClientListByServerResponse{}, err } return client.listByServerHandleResponse(resp) }, @@ -305,8 +306,12 @@ func (client *VirtualNetworkRulesClient) NewListByServerPager(resourceGroupName } // listByServerCreateRequest creates the ListByServer request. -func (client *VirtualNetworkRulesClient) listByServerCreateRequest(ctx context.Context, resourceGroupName string, serverName string, options *VirtualNetworkRulesClientListByServerOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/virtualNetworkRules" +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") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -315,26 +320,22 @@ func (client *VirtualNetworkRulesClient) listByServerCreateRequest(ctx context.C return nil, errors.New("parameter serverName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{serverName}", url.PathEscape(serverName)) - 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.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2017-12-01") + 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 *VirtualNetworkRulesClient) listByServerHandleResponse(resp *http.Response) (VirtualNetworkRulesClientListByServerResponse, error) { - result := VirtualNetworkRulesClientListByServerResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualNetworkRuleListResult); err != nil { - return VirtualNetworkRulesClientListByServerResponse{}, 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/armpostgresql/administratorsmicrosoftentra_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresql/administratorsmicrosoftentra_client_example_test.go new file mode 100644 index 000000000000..eb1ff4c133f0 --- /dev/null +++ b/sdk/resourcemanager/postgresql/armpostgresql/administratorsmicrosoftentra_client_example_test.go @@ -0,0 +1,145 @@ +// 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) Go Code Generator. DO NOT EDIT. + +package armpostgresql_test + +import ( + "context" + "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/armpostgresql/v2" + "log" +) + +// Generated from example definition: 2025-08-01/AdministratorsMicrosoftEntraAdd.json +func ExampleAdministratorsMicrosoftEntraClient_BeginCreateOrUpdate() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armpostgresql.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewAdministratorsMicrosoftEntraClient().BeginCreateOrUpdate(ctx, "exampleresourcegroup", "exampleserver", "oooooooo-oooo-oooo-oooo-oooooooooooo", armpostgresql.AdministratorMicrosoftEntraAdd{ + Properties: &armpostgresql.AdministratorMicrosoftEntraPropertiesForAdd{ + PrincipalName: to.Ptr("exampleuser@contoso.com"), + PrincipalType: to.Ptr(armpostgresql.PrincipalTypeUser), + TenantID: to.Ptr("tttttttt-tttt-tttt-tttt-tttttttttttt"), + }, + }, 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: 2025-08-01/AdministratorsMicrosoftEntraDelete.json +func ExampleAdministratorsMicrosoftEntraClient_BeginDelete() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armpostgresql.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + 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) + } + _, err = poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } +} + +// Generated from example definition: 2025-08-01/AdministratorsMicrosoftEntraGet.json +func ExampleAdministratorsMicrosoftEntraClient_Get() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armpostgresql.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + 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 = armpostgresql.AdministratorsMicrosoftEntraClientGetResponse{ + // AdministratorMicrosoftEntra: &armpostgresql.AdministratorMicrosoftEntra{ + // Name: to.Ptr("exampleuser@contoso.com"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/administrators"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/administrators/oooooooo-oooo-oooo-oooo-oooooooooooo"), + // Properties: &armpostgresql.AdministratorMicrosoftEntraProperties{ + // ObjectID: to.Ptr("oooooooo-oooo-oooo-oooo-oooooooooooo"), + // PrincipalName: to.Ptr("exampleuser@contoso.com"), + // PrincipalType: to.Ptr(armpostgresql.PrincipalTypeUser), + // TenantID: to.Ptr("tttttttt-tttt-tttt-tttt-tttttttttttt"), + // }, + // }, + // } +} + +// Generated from example definition: 2025-08-01/AdministratorsMicrosoftEntraListByServer.json +func ExampleAdministratorsMicrosoftEntraClient_NewListByServerPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armpostgresql.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewAdministratorsMicrosoftEntraClient().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 = armpostgresql.AdministratorsMicrosoftEntraClientListByServerResponse{ + // AdministratorMicrosoftEntraList: armpostgresql.AdministratorMicrosoftEntraList{ + // Value: []*armpostgresql.AdministratorMicrosoftEntra{ + // { + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/administrators"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/administrators/oooooooo-oooo-oooo-oooo-oooooooooooo"), + // Properties: &armpostgresql.AdministratorMicrosoftEntraProperties{ + // ObjectID: to.Ptr("oooooooo-oooo-oooo-oooo-oooooooooooo"), + // PrincipalName: to.Ptr("exampleuser@contoso.com"), + // PrincipalType: to.Ptr(armpostgresql.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/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/administrators/gggggggg-gggg-gggg-gggg-gggggggggggg"), + // Properties: &armpostgresql.AdministratorMicrosoftEntraProperties{ + // ObjectID: to.Ptr("gggggggg-gggg-gggg-gggg-gggggggggggg"), + // PrincipalName: to.Ptr("examplegroup@contoso.com"), + // PrincipalType: to.Ptr(armpostgresql.PrincipalTypeGroup), + // TenantID: to.Ptr("tttttttt-tttt-tttt-tttt-tttttttttttt"), + // }, + // }, + // }, + // }, + // } + } +} diff --git a/sdk/resourcemanager/postgresql/armpostgresql/advancedthreatprotectionsettings_client.go b/sdk/resourcemanager/postgresql/armpostgresql/advancedthreatprotectionsettings_client.go new file mode 100644 index 000000000000..96886832e88a --- /dev/null +++ b/sdk/resourcemanager/postgresql/armpostgresql/advancedthreatprotectionsettings_client.go @@ -0,0 +1,175 @@ +// 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) Go Code Generator. DO NOT EDIT. + +package armpostgresql + +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" +) + +// 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 +} + +// 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 - 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 := &AdvancedThreatProtectionSettingsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// 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-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serverName - The name of the server. +// - 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 = "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, threatProtectionName, options) + if err != nil { + return AdvancedThreatProtectionSettingsClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return AdvancedThreatProtectionSettingsClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return AdvancedThreatProtectionSettingsClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +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") + } + 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-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 *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 - Lists state of advanced threat protection settings 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 - AdvancedThreatProtectionSettingsClientListByServerOptions contains the optional parameters for the AdvancedThreatProtectionSettingsClient.NewListByServerPager +// method. +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 *AdvancedThreatProtectionSettingsClientListByServerResponse) (AdvancedThreatProtectionSettingsClientListByServerResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "AdvancedThreatProtectionSettingsClient.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 AdvancedThreatProtectionSettingsClientListByServerResponse{}, err + } + return client.listByServerHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listByServerCreateRequest creates the ListByServer request. +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") + } + 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 *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/armpostgresql/advancedthreatprotectionsettings_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresql/advancedthreatprotectionsettings_client_example_test.go new file mode 100644 index 000000000000..7d5f93bfe53f --- /dev/null +++ b/sdk/resourcemanager/postgresql/armpostgresql/advancedthreatprotectionsettings_client_example_test.go @@ -0,0 +1,83 @@ +// 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) Go Code Generator. DO NOT EDIT. + +package armpostgresql_test + +import ( + "context" + "github.com/Azure/azure-sdk-for-go/sdk/azidentity" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresql/v2" + "log" +) + +// Generated from example definition: 2025-08-01/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 := armpostgresql.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewAdvancedThreatProtectionSettingsClient().Get(ctx, "exampleresourcegroup", "exampleserver", armpostgresql.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 = armpostgresql.AdvancedThreatProtectionSettingsClientGetResponse{ + // AdvancedThreatProtectionSettingsModel: &armpostgresql.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: &armpostgresql.AdvancedThreatProtectionSettingsProperties{ + // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T18:30:22.123456Z"); return t}()), + // State: to.Ptr(armpostgresql.ThreatProtectionStateEnabled), + // }, + // }, + // } +} + +// Generated from example definition: 2025-08-01/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 := armpostgresql.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", 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 = armpostgresql.AdvancedThreatProtectionSettingsClientListByServerResponse{ + // AdvancedThreatProtectionSettingsList: armpostgresql.AdvancedThreatProtectionSettingsList{ + // Value: []*armpostgresql.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: &armpostgresql.AdvancedThreatProtectionSettingsProperties{ + // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T18:30:22.123456Z"); return t}()), + // State: to.Ptr(armpostgresql.ThreatProtectionStateEnabled), + // }, + // }, + // }, + // }, + // } + } +} diff --git a/sdk/resourcemanager/postgresql/armpostgresql/autorest.md b/sdk/resourcemanager/postgresql/armpostgresql/autorest.md deleted file mode 100644 index 188641623a3d..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresql/autorest.md +++ /dev/null @@ -1,13 +0,0 @@ -### AutoRest Configuration - -> see https://aka.ms/autorest - -``` yaml -azure-arm: true -require: -- https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/readme.go.md -license-header: MICROSOFT_MIT_NO_VERSION -module-version: 1.2.0 -package-singleservers: true -``` \ No newline at end of file diff --git a/sdk/resourcemanager/postgresql/armpostgresql/backupsautomaticandondemand_client.go b/sdk/resourcemanager/postgresql/armpostgresql/backupsautomaticandondemand_client.go new file mode 100644 index 000000000000..cacb22aaa9a8 --- /dev/null +++ b/sdk/resourcemanager/postgresql/armpostgresql/backupsautomaticandondemand_client.go @@ -0,0 +1,336 @@ +// 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) Go Code Generator. DO NOT EDIT. + +package armpostgresql + +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" +) + +// 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 +} + +// 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 - 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 := &BackupsAutomaticAndOnDemandClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreate - Creates an on demand backup of 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 - 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[BackupsAutomaticAndOnDemandClientCreateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[BackupsAutomaticAndOnDemandClientCreateResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// Create - Creates an on demand backup of a server. +// If the operation fails it returns an *azcore.ResponseError type. +// +// 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 = "BackupsAutomaticAndOnDemandClient.BeginCreate" + 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, backupName, 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 +} + +// createCreateRequest creates the Create request. +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") + } + 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.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() + return req, nil +} + +// BeginDelete - Deletes a specific backup, given its name. +// 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 - 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[BackupsAutomaticAndOnDemandClientDeleteResponse]{ + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[BackupsAutomaticAndOnDemandClientDeleteResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// Delete - Deletes a specific backup, given its name. +// If the operation fails it returns an *azcore.ResponseError type. +// +// 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 = "BackupsAutomaticAndOnDemandClient.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, backupName, 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 *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") + } + 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.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() + return req, nil +} + +// 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-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serverName - The name of the server. +// - 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 = "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 BackupsAutomaticAndOnDemandClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return BackupsAutomaticAndOnDemandClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return BackupsAutomaticAndOnDemandClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +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") + } + 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 *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 - Lists all available backups of 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 - BackupsAutomaticAndOnDemandClientListByServerOptions contains the optional parameters for the BackupsAutomaticAndOnDemandClient.NewListByServerPager +// method. +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 *BackupsAutomaticAndOnDemandClientListByServerResponse) (BackupsAutomaticAndOnDemandClientListByServerResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "BackupsAutomaticAndOnDemandClient.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 BackupsAutomaticAndOnDemandClientListByServerResponse{}, err + } + return client.listByServerHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listByServerCreateRequest creates the ListByServer request. +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") + } + 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 *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/armpostgresql/backupsautomaticandondemand_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresql/backupsautomaticandondemand_client_example_test.go new file mode 100644 index 000000000000..3a66deb54fa3 --- /dev/null +++ b/sdk/resourcemanager/postgresql/armpostgresql/backupsautomaticandondemand_client_example_test.go @@ -0,0 +1,137 @@ +// 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) Go Code Generator. DO NOT EDIT. + +package armpostgresql_test + +import ( + "context" + "github.com/Azure/azure-sdk-for-go/sdk/azidentity" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresql/v2" + "log" +) + +// Generated from example definition: 2025-08-01/BackupsAutomaticAndOnDemandCreate.json +func ExampleBackupsAutomaticAndOnDemandClient_BeginCreate() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armpostgresql.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewBackupsAutomaticAndOnDemandClient().BeginCreate(ctx, "exampleresourcegroup", "exampleserver", "ondemandbackup-20250601T183022", 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: 2025-08-01/BackupsAutomaticAndOnDemandDelete.json +func ExampleBackupsAutomaticAndOnDemandClient_BeginDelete() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armpostgresql.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewBackupsAutomaticAndOnDemandClient().BeginDelete(ctx, "exampleresourcegroup", "exampleserver", "ondemandbackup-20250601T183022", 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: 2025-08-01/BackupsAutomaticAndOnDemandGet.json +func ExampleBackupsAutomaticAndOnDemandClient_Get() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armpostgresql.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + 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 = armpostgresql.BackupsAutomaticAndOnDemandClientGetResponse{ + // BackupAutomaticAndOnDemand: &armpostgresql.BackupAutomaticAndOnDemand{ + // Name: to.Ptr("backup_20250601T183022"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/backups"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/backups/backup_638830782181266873"), + // Properties: &armpostgresql.BackupAutomaticAndOnDemandProperties{ + // BackupType: to.Ptr(armpostgresql.BackupTypeFull), + // CompletedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T14:30:22.123456+00:00"); return t}()), + // Source: to.Ptr("Automatic"), + // }, + // }, + // } +} + +// Generated from example definition: 2025-08-01/BackupsAutomaticAndOnDemandListByServer.json +func ExampleBackupsAutomaticAndOnDemandClient_NewListByServerPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armpostgresql.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewBackupsAutomaticAndOnDemandClient().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 = armpostgresql.BackupsAutomaticAndOnDemandClientListByServerResponse{ + // BackupAutomaticAndOnDemandList: armpostgresql.BackupAutomaticAndOnDemandList{ + // Value: []*armpostgresql.BackupAutomaticAndOnDemand{ + // { + // Name: to.Ptr("backup_638830782181266873"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/backups"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/backups/backup_638830782181266873"), + // Properties: &armpostgresql.BackupAutomaticAndOnDemandProperties{ + // BackupType: to.Ptr(armpostgresql.BackupTypeFull), + // CompletedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T14:30:22.123456+00:00"); return t}()), + // Source: to.Ptr("Automatic"), + // }, + // }, + // { + // Name: to.Ptr("ondemandbackup-20250601T183022"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/backups"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/backups/ondemandbackup-20250601T183022"), + // Properties: &armpostgresql.BackupAutomaticAndOnDemandProperties{ + // BackupType: to.Ptr(armpostgresql.BackupTypeCustomerOnDemand), + // CompletedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T18:30:22.123456+00:00"); return t}()), + // Source: to.Ptr("Customer Initiated"), + // }, + // }, + // }, + // }, + // } + } +} diff --git a/sdk/resourcemanager/postgresql/armpostgresql/backupslongtermretention_client.go b/sdk/resourcemanager/postgresql/armpostgresql/backupslongtermretention_client.go new file mode 100644 index 000000000000..8a971ee2563d --- /dev/null +++ b/sdk/resourcemanager/postgresql/armpostgresql/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) Go Code Generator. DO NOT EDIT. + +package armpostgresql + +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"} + req.Raw().Header["Content-Type"] = []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]{ + 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"} + req.Raw().Header["Content-Type"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} diff --git a/sdk/resourcemanager/postgresql/armpostgresql/backupslongtermretention_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresql/backupslongtermretention_client_example_test.go new file mode 100644 index 000000000000..2a43aa76639d --- /dev/null +++ b/sdk/resourcemanager/postgresql/armpostgresql/backupslongtermretention_client_example_test.go @@ -0,0 +1,173 @@ +// 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) Go Code Generator. DO NOT EDIT. + +package armpostgresql_test + +import ( + "context" + "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/armpostgresql/v2" + "log" +) + +// Generated from example definition: 2025-08-01/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 := armpostgresql.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewBackupsLongTermRetentionClient().CheckPrerequisites(ctx, "exampleresourcegroup", "exampleserver", armpostgresql.LtrPreBackupRequest{ + BackupSettings: &armpostgresql.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 = armpostgresql.BackupsLongTermRetentionClientCheckPrerequisitesResponse{ + // LtrPreBackupResponse: &armpostgresql.LtrPreBackupResponse{ + // Properties: &armpostgresql.BackupsLongTermRetentionResponseProperties{ + // NumberOfContainers: to.Ptr[int32](1), + // }, + // }, + // } +} + +// Generated from example definition: 2025-08-01/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 := armpostgresql.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", 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 = armpostgresql.BackupsLongTermRetentionClientGetResponse{ + // BackupsLongTermRetentionOperation: &armpostgresql.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: &armpostgresql.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(armpostgresql.ExecutionStatusRunning), + // }, + // }, + // } +} + +// Generated from example definition: 2025-08-01/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 := armpostgresql.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", 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 = armpostgresql.BackupsLongTermRetentionClientListByServerResponse{ + // LtrServerBackupOperationList: armpostgresql.LtrServerBackupOperationList{ + // Value: []*armpostgresql.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: &armpostgresql.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(armpostgresql.ExecutionStatusRunning), + // }, + // }, + // }, + // }, + // } + } +} + +// Generated from example definition: 2025-08-01/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 := armpostgresql.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewBackupsLongTermRetentionClient().BeginStart(ctx, "exampleresourcegroup", "exampleserver", armpostgresql.BackupsLongTermRetentionRequest{ + BackupSettings: &armpostgresql.BackupSettings{ + BackupName: to.Ptr("exampleltrbackup"), + }, + TargetDetails: &armpostgresql.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 = armpostgresql.BackupsLongTermRetentionClientStartResponse{ + // BackupsLongTermRetentionResponse: &armpostgresql.BackupsLongTermRetentionResponse{ + // Properties: &armpostgresql.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(armpostgresql.ExecutionStatusRunning), + // }, + // }, + // } +} diff --git a/sdk/resourcemanager/postgresql/armpostgresql/build.go b/sdk/resourcemanager/postgresql/armpostgresql/build.go deleted file mode 100644 index 5fb60f96a7f5..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresql/build.go +++ /dev/null @@ -1,7 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. - -// This file enables 'go generate' to regenerate this specific SDK -//go:generate pwsh ../../../../eng/scripts/build.ps1 -skipBuild -cleanGenerated -format -tidy -generate resourcemanager/postgresql/armpostgresql - -package armpostgresql diff --git a/sdk/resourcemanager/postgresql/armpostgresql/capabilitiesbylocation_client.go b/sdk/resourcemanager/postgresql/armpostgresql/capabilitiesbylocation_client.go new file mode 100644 index 000000000000..6fb42d389433 --- /dev/null +++ b/sdk/resourcemanager/postgresql/armpostgresql/capabilitiesbylocation_client.go @@ -0,0 +1,100 @@ +// 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) Go Code Generator. DO NOT EDIT. + +package armpostgresql + +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/armpostgresql/capabilitiesbylocation_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresql/capabilitiesbylocation_client_example_test.go new file mode 100644 index 000000000000..a0cf16b2cff7 --- /dev/null +++ b/sdk/resourcemanager/postgresql/armpostgresql/capabilitiesbylocation_client_example_test.go @@ -0,0 +1,2439 @@ +// 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) Go Code Generator. DO NOT EDIT. + +package armpostgresql_test + +import ( + "context" + "github.com/Azure/azure-sdk-for-go/sdk/azidentity" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresql/v2" + "log" +) + +// Generated from example definition: 2025-08-01/CapabilitiesByLocationList.json +func ExampleCapabilitiesByLocationClient_NewListPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armpostgresql.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewCapabilitiesByLocationClient().NewListPager("eastus", 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 = armpostgresql.CapabilitiesByLocationClientListResponse{ + // CapabilityList: armpostgresql.CapabilityList{ + // Value: []*armpostgresql.Capability{ + // { + // Name: to.Ptr("FlexibleServerCapabilities"), + // FastProvisioningSupported: to.Ptr(armpostgresql.FastProvisioningSupportEnabled), + // GeoBackupSupported: to.Ptr(armpostgresql.GeographicallyRedundantBackupSupportEnabled), + // OnlineResizeSupported: to.Ptr(armpostgresql.OnlineStorageResizeSupportEnabled), + // StorageAutoGrowthSupported: to.Ptr(armpostgresql.StorageAutoGrowthSupportEnabled), + // SupportedFastProvisioningEditions: []*armpostgresql.FastProvisioningEditionCapability{ + // { + // ServerCount: to.Ptr[int32](0), + // SupportedServerVersions: to.Ptr("12"), + // SupportedSKU: to.Ptr("standard_b1ms"), + // SupportedStorageGb: to.Ptr[int32](32), + // SupportedTier: to.Ptr("Burstable"), + // }, + // { + // ServerCount: to.Ptr[int32](0), + // SupportedServerVersions: to.Ptr("12"), + // SupportedSKU: to.Ptr("standard_b2s"), + // SupportedStorageGb: to.Ptr[int32](32), + // SupportedTier: to.Ptr("Burstable"), + // }, + // { + // ServerCount: to.Ptr[int32](0), + // SupportedServerVersions: to.Ptr("12"), + // SupportedSKU: to.Ptr("standard_d2s_v3"), + // SupportedStorageGb: to.Ptr[int32](128), + // SupportedTier: to.Ptr("GeneralPurpose"), + // }, + // { + // ServerCount: to.Ptr[int32](0), + // SupportedServerVersions: to.Ptr("12"), + // SupportedSKU: to.Ptr("standard_d2ds_v4"), + // SupportedStorageGb: to.Ptr[int32](128), + // SupportedTier: to.Ptr("GeneralPurpose"), + // }, + // { + // ServerCount: to.Ptr[int32](0), + // SupportedServerVersions: to.Ptr("12"), + // SupportedSKU: to.Ptr("standard_e2ds_v4"), + // SupportedStorageGb: to.Ptr[int32](512), + // SupportedTier: to.Ptr("MemoryOptimized"), + // }, + // { + // ServerCount: to.Ptr[int32](0), + // SupportedServerVersions: to.Ptr("13"), + // SupportedSKU: to.Ptr("standard_b1ms"), + // SupportedStorageGb: to.Ptr[int32](32), + // SupportedTier: to.Ptr("Burstable"), + // }, + // { + // ServerCount: to.Ptr[int32](0), + // SupportedServerVersions: to.Ptr("13"), + // SupportedSKU: to.Ptr("standard_b2s"), + // SupportedStorageGb: to.Ptr[int32](32), + // SupportedTier: to.Ptr("Burstable"), + // }, + // { + // ServerCount: to.Ptr[int32](0), + // SupportedServerVersions: to.Ptr("13"), + // SupportedSKU: to.Ptr("standard_d2s_v3"), + // SupportedStorageGb: to.Ptr[int32](128), + // SupportedTier: to.Ptr("GeneralPurpose"), + // }, + // { + // ServerCount: to.Ptr[int32](0), + // SupportedServerVersions: to.Ptr("13"), + // SupportedSKU: to.Ptr("standard_d2ds_v4"), + // SupportedStorageGb: to.Ptr[int32](128), + // SupportedTier: to.Ptr("GeneralPurpose"), + // }, + // { + // ServerCount: to.Ptr[int32](0), + // SupportedServerVersions: to.Ptr("13"), + // SupportedSKU: to.Ptr("standard_e2ds_v4"), + // SupportedStorageGb: to.Ptr[int32](512), + // SupportedTier: to.Ptr("MemoryOptimized"), + // }, + // { + // ServerCount: to.Ptr[int32](0), + // SupportedServerVersions: to.Ptr("14"), + // SupportedSKU: to.Ptr("standard_b1ms"), + // SupportedStorageGb: to.Ptr[int32](32), + // SupportedTier: to.Ptr("Burstable"), + // }, + // { + // ServerCount: to.Ptr[int32](0), + // SupportedServerVersions: to.Ptr("14"), + // SupportedSKU: to.Ptr("standard_b2s"), + // SupportedStorageGb: to.Ptr[int32](32), + // SupportedTier: to.Ptr("Burstable"), + // }, + // { + // ServerCount: to.Ptr[int32](0), + // SupportedServerVersions: to.Ptr("14"), + // SupportedSKU: to.Ptr("standard_d2s_v3"), + // SupportedStorageGb: to.Ptr[int32](128), + // SupportedTier: to.Ptr("GeneralPurpose"), + // }, + // { + // ServerCount: to.Ptr[int32](0), + // SupportedServerVersions: to.Ptr("14"), + // SupportedSKU: to.Ptr("standard_d2ds_v4"), + // SupportedStorageGb: to.Ptr[int32](128), + // SupportedTier: to.Ptr("GeneralPurpose"), + // }, + // { + // ServerCount: to.Ptr[int32](0), + // SupportedServerVersions: to.Ptr("14"), + // SupportedSKU: to.Ptr("standard_e2ds_v4"), + // SupportedStorageGb: to.Ptr[int32](512), + // SupportedTier: to.Ptr("MemoryOptimized"), + // }, + // { + // ServerCount: to.Ptr[int32](0), + // SupportedServerVersions: to.Ptr("15"), + // SupportedSKU: to.Ptr("standard_b1ms"), + // SupportedStorageGb: to.Ptr[int32](32), + // SupportedTier: to.Ptr("Burstable"), + // }, + // { + // ServerCount: to.Ptr[int32](0), + // SupportedServerVersions: to.Ptr("15"), + // SupportedSKU: to.Ptr("standard_b2s"), + // SupportedStorageGb: to.Ptr[int32](32), + // SupportedTier: to.Ptr("Burstable"), + // }, + // { + // ServerCount: to.Ptr[int32](0), + // SupportedServerVersions: to.Ptr("15"), + // SupportedSKU: to.Ptr("standard_d2s_v3"), + // SupportedStorageGb: to.Ptr[int32](128), + // SupportedTier: to.Ptr("GeneralPurpose"), + // }, + // { + // ServerCount: to.Ptr[int32](0), + // SupportedServerVersions: to.Ptr("15"), + // SupportedSKU: to.Ptr("standard_d2ds_v4"), + // SupportedStorageGb: to.Ptr[int32](128), + // SupportedTier: to.Ptr("GeneralPurpose"), + // }, + // { + // ServerCount: to.Ptr[int32](0), + // SupportedServerVersions: to.Ptr("15"), + // SupportedSKU: to.Ptr("standard_e2ds_v4"), + // SupportedStorageGb: to.Ptr[int32](512), + // SupportedTier: to.Ptr("MemoryOptimized"), + // }, + // { + // ServerCount: to.Ptr[int32](0), + // SupportedServerVersions: to.Ptr("16"), + // SupportedSKU: to.Ptr("standard_b1ms"), + // SupportedStorageGb: to.Ptr[int32](32), + // SupportedTier: to.Ptr("Burstable"), + // }, + // { + // ServerCount: to.Ptr[int32](0), + // SupportedServerVersions: to.Ptr("16"), + // SupportedSKU: to.Ptr("standard_b2s"), + // SupportedStorageGb: to.Ptr[int32](32), + // SupportedTier: to.Ptr("Burstable"), + // }, + // { + // ServerCount: to.Ptr[int32](0), + // SupportedServerVersions: to.Ptr("16"), + // SupportedSKU: to.Ptr("standard_d2s_v3"), + // SupportedStorageGb: to.Ptr[int32](128), + // SupportedTier: to.Ptr("GeneralPurpose"), + // }, + // { + // ServerCount: to.Ptr[int32](0), + // SupportedServerVersions: to.Ptr("16"), + // SupportedSKU: to.Ptr("standard_d2ds_v4"), + // SupportedStorageGb: to.Ptr[int32](128), + // SupportedTier: to.Ptr("GeneralPurpose"), + // }, + // { + // ServerCount: to.Ptr[int32](0), + // SupportedServerVersions: to.Ptr("16"), + // SupportedSKU: to.Ptr("standard_e2ds_v4"), + // SupportedStorageGb: to.Ptr[int32](512), + // SupportedTier: to.Ptr("MemoryOptimized"), + // }, + // }, + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // { + // Name: to.Ptr("FastProvisioning"), + // Status: to.Ptr(armpostgresql.FeatureStatusEnabled), + // }, + // { + // Name: to.Ptr("ZoneRedundantHa"), + // Status: to.Ptr(armpostgresql.FeatureStatusEnabled), + // }, + // { + // Name: to.Ptr("GeoBackup"), + // Status: to.Ptr(armpostgresql.FeatureStatusEnabled), + // }, + // { + // Name: to.Ptr("ZoneRedundantHaAndGeoBackup"), + // Status: to.Ptr(armpostgresql.FeatureStatusEnabled), + // }, + // { + // Name: to.Ptr("StorageAutoGrowth"), + // Status: to.Ptr(armpostgresql.FeatureStatusEnabled), + // }, + // { + // Name: to.Ptr("OnlineResize"), + // Status: to.Ptr(armpostgresql.FeatureStatusEnabled), + // }, + // { + // Name: to.Ptr("OfferRestricted"), + // Status: to.Ptr(armpostgresql.FeatureStatusDisabled), + // }, + // { + // Name: to.Ptr("IndexTuning"), + // Status: to.Ptr(armpostgresql.FeatureStatusEnabled), + // }, + // { + // Name: to.Ptr("Clusters"), + // Status: to.Ptr(armpostgresql.FeatureStatusEnabled), + // }, + // { + // Name: to.Ptr("ConfigTuning"), + // Status: to.Ptr(armpostgresql.FeatureStatusDisabled), + // }, + // }, + // SupportedServerEditions: []*armpostgresql.ServerEditionCapability{ + // { + // Name: to.Ptr("Burstable"), + // DefaultSKUName: to.Ptr("Standard_B1ms"), + // SupportedServerSKUs: []*armpostgresql.ServerSKUCapability{ + // { + // Name: to.Ptr("Standard_B1ms"), + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // }, + // SupportedHaMode: []*armpostgresql.HighAvailabilityMode{ + // to.Ptr(armpostgresql.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresql.HighAvailabilityModeZoneRedundant), + // }, + // SupportedIops: to.Ptr[int32](640), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](2048), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int32](1), + // }, + // { + // Name: to.Ptr("Standard_B2s"), + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // }, + // SupportedHaMode: []*armpostgresql.HighAvailabilityMode{ + // to.Ptr(armpostgresql.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresql.HighAvailabilityModeZoneRedundant), + // }, + // SupportedIops: to.Ptr[int32](1280), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](2048), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int32](2), + // }, + // { + // Name: to.Ptr("Standard_B2ms"), + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // }, + // SupportedHaMode: []*armpostgresql.HighAvailabilityMode{ + // to.Ptr(armpostgresql.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresql.HighAvailabilityModeZoneRedundant), + // }, + // SupportedIops: to.Ptr[int32](1920), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int32](2), + // }, + // { + // Name: to.Ptr("Standard_B4ms"), + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // }, + // SupportedHaMode: []*armpostgresql.HighAvailabilityMode{ + // to.Ptr(armpostgresql.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresql.HighAvailabilityModeZoneRedundant), + // }, + // SupportedIops: to.Ptr[int32](2880), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int32](4), + // }, + // { + // Name: to.Ptr("Standard_B8ms"), + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // }, + // SupportedHaMode: []*armpostgresql.HighAvailabilityMode{ + // to.Ptr(armpostgresql.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresql.HighAvailabilityModeZoneRedundant), + // }, + // SupportedIops: to.Ptr[int32](4320), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int32](8), + // }, + // { + // Name: to.Ptr("Standard_B12ms"), + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // }, + // SupportedHaMode: []*armpostgresql.HighAvailabilityMode{ + // to.Ptr(armpostgresql.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresql.HighAvailabilityModeZoneRedundant), + // }, + // SupportedIops: to.Ptr[int32](4320), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int32](12), + // }, + // { + // Name: to.Ptr("Standard_B16ms"), + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // }, + // SupportedHaMode: []*armpostgresql.HighAvailabilityMode{ + // to.Ptr(armpostgresql.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresql.HighAvailabilityModeZoneRedundant), + // }, + // SupportedIops: to.Ptr[int32](4320), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int32](16), + // }, + // { + // Name: to.Ptr("Standard_B20ms"), + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // }, + // SupportedHaMode: []*armpostgresql.HighAvailabilityMode{ + // to.Ptr(armpostgresql.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresql.HighAvailabilityModeZoneRedundant), + // }, + // SupportedIops: to.Ptr[int32](4320), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int32](20), + // }, + // }, + // SupportedStorageEditions: []*armpostgresql.StorageEditionCapability{ + // { + // Name: to.Ptr("ManagedDisk"), + // DefaultStorageSizeMb: to.Ptr[int64](32768), + // SupportedStorageMb: []*armpostgresql.StorageMbCapability{ + // { + // DefaultIopsTier: to.Ptr("P4"), + // StorageSizeMb: to.Ptr[int64](32768), + // SupportedIops: to.Ptr[int32](120), + // SupportedIopsTiers: []*armpostgresql.StorageTierCapability{ + // { + // Name: to.Ptr("P4"), + // Iops: to.Ptr[int32](120), + // }, + // { + // Name: to.Ptr("P6"), + // Iops: to.Ptr[int32](240), + // }, + // { + // Name: to.Ptr("P10"), + // Iops: to.Ptr[int32](500), + // }, + // { + // Name: to.Ptr("P15"), + // Iops: to.Ptr[int32](1100), + // }, + // { + // Name: to.Ptr("P20"), + // Iops: to.Ptr[int32](2300), + // }, + // { + // Name: to.Ptr("P30"), + // Iops: to.Ptr[int32](5000), + // }, + // { + // Name: to.Ptr("P40"), + // Iops: to.Ptr[int32](7500), + // }, + // { + // Name: to.Ptr("P50"), + // Iops: to.Ptr[int32](7500), + // }, + // }, + // }, + // { + // DefaultIopsTier: to.Ptr("P6"), + // StorageSizeMb: to.Ptr[int64](65536), + // SupportedIops: to.Ptr[int32](240), + // SupportedIopsTiers: []*armpostgresql.StorageTierCapability{ + // { + // Name: to.Ptr("P6"), + // Iops: to.Ptr[int32](240), + // }, + // { + // Name: to.Ptr("P10"), + // Iops: to.Ptr[int32](500), + // }, + // { + // Name: to.Ptr("P15"), + // Iops: to.Ptr[int32](1100), + // }, + // { + // Name: to.Ptr("P20"), + // Iops: to.Ptr[int32](2300), + // }, + // { + // Name: to.Ptr("P30"), + // Iops: to.Ptr[int32](5000), + // }, + // { + // Name: to.Ptr("P40"), + // Iops: to.Ptr[int32](7500), + // }, + // { + // Name: to.Ptr("P50"), + // Iops: to.Ptr[int32](7500), + // }, + // }, + // }, + // { + // DefaultIopsTier: to.Ptr("P10"), + // StorageSizeMb: to.Ptr[int64](131072), + // SupportedIops: to.Ptr[int32](500), + // SupportedIopsTiers: []*armpostgresql.StorageTierCapability{ + // { + // Name: to.Ptr("P10"), + // Iops: to.Ptr[int32](500), + // }, + // { + // Name: to.Ptr("P15"), + // Iops: to.Ptr[int32](1100), + // }, + // { + // Name: to.Ptr("P20"), + // Iops: to.Ptr[int32](2300), + // }, + // { + // Name: to.Ptr("P30"), + // Iops: to.Ptr[int32](5000), + // }, + // { + // Name: to.Ptr("P40"), + // Iops: to.Ptr[int32](7500), + // }, + // { + // Name: to.Ptr("P50"), + // Iops: to.Ptr[int32](7500), + // }, + // }, + // }, + // { + // DefaultIopsTier: to.Ptr("P15"), + // StorageSizeMb: to.Ptr[int64](262144), + // SupportedIops: to.Ptr[int32](1100), + // SupportedIopsTiers: []*armpostgresql.StorageTierCapability{ + // { + // Name: to.Ptr("P15"), + // Iops: to.Ptr[int32](1100), + // }, + // { + // Name: to.Ptr("P20"), + // Iops: to.Ptr[int32](2300), + // }, + // { + // Name: to.Ptr("P30"), + // Iops: to.Ptr[int32](5000), + // }, + // { + // Name: to.Ptr("P40"), + // Iops: to.Ptr[int32](7500), + // }, + // { + // Name: to.Ptr("P50"), + // Iops: to.Ptr[int32](7500), + // }, + // }, + // }, + // { + // DefaultIopsTier: to.Ptr("P20"), + // StorageSizeMb: to.Ptr[int64](524288), + // SupportedIops: to.Ptr[int32](2300), + // SupportedIopsTiers: []*armpostgresql.StorageTierCapability{ + // { + // Name: to.Ptr("P20"), + // Iops: to.Ptr[int32](2300), + // }, + // { + // Name: to.Ptr("P30"), + // Iops: to.Ptr[int32](5000), + // }, + // { + // Name: to.Ptr("P40"), + // Iops: to.Ptr[int32](7500), + // }, + // { + // Name: to.Ptr("P50"), + // Iops: to.Ptr[int32](7500), + // }, + // }, + // }, + // { + // DefaultIopsTier: to.Ptr("P30"), + // StorageSizeMb: to.Ptr[int64](1048576), + // SupportedIops: to.Ptr[int32](5000), + // SupportedIopsTiers: []*armpostgresql.StorageTierCapability{ + // { + // Name: to.Ptr("P30"), + // Iops: to.Ptr[int32](5000), + // }, + // { + // Name: to.Ptr("P40"), + // Iops: to.Ptr[int32](7500), + // }, + // { + // Name: to.Ptr("P50"), + // Iops: to.Ptr[int32](7500), + // }, + // }, + // }, + // { + // DefaultIopsTier: to.Ptr("P40"), + // StorageSizeMb: to.Ptr[int64](2097152), + // SupportedIops: to.Ptr[int32](7500), + // SupportedIopsTiers: []*armpostgresql.StorageTierCapability{ + // { + // Name: to.Ptr("P40"), + // Iops: to.Ptr[int32](7500), + // }, + // { + // Name: to.Ptr("P50"), + // Iops: to.Ptr[int32](7500), + // }, + // }, + // }, + // { + // DefaultIopsTier: to.Ptr("P50"), + // StorageSizeMb: to.Ptr[int64](4193280), + // SupportedIops: to.Ptr[int32](7500), + // SupportedIopsTiers: []*armpostgresql.StorageTierCapability{ + // { + // Name: to.Ptr("P50"), + // Iops: to.Ptr[int32](7500), + // }, + // }, + // }, + // { + // DefaultIopsTier: to.Ptr("P50"), + // StorageSizeMb: to.Ptr[int64](4194304), + // SupportedIops: to.Ptr[int32](7500), + // SupportedIopsTiers: []*armpostgresql.StorageTierCapability{ + // { + // Name: to.Ptr("P50"), + // Iops: to.Ptr[int32](7500), + // }, + // }, + // }, + // { + // DefaultIopsTier: to.Ptr("P60"), + // StorageSizeMb: to.Ptr[int64](8388608), + // SupportedIops: to.Ptr[int32](16000), + // SupportedIopsTiers: []*armpostgresql.StorageTierCapability{ + // { + // Name: to.Ptr("P60"), + // Iops: to.Ptr[int32](16000), + // }, + // { + // Name: to.Ptr("P70"), + // Iops: to.Ptr[int32](18000), + // }, + // { + // Name: to.Ptr("P80"), + // Iops: to.Ptr[int32](20000), + // }, + // }, + // }, + // { + // DefaultIopsTier: to.Ptr("P70"), + // StorageSizeMb: to.Ptr[int64](16777216), + // SupportedIops: to.Ptr[int32](18000), + // SupportedIopsTiers: []*armpostgresql.StorageTierCapability{ + // { + // Name: to.Ptr("P70"), + // Iops: to.Ptr[int32](18000), + // }, + // { + // Name: to.Ptr("P80"), + // Iops: to.Ptr[int32](20000), + // }, + // }, + // }, + // { + // DefaultIopsTier: to.Ptr("P80"), + // StorageSizeMb: to.Ptr[int64](33553408), + // SupportedIops: to.Ptr[int32](20000), + // SupportedIopsTiers: []*armpostgresql.StorageTierCapability{ + // { + // Name: to.Ptr("P80"), + // Iops: to.Ptr[int32](20000), + // }, + // }, + // }, + // }, + // }, + // { + // Name: to.Ptr("ManagedDiskV2"), + // DefaultStorageSizeMb: to.Ptr[int64](32768), + // SupportedStorageMb: []*armpostgresql.StorageMbCapability{ + // { + // DefaultIopsTier: to.Ptr("None"), + // MaximumStorageSizeMb: to.Ptr[int64](67108864), + // StorageSizeMb: to.Ptr[int64](32768), + // SupportedIops: to.Ptr[int32](3000), + // SupportedIopsTiers: []*armpostgresql.StorageTierCapability{ + // { + // Name: to.Ptr("None"), + // Iops: to.Ptr[int32](0), + // }, + // }, + // SupportedMaximumIops: to.Ptr[int32](80000), + // SupportedMaximumThroughput: to.Ptr[int32](1200), + // SupportedThroughput: to.Ptr[int32](125), + // }, + // }, + // }, + // }, + // }, + // { + // Name: to.Ptr("GeneralPurpose"), + // DefaultSKUName: to.Ptr("Standard_D4ds_v5"), + // SupportedServerSKUs: []*armpostgresql.ServerSKUCapability{ + // { + // Name: to.Ptr("Standard_D2s_v3"), + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // }, + // SupportedHaMode: []*armpostgresql.HighAvailabilityMode{ + // to.Ptr(armpostgresql.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresql.HighAvailabilityModeZoneRedundant), + // }, + // SupportedIops: to.Ptr[int32](3200), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int32](2), + // }, + // { + // Name: to.Ptr("Standard_D4s_v3"), + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // }, + // SupportedHaMode: []*armpostgresql.HighAvailabilityMode{ + // to.Ptr(armpostgresql.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresql.HighAvailabilityModeZoneRedundant), + // }, + // SupportedIops: to.Ptr[int32](6400), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int32](4), + // }, + // { + // Name: to.Ptr("Standard_D8s_v3"), + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // }, + // SupportedHaMode: []*armpostgresql.HighAvailabilityMode{ + // to.Ptr(armpostgresql.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresql.HighAvailabilityModeZoneRedundant), + // }, + // SupportedIops: to.Ptr[int32](12800), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int32](8), + // }, + // { + // Name: to.Ptr("Standard_D16s_v3"), + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // }, + // SupportedHaMode: []*armpostgresql.HighAvailabilityMode{ + // to.Ptr(armpostgresql.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresql.HighAvailabilityModeZoneRedundant), + // }, + // SupportedIops: to.Ptr[int32](25600), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int32](16), + // }, + // { + // Name: to.Ptr("Standard_D32s_v3"), + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // }, + // SupportedHaMode: []*armpostgresql.HighAvailabilityMode{ + // to.Ptr(armpostgresql.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresql.HighAvailabilityModeZoneRedundant), + // }, + // SupportedIops: to.Ptr[int32](51200), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int32](32), + // }, + // { + // Name: to.Ptr("Standard_D48s_v3"), + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // }, + // SupportedHaMode: []*armpostgresql.HighAvailabilityMode{ + // to.Ptr(armpostgresql.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresql.HighAvailabilityModeZoneRedundant), + // }, + // SupportedIops: to.Ptr[int32](76800), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int32](48), + // }, + // { + // Name: to.Ptr("Standard_D64s_v3"), + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // }, + // SupportedHaMode: []*armpostgresql.HighAvailabilityMode{ + // to.Ptr(armpostgresql.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresql.HighAvailabilityModeZoneRedundant), + // }, + // SupportedIops: to.Ptr[int32](80000), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int32](64), + // }, + // { + // Name: to.Ptr("Standard_D2ds_v4"), + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // }, + // SupportedHaMode: []*armpostgresql.HighAvailabilityMode{ + // to.Ptr(armpostgresql.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresql.HighAvailabilityModeZoneRedundant), + // }, + // SupportedIops: to.Ptr[int32](3200), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int32](2), + // }, + // { + // Name: to.Ptr("Standard_D4ds_v4"), + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // }, + // SupportedHaMode: []*armpostgresql.HighAvailabilityMode{ + // to.Ptr(armpostgresql.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresql.HighAvailabilityModeZoneRedundant), + // }, + // SupportedIops: to.Ptr[int32](6400), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int32](4), + // }, + // { + // Name: to.Ptr("Standard_D8ds_v4"), + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // }, + // SupportedHaMode: []*armpostgresql.HighAvailabilityMode{ + // to.Ptr(armpostgresql.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresql.HighAvailabilityModeZoneRedundant), + // }, + // SupportedIops: to.Ptr[int32](12800), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int32](8), + // }, + // { + // Name: to.Ptr("Standard_D16ds_v4"), + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // }, + // SupportedHaMode: []*armpostgresql.HighAvailabilityMode{ + // to.Ptr(armpostgresql.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresql.HighAvailabilityModeZoneRedundant), + // }, + // SupportedIops: to.Ptr[int32](25600), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int32](16), + // }, + // { + // Name: to.Ptr("Standard_D32ds_v4"), + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // }, + // SupportedHaMode: []*armpostgresql.HighAvailabilityMode{ + // to.Ptr(armpostgresql.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresql.HighAvailabilityModeZoneRedundant), + // }, + // SupportedIops: to.Ptr[int32](51200), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int32](32), + // }, + // { + // Name: to.Ptr("Standard_D48ds_v4"), + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // }, + // SupportedHaMode: []*armpostgresql.HighAvailabilityMode{ + // to.Ptr(armpostgresql.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresql.HighAvailabilityModeZoneRedundant), + // }, + // SupportedIops: to.Ptr[int32](76800), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int32](48), + // }, + // { + // Name: to.Ptr("Standard_D64ds_v4"), + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // }, + // SupportedHaMode: []*armpostgresql.HighAvailabilityMode{ + // to.Ptr(armpostgresql.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresql.HighAvailabilityModeZoneRedundant), + // }, + // SupportedIops: to.Ptr[int32](80000), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int32](64), + // }, + // { + // Name: to.Ptr("Standard_D2ads_v5"), + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // }, + // SupportedHaMode: []*armpostgresql.HighAvailabilityMode{ + // to.Ptr(armpostgresql.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresql.HighAvailabilityModeZoneRedundant), + // }, + // SupportedIops: to.Ptr[int32](3200), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int32](2), + // }, + // { + // Name: to.Ptr("Standard_D4ads_v5"), + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // }, + // SupportedHaMode: []*armpostgresql.HighAvailabilityMode{ + // to.Ptr(armpostgresql.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresql.HighAvailabilityModeZoneRedundant), + // }, + // SupportedIops: to.Ptr[int32](6400), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int32](4), + // }, + // { + // Name: to.Ptr("Standard_D8ads_v5"), + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // }, + // SupportedHaMode: []*armpostgresql.HighAvailabilityMode{ + // to.Ptr(armpostgresql.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresql.HighAvailabilityModeZoneRedundant), + // }, + // SupportedIops: to.Ptr[int32](12800), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int32](8), + // }, + // { + // Name: to.Ptr("Standard_D16ads_v5"), + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // }, + // SupportedHaMode: []*armpostgresql.HighAvailabilityMode{ + // to.Ptr(armpostgresql.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresql.HighAvailabilityModeZoneRedundant), + // }, + // SupportedIops: to.Ptr[int32](25600), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int32](16), + // }, + // { + // Name: to.Ptr("Standard_D32ads_v5"), + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // }, + // SupportedHaMode: []*armpostgresql.HighAvailabilityMode{ + // to.Ptr(armpostgresql.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresql.HighAvailabilityModeZoneRedundant), + // }, + // SupportedIops: to.Ptr[int32](51200), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int32](32), + // }, + // { + // Name: to.Ptr("Standard_D48ads_v5"), + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // }, + // SupportedHaMode: []*armpostgresql.HighAvailabilityMode{ + // to.Ptr(armpostgresql.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresql.HighAvailabilityModeZoneRedundant), + // }, + // SupportedIops: to.Ptr[int32](76800), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int32](48), + // }, + // { + // Name: to.Ptr("Standard_D64ads_v5"), + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // }, + // SupportedHaMode: []*armpostgresql.HighAvailabilityMode{ + // to.Ptr(armpostgresql.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresql.HighAvailabilityModeZoneRedundant), + // }, + // SupportedIops: to.Ptr[int32](80000), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int32](64), + // }, + // { + // Name: to.Ptr("Standard_D96ads_v5"), + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // }, + // SupportedHaMode: []*armpostgresql.HighAvailabilityMode{ + // to.Ptr(armpostgresql.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresql.HighAvailabilityModeZoneRedundant), + // }, + // SupportedIops: to.Ptr[int32](80000), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int32](96), + // }, + // { + // Name: to.Ptr("Standard_D2ds_v5"), + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // }, + // SupportedHaMode: []*armpostgresql.HighAvailabilityMode{ + // to.Ptr(armpostgresql.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresql.HighAvailabilityModeZoneRedundant), + // }, + // SupportedIops: to.Ptr[int32](3750), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int32](2), + // }, + // { + // Name: to.Ptr("Standard_D4ds_v5"), + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // }, + // SupportedHaMode: []*armpostgresql.HighAvailabilityMode{ + // to.Ptr(armpostgresql.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresql.HighAvailabilityModeZoneRedundant), + // }, + // SupportedIops: to.Ptr[int32](6400), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int32](4), + // }, + // { + // Name: to.Ptr("Standard_D8ds_v5"), + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // }, + // SupportedHaMode: []*armpostgresql.HighAvailabilityMode{ + // to.Ptr(armpostgresql.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresql.HighAvailabilityModeZoneRedundant), + // }, + // SupportedIops: to.Ptr[int32](12800), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int32](8), + // }, + // { + // Name: to.Ptr("Standard_D16ds_v5"), + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // }, + // SupportedHaMode: []*armpostgresql.HighAvailabilityMode{ + // to.Ptr(armpostgresql.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresql.HighAvailabilityModeZoneRedundant), + // }, + // SupportedIops: to.Ptr[int32](25600), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int32](16), + // }, + // { + // Name: to.Ptr("Standard_D32ds_v5"), + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // }, + // SupportedHaMode: []*armpostgresql.HighAvailabilityMode{ + // to.Ptr(armpostgresql.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresql.HighAvailabilityModeZoneRedundant), + // }, + // SupportedIops: to.Ptr[int32](51200), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int32](32), + // }, + // { + // Name: to.Ptr("Standard_D48ds_v5"), + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // }, + // SupportedHaMode: []*armpostgresql.HighAvailabilityMode{ + // to.Ptr(armpostgresql.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresql.HighAvailabilityModeZoneRedundant), + // }, + // SupportedIops: to.Ptr[int32](76800), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int32](48), + // }, + // { + // Name: to.Ptr("Standard_D64ds_v5"), + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // }, + // SupportedHaMode: []*armpostgresql.HighAvailabilityMode{ + // to.Ptr(armpostgresql.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresql.HighAvailabilityModeZoneRedundant), + // }, + // SupportedIops: to.Ptr[int32](80000), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int32](64), + // }, + // { + // Name: to.Ptr("Standard_D96ds_v5"), + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // }, + // SupportedHaMode: []*armpostgresql.HighAvailabilityMode{ + // to.Ptr(armpostgresql.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresql.HighAvailabilityModeZoneRedundant), + // }, + // SupportedIops: to.Ptr[int32](80000), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int32](96), + // }, + // }, + // SupportedStorageEditions: []*armpostgresql.StorageEditionCapability{ + // { + // Name: to.Ptr("ManagedDisk"), + // DefaultStorageSizeMb: to.Ptr[int64](65536), + // SupportedStorageMb: []*armpostgresql.StorageMbCapability{ + // { + // DefaultIopsTier: to.Ptr("P4"), + // StorageSizeMb: to.Ptr[int64](32768), + // SupportedIops: to.Ptr[int32](120), + // SupportedIopsTiers: []*armpostgresql.StorageTierCapability{ + // { + // Name: to.Ptr("P4"), + // Iops: to.Ptr[int32](120), + // }, + // { + // Name: to.Ptr("P6"), + // Iops: to.Ptr[int32](240), + // }, + // { + // Name: to.Ptr("P10"), + // Iops: to.Ptr[int32](500), + // }, + // { + // Name: to.Ptr("P15"), + // Iops: to.Ptr[int32](1100), + // }, + // { + // Name: to.Ptr("P20"), + // Iops: to.Ptr[int32](2300), + // }, + // { + // Name: to.Ptr("P30"), + // Iops: to.Ptr[int32](5000), + // }, + // { + // Name: to.Ptr("P40"), + // Iops: to.Ptr[int32](7500), + // }, + // { + // Name: to.Ptr("P50"), + // Iops: to.Ptr[int32](7500), + // }, + // }, + // }, + // { + // DefaultIopsTier: to.Ptr("P6"), + // StorageSizeMb: to.Ptr[int64](65536), + // SupportedIops: to.Ptr[int32](240), + // SupportedIopsTiers: []*armpostgresql.StorageTierCapability{ + // { + // Name: to.Ptr("P6"), + // Iops: to.Ptr[int32](240), + // }, + // { + // Name: to.Ptr("P10"), + // Iops: to.Ptr[int32](500), + // }, + // { + // Name: to.Ptr("P15"), + // Iops: to.Ptr[int32](1100), + // }, + // { + // Name: to.Ptr("P20"), + // Iops: to.Ptr[int32](2300), + // }, + // { + // Name: to.Ptr("P30"), + // Iops: to.Ptr[int32](5000), + // }, + // { + // Name: to.Ptr("P40"), + // Iops: to.Ptr[int32](7500), + // }, + // { + // Name: to.Ptr("P50"), + // Iops: to.Ptr[int32](7500), + // }, + // }, + // }, + // { + // DefaultIopsTier: to.Ptr("P10"), + // StorageSizeMb: to.Ptr[int64](131072), + // SupportedIops: to.Ptr[int32](500), + // SupportedIopsTiers: []*armpostgresql.StorageTierCapability{ + // { + // Name: to.Ptr("P10"), + // Iops: to.Ptr[int32](500), + // }, + // { + // Name: to.Ptr("P15"), + // Iops: to.Ptr[int32](1100), + // }, + // { + // Name: to.Ptr("P20"), + // Iops: to.Ptr[int32](2300), + // }, + // { + // Name: to.Ptr("P30"), + // Iops: to.Ptr[int32](5000), + // }, + // { + // Name: to.Ptr("P40"), + // Iops: to.Ptr[int32](7500), + // }, + // { + // Name: to.Ptr("P50"), + // Iops: to.Ptr[int32](7500), + // }, + // }, + // }, + // { + // DefaultIopsTier: to.Ptr("P15"), + // StorageSizeMb: to.Ptr[int64](262144), + // SupportedIops: to.Ptr[int32](1100), + // SupportedIopsTiers: []*armpostgresql.StorageTierCapability{ + // { + // Name: to.Ptr("P15"), + // Iops: to.Ptr[int32](1100), + // }, + // { + // Name: to.Ptr("P20"), + // Iops: to.Ptr[int32](2300), + // }, + // { + // Name: to.Ptr("P30"), + // Iops: to.Ptr[int32](5000), + // }, + // { + // Name: to.Ptr("P40"), + // Iops: to.Ptr[int32](7500), + // }, + // { + // Name: to.Ptr("P50"), + // Iops: to.Ptr[int32](7500), + // }, + // }, + // }, + // { + // DefaultIopsTier: to.Ptr("P20"), + // StorageSizeMb: to.Ptr[int64](524288), + // SupportedIops: to.Ptr[int32](2300), + // SupportedIopsTiers: []*armpostgresql.StorageTierCapability{ + // { + // Name: to.Ptr("P20"), + // Iops: to.Ptr[int32](2300), + // }, + // { + // Name: to.Ptr("P30"), + // Iops: to.Ptr[int32](5000), + // }, + // { + // Name: to.Ptr("P40"), + // Iops: to.Ptr[int32](7500), + // }, + // { + // Name: to.Ptr("P50"), + // Iops: to.Ptr[int32](7500), + // }, + // }, + // }, + // { + // DefaultIopsTier: to.Ptr("P30"), + // StorageSizeMb: to.Ptr[int64](1048576), + // SupportedIops: to.Ptr[int32](5000), + // SupportedIopsTiers: []*armpostgresql.StorageTierCapability{ + // { + // Name: to.Ptr("P30"), + // Iops: to.Ptr[int32](5000), + // }, + // { + // Name: to.Ptr("P40"), + // Iops: to.Ptr[int32](7500), + // }, + // { + // Name: to.Ptr("P50"), + // Iops: to.Ptr[int32](7500), + // }, + // }, + // }, + // { + // DefaultIopsTier: to.Ptr("P40"), + // StorageSizeMb: to.Ptr[int64](2097152), + // SupportedIops: to.Ptr[int32](7500), + // SupportedIopsTiers: []*armpostgresql.StorageTierCapability{ + // { + // Name: to.Ptr("P40"), + // Iops: to.Ptr[int32](7500), + // }, + // { + // Name: to.Ptr("P50"), + // Iops: to.Ptr[int32](7500), + // }, + // }, + // }, + // { + // DefaultIopsTier: to.Ptr("P50"), + // StorageSizeMb: to.Ptr[int64](4193280), + // SupportedIops: to.Ptr[int32](7500), + // SupportedIopsTiers: []*armpostgresql.StorageTierCapability{ + // { + // Name: to.Ptr("P50"), + // Iops: to.Ptr[int32](7500), + // }, + // }, + // }, + // { + // DefaultIopsTier: to.Ptr("P50"), + // StorageSizeMb: to.Ptr[int64](4194304), + // SupportedIops: to.Ptr[int32](7500), + // SupportedIopsTiers: []*armpostgresql.StorageTierCapability{ + // { + // Name: to.Ptr("P50"), + // Iops: to.Ptr[int32](7500), + // }, + // }, + // }, + // { + // DefaultIopsTier: to.Ptr("P60"), + // StorageSizeMb: to.Ptr[int64](8388608), + // SupportedIops: to.Ptr[int32](16000), + // SupportedIopsTiers: []*armpostgresql.StorageTierCapability{ + // { + // Name: to.Ptr("P60"), + // Iops: to.Ptr[int32](16000), + // }, + // { + // Name: to.Ptr("P70"), + // Iops: to.Ptr[int32](18000), + // }, + // { + // Name: to.Ptr("P80"), + // Iops: to.Ptr[int32](20000), + // }, + // }, + // }, + // { + // DefaultIopsTier: to.Ptr("P70"), + // StorageSizeMb: to.Ptr[int64](16777216), + // SupportedIops: to.Ptr[int32](18000), + // SupportedIopsTiers: []*armpostgresql.StorageTierCapability{ + // { + // Name: to.Ptr("P70"), + // Iops: to.Ptr[int32](18000), + // }, + // { + // Name: to.Ptr("P80"), + // Iops: to.Ptr[int32](20000), + // }, + // }, + // }, + // { + // DefaultIopsTier: to.Ptr("P80"), + // StorageSizeMb: to.Ptr[int64](33553408), + // SupportedIops: to.Ptr[int32](20000), + // SupportedIopsTiers: []*armpostgresql.StorageTierCapability{ + // { + // Name: to.Ptr("P80"), + // Iops: to.Ptr[int32](20000), + // }, + // }, + // }, + // }, + // }, + // { + // Name: to.Ptr("ManagedDiskV2"), + // DefaultStorageSizeMb: to.Ptr[int64](65536), + // SupportedStorageMb: []*armpostgresql.StorageMbCapability{ + // { + // DefaultIopsTier: to.Ptr("None"), + // MaximumStorageSizeMb: to.Ptr[int64](67108864), + // StorageSizeMb: to.Ptr[int64](32768), + // SupportedIops: to.Ptr[int32](3000), + // SupportedIopsTiers: []*armpostgresql.StorageTierCapability{ + // { + // Name: to.Ptr("None"), + // Iops: to.Ptr[int32](0), + // }, + // }, + // SupportedMaximumIops: to.Ptr[int32](80000), + // SupportedMaximumThroughput: to.Ptr[int32](1200), + // SupportedThroughput: to.Ptr[int32](125), + // }, + // }, + // }, + // }, + // }, + // { + // Name: to.Ptr("MemoryOptimized"), + // DefaultSKUName: to.Ptr("Standard_E4ds_v5"), + // SupportedServerSKUs: []*armpostgresql.ServerSKUCapability{ + // { + // Name: to.Ptr("Standard_E2s_v3"), + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // }, + // SupportedHaMode: []*armpostgresql.HighAvailabilityMode{ + // to.Ptr(armpostgresql.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresql.HighAvailabilityModeZoneRedundant), + // }, + // SupportedIops: to.Ptr[int32](3200), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int32](2), + // }, + // { + // Name: to.Ptr("Standard_E4s_v3"), + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // }, + // SupportedHaMode: []*armpostgresql.HighAvailabilityMode{ + // to.Ptr(armpostgresql.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresql.HighAvailabilityModeZoneRedundant), + // }, + // SupportedIops: to.Ptr[int32](6400), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int32](4), + // }, + // { + // Name: to.Ptr("Standard_E8s_v3"), + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // }, + // SupportedHaMode: []*armpostgresql.HighAvailabilityMode{ + // to.Ptr(armpostgresql.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresql.HighAvailabilityModeZoneRedundant), + // }, + // SupportedIops: to.Ptr[int32](12800), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int32](8), + // }, + // { + // Name: to.Ptr("Standard_E16s_v3"), + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // }, + // SupportedHaMode: []*armpostgresql.HighAvailabilityMode{ + // to.Ptr(armpostgresql.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresql.HighAvailabilityModeZoneRedundant), + // }, + // SupportedIops: to.Ptr[int32](25600), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int32](16), + // }, + // { + // Name: to.Ptr("Standard_E32s_v3"), + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // }, + // SupportedHaMode: []*armpostgresql.HighAvailabilityMode{ + // to.Ptr(armpostgresql.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresql.HighAvailabilityModeZoneRedundant), + // }, + // SupportedIops: to.Ptr[int32](32000), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int32](32), + // }, + // { + // Name: to.Ptr("Standard_E48s_v3"), + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // }, + // SupportedHaMode: []*armpostgresql.HighAvailabilityMode{ + // to.Ptr(armpostgresql.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresql.HighAvailabilityModeZoneRedundant), + // }, + // SupportedIops: to.Ptr[int32](51200), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int32](48), + // }, + // { + // Name: to.Ptr("Standard_E64s_v3"), + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // }, + // SupportedHaMode: []*armpostgresql.HighAvailabilityMode{ + // to.Ptr(armpostgresql.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresql.HighAvailabilityModeZoneRedundant), + // }, + // SupportedIops: to.Ptr[int32](76800), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](6912), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int32](64), + // }, + // { + // Name: to.Ptr("Standard_E2ds_v4"), + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // }, + // SupportedHaMode: []*armpostgresql.HighAvailabilityMode{ + // to.Ptr(armpostgresql.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresql.HighAvailabilityModeZoneRedundant), + // }, + // SupportedIops: to.Ptr[int32](3200), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int32](2), + // }, + // { + // Name: to.Ptr("Standard_E4ds_v4"), + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // }, + // SupportedHaMode: []*armpostgresql.HighAvailabilityMode{ + // to.Ptr(armpostgresql.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresql.HighAvailabilityModeZoneRedundant), + // }, + // SupportedIops: to.Ptr[int32](6400), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int32](4), + // }, + // { + // Name: to.Ptr("Standard_E8ds_v4"), + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // }, + // SupportedHaMode: []*armpostgresql.HighAvailabilityMode{ + // to.Ptr(armpostgresql.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresql.HighAvailabilityModeZoneRedundant), + // }, + // SupportedIops: to.Ptr[int32](12800), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int32](8), + // }, + // { + // Name: to.Ptr("Standard_E16ds_v4"), + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // }, + // SupportedHaMode: []*armpostgresql.HighAvailabilityMode{ + // to.Ptr(armpostgresql.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresql.HighAvailabilityModeZoneRedundant), + // }, + // SupportedIops: to.Ptr[int32](25600), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int32](16), + // }, + // { + // Name: to.Ptr("Standard_E20ds_v4"), + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // }, + // SupportedHaMode: []*armpostgresql.HighAvailabilityMode{ + // to.Ptr(armpostgresql.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresql.HighAvailabilityModeZoneRedundant), + // }, + // SupportedIops: to.Ptr[int32](32000), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int32](20), + // }, + // { + // Name: to.Ptr("Standard_E32ds_v4"), + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // }, + // SupportedHaMode: []*armpostgresql.HighAvailabilityMode{ + // to.Ptr(armpostgresql.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresql.HighAvailabilityModeZoneRedundant), + // }, + // SupportedIops: to.Ptr[int32](51200), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int32](32), + // }, + // { + // Name: to.Ptr("Standard_E48ds_v4"), + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // }, + // SupportedHaMode: []*armpostgresql.HighAvailabilityMode{ + // to.Ptr(armpostgresql.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresql.HighAvailabilityModeZoneRedundant), + // }, + // SupportedIops: to.Ptr[int32](76800), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int32](48), + // }, + // { + // Name: to.Ptr("Standard_E64ds_v4"), + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // }, + // SupportedHaMode: []*armpostgresql.HighAvailabilityMode{ + // to.Ptr(armpostgresql.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresql.HighAvailabilityModeZoneRedundant), + // }, + // SupportedIops: to.Ptr[int32](80000), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](6912), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int32](64), + // }, + // { + // Name: to.Ptr("Standard_E2ads_v5"), + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // }, + // SupportedHaMode: []*armpostgresql.HighAvailabilityMode{ + // to.Ptr(armpostgresql.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresql.HighAvailabilityModeZoneRedundant), + // }, + // SupportedIops: to.Ptr[int32](3750), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int32](2), + // }, + // { + // Name: to.Ptr("Standard_E4ads_v5"), + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // }, + // SupportedHaMode: []*armpostgresql.HighAvailabilityMode{ + // to.Ptr(armpostgresql.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresql.HighAvailabilityModeZoneRedundant), + // }, + // SupportedIops: to.Ptr[int32](6400), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int32](4), + // }, + // { + // Name: to.Ptr("Standard_E8ads_v5"), + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // }, + // SupportedHaMode: []*armpostgresql.HighAvailabilityMode{ + // to.Ptr(armpostgresql.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresql.HighAvailabilityModeZoneRedundant), + // }, + // SupportedIops: to.Ptr[int32](12800), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int32](8), + // }, + // { + // Name: to.Ptr("Standard_E16ads_v5"), + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // }, + // SupportedHaMode: []*armpostgresql.HighAvailabilityMode{ + // to.Ptr(armpostgresql.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresql.HighAvailabilityModeZoneRedundant), + // }, + // SupportedIops: to.Ptr[int32](25600), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int32](16), + // }, + // { + // Name: to.Ptr("Standard_E20ads_v5"), + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // }, + // SupportedHaMode: []*armpostgresql.HighAvailabilityMode{ + // to.Ptr(armpostgresql.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresql.HighAvailabilityModeZoneRedundant), + // }, + // SupportedIops: to.Ptr[int32](32000), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int32](20), + // }, + // { + // Name: to.Ptr("Standard_E32ads_v5"), + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // }, + // SupportedHaMode: []*armpostgresql.HighAvailabilityMode{ + // to.Ptr(armpostgresql.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresql.HighAvailabilityModeZoneRedundant), + // }, + // SupportedIops: to.Ptr[int32](51200), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int32](32), + // }, + // { + // Name: to.Ptr("Standard_E48ads_v5"), + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // }, + // SupportedHaMode: []*armpostgresql.HighAvailabilityMode{ + // to.Ptr(armpostgresql.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresql.HighAvailabilityModeZoneRedundant), + // }, + // SupportedIops: to.Ptr[int32](76800), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int32](48), + // }, + // { + // Name: to.Ptr("Standard_E64ads_v5"), + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // }, + // SupportedHaMode: []*armpostgresql.HighAvailabilityMode{ + // to.Ptr(armpostgresql.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresql.HighAvailabilityModeZoneRedundant), + // }, + // SupportedIops: to.Ptr[int32](80000), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int32](64), + // }, + // { + // Name: to.Ptr("Standard_E96ads_v5"), + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // }, + // SupportedHaMode: []*armpostgresql.HighAvailabilityMode{ + // to.Ptr(armpostgresql.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresql.HighAvailabilityModeZoneRedundant), + // }, + // SupportedIops: to.Ptr[int32](80000), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](7168), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int32](96), + // }, + // { + // Name: to.Ptr("Standard_E2ds_v5"), + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // }, + // SupportedHaMode: []*armpostgresql.HighAvailabilityMode{ + // to.Ptr(armpostgresql.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresql.HighAvailabilityModeZoneRedundant), + // }, + // SupportedIops: to.Ptr[int32](3750), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int32](2), + // }, + // { + // Name: to.Ptr("Standard_E4ds_v5"), + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // }, + // SupportedHaMode: []*armpostgresql.HighAvailabilityMode{ + // to.Ptr(armpostgresql.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresql.HighAvailabilityModeZoneRedundant), + // }, + // SupportedIops: to.Ptr[int32](6400), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int32](4), + // }, + // { + // Name: to.Ptr("Standard_E8ds_v5"), + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // }, + // SupportedHaMode: []*armpostgresql.HighAvailabilityMode{ + // to.Ptr(armpostgresql.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresql.HighAvailabilityModeZoneRedundant), + // }, + // SupportedIops: to.Ptr[int32](12800), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int32](8), + // }, + // { + // Name: to.Ptr("Standard_E16ds_v5"), + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // }, + // SupportedHaMode: []*armpostgresql.HighAvailabilityMode{ + // to.Ptr(armpostgresql.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresql.HighAvailabilityModeZoneRedundant), + // }, + // SupportedIops: to.Ptr[int32](25600), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int32](16), + // }, + // { + // Name: to.Ptr("Standard_E20ds_v5"), + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // }, + // SupportedHaMode: []*armpostgresql.HighAvailabilityMode{ + // to.Ptr(armpostgresql.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresql.HighAvailabilityModeZoneRedundant), + // }, + // SupportedIops: to.Ptr[int32](32000), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int32](20), + // }, + // { + // Name: to.Ptr("Standard_E32ds_v5"), + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // }, + // SupportedHaMode: []*armpostgresql.HighAvailabilityMode{ + // to.Ptr(armpostgresql.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresql.HighAvailabilityModeZoneRedundant), + // }, + // SupportedIops: to.Ptr[int32](51200), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int32](32), + // }, + // { + // Name: to.Ptr("Standard_E48ds_v5"), + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // }, + // SupportedHaMode: []*armpostgresql.HighAvailabilityMode{ + // to.Ptr(armpostgresql.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresql.HighAvailabilityModeZoneRedundant), + // }, + // SupportedIops: to.Ptr[int32](76800), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int32](48), + // }, + // { + // Name: to.Ptr("Standard_E64ds_v5"), + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // }, + // SupportedHaMode: []*armpostgresql.HighAvailabilityMode{ + // to.Ptr(armpostgresql.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresql.HighAvailabilityModeZoneRedundant), + // }, + // SupportedIops: to.Ptr[int32](80000), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int32](64), + // }, + // { + // Name: to.Ptr("Standard_E96ds_v5"), + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // }, + // SupportedHaMode: []*armpostgresql.HighAvailabilityMode{ + // to.Ptr(armpostgresql.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresql.HighAvailabilityModeZoneRedundant), + // }, + // SupportedIops: to.Ptr[int32](80000), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](7168), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int32](96), + // }, + // }, + // SupportedStorageEditions: []*armpostgresql.StorageEditionCapability{ + // { + // Name: to.Ptr("ManagedDisk"), + // DefaultStorageSizeMb: to.Ptr[int64](131072), + // SupportedStorageMb: []*armpostgresql.StorageMbCapability{ + // { + // DefaultIopsTier: to.Ptr("P4"), + // StorageSizeMb: to.Ptr[int64](32768), + // SupportedIops: to.Ptr[int32](120), + // SupportedIopsTiers: []*armpostgresql.StorageTierCapability{ + // { + // Name: to.Ptr("P4"), + // Iops: to.Ptr[int32](120), + // }, + // { + // Name: to.Ptr("P6"), + // Iops: to.Ptr[int32](240), + // }, + // { + // Name: to.Ptr("P10"), + // Iops: to.Ptr[int32](500), + // }, + // { + // Name: to.Ptr("P15"), + // Iops: to.Ptr[int32](1100), + // }, + // { + // Name: to.Ptr("P20"), + // Iops: to.Ptr[int32](2300), + // }, + // { + // Name: to.Ptr("P30"), + // Iops: to.Ptr[int32](5000), + // }, + // { + // Name: to.Ptr("P40"), + // Iops: to.Ptr[int32](7500), + // }, + // { + // Name: to.Ptr("P50"), + // Iops: to.Ptr[int32](7500), + // }, + // }, + // }, + // { + // DefaultIopsTier: to.Ptr("P6"), + // StorageSizeMb: to.Ptr[int64](65536), + // SupportedIops: to.Ptr[int32](240), + // SupportedIopsTiers: []*armpostgresql.StorageTierCapability{ + // { + // Name: to.Ptr("P6"), + // Iops: to.Ptr[int32](240), + // }, + // { + // Name: to.Ptr("P10"), + // Iops: to.Ptr[int32](500), + // }, + // { + // Name: to.Ptr("P15"), + // Iops: to.Ptr[int32](1100), + // }, + // { + // Name: to.Ptr("P20"), + // Iops: to.Ptr[int32](2300), + // }, + // { + // Name: to.Ptr("P30"), + // Iops: to.Ptr[int32](5000), + // }, + // { + // Name: to.Ptr("P40"), + // Iops: to.Ptr[int32](7500), + // }, + // { + // Name: to.Ptr("P50"), + // Iops: to.Ptr[int32](7500), + // }, + // }, + // }, + // { + // DefaultIopsTier: to.Ptr("P10"), + // StorageSizeMb: to.Ptr[int64](131072), + // SupportedIops: to.Ptr[int32](500), + // SupportedIopsTiers: []*armpostgresql.StorageTierCapability{ + // { + // Name: to.Ptr("P10"), + // Iops: to.Ptr[int32](500), + // }, + // { + // Name: to.Ptr("P15"), + // Iops: to.Ptr[int32](1100), + // }, + // { + // Name: to.Ptr("P20"), + // Iops: to.Ptr[int32](2300), + // }, + // { + // Name: to.Ptr("P30"), + // Iops: to.Ptr[int32](5000), + // }, + // { + // Name: to.Ptr("P40"), + // Iops: to.Ptr[int32](7500), + // }, + // { + // Name: to.Ptr("P50"), + // Iops: to.Ptr[int32](7500), + // }, + // }, + // }, + // { + // DefaultIopsTier: to.Ptr("P15"), + // StorageSizeMb: to.Ptr[int64](262144), + // SupportedIops: to.Ptr[int32](1100), + // SupportedIopsTiers: []*armpostgresql.StorageTierCapability{ + // { + // Name: to.Ptr("P15"), + // Iops: to.Ptr[int32](1100), + // }, + // { + // Name: to.Ptr("P20"), + // Iops: to.Ptr[int32](2300), + // }, + // { + // Name: to.Ptr("P30"), + // Iops: to.Ptr[int32](5000), + // }, + // { + // Name: to.Ptr("P40"), + // Iops: to.Ptr[int32](7500), + // }, + // { + // Name: to.Ptr("P50"), + // Iops: to.Ptr[int32](7500), + // }, + // }, + // }, + // { + // DefaultIopsTier: to.Ptr("P20"), + // StorageSizeMb: to.Ptr[int64](524288), + // SupportedIops: to.Ptr[int32](2300), + // SupportedIopsTiers: []*armpostgresql.StorageTierCapability{ + // { + // Name: to.Ptr("P20"), + // Iops: to.Ptr[int32](2300), + // }, + // { + // Name: to.Ptr("P30"), + // Iops: to.Ptr[int32](5000), + // }, + // { + // Name: to.Ptr("P40"), + // Iops: to.Ptr[int32](7500), + // }, + // { + // Name: to.Ptr("P50"), + // Iops: to.Ptr[int32](7500), + // }, + // }, + // }, + // { + // DefaultIopsTier: to.Ptr("P30"), + // StorageSizeMb: to.Ptr[int64](1048576), + // SupportedIops: to.Ptr[int32](5000), + // SupportedIopsTiers: []*armpostgresql.StorageTierCapability{ + // { + // Name: to.Ptr("P30"), + // Iops: to.Ptr[int32](5000), + // }, + // { + // Name: to.Ptr("P40"), + // Iops: to.Ptr[int32](7500), + // }, + // { + // Name: to.Ptr("P50"), + // Iops: to.Ptr[int32](7500), + // }, + // }, + // }, + // { + // DefaultIopsTier: to.Ptr("P40"), + // StorageSizeMb: to.Ptr[int64](2097152), + // SupportedIops: to.Ptr[int32](7500), + // SupportedIopsTiers: []*armpostgresql.StorageTierCapability{ + // { + // Name: to.Ptr("P40"), + // Iops: to.Ptr[int32](7500), + // }, + // { + // Name: to.Ptr("P50"), + // Iops: to.Ptr[int32](7500), + // }, + // }, + // }, + // { + // DefaultIopsTier: to.Ptr("P50"), + // StorageSizeMb: to.Ptr[int64](4193280), + // SupportedIops: to.Ptr[int32](7500), + // SupportedIopsTiers: []*armpostgresql.StorageTierCapability{ + // { + // Name: to.Ptr("P50"), + // Iops: to.Ptr[int32](7500), + // }, + // }, + // }, + // { + // DefaultIopsTier: to.Ptr("P50"), + // StorageSizeMb: to.Ptr[int64](4194304), + // SupportedIops: to.Ptr[int32](7500), + // SupportedIopsTiers: []*armpostgresql.StorageTierCapability{ + // { + // Name: to.Ptr("P50"), + // Iops: to.Ptr[int32](7500), + // }, + // }, + // }, + // { + // DefaultIopsTier: to.Ptr("P60"), + // StorageSizeMb: to.Ptr[int64](8388608), + // SupportedIops: to.Ptr[int32](16000), + // SupportedIopsTiers: []*armpostgresql.StorageTierCapability{ + // { + // Name: to.Ptr("P60"), + // Iops: to.Ptr[int32](16000), + // }, + // { + // Name: to.Ptr("P70"), + // Iops: to.Ptr[int32](18000), + // }, + // { + // Name: to.Ptr("P80"), + // Iops: to.Ptr[int32](20000), + // }, + // }, + // }, + // { + // DefaultIopsTier: to.Ptr("P70"), + // StorageSizeMb: to.Ptr[int64](16777216), + // SupportedIops: to.Ptr[int32](18000), + // SupportedIopsTiers: []*armpostgresql.StorageTierCapability{ + // { + // Name: to.Ptr("P70"), + // Iops: to.Ptr[int32](18000), + // }, + // { + // Name: to.Ptr("P80"), + // Iops: to.Ptr[int32](20000), + // }, + // }, + // }, + // { + // DefaultIopsTier: to.Ptr("P80"), + // StorageSizeMb: to.Ptr[int64](33553408), + // SupportedIops: to.Ptr[int32](20000), + // SupportedIopsTiers: []*armpostgresql.StorageTierCapability{ + // { + // Name: to.Ptr("P80"), + // Iops: to.Ptr[int32](20000), + // }, + // }, + // }, + // }, + // }, + // { + // Name: to.Ptr("ManagedDiskV2"), + // DefaultStorageSizeMb: to.Ptr[int64](131072), + // SupportedStorageMb: []*armpostgresql.StorageMbCapability{ + // { + // DefaultIopsTier: to.Ptr("None"), + // MaximumStorageSizeMb: to.Ptr[int64](67108864), + // StorageSizeMb: to.Ptr[int64](32768), + // SupportedIops: to.Ptr[int32](3000), + // SupportedIopsTiers: []*armpostgresql.StorageTierCapability{ + // { + // Name: to.Ptr("None"), + // Iops: to.Ptr[int32](0), + // }, + // }, + // SupportedMaximumIops: to.Ptr[int32](80000), + // SupportedMaximumThroughput: to.Ptr[int32](1200), + // SupportedThroughput: to.Ptr[int32](125), + // }, + // }, + // }, + // }, + // }, + // }, + // SupportedServerVersions: []*armpostgresql.ServerVersionCapability{ + // { + // Name: to.Ptr("11"), + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // }, + // SupportedVersionsToUpgrade: []*string{ + // to.Ptr("12"), + // to.Ptr("13"), + // to.Ptr("14"), + // to.Ptr("15"), + // to.Ptr("16"), + // to.Ptr("17"), + // to.Ptr("18"), + // }, + // }, + // { + // Name: to.Ptr("12"), + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // }, + // SupportedVersionsToUpgrade: []*string{ + // to.Ptr("13"), + // to.Ptr("14"), + // to.Ptr("15"), + // to.Ptr("16"), + // to.Ptr("17"), + // to.Ptr("18"), + // }, + // }, + // { + // Name: to.Ptr("13"), + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // }, + // SupportedVersionsToUpgrade: []*string{ + // to.Ptr("14"), + // to.Ptr("15"), + // to.Ptr("16"), + // to.Ptr("17"), + // to.Ptr("18"), + // }, + // }, + // { + // Name: to.Ptr("14"), + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // }, + // SupportedVersionsToUpgrade: []*string{ + // to.Ptr("15"), + // to.Ptr("16"), + // to.Ptr("17"), + // to.Ptr("18"), + // }, + // }, + // { + // Name: to.Ptr("15"), + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // }, + // SupportedVersionsToUpgrade: []*string{ + // to.Ptr("16"), + // to.Ptr("17"), + // to.Ptr("18"), + // }, + // }, + // { + // Name: to.Ptr("16"), + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // }, + // SupportedVersionsToUpgrade: []*string{ + // to.Ptr("17"), + // to.Ptr("18"), + // }, + // }, + // { + // Name: to.Ptr("17"), + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // }, + // SupportedVersionsToUpgrade: []*string{ + // to.Ptr("18"), + // }, + // }, + // { + // Name: to.Ptr("18"), + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // }, + // SupportedVersionsToUpgrade: []*string{ + // }, + // }, + // }, + // ZoneRedundantHaAndGeoBackupSupported: to.Ptr(armpostgresql.ZoneRedundantHighAvailabilityAndGeographicallyRedundantBackupSupportEnabled), + // ZoneRedundantHaSupported: to.Ptr(armpostgresql.ZoneRedundantHighAvailabilitySupportEnabled), + // }, + // }, + // }, + // } + } +} diff --git a/sdk/resourcemanager/postgresql/armpostgresql/capabilitiesbyserver_client.go b/sdk/resourcemanager/postgresql/armpostgresql/capabilitiesbyserver_client.go new file mode 100644 index 000000000000..e8a2f162a575 --- /dev/null +++ b/sdk/resourcemanager/postgresql/armpostgresql/capabilitiesbyserver_client.go @@ -0,0 +1,105 @@ +// 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) Go Code Generator. DO NOT EDIT. + +package armpostgresql + +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" +) + +// 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 +} + +// 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 - 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 := &CapabilitiesByServerClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// NewListPager - Lists the capabilities available for a given 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 - CapabilitiesByServerClientListOptions contains the optional parameters for the CapabilitiesByServerClient.NewListPager +// method. +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 *CapabilitiesByServerClientListResponse) (CapabilitiesByServerClientListResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "CapabilitiesByServerClient.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, resourceGroupName, serverName, options) + }, nil) + if err != nil { + return CapabilitiesByServerClientListResponse{}, err + } + return client.listHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listCreateRequest creates the List request. +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") + } + 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 +} + +// listHandleResponse handles the List response. +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/armpostgresql/capabilitiesbyserver_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresql/capabilitiesbyserver_client_example_test.go new file mode 100644 index 000000000000..30d3864253b6 --- /dev/null +++ b/sdk/resourcemanager/postgresql/armpostgresql/capabilitiesbyserver_client_example_test.go @@ -0,0 +1,2181 @@ +// 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) Go Code Generator. DO NOT EDIT. + +package armpostgresql_test + +import ( + "context" + "github.com/Azure/azure-sdk-for-go/sdk/azidentity" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresql/v2" + "log" +) + +// Generated from example definition: 2025-08-01/CapabilitiesByServerList.json +func ExampleCapabilitiesByServerClient_NewListPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armpostgresql.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewCapabilitiesByServerClient().NewListPager("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 = armpostgresql.CapabilitiesByServerClientListResponse{ + // CapabilityList: armpostgresql.CapabilityList{ + // Value: []*armpostgresql.Capability{ + // { + // Name: to.Ptr("FlexibleServerCapabilities"), + // FastProvisioningSupported: to.Ptr(armpostgresql.FastProvisioningSupportEnabled), + // GeoBackupSupported: to.Ptr(armpostgresql.GeographicallyRedundantBackupSupportEnabled), + // OnlineResizeSupported: to.Ptr(armpostgresql.OnlineStorageResizeSupportEnabled), + // Restricted: to.Ptr(armpostgresql.LocationRestrictedDisabled), + // StorageAutoGrowthSupported: to.Ptr(armpostgresql.StorageAutoGrowthSupportEnabled), + // SupportedFastProvisioningEditions: []*armpostgresql.FastProvisioningEditionCapability{ + // { + // ServerCount: to.Ptr[int32](0), + // SupportedServerVersions: to.Ptr("12"), + // SupportedSKU: to.Ptr("standard_b1ms"), + // SupportedStorageGb: to.Ptr[int32](32), + // SupportedTier: to.Ptr("Burstable"), + // }, + // { + // ServerCount: to.Ptr[int32](0), + // SupportedServerVersions: to.Ptr("12"), + // SupportedSKU: to.Ptr("standard_b2s"), + // SupportedStorageGb: to.Ptr[int32](32), + // SupportedTier: to.Ptr("Burstable"), + // }, + // { + // ServerCount: to.Ptr[int32](0), + // SupportedServerVersions: to.Ptr("12"), + // SupportedSKU: to.Ptr("standard_d2s_v3"), + // SupportedStorageGb: to.Ptr[int32](128), + // SupportedTier: to.Ptr("GeneralPurpose"), + // }, + // { + // ServerCount: to.Ptr[int32](0), + // SupportedServerVersions: to.Ptr("12"), + // SupportedSKU: to.Ptr("standard_d2ds_v4"), + // SupportedStorageGb: to.Ptr[int32](128), + // SupportedTier: to.Ptr("GeneralPurpose"), + // }, + // { + // ServerCount: to.Ptr[int32](0), + // SupportedServerVersions: to.Ptr("12"), + // SupportedSKU: to.Ptr("standard_e2ds_v4"), + // SupportedStorageGb: to.Ptr[int32](512), + // SupportedTier: to.Ptr("MemoryOptimized"), + // }, + // { + // ServerCount: to.Ptr[int32](0), + // SupportedServerVersions: to.Ptr("13"), + // SupportedSKU: to.Ptr("standard_b1ms"), + // SupportedStorageGb: to.Ptr[int32](32), + // SupportedTier: to.Ptr("Burstable"), + // }, + // { + // ServerCount: to.Ptr[int32](0), + // SupportedServerVersions: to.Ptr("13"), + // SupportedSKU: to.Ptr("standard_b2s"), + // SupportedStorageGb: to.Ptr[int32](32), + // SupportedTier: to.Ptr("Burstable"), + // }, + // { + // ServerCount: to.Ptr[int32](0), + // SupportedServerVersions: to.Ptr("13"), + // SupportedSKU: to.Ptr("standard_d2s_v3"), + // SupportedStorageGb: to.Ptr[int32](128), + // SupportedTier: to.Ptr("GeneralPurpose"), + // }, + // { + // ServerCount: to.Ptr[int32](0), + // SupportedServerVersions: to.Ptr("13"), + // SupportedSKU: to.Ptr("standard_d2ds_v4"), + // SupportedStorageGb: to.Ptr[int32](128), + // SupportedTier: to.Ptr("GeneralPurpose"), + // }, + // { + // ServerCount: to.Ptr[int32](0), + // SupportedServerVersions: to.Ptr("13"), + // SupportedSKU: to.Ptr("standard_e2ds_v4"), + // SupportedStorageGb: to.Ptr[int32](512), + // SupportedTier: to.Ptr("MemoryOptimized"), + // }, + // { + // ServerCount: to.Ptr[int32](0), + // SupportedServerVersions: to.Ptr("14"), + // SupportedSKU: to.Ptr("standard_b1ms"), + // SupportedStorageGb: to.Ptr[int32](32), + // SupportedTier: to.Ptr("Burstable"), + // }, + // { + // ServerCount: to.Ptr[int32](0), + // SupportedServerVersions: to.Ptr("14"), + // SupportedSKU: to.Ptr("standard_b2s"), + // SupportedStorageGb: to.Ptr[int32](32), + // SupportedTier: to.Ptr("Burstable"), + // }, + // { + // ServerCount: to.Ptr[int32](0), + // SupportedServerVersions: to.Ptr("14"), + // SupportedSKU: to.Ptr("standard_d2s_v3"), + // SupportedStorageGb: to.Ptr[int32](128), + // SupportedTier: to.Ptr("GeneralPurpose"), + // }, + // { + // ServerCount: to.Ptr[int32](0), + // SupportedServerVersions: to.Ptr("14"), + // SupportedSKU: to.Ptr("standard_d2ds_v4"), + // SupportedStorageGb: to.Ptr[int32](128), + // SupportedTier: to.Ptr("GeneralPurpose"), + // }, + // { + // ServerCount: to.Ptr[int32](0), + // SupportedServerVersions: to.Ptr("14"), + // SupportedSKU: to.Ptr("standard_e2ds_v4"), + // SupportedStorageGb: to.Ptr[int32](512), + // SupportedTier: to.Ptr("MemoryOptimized"), + // }, + // { + // ServerCount: to.Ptr[int32](0), + // SupportedServerVersions: to.Ptr("15"), + // SupportedSKU: to.Ptr("standard_b1ms"), + // SupportedStorageGb: to.Ptr[int32](32), + // SupportedTier: to.Ptr("Burstable"), + // }, + // { + // ServerCount: to.Ptr[int32](0), + // SupportedServerVersions: to.Ptr("15"), + // SupportedSKU: to.Ptr("standard_b2s"), + // SupportedStorageGb: to.Ptr[int32](32), + // SupportedTier: to.Ptr("Burstable"), + // }, + // { + // ServerCount: to.Ptr[int32](0), + // SupportedServerVersions: to.Ptr("15"), + // SupportedSKU: to.Ptr("standard_d2s_v3"), + // SupportedStorageGb: to.Ptr[int32](128), + // SupportedTier: to.Ptr("GeneralPurpose"), + // }, + // { + // ServerCount: to.Ptr[int32](0), + // SupportedServerVersions: to.Ptr("15"), + // SupportedSKU: to.Ptr("standard_d2ds_v4"), + // SupportedStorageGb: to.Ptr[int32](128), + // SupportedTier: to.Ptr("GeneralPurpose"), + // }, + // { + // ServerCount: to.Ptr[int32](0), + // SupportedServerVersions: to.Ptr("15"), + // SupportedSKU: to.Ptr("standard_e2ds_v4"), + // SupportedStorageGb: to.Ptr[int32](512), + // SupportedTier: to.Ptr("MemoryOptimized"), + // }, + // { + // ServerCount: to.Ptr[int32](0), + // SupportedServerVersions: to.Ptr("16"), + // SupportedSKU: to.Ptr("standard_b1ms"), + // SupportedStorageGb: to.Ptr[int32](32), + // SupportedTier: to.Ptr("Burstable"), + // }, + // { + // ServerCount: to.Ptr[int32](0), + // SupportedServerVersions: to.Ptr("16"), + // SupportedSKU: to.Ptr("standard_b2s"), + // SupportedStorageGb: to.Ptr[int32](32), + // SupportedTier: to.Ptr("Burstable"), + // }, + // { + // ServerCount: to.Ptr[int32](0), + // SupportedServerVersions: to.Ptr("16"), + // SupportedSKU: to.Ptr("standard_d2s_v3"), + // SupportedStorageGb: to.Ptr[int32](128), + // SupportedTier: to.Ptr("GeneralPurpose"), + // }, + // { + // ServerCount: to.Ptr[int32](0), + // SupportedServerVersions: to.Ptr("16"), + // SupportedSKU: to.Ptr("standard_d2ds_v4"), + // SupportedStorageGb: to.Ptr[int32](128), + // SupportedTier: to.Ptr("GeneralPurpose"), + // }, + // { + // ServerCount: to.Ptr[int32](0), + // SupportedServerVersions: to.Ptr("16"), + // SupportedSKU: to.Ptr("standard_e2ds_v4"), + // SupportedStorageGb: to.Ptr[int32](512), + // SupportedTier: to.Ptr("MemoryOptimized"), + // }, + // }, + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // { + // Name: to.Ptr("FastProvisioning"), + // Status: to.Ptr(armpostgresql.FeatureStatusEnabled), + // }, + // { + // Name: to.Ptr("ZoneRedundantHa"), + // Status: to.Ptr(armpostgresql.FeatureStatusEnabled), + // }, + // { + // Name: to.Ptr("GeoBackup"), + // Status: to.Ptr(armpostgresql.FeatureStatusEnabled), + // }, + // { + // Name: to.Ptr("ZoneRedundantHaAndGeoBackup"), + // Status: to.Ptr(armpostgresql.FeatureStatusEnabled), + // }, + // { + // Name: to.Ptr("StorageAutoGrowth"), + // Status: to.Ptr(armpostgresql.FeatureStatusEnabled), + // }, + // { + // Name: to.Ptr("OnlineResize"), + // Status: to.Ptr(armpostgresql.FeatureStatusEnabled), + // }, + // { + // Name: to.Ptr("OfferRestricted"), + // Status: to.Ptr(armpostgresql.FeatureStatusDisabled), + // }, + // { + // Name: to.Ptr("IndexTuning"), + // Status: to.Ptr(armpostgresql.FeatureStatusEnabled), + // }, + // { + // Name: to.Ptr("Clusters"), + // Status: to.Ptr(armpostgresql.FeatureStatusEnabled), + // }, + // }, + // SupportedServerEditions: []*armpostgresql.ServerEditionCapability{ + // { + // Name: to.Ptr("Burstable"), + // DefaultSKUName: to.Ptr("Standard_B1ms"), + // SupportedServerSKUs: []*armpostgresql.ServerSKUCapability{ + // { + // Name: to.Ptr("Standard_B1ms"), + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // }, + // SupportedHaMode: []*armpostgresql.HighAvailabilityMode{ + // to.Ptr(armpostgresql.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresql.HighAvailabilityModeZoneRedundant), + // }, + // SupportedIops: to.Ptr[int32](640), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](2048), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int32](1), + // }, + // { + // Name: to.Ptr("Standard_B2s"), + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // }, + // SupportedHaMode: []*armpostgresql.HighAvailabilityMode{ + // to.Ptr(armpostgresql.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresql.HighAvailabilityModeZoneRedundant), + // }, + // SupportedIops: to.Ptr[int32](1280), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](2048), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int32](2), + // }, + // { + // Name: to.Ptr("Standard_B2ms"), + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // }, + // SupportedHaMode: []*armpostgresql.HighAvailabilityMode{ + // to.Ptr(armpostgresql.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresql.HighAvailabilityModeZoneRedundant), + // }, + // SupportedIops: to.Ptr[int32](1920), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int32](2), + // }, + // { + // Name: to.Ptr("Standard_B4ms"), + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // }, + // SupportedHaMode: []*armpostgresql.HighAvailabilityMode{ + // to.Ptr(armpostgresql.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresql.HighAvailabilityModeZoneRedundant), + // }, + // SupportedIops: to.Ptr[int32](2880), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int32](4), + // }, + // { + // Name: to.Ptr("Standard_B8ms"), + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // }, + // SupportedHaMode: []*armpostgresql.HighAvailabilityMode{ + // to.Ptr(armpostgresql.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresql.HighAvailabilityModeZoneRedundant), + // }, + // SupportedIops: to.Ptr[int32](4320), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int32](8), + // }, + // { + // Name: to.Ptr("Standard_B12ms"), + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // }, + // SupportedHaMode: []*armpostgresql.HighAvailabilityMode{ + // to.Ptr(armpostgresql.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresql.HighAvailabilityModeZoneRedundant), + // }, + // SupportedIops: to.Ptr[int32](4320), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int32](12), + // }, + // { + // Name: to.Ptr("Standard_B16ms"), + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // }, + // SupportedHaMode: []*armpostgresql.HighAvailabilityMode{ + // to.Ptr(armpostgresql.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresql.HighAvailabilityModeZoneRedundant), + // }, + // SupportedIops: to.Ptr[int32](4320), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int32](16), + // }, + // { + // Name: to.Ptr("Standard_B20ms"), + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // }, + // SupportedHaMode: []*armpostgresql.HighAvailabilityMode{ + // to.Ptr(armpostgresql.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresql.HighAvailabilityModeZoneRedundant), + // }, + // SupportedIops: to.Ptr[int32](4320), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int32](20), + // }, + // }, + // SupportedStorageEditions: []*armpostgresql.StorageEditionCapability{ + // { + // Name: to.Ptr("ManagedDisk"), + // DefaultStorageSizeMb: to.Ptr[int64](32768), + // SupportedStorageMb: []*armpostgresql.StorageMbCapability{ + // { + // DefaultIopsTier: to.Ptr("P4"), + // StorageSizeMb: to.Ptr[int64](32768), + // SupportedIops: to.Ptr[int32](120), + // SupportedIopsTiers: []*armpostgresql.StorageTierCapability{ + // { + // Name: to.Ptr("P4"), + // Iops: to.Ptr[int32](120), + // }, + // { + // Name: to.Ptr("P6"), + // Iops: to.Ptr[int32](240), + // }, + // { + // Name: to.Ptr("P10"), + // Iops: to.Ptr[int32](500), + // }, + // { + // Name: to.Ptr("P15"), + // Iops: to.Ptr[int32](1100), + // }, + // { + // Name: to.Ptr("P20"), + // Iops: to.Ptr[int32](2300), + // }, + // { + // Name: to.Ptr("P30"), + // Iops: to.Ptr[int32](5000), + // }, + // { + // Name: to.Ptr("P40"), + // Iops: to.Ptr[int32](7500), + // }, + // { + // Name: to.Ptr("P50"), + // Iops: to.Ptr[int32](7500), + // }, + // }, + // }, + // { + // DefaultIopsTier: to.Ptr("P6"), + // StorageSizeMb: to.Ptr[int64](65536), + // SupportedIops: to.Ptr[int32](240), + // SupportedIopsTiers: []*armpostgresql.StorageTierCapability{ + // { + // Name: to.Ptr("P6"), + // Iops: to.Ptr[int32](240), + // }, + // { + // Name: to.Ptr("P10"), + // Iops: to.Ptr[int32](500), + // }, + // { + // Name: to.Ptr("P15"), + // Iops: to.Ptr[int32](1100), + // }, + // { + // Name: to.Ptr("P20"), + // Iops: to.Ptr[int32](2300), + // }, + // { + // Name: to.Ptr("P30"), + // Iops: to.Ptr[int32](5000), + // }, + // { + // Name: to.Ptr("P40"), + // Iops: to.Ptr[int32](7500), + // }, + // { + // Name: to.Ptr("P50"), + // Iops: to.Ptr[int32](7500), + // }, + // }, + // }, + // { + // DefaultIopsTier: to.Ptr("P10"), + // StorageSizeMb: to.Ptr[int64](131072), + // SupportedIops: to.Ptr[int32](500), + // SupportedIopsTiers: []*armpostgresql.StorageTierCapability{ + // { + // Name: to.Ptr("P10"), + // Iops: to.Ptr[int32](500), + // }, + // { + // Name: to.Ptr("P15"), + // Iops: to.Ptr[int32](1100), + // }, + // { + // Name: to.Ptr("P20"), + // Iops: to.Ptr[int32](2300), + // }, + // { + // Name: to.Ptr("P30"), + // Iops: to.Ptr[int32](5000), + // }, + // { + // Name: to.Ptr("P40"), + // Iops: to.Ptr[int32](7500), + // }, + // { + // Name: to.Ptr("P50"), + // Iops: to.Ptr[int32](7500), + // }, + // }, + // }, + // { + // DefaultIopsTier: to.Ptr("P15"), + // StorageSizeMb: to.Ptr[int64](262144), + // SupportedIops: to.Ptr[int32](1100), + // SupportedIopsTiers: []*armpostgresql.StorageTierCapability{ + // { + // Name: to.Ptr("P15"), + // Iops: to.Ptr[int32](1100), + // }, + // { + // Name: to.Ptr("P20"), + // Iops: to.Ptr[int32](2300), + // }, + // { + // Name: to.Ptr("P30"), + // Iops: to.Ptr[int32](5000), + // }, + // { + // Name: to.Ptr("P40"), + // Iops: to.Ptr[int32](7500), + // }, + // { + // Name: to.Ptr("P50"), + // Iops: to.Ptr[int32](7500), + // }, + // }, + // }, + // { + // DefaultIopsTier: to.Ptr("P20"), + // StorageSizeMb: to.Ptr[int64](524288), + // SupportedIops: to.Ptr[int32](2300), + // SupportedIopsTiers: []*armpostgresql.StorageTierCapability{ + // { + // Name: to.Ptr("P20"), + // Iops: to.Ptr[int32](2300), + // }, + // { + // Name: to.Ptr("P30"), + // Iops: to.Ptr[int32](5000), + // }, + // { + // Name: to.Ptr("P40"), + // Iops: to.Ptr[int32](7500), + // }, + // { + // Name: to.Ptr("P50"), + // Iops: to.Ptr[int32](7500), + // }, + // }, + // }, + // { + // DefaultIopsTier: to.Ptr("P30"), + // StorageSizeMb: to.Ptr[int64](1048576), + // SupportedIops: to.Ptr[int32](5000), + // SupportedIopsTiers: []*armpostgresql.StorageTierCapability{ + // { + // Name: to.Ptr("P30"), + // Iops: to.Ptr[int32](5000), + // }, + // { + // Name: to.Ptr("P40"), + // Iops: to.Ptr[int32](7500), + // }, + // { + // Name: to.Ptr("P50"), + // Iops: to.Ptr[int32](7500), + // }, + // }, + // }, + // { + // DefaultIopsTier: to.Ptr("P40"), + // StorageSizeMb: to.Ptr[int64](2097152), + // SupportedIops: to.Ptr[int32](7500), + // SupportedIopsTiers: []*armpostgresql.StorageTierCapability{ + // { + // Name: to.Ptr("P40"), + // Iops: to.Ptr[int32](7500), + // }, + // { + // Name: to.Ptr("P50"), + // Iops: to.Ptr[int32](7500), + // }, + // }, + // }, + // { + // DefaultIopsTier: to.Ptr("P50"), + // StorageSizeMb: to.Ptr[int64](4193280), + // SupportedIops: to.Ptr[int32](7500), + // SupportedIopsTiers: []*armpostgresql.StorageTierCapability{ + // { + // Name: to.Ptr("P50"), + // Iops: to.Ptr[int32](7500), + // }, + // }, + // }, + // { + // DefaultIopsTier: to.Ptr("P50"), + // StorageSizeMb: to.Ptr[int64](4194304), + // SupportedIops: to.Ptr[int32](7500), + // SupportedIopsTiers: []*armpostgresql.StorageTierCapability{ + // { + // Name: to.Ptr("P50"), + // Iops: to.Ptr[int32](7500), + // }, + // }, + // }, + // { + // DefaultIopsTier: to.Ptr("P60"), + // StorageSizeMb: to.Ptr[int64](8388608), + // SupportedIops: to.Ptr[int32](16000), + // SupportedIopsTiers: []*armpostgresql.StorageTierCapability{ + // { + // Name: to.Ptr("P60"), + // Iops: to.Ptr[int32](16000), + // }, + // { + // Name: to.Ptr("P70"), + // Iops: to.Ptr[int32](18000), + // }, + // { + // Name: to.Ptr("P80"), + // Iops: to.Ptr[int32](20000), + // }, + // }, + // }, + // { + // DefaultIopsTier: to.Ptr("P70"), + // StorageSizeMb: to.Ptr[int64](16777216), + // SupportedIops: to.Ptr[int32](18000), + // SupportedIopsTiers: []*armpostgresql.StorageTierCapability{ + // { + // Name: to.Ptr("P70"), + // Iops: to.Ptr[int32](18000), + // }, + // { + // Name: to.Ptr("P80"), + // Iops: to.Ptr[int32](20000), + // }, + // }, + // }, + // { + // DefaultIopsTier: to.Ptr("P80"), + // StorageSizeMb: to.Ptr[int64](33553408), + // SupportedIops: to.Ptr[int32](20000), + // SupportedIopsTiers: []*armpostgresql.StorageTierCapability{ + // { + // Name: to.Ptr("P80"), + // Iops: to.Ptr[int32](20000), + // }, + // }, + // }, + // }, + // }, + // { + // Name: to.Ptr("ManagedDiskV2"), + // DefaultStorageSizeMb: to.Ptr[int64](32768), + // SupportedStorageMb: []*armpostgresql.StorageMbCapability{ + // { + // DefaultIopsTier: to.Ptr("None"), + // MaximumStorageSizeMb: to.Ptr[int64](67108864), + // StorageSizeMb: to.Ptr[int64](32768), + // SupportedIops: to.Ptr[int32](3000), + // SupportedIopsTiers: []*armpostgresql.StorageTierCapability{ + // { + // Name: to.Ptr("None"), + // Iops: to.Ptr[int32](0), + // }, + // }, + // SupportedMaximumIops: to.Ptr[int32](80000), + // SupportedMaximumThroughput: to.Ptr[int32](1200), + // SupportedThroughput: to.Ptr[int32](125), + // }, + // }, + // }, + // }, + // }, + // { + // Name: to.Ptr("GeneralPurpose"), + // DefaultSKUName: to.Ptr("Standard_D4ds_v5"), + // SupportedServerSKUs: []*armpostgresql.ServerSKUCapability{ + // { + // Name: to.Ptr("Standard_D2s_v3"), + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // }, + // SupportedHaMode: []*armpostgresql.HighAvailabilityMode{ + // to.Ptr(armpostgresql.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresql.HighAvailabilityModeZoneRedundant), + // }, + // SupportedIops: to.Ptr[int32](3200), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int32](2), + // }, + // { + // Name: to.Ptr("Standard_D4ds_v5"), + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // }, + // SupportedHaMode: []*armpostgresql.HighAvailabilityMode{ + // to.Ptr(armpostgresql.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresql.HighAvailabilityModeZoneRedundant), + // }, + // SupportedIops: to.Ptr[int32](6400), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int32](4), + // }, + // { + // Name: to.Ptr("Standard_D8s_v3"), + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // }, + // SupportedHaMode: []*armpostgresql.HighAvailabilityMode{ + // to.Ptr(armpostgresql.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresql.HighAvailabilityModeZoneRedundant), + // }, + // SupportedIops: to.Ptr[int32](12800), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int32](8), + // }, + // { + // Name: to.Ptr("Standard_D16s_v3"), + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // }, + // SupportedHaMode: []*armpostgresql.HighAvailabilityMode{ + // to.Ptr(armpostgresql.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresql.HighAvailabilityModeZoneRedundant), + // }, + // SupportedIops: to.Ptr[int32](25600), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int32](16), + // }, + // { + // Name: to.Ptr("Standard_D32s_v3"), + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // }, + // SupportedHaMode: []*armpostgresql.HighAvailabilityMode{ + // to.Ptr(armpostgresql.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresql.HighAvailabilityModeZoneRedundant), + // }, + // SupportedIops: to.Ptr[int32](51200), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int32](32), + // }, + // { + // Name: to.Ptr("Standard_D48s_v3"), + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // }, + // SupportedHaMode: []*armpostgresql.HighAvailabilityMode{ + // to.Ptr(armpostgresql.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresql.HighAvailabilityModeZoneRedundant), + // }, + // SupportedIops: to.Ptr[int32](76800), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int32](48), + // }, + // { + // Name: to.Ptr("Standard_D64s_v3"), + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // }, + // SupportedHaMode: []*armpostgresql.HighAvailabilityMode{ + // to.Ptr(armpostgresql.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresql.HighAvailabilityModeZoneRedundant), + // }, + // SupportedIops: to.Ptr[int32](80000), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int32](64), + // }, + // { + // Name: to.Ptr("Standard_D2ds_v4"), + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // }, + // SupportedHaMode: []*armpostgresql.HighAvailabilityMode{ + // to.Ptr(armpostgresql.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresql.HighAvailabilityModeZoneRedundant), + // }, + // SupportedIops: to.Ptr[int32](3200), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int32](2), + // }, + // { + // Name: to.Ptr("Standard_D4ds_v4"), + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // }, + // SupportedHaMode: []*armpostgresql.HighAvailabilityMode{ + // to.Ptr(armpostgresql.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresql.HighAvailabilityModeZoneRedundant), + // }, + // SupportedIops: to.Ptr[int32](6400), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int32](4), + // }, + // { + // Name: to.Ptr("Standard_D8ds_v4"), + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // }, + // SupportedHaMode: []*armpostgresql.HighAvailabilityMode{ + // to.Ptr(armpostgresql.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresql.HighAvailabilityModeZoneRedundant), + // }, + // SupportedIops: to.Ptr[int32](12800), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int32](8), + // }, + // { + // Name: to.Ptr("Standard_D16ds_v4"), + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // }, + // SupportedHaMode: []*armpostgresql.HighAvailabilityMode{ + // to.Ptr(armpostgresql.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresql.HighAvailabilityModeZoneRedundant), + // }, + // SupportedIops: to.Ptr[int32](25600), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int32](16), + // }, + // { + // Name: to.Ptr("Standard_D32ds_v4"), + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // }, + // SupportedHaMode: []*armpostgresql.HighAvailabilityMode{ + // to.Ptr(armpostgresql.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresql.HighAvailabilityModeZoneRedundant), + // }, + // SupportedIops: to.Ptr[int32](51200), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int32](32), + // }, + // { + // Name: to.Ptr("Standard_D48ds_v4"), + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // }, + // SupportedHaMode: []*armpostgresql.HighAvailabilityMode{ + // to.Ptr(armpostgresql.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresql.HighAvailabilityModeZoneRedundant), + // }, + // SupportedIops: to.Ptr[int32](76800), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int32](48), + // }, + // { + // Name: to.Ptr("Standard_D64ds_v4"), + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // }, + // SupportedHaMode: []*armpostgresql.HighAvailabilityMode{ + // to.Ptr(armpostgresql.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresql.HighAvailabilityModeZoneRedundant), + // }, + // SupportedIops: to.Ptr[int32](80000), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int32](64), + // }, + // { + // Name: to.Ptr("Standard_D2ds_v5"), + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // }, + // SupportedHaMode: []*armpostgresql.HighAvailabilityMode{ + // to.Ptr(armpostgresql.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresql.HighAvailabilityModeZoneRedundant), + // }, + // SupportedIops: to.Ptr[int32](3750), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int32](2), + // }, + // { + // Name: to.Ptr("Standard_D4ds_v5"), + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // }, + // SupportedHaMode: []*armpostgresql.HighAvailabilityMode{ + // to.Ptr(armpostgresql.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresql.HighAvailabilityModeZoneRedundant), + // }, + // SupportedIops: to.Ptr[int32](6400), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int32](4), + // }, + // { + // Name: to.Ptr("Standard_D8ds_v5"), + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // }, + // SupportedHaMode: []*armpostgresql.HighAvailabilityMode{ + // to.Ptr(armpostgresql.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresql.HighAvailabilityModeZoneRedundant), + // }, + // SupportedIops: to.Ptr[int32](12800), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int32](8), + // }, + // { + // Name: to.Ptr("Standard_D16ds_v5"), + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // }, + // SupportedHaMode: []*armpostgresql.HighAvailabilityMode{ + // to.Ptr(armpostgresql.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresql.HighAvailabilityModeZoneRedundant), + // }, + // SupportedIops: to.Ptr[int32](25600), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int32](16), + // }, + // { + // Name: to.Ptr("Standard_D32ds_v5"), + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // }, + // SupportedHaMode: []*armpostgresql.HighAvailabilityMode{ + // to.Ptr(armpostgresql.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresql.HighAvailabilityModeZoneRedundant), + // }, + // SupportedIops: to.Ptr[int32](51200), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int32](32), + // }, + // { + // Name: to.Ptr("Standard_D48ds_v5"), + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // }, + // SupportedHaMode: []*armpostgresql.HighAvailabilityMode{ + // to.Ptr(armpostgresql.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresql.HighAvailabilityModeZoneRedundant), + // }, + // SupportedIops: to.Ptr[int32](76800), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int32](48), + // }, + // { + // Name: to.Ptr("Standard_D64ds_v5"), + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // }, + // SupportedHaMode: []*armpostgresql.HighAvailabilityMode{ + // to.Ptr(armpostgresql.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresql.HighAvailabilityModeZoneRedundant), + // }, + // SupportedIops: to.Ptr[int32](80000), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int32](64), + // }, + // { + // Name: to.Ptr("Standard_D96ds_v5"), + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // }, + // SupportedHaMode: []*armpostgresql.HighAvailabilityMode{ + // to.Ptr(armpostgresql.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresql.HighAvailabilityModeZoneRedundant), + // }, + // SupportedIops: to.Ptr[int32](80000), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int32](96), + // }, + // }, + // SupportedStorageEditions: []*armpostgresql.StorageEditionCapability{ + // { + // Name: to.Ptr("ManagedDisk"), + // DefaultStorageSizeMb: to.Ptr[int64](65536), + // SupportedStorageMb: []*armpostgresql.StorageMbCapability{ + // { + // DefaultIopsTier: to.Ptr("P4"), + // StorageSizeMb: to.Ptr[int64](32768), + // SupportedIops: to.Ptr[int32](120), + // SupportedIopsTiers: []*armpostgresql.StorageTierCapability{ + // { + // Name: to.Ptr("P4"), + // Iops: to.Ptr[int32](120), + // }, + // { + // Name: to.Ptr("P6"), + // Iops: to.Ptr[int32](240), + // }, + // { + // Name: to.Ptr("P10"), + // Iops: to.Ptr[int32](500), + // }, + // { + // Name: to.Ptr("P15"), + // Iops: to.Ptr[int32](1100), + // }, + // { + // Name: to.Ptr("P20"), + // Iops: to.Ptr[int32](2300), + // }, + // { + // Name: to.Ptr("P30"), + // Iops: to.Ptr[int32](5000), + // }, + // { + // Name: to.Ptr("P40"), + // Iops: to.Ptr[int32](7500), + // }, + // { + // Name: to.Ptr("P50"), + // Iops: to.Ptr[int32](7500), + // }, + // }, + // }, + // { + // DefaultIopsTier: to.Ptr("P6"), + // StorageSizeMb: to.Ptr[int64](65536), + // SupportedIops: to.Ptr[int32](240), + // SupportedIopsTiers: []*armpostgresql.StorageTierCapability{ + // { + // Name: to.Ptr("P6"), + // Iops: to.Ptr[int32](240), + // }, + // { + // Name: to.Ptr("P10"), + // Iops: to.Ptr[int32](500), + // }, + // { + // Name: to.Ptr("P15"), + // Iops: to.Ptr[int32](1100), + // }, + // { + // Name: to.Ptr("P20"), + // Iops: to.Ptr[int32](2300), + // }, + // { + // Name: to.Ptr("P30"), + // Iops: to.Ptr[int32](5000), + // }, + // { + // Name: to.Ptr("P40"), + // Iops: to.Ptr[int32](7500), + // }, + // { + // Name: to.Ptr("P50"), + // Iops: to.Ptr[int32](7500), + // }, + // }, + // }, + // { + // DefaultIopsTier: to.Ptr("P10"), + // StorageSizeMb: to.Ptr[int64](131072), + // SupportedIops: to.Ptr[int32](500), + // SupportedIopsTiers: []*armpostgresql.StorageTierCapability{ + // { + // Name: to.Ptr("P10"), + // Iops: to.Ptr[int32](500), + // }, + // { + // Name: to.Ptr("P15"), + // Iops: to.Ptr[int32](1100), + // }, + // { + // Name: to.Ptr("P20"), + // Iops: to.Ptr[int32](2300), + // }, + // { + // Name: to.Ptr("P30"), + // Iops: to.Ptr[int32](5000), + // }, + // { + // Name: to.Ptr("P40"), + // Iops: to.Ptr[int32](7500), + // }, + // { + // Name: to.Ptr("P50"), + // Iops: to.Ptr[int32](7500), + // }, + // }, + // }, + // { + // DefaultIopsTier: to.Ptr("P15"), + // StorageSizeMb: to.Ptr[int64](262144), + // SupportedIops: to.Ptr[int32](1100), + // SupportedIopsTiers: []*armpostgresql.StorageTierCapability{ + // { + // Name: to.Ptr("P15"), + // Iops: to.Ptr[int32](1100), + // }, + // { + // Name: to.Ptr("P20"), + // Iops: to.Ptr[int32](2300), + // }, + // { + // Name: to.Ptr("P30"), + // Iops: to.Ptr[int32](5000), + // }, + // { + // Name: to.Ptr("P40"), + // Iops: to.Ptr[int32](7500), + // }, + // { + // Name: to.Ptr("P50"), + // Iops: to.Ptr[int32](7500), + // }, + // }, + // }, + // { + // DefaultIopsTier: to.Ptr("P20"), + // StorageSizeMb: to.Ptr[int64](524288), + // SupportedIops: to.Ptr[int32](2300), + // SupportedIopsTiers: []*armpostgresql.StorageTierCapability{ + // { + // Name: to.Ptr("P20"), + // Iops: to.Ptr[int32](2300), + // }, + // { + // Name: to.Ptr("P30"), + // Iops: to.Ptr[int32](5000), + // }, + // { + // Name: to.Ptr("P40"), + // Iops: to.Ptr[int32](7500), + // }, + // { + // Name: to.Ptr("P50"), + // Iops: to.Ptr[int32](7500), + // }, + // }, + // }, + // { + // DefaultIopsTier: to.Ptr("P30"), + // StorageSizeMb: to.Ptr[int64](1048576), + // SupportedIops: to.Ptr[int32](5000), + // SupportedIopsTiers: []*armpostgresql.StorageTierCapability{ + // { + // Name: to.Ptr("P30"), + // Iops: to.Ptr[int32](5000), + // }, + // { + // Name: to.Ptr("P40"), + // Iops: to.Ptr[int32](7500), + // }, + // { + // Name: to.Ptr("P50"), + // Iops: to.Ptr[int32](7500), + // }, + // }, + // }, + // { + // DefaultIopsTier: to.Ptr("P40"), + // StorageSizeMb: to.Ptr[int64](2097152), + // SupportedIops: to.Ptr[int32](7500), + // SupportedIopsTiers: []*armpostgresql.StorageTierCapability{ + // { + // Name: to.Ptr("P40"), + // Iops: to.Ptr[int32](7500), + // }, + // { + // Name: to.Ptr("P50"), + // Iops: to.Ptr[int32](7500), + // }, + // }, + // }, + // { + // DefaultIopsTier: to.Ptr("P50"), + // StorageSizeMb: to.Ptr[int64](4193280), + // SupportedIops: to.Ptr[int32](7500), + // SupportedIopsTiers: []*armpostgresql.StorageTierCapability{ + // { + // Name: to.Ptr("P50"), + // Iops: to.Ptr[int32](7500), + // }, + // }, + // }, + // { + // DefaultIopsTier: to.Ptr("P50"), + // StorageSizeMb: to.Ptr[int64](4194304), + // SupportedIops: to.Ptr[int32](7500), + // SupportedIopsTiers: []*armpostgresql.StorageTierCapability{ + // { + // Name: to.Ptr("P50"), + // Iops: to.Ptr[int32](7500), + // }, + // }, + // }, + // { + // DefaultIopsTier: to.Ptr("P60"), + // StorageSizeMb: to.Ptr[int64](8388608), + // SupportedIops: to.Ptr[int32](16000), + // SupportedIopsTiers: []*armpostgresql.StorageTierCapability{ + // { + // Name: to.Ptr("P60"), + // Iops: to.Ptr[int32](16000), + // }, + // { + // Name: to.Ptr("P70"), + // Iops: to.Ptr[int32](18000), + // }, + // { + // Name: to.Ptr("P80"), + // Iops: to.Ptr[int32](20000), + // }, + // }, + // }, + // { + // DefaultIopsTier: to.Ptr("P70"), + // StorageSizeMb: to.Ptr[int64](16777216), + // SupportedIops: to.Ptr[int32](18000), + // SupportedIopsTiers: []*armpostgresql.StorageTierCapability{ + // { + // Name: to.Ptr("P70"), + // Iops: to.Ptr[int32](18000), + // }, + // { + // Name: to.Ptr("P80"), + // Iops: to.Ptr[int32](20000), + // }, + // }, + // }, + // { + // DefaultIopsTier: to.Ptr("P80"), + // StorageSizeMb: to.Ptr[int64](33553408), + // SupportedIops: to.Ptr[int32](20000), + // SupportedIopsTiers: []*armpostgresql.StorageTierCapability{ + // { + // Name: to.Ptr("P80"), + // Iops: to.Ptr[int32](20000), + // }, + // }, + // }, + // }, + // }, + // { + // Name: to.Ptr("ManagedDiskV2"), + // DefaultStorageSizeMb: to.Ptr[int64](65536), + // SupportedStorageMb: []*armpostgresql.StorageMbCapability{ + // { + // DefaultIopsTier: to.Ptr("None"), + // MaximumStorageSizeMb: to.Ptr[int64](67108864), + // StorageSizeMb: to.Ptr[int64](32768), + // SupportedIops: to.Ptr[int32](3000), + // SupportedIopsTiers: []*armpostgresql.StorageTierCapability{ + // { + // Name: to.Ptr("None"), + // Iops: to.Ptr[int32](0), + // }, + // }, + // SupportedMaximumIops: to.Ptr[int32](80000), + // SupportedMaximumThroughput: to.Ptr[int32](1200), + // SupportedThroughput: to.Ptr[int32](125), + // }, + // }, + // }, + // }, + // }, + // { + // Name: to.Ptr("MemoryOptimized"), + // DefaultSKUName: to.Ptr("Standard_E4ds_v5"), + // SupportedServerSKUs: []*armpostgresql.ServerSKUCapability{ + // { + // Name: to.Ptr("Standard_E2s_v3"), + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // }, + // SupportedHaMode: []*armpostgresql.HighAvailabilityMode{ + // to.Ptr(armpostgresql.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresql.HighAvailabilityModeZoneRedundant), + // }, + // SupportedIops: to.Ptr[int32](3200), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int32](2), + // }, + // { + // Name: to.Ptr("Standard_E4s_v3"), + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // }, + // SupportedHaMode: []*armpostgresql.HighAvailabilityMode{ + // to.Ptr(armpostgresql.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresql.HighAvailabilityModeZoneRedundant), + // }, + // SupportedIops: to.Ptr[int32](6400), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int32](4), + // }, + // { + // Name: to.Ptr("Standard_E8s_v3"), + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // }, + // SupportedHaMode: []*armpostgresql.HighAvailabilityMode{ + // to.Ptr(armpostgresql.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresql.HighAvailabilityModeZoneRedundant), + // }, + // SupportedIops: to.Ptr[int32](12800), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int32](8), + // }, + // { + // Name: to.Ptr("Standard_E16s_v3"), + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // }, + // SupportedHaMode: []*armpostgresql.HighAvailabilityMode{ + // to.Ptr(armpostgresql.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresql.HighAvailabilityModeZoneRedundant), + // }, + // SupportedIops: to.Ptr[int32](25600), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int32](16), + // }, + // { + // Name: to.Ptr("Standard_E32s_v3"), + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // }, + // SupportedHaMode: []*armpostgresql.HighAvailabilityMode{ + // to.Ptr(armpostgresql.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresql.HighAvailabilityModeZoneRedundant), + // }, + // SupportedIops: to.Ptr[int32](32000), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int32](32), + // }, + // { + // Name: to.Ptr("Standard_E48s_v3"), + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // }, + // SupportedHaMode: []*armpostgresql.HighAvailabilityMode{ + // to.Ptr(armpostgresql.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresql.HighAvailabilityModeZoneRedundant), + // }, + // SupportedIops: to.Ptr[int32](51200), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int32](48), + // }, + // { + // Name: to.Ptr("Standard_E64s_v3"), + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // }, + // SupportedHaMode: []*armpostgresql.HighAvailabilityMode{ + // to.Ptr(armpostgresql.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresql.HighAvailabilityModeZoneRedundant), + // }, + // SupportedIops: to.Ptr[int32](76800), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](6912), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int32](64), + // }, + // { + // Name: to.Ptr("Standard_E2ds_v4"), + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // }, + // SupportedHaMode: []*armpostgresql.HighAvailabilityMode{ + // to.Ptr(armpostgresql.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresql.HighAvailabilityModeZoneRedundant), + // }, + // SupportedIops: to.Ptr[int32](3200), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int32](2), + // }, + // { + // Name: to.Ptr("Standard_E4ds_v4"), + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // }, + // SupportedHaMode: []*armpostgresql.HighAvailabilityMode{ + // to.Ptr(armpostgresql.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresql.HighAvailabilityModeZoneRedundant), + // }, + // SupportedIops: to.Ptr[int32](6400), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int32](4), + // }, + // { + // Name: to.Ptr("Standard_E8ds_v4"), + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // }, + // SupportedHaMode: []*armpostgresql.HighAvailabilityMode{ + // to.Ptr(armpostgresql.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresql.HighAvailabilityModeZoneRedundant), + // }, + // SupportedIops: to.Ptr[int32](12800), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int32](8), + // }, + // { + // Name: to.Ptr("Standard_E16ds_v4"), + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // }, + // SupportedHaMode: []*armpostgresql.HighAvailabilityMode{ + // to.Ptr(armpostgresql.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresql.HighAvailabilityModeZoneRedundant), + // }, + // SupportedIops: to.Ptr[int32](25600), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int32](16), + // }, + // { + // Name: to.Ptr("Standard_E20ds_v4"), + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // }, + // SupportedHaMode: []*armpostgresql.HighAvailabilityMode{ + // to.Ptr(armpostgresql.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresql.HighAvailabilityModeZoneRedundant), + // }, + // SupportedIops: to.Ptr[int32](32000), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int32](20), + // }, + // { + // Name: to.Ptr("Standard_E32ds_v4"), + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // }, + // SupportedHaMode: []*armpostgresql.HighAvailabilityMode{ + // to.Ptr(armpostgresql.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresql.HighAvailabilityModeZoneRedundant), + // }, + // SupportedIops: to.Ptr[int32](51200), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int32](32), + // }, + // { + // Name: to.Ptr("Standard_E48ds_v4"), + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // }, + // SupportedHaMode: []*armpostgresql.HighAvailabilityMode{ + // to.Ptr(armpostgresql.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresql.HighAvailabilityModeZoneRedundant), + // }, + // SupportedIops: to.Ptr[int32](76800), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int32](48), + // }, + // { + // Name: to.Ptr("Standard_E64ds_v4"), + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // }, + // SupportedHaMode: []*armpostgresql.HighAvailabilityMode{ + // to.Ptr(armpostgresql.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresql.HighAvailabilityModeZoneRedundant), + // }, + // SupportedIops: to.Ptr[int32](80000), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](6912), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int32](64), + // }, + // { + // Name: to.Ptr("Standard_M64"), + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // }, + // SupportedHaMode: []*armpostgresql.HighAvailabilityMode{ + // to.Ptr(armpostgresql.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresql.HighAvailabilityModeZoneRedundant), + // }, + // SupportedIops: to.Ptr[int32](40000), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](16384), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int32](64), + // }, + // { + // Name: to.Ptr("Standard_M128"), + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // }, + // SupportedHaMode: []*armpostgresql.HighAvailabilityMode{ + // to.Ptr(armpostgresql.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresql.HighAvailabilityModeZoneRedundant), + // }, + // SupportedIops: to.Ptr[int32](80000), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](16384), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int32](128), + // }, + // { + // Name: to.Ptr("Standard_E2ds_v5"), + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // }, + // SupportedHaMode: []*armpostgresql.HighAvailabilityMode{ + // to.Ptr(armpostgresql.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresql.HighAvailabilityModeZoneRedundant), + // }, + // SupportedIops: to.Ptr[int32](3750), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int32](2), + // }, + // { + // Name: to.Ptr("Standard_E4ds_v5"), + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // }, + // SupportedHaMode: []*armpostgresql.HighAvailabilityMode{ + // to.Ptr(armpostgresql.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresql.HighAvailabilityModeZoneRedundant), + // }, + // SupportedIops: to.Ptr[int32](6400), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int32](4), + // }, + // { + // Name: to.Ptr("Standard_E8ds_v5"), + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // }, + // SupportedHaMode: []*armpostgresql.HighAvailabilityMode{ + // to.Ptr(armpostgresql.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresql.HighAvailabilityModeZoneRedundant), + // }, + // SupportedIops: to.Ptr[int32](12800), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int32](8), + // }, + // { + // Name: to.Ptr("Standard_E16ds_v5"), + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // }, + // SupportedHaMode: []*armpostgresql.HighAvailabilityMode{ + // to.Ptr(armpostgresql.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresql.HighAvailabilityModeZoneRedundant), + // }, + // SupportedIops: to.Ptr[int32](25600), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int32](16), + // }, + // { + // Name: to.Ptr("Standard_E20ds_v5"), + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // }, + // SupportedHaMode: []*armpostgresql.HighAvailabilityMode{ + // to.Ptr(armpostgresql.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresql.HighAvailabilityModeZoneRedundant), + // }, + // SupportedIops: to.Ptr[int32](32000), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int32](20), + // }, + // { + // Name: to.Ptr("Standard_E32ds_v5"), + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // }, + // SupportedHaMode: []*armpostgresql.HighAvailabilityMode{ + // to.Ptr(armpostgresql.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresql.HighAvailabilityModeZoneRedundant), + // }, + // SupportedIops: to.Ptr[int32](51200), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int32](32), + // }, + // { + // Name: to.Ptr("Standard_E48ds_v5"), + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // }, + // SupportedHaMode: []*armpostgresql.HighAvailabilityMode{ + // to.Ptr(armpostgresql.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresql.HighAvailabilityModeZoneRedundant), + // }, + // SupportedIops: to.Ptr[int32](76800), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int32](48), + // }, + // { + // Name: to.Ptr("Standard_E64ds_v5"), + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // }, + // SupportedHaMode: []*armpostgresql.HighAvailabilityMode{ + // to.Ptr(armpostgresql.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresql.HighAvailabilityModeZoneRedundant), + // }, + // SupportedIops: to.Ptr[int32](80000), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int32](64), + // }, + // { + // Name: to.Ptr("Standard_E96ds_v5"), + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // }, + // SupportedHaMode: []*armpostgresql.HighAvailabilityMode{ + // to.Ptr(armpostgresql.HighAvailabilityModeSameZone), + // to.Ptr(armpostgresql.HighAvailabilityModeZoneRedundant), + // }, + // SupportedIops: to.Ptr[int32](80000), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](7168), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int32](96), + // }, + // }, + // SupportedStorageEditions: []*armpostgresql.StorageEditionCapability{ + // { + // Name: to.Ptr("ManagedDisk"), + // DefaultStorageSizeMb: to.Ptr[int64](131072), + // SupportedStorageMb: []*armpostgresql.StorageMbCapability{ + // { + // DefaultIopsTier: to.Ptr("P4"), + // StorageSizeMb: to.Ptr[int64](32768), + // SupportedIops: to.Ptr[int32](120), + // SupportedIopsTiers: []*armpostgresql.StorageTierCapability{ + // { + // Name: to.Ptr("P4"), + // Iops: to.Ptr[int32](120), + // }, + // { + // Name: to.Ptr("P6"), + // Iops: to.Ptr[int32](240), + // }, + // { + // Name: to.Ptr("P10"), + // Iops: to.Ptr[int32](500), + // }, + // { + // Name: to.Ptr("P15"), + // Iops: to.Ptr[int32](1100), + // }, + // { + // Name: to.Ptr("P20"), + // Iops: to.Ptr[int32](2300), + // }, + // { + // Name: to.Ptr("P30"), + // Iops: to.Ptr[int32](5000), + // }, + // { + // Name: to.Ptr("P40"), + // Iops: to.Ptr[int32](7500), + // }, + // { + // Name: to.Ptr("P50"), + // Iops: to.Ptr[int32](7500), + // }, + // }, + // }, + // { + // DefaultIopsTier: to.Ptr("P6"), + // StorageSizeMb: to.Ptr[int64](65536), + // SupportedIops: to.Ptr[int32](240), + // SupportedIopsTiers: []*armpostgresql.StorageTierCapability{ + // { + // Name: to.Ptr("P6"), + // Iops: to.Ptr[int32](240), + // }, + // { + // Name: to.Ptr("P10"), + // Iops: to.Ptr[int32](500), + // }, + // { + // Name: to.Ptr("P15"), + // Iops: to.Ptr[int32](1100), + // }, + // { + // Name: to.Ptr("P20"), + // Iops: to.Ptr[int32](2300), + // }, + // { + // Name: to.Ptr("P30"), + // Iops: to.Ptr[int32](5000), + // }, + // { + // Name: to.Ptr("P40"), + // Iops: to.Ptr[int32](7500), + // }, + // { + // Name: to.Ptr("P50"), + // Iops: to.Ptr[int32](7500), + // }, + // }, + // }, + // { + // DefaultIopsTier: to.Ptr("P10"), + // StorageSizeMb: to.Ptr[int64](131072), + // SupportedIops: to.Ptr[int32](500), + // SupportedIopsTiers: []*armpostgresql.StorageTierCapability{ + // { + // Name: to.Ptr("P10"), + // Iops: to.Ptr[int32](500), + // }, + // { + // Name: to.Ptr("P15"), + // Iops: to.Ptr[int32](1100), + // }, + // { + // Name: to.Ptr("P20"), + // Iops: to.Ptr[int32](2300), + // }, + // { + // Name: to.Ptr("P30"), + // Iops: to.Ptr[int32](5000), + // }, + // { + // Name: to.Ptr("P40"), + // Iops: to.Ptr[int32](7500), + // }, + // { + // Name: to.Ptr("P50"), + // Iops: to.Ptr[int32](7500), + // }, + // }, + // }, + // { + // DefaultIopsTier: to.Ptr("P15"), + // StorageSizeMb: to.Ptr[int64](262144), + // SupportedIops: to.Ptr[int32](1100), + // SupportedIopsTiers: []*armpostgresql.StorageTierCapability{ + // { + // Name: to.Ptr("P15"), + // Iops: to.Ptr[int32](1100), + // }, + // { + // Name: to.Ptr("P20"), + // Iops: to.Ptr[int32](2300), + // }, + // { + // Name: to.Ptr("P30"), + // Iops: to.Ptr[int32](5000), + // }, + // { + // Name: to.Ptr("P40"), + // Iops: to.Ptr[int32](7500), + // }, + // { + // Name: to.Ptr("P50"), + // Iops: to.Ptr[int32](7500), + // }, + // }, + // }, + // { + // DefaultIopsTier: to.Ptr("P20"), + // StorageSizeMb: to.Ptr[int64](524288), + // SupportedIops: to.Ptr[int32](2300), + // SupportedIopsTiers: []*armpostgresql.StorageTierCapability{ + // { + // Name: to.Ptr("P20"), + // Iops: to.Ptr[int32](2300), + // }, + // { + // Name: to.Ptr("P30"), + // Iops: to.Ptr[int32](5000), + // }, + // { + // Name: to.Ptr("P40"), + // Iops: to.Ptr[int32](7500), + // }, + // { + // Name: to.Ptr("P50"), + // Iops: to.Ptr[int32](7500), + // }, + // }, + // }, + // { + // DefaultIopsTier: to.Ptr("P30"), + // StorageSizeMb: to.Ptr[int64](1048576), + // SupportedIops: to.Ptr[int32](5000), + // SupportedIopsTiers: []*armpostgresql.StorageTierCapability{ + // { + // Name: to.Ptr("P30"), + // Iops: to.Ptr[int32](5000), + // }, + // { + // Name: to.Ptr("P40"), + // Iops: to.Ptr[int32](7500), + // }, + // { + // Name: to.Ptr("P50"), + // Iops: to.Ptr[int32](7500), + // }, + // }, + // }, + // { + // DefaultIopsTier: to.Ptr("P40"), + // StorageSizeMb: to.Ptr[int64](2097152), + // SupportedIops: to.Ptr[int32](7500), + // SupportedIopsTiers: []*armpostgresql.StorageTierCapability{ + // { + // Name: to.Ptr("P40"), + // Iops: to.Ptr[int32](7500), + // }, + // { + // Name: to.Ptr("P50"), + // Iops: to.Ptr[int32](7500), + // }, + // }, + // }, + // { + // DefaultIopsTier: to.Ptr("P50"), + // StorageSizeMb: to.Ptr[int64](4193280), + // SupportedIops: to.Ptr[int32](7500), + // SupportedIopsTiers: []*armpostgresql.StorageTierCapability{ + // { + // Name: to.Ptr("P50"), + // Iops: to.Ptr[int32](7500), + // }, + // }, + // }, + // { + // DefaultIopsTier: to.Ptr("P50"), + // StorageSizeMb: to.Ptr[int64](4194304), + // SupportedIops: to.Ptr[int32](7500), + // SupportedIopsTiers: []*armpostgresql.StorageTierCapability{ + // { + // Name: to.Ptr("P50"), + // Iops: to.Ptr[int32](7500), + // }, + // }, + // }, + // { + // DefaultIopsTier: to.Ptr("P60"), + // StorageSizeMb: to.Ptr[int64](8388608), + // SupportedIops: to.Ptr[int32](16000), + // SupportedIopsTiers: []*armpostgresql.StorageTierCapability{ + // { + // Name: to.Ptr("P60"), + // Iops: to.Ptr[int32](16000), + // }, + // { + // Name: to.Ptr("P70"), + // Iops: to.Ptr[int32](18000), + // }, + // { + // Name: to.Ptr("P80"), + // Iops: to.Ptr[int32](20000), + // }, + // }, + // }, + // { + // DefaultIopsTier: to.Ptr("P70"), + // StorageSizeMb: to.Ptr[int64](16777216), + // SupportedIops: to.Ptr[int32](18000), + // SupportedIopsTiers: []*armpostgresql.StorageTierCapability{ + // { + // Name: to.Ptr("P70"), + // Iops: to.Ptr[int32](18000), + // }, + // { + // Name: to.Ptr("P80"), + // Iops: to.Ptr[int32](20000), + // }, + // }, + // }, + // { + // DefaultIopsTier: to.Ptr("P80"), + // StorageSizeMb: to.Ptr[int64](33553408), + // SupportedIops: to.Ptr[int32](20000), + // SupportedIopsTiers: []*armpostgresql.StorageTierCapability{ + // { + // Name: to.Ptr("P80"), + // Iops: to.Ptr[int32](20000), + // }, + // }, + // }, + // }, + // }, + // { + // Name: to.Ptr("ManagedDiskV2"), + // DefaultStorageSizeMb: to.Ptr[int64](131072), + // SupportedStorageMb: []*armpostgresql.StorageMbCapability{ + // { + // DefaultIopsTier: to.Ptr("None"), + // MaximumStorageSizeMb: to.Ptr[int64](67108864), + // StorageSizeMb: to.Ptr[int64](32768), + // SupportedIops: to.Ptr[int32](3000), + // SupportedIopsTiers: []*armpostgresql.StorageTierCapability{ + // { + // Name: to.Ptr("None"), + // Iops: to.Ptr[int32](0), + // }, + // }, + // SupportedMaximumIops: to.Ptr[int32](80000), + // SupportedMaximumThroughput: to.Ptr[int32](1200), + // SupportedThroughput: to.Ptr[int32](125), + // }, + // }, + // }, + // }, + // }, + // }, + // SupportedServerVersions: []*armpostgresql.ServerVersionCapability{ + // { + // Name: to.Ptr("11"), + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // }, + // SupportedVersionsToUpgrade: []*string{ + // to.Ptr("12"), + // to.Ptr("13"), + // to.Ptr("14"), + // to.Ptr("15"), + // to.Ptr("16"), + // to.Ptr("17"), + // to.Ptr("18"), + // }, + // }, + // { + // Name: to.Ptr("12"), + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // }, + // SupportedVersionsToUpgrade: []*string{ + // to.Ptr("13"), + // to.Ptr("14"), + // to.Ptr("15"), + // to.Ptr("16"), + // to.Ptr("17"), + // to.Ptr("18"), + // }, + // }, + // { + // Name: to.Ptr("13"), + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // }, + // SupportedVersionsToUpgrade: []*string{ + // to.Ptr("14"), + // to.Ptr("15"), + // to.Ptr("16"), + // to.Ptr("17"), + // to.Ptr("18"), + // }, + // }, + // { + // Name: to.Ptr("14"), + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // }, + // SupportedVersionsToUpgrade: []*string{ + // to.Ptr("15"), + // to.Ptr("16"), + // to.Ptr("17"), + // to.Ptr("18"), + // }, + // }, + // { + // Name: to.Ptr("15"), + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // }, + // SupportedVersionsToUpgrade: []*string{ + // to.Ptr("16"), + // to.Ptr("17"), + // to.Ptr("18"), + // }, + // }, + // { + // Name: to.Ptr("16"), + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // }, + // SupportedVersionsToUpgrade: []*string{ + // to.Ptr("17"), + // to.Ptr("18"), + // }, + // }, + // { + // Name: to.Ptr("17"), + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // }, + // SupportedVersionsToUpgrade: []*string{ + // to.Ptr("18"), + // }, + // }, + // { + // Name: to.Ptr("18"), + // SupportedFeatures: []*armpostgresql.SupportedFeature{ + // }, + // SupportedVersionsToUpgrade: []*string{ + // }, + // }, + // }, + // ZoneRedundantHaAndGeoBackupSupported: to.Ptr(armpostgresql.ZoneRedundantHighAvailabilityAndGeographicallyRedundantBackupSupportEnabled), + // ZoneRedundantHaSupported: to.Ptr(armpostgresql.ZoneRedundantHighAvailabilitySupportEnabled), + // }, + // }, + // }, + // } + } +} diff --git a/sdk/resourcemanager/postgresql/armpostgresql/capturedlogs_client.go b/sdk/resourcemanager/postgresql/armpostgresql/capturedlogs_client.go new file mode 100644 index 000000000000..3daaca3b3332 --- /dev/null +++ b/sdk/resourcemanager/postgresql/armpostgresql/capturedlogs_client.go @@ -0,0 +1,105 @@ +// 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) Go Code Generator. DO NOT EDIT. + +package armpostgresql + +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" +) + +// 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 +} + +// 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 - 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 := &CapturedLogsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// NewListByServerPager - Lists all captured logs for download in 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 - CapturedLogsClientListByServerOptions contains the optional parameters for the CapturedLogsClient.NewListByServerPager +// method. +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 *CapturedLogsClientListByServerResponse) (CapturedLogsClientListByServerResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "CapturedLogsClient.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 CapturedLogsClientListByServerResponse{}, err + } + return client.listByServerHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listByServerCreateRequest creates the ListByServer request. +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") + } + 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 *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/armpostgresql/capturedlogs_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresql/capturedlogs_client_example_test.go new file mode 100644 index 000000000000..2971358258fe --- /dev/null +++ b/sdk/resourcemanager/postgresql/armpostgresql/capturedlogs_client_example_test.go @@ -0,0 +1,55 @@ +// 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) Go Code Generator. DO NOT EDIT. + +package armpostgresql_test + +import ( + "context" + "github.com/Azure/azure-sdk-for-go/sdk/azidentity" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresql/v2" + "log" +) + +// Generated from example definition: 2025-08-01/CapturedLogsListByServer.json +func ExampleCapturedLogsClient_NewListByServerPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armpostgresql.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewCapturedLogsClient().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 = armpostgresql.CapturedLogsClientListByServerResponse{ + // CapturedLogList: armpostgresql.CapturedLogList{ + // Value: []*armpostgresql.CapturedLog{ + // { + // Name: to.Ptr("postgresql-20250601.log"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/logFiles"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/logFiles/postgresql-20250601.log"), + // Properties: &armpostgresql.CapturedLogProperties{ + // Type: to.Ptr("slowlog"), + // CreatedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "0001-01-01T00:00:00+00:00"); return t}()), + // LastModifiedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T18:30:00+00:00"); return t}()), + // SizeInKb: to.Ptr[int64](1), + // 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/armpostgresql/checknameavailability_client.go b/sdk/resourcemanager/postgresql/armpostgresql/checknameavailability_client.go deleted file mode 100644 index 0c0fe050d0bb..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresql/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 armpostgresql - -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. -// - 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 2017-12-01 -// - 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 NameAvailabilityRequest, 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 NameAvailabilityRequest, options *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", "2017-12-01") - 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/armpostgresql/checknameavailability_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresql/checknameavailability_client_example_test.go index 4f15ab947370..27853de6020d 100644 --- a/sdk/resourcemanager/postgresql/armpostgresql/checknameavailability_client_example_test.go +++ b/sdk/resourcemanager/postgresql/armpostgresql/checknameavailability_client_example_test.go @@ -12,7 +12,7 @@ import ( "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/armpostgresql" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresql/v2" ) // Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/CheckNameAvailability.json @@ -27,8 +27,8 @@ func ExampleCheckNameAvailabilityClient_Execute() { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewCheckNameAvailabilityClient().Execute(ctx, armpostgresql.NameAvailabilityRequest{ - Name: to.Ptr("name1"), - Type: to.Ptr("Microsoft.DBforPostgreSQL"), + Name: to.Ptr("name1"), + Type: to.Ptr("Microsoft.DBforPostgreSQL"), }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) diff --git a/sdk/resourcemanager/postgresql/armpostgresql/client_factory.go b/sdk/resourcemanager/postgresql/armpostgresql/client_factory.go index 6668708f0c23..91a764a84559 100644 --- a/sdk/resourcemanager/postgresql/armpostgresql/client_factory.go +++ b/sdk/resourcemanager/postgresql/armpostgresql/client_factory.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armpostgresql @@ -14,130 +13,203 @@ import ( // Don't use this type directly, use NewClientFactory instead. type ClientFactory struct { subscriptionID string - credential azcore.TokenCredential - options *arm.ClientOptions + internal *arm.Client } // NewClientFactory creates a new instance of ClientFactory with the specified values. // The parameter values will be propagated to any client created from this factory. -// - subscriptionID - The ID of the target subscription. +// - 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 NewClientFactory(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ClientFactory, error) { - _, err := arm.NewClient(moduleName, moduleVersion, credential, options) + internal, err := arm.NewClient(moduleName, moduleVersion, credential, options) if err != nil { return nil, err } return &ClientFactory{ - subscriptionID: subscriptionID, credential: credential, - options: options.Clone(), + subscriptionID: subscriptionID, + internal: internal, }, nil } -// NewCheckNameAvailabilityClient creates a new instance of CheckNameAvailabilityClient. -func (c *ClientFactory) NewCheckNameAvailabilityClient() *CheckNameAvailabilityClient { - subClient, _ := NewCheckNameAvailabilityClient(c.subscriptionID, c.credential, c.options) - return subClient +// NewAdministratorsMicrosoftEntraClient creates a new instance of AdministratorsMicrosoftEntraClient. +func (c *ClientFactory) NewAdministratorsMicrosoftEntraClient() *AdministratorsMicrosoftEntraClient { + return &AdministratorsMicrosoftEntraClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } +} + +// NewAdvancedThreatProtectionSettingsClient creates a new instance of AdvancedThreatProtectionSettingsClient. +func (c *ClientFactory) NewAdvancedThreatProtectionSettingsClient() *AdvancedThreatProtectionSettingsClient { + return &AdvancedThreatProtectionSettingsClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } +} + +// NewBackupsAutomaticAndOnDemandClient creates a new instance of BackupsAutomaticAndOnDemandClient. +func (c *ClientFactory) NewBackupsAutomaticAndOnDemandClient() *BackupsAutomaticAndOnDemandClient { + return &BackupsAutomaticAndOnDemandClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } +} + +// NewBackupsLongTermRetentionClient creates a new instance of BackupsLongTermRetentionClient. +func (c *ClientFactory) NewBackupsLongTermRetentionClient() *BackupsLongTermRetentionClient { + return &BackupsLongTermRetentionClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } +} + +// NewCapabilitiesByLocationClient creates a new instance of CapabilitiesByLocationClient. +func (c *ClientFactory) NewCapabilitiesByLocationClient() *CapabilitiesByLocationClient { + return &CapabilitiesByLocationClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } +} + +// NewCapabilitiesByServerClient creates a new instance of CapabilitiesByServerClient. +func (c *ClientFactory) NewCapabilitiesByServerClient() *CapabilitiesByServerClient { + return &CapabilitiesByServerClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } +} + +// NewCapturedLogsClient creates a new instance of CapturedLogsClient. +func (c *ClientFactory) NewCapturedLogsClient() *CapturedLogsClient { + return &CapturedLogsClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewConfigurationsClient creates a new instance of ConfigurationsClient. func (c *ClientFactory) NewConfigurationsClient() *ConfigurationsClient { - subClient, _ := NewConfigurationsClient(c.subscriptionID, c.credential, c.options) - return subClient + return &ConfigurationsClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewDatabasesClient creates a new instance of DatabasesClient. func (c *ClientFactory) NewDatabasesClient() *DatabasesClient { - subClient, _ := NewDatabasesClient(c.subscriptionID, c.credential, c.options) - return subClient + return &DatabasesClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewFirewallRulesClient creates a new instance of FirewallRulesClient. func (c *ClientFactory) NewFirewallRulesClient() *FirewallRulesClient { - subClient, _ := NewFirewallRulesClient(c.subscriptionID, c.credential, c.options) - return subClient + return &FirewallRulesClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } -// NewLocationBasedPerformanceTierClient creates a new instance of LocationBasedPerformanceTierClient. -func (c *ClientFactory) NewLocationBasedPerformanceTierClient() *LocationBasedPerformanceTierClient { - subClient, _ := NewLocationBasedPerformanceTierClient(c.subscriptionID, c.credential, c.options) - return subClient +// NewMigrationsClient creates a new instance of MigrationsClient. +func (c *ClientFactory) NewMigrationsClient() *MigrationsClient { + return &MigrationsClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } -// NewLogFilesClient creates a new instance of LogFilesClient. -func (c *ClientFactory) NewLogFilesClient() *LogFilesClient { - subClient, _ := NewLogFilesClient(c.subscriptionID, c.credential, c.options) - return subClient +// NewNameAvailabilityClient creates a new instance of NameAvailabilityClient. +func (c *ClientFactory) NewNameAvailabilityClient() *NameAvailabilityClient { + return &NameAvailabilityClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewOperationsClient creates a new instance of OperationsClient. func (c *ClientFactory) NewOperationsClient() *OperationsClient { - subClient, _ := NewOperationsClient(c.credential, c.options) - return subClient + return &OperationsClient{ + internal: c.internal, + } +} + +// NewPrivateDNSZoneSuffixClient creates a new instance of PrivateDNSZoneSuffixClient. +func (c *ClientFactory) NewPrivateDNSZoneSuffixClient() *PrivateDNSZoneSuffixClient { + return &PrivateDNSZoneSuffixClient{ + internal: c.internal, + } } // NewPrivateEndpointConnectionsClient creates a new instance of PrivateEndpointConnectionsClient. func (c *ClientFactory) NewPrivateEndpointConnectionsClient() *PrivateEndpointConnectionsClient { - subClient, _ := NewPrivateEndpointConnectionsClient(c.subscriptionID, c.credential, c.options) - return subClient + return &PrivateEndpointConnectionsClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewPrivateLinkResourcesClient creates a new instance of PrivateLinkResourcesClient. func (c *ClientFactory) NewPrivateLinkResourcesClient() *PrivateLinkResourcesClient { - subClient, _ := NewPrivateLinkResourcesClient(c.subscriptionID, c.credential, c.options) - return subClient + return &PrivateLinkResourcesClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } -// NewRecoverableServersClient creates a new instance of RecoverableServersClient. -func (c *ClientFactory) NewRecoverableServersClient() *RecoverableServersClient { - subClient, _ := NewRecoverableServersClient(c.subscriptionID, c.credential, c.options) - return subClient +// NewQuotaUsagesClient creates a new instance of QuotaUsagesClient. +func (c *ClientFactory) NewQuotaUsagesClient() *QuotaUsagesClient { + return &QuotaUsagesClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewReplicasClient creates a new instance of ReplicasClient. func (c *ClientFactory) NewReplicasClient() *ReplicasClient { - subClient, _ := NewReplicasClient(c.subscriptionID, c.credential, c.options) - return subClient -} - -// NewServerAdministratorsClient creates a new instance of ServerAdministratorsClient. -func (c *ClientFactory) NewServerAdministratorsClient() *ServerAdministratorsClient { - subClient, _ := NewServerAdministratorsClient(c.subscriptionID, c.credential, c.options) - return subClient -} - -// NewServerBasedPerformanceTierClient creates a new instance of ServerBasedPerformanceTierClient. -func (c *ClientFactory) NewServerBasedPerformanceTierClient() *ServerBasedPerformanceTierClient { - subClient, _ := NewServerBasedPerformanceTierClient(c.subscriptionID, c.credential, c.options) - return subClient + return &ReplicasClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } -// NewServerKeysClient creates a new instance of ServerKeysClient. -func (c *ClientFactory) NewServerKeysClient() *ServerKeysClient { - subClient, _ := NewServerKeysClient(c.subscriptionID, c.credential, c.options) - return subClient +// NewServerThreatProtectionSettingsClient creates a new instance of ServerThreatProtectionSettingsClient. +func (c *ClientFactory) NewServerThreatProtectionSettingsClient() *ServerThreatProtectionSettingsClient { + return &ServerThreatProtectionSettingsClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } -// NewServerParametersClient creates a new instance of ServerParametersClient. -func (c *ClientFactory) NewServerParametersClient() *ServerParametersClient { - subClient, _ := NewServerParametersClient(c.subscriptionID, c.credential, c.options) - return subClient +// NewServersClient creates a new instance of ServersClient. +func (c *ClientFactory) NewServersClient() *ServersClient { + return &ServersClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } -// NewServerSecurityAlertPoliciesClient creates a new instance of ServerSecurityAlertPoliciesClient. -func (c *ClientFactory) NewServerSecurityAlertPoliciesClient() *ServerSecurityAlertPoliciesClient { - subClient, _ := NewServerSecurityAlertPoliciesClient(c.subscriptionID, c.credential, c.options) - return subClient +// NewTuningOptionsClient creates a new instance of TuningOptionsClient. +func (c *ClientFactory) NewTuningOptionsClient() *TuningOptionsClient { + return &TuningOptionsClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } -// NewServersClient creates a new instance of ServersClient. -func (c *ClientFactory) NewServersClient() *ServersClient { - subClient, _ := NewServersClient(c.subscriptionID, c.credential, c.options) - return subClient +// NewVirtualEndpointsClient creates a new instance of VirtualEndpointsClient. +func (c *ClientFactory) NewVirtualEndpointsClient() *VirtualEndpointsClient { + return &VirtualEndpointsClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } -// NewVirtualNetworkRulesClient creates a new instance of VirtualNetworkRulesClient. -func (c *ClientFactory) NewVirtualNetworkRulesClient() *VirtualNetworkRulesClient { - subClient, _ := NewVirtualNetworkRulesClient(c.subscriptionID, c.credential, c.options) - return subClient +// NewVirtualNetworkSubnetUsageClient creates a new instance of VirtualNetworkSubnetUsageClient. +func (c *ClientFactory) NewVirtualNetworkSubnetUsageClient() *VirtualNetworkSubnetUsageClient { + return &VirtualNetworkSubnetUsageClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } diff --git a/sdk/resourcemanager/postgresql/armpostgresql/configurations_client.go b/sdk/resourcemanager/postgresql/armpostgresql/configurations_client.go index 606f84546fed..7a1a3afac68e 100644 --- a/sdk/resourcemanager/postgresql/armpostgresql/configurations_client.go +++ b/sdk/resourcemanager/postgresql/armpostgresql/configurations_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armpostgresql @@ -25,9 +24,9 @@ type ConfigurationsClient struct { } // NewConfigurationsClient creates a new instance of ConfigurationsClient with the specified values. -// - subscriptionID - The ID of the target subscription. +// - 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,98 +39,13 @@ func NewConfigurationsClient(subscriptionID string, credential azcore.TokenCrede return client, nil } -// BeginCreateOrUpdate - Updates a configuration of a 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 2017-12-01 +// 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. -// - options - ConfigurationsClientBeginCreateOrUpdateOptions contains the optional parameters for the ConfigurationsClient.BeginCreateOrUpdate -// method. -func (client *ConfigurationsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, configurationName string, parameters Configuration, options *ConfigurationsClientBeginCreateOrUpdateOptions) (*runtime.Poller[ConfigurationsClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, serverName, configurationName, parameters, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ConfigurationsClientCreateOrUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ConfigurationsClientCreateOrUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// CreateOrUpdate - Updates a configuration of a server. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2017-12-01 -func (client *ConfigurationsClient) createOrUpdate(ctx context.Context, resourceGroupName string, serverName string, configurationName string, parameters Configuration, options *ConfigurationsClientBeginCreateOrUpdateOptions) (*http.Response, error) { - var err error - const operationName = "ConfigurationsClient.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.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, configurationName, 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 -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *ConfigurationsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, serverName string, configurationName string, parameters Configuration, options *ConfigurationsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/configurations/{configurationName}" - 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 configurationName == "" { - return nil, errors.New("parameter configurationName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{configurationName}", url.PathEscape(configurationName)) - 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", "2017-12-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 information about a configuration of server. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2017-12-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 @@ -156,8 +70,8 @@ func (client *ConfigurationsClient) Get(ctx context.Context, resourceGroupName s } // getCreateRequest creates the Get request. -func (client *ConfigurationsClient) getCreateRequest(ctx context.Context, resourceGroupName string, serverName string, configurationName string, options *ConfigurationsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/configurations/{configurationName}" +func (client *ConfigurationsClient) getCreateRequest(ctx context.Context, resourceGroupName string, serverName string, configurationName string, _ *ConfigurationsClientGetOptions) (*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") } @@ -179,7 +93,7 @@ func (client *ConfigurationsClient) getCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2017-12-01") + reqQP.Set("api-version", "2025-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -194,9 +108,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 2017-12-01 +// 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 @@ -204,21 +118,20 @@ func (client *ConfigurationsClient) getHandleResponse(resp *http.Response) (Conf func (client *ConfigurationsClient) NewListByServerPager(resourceGroupName string, serverName string, options *ConfigurationsClientListByServerOptions) *runtime.Pager[ConfigurationsClientListByServerResponse] { return runtime.NewPager(runtime.PagingHandler[ConfigurationsClientListByServerResponse]{ More: func(page ConfigurationsClientListByServerResponse) bool { - return false + return page.NextLink != nil && len(*page.NextLink) > 0 }, Fetcher: func(ctx context.Context, page *ConfigurationsClientListByServerResponse) (ConfigurationsClientListByServerResponse, error) { ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "ConfigurationsClient.NewListByServerPager") - req, err := client.listByServerCreateRequest(ctx, resourceGroupName, serverName, options) - if err != nil { - return ConfigurationsClientListByServerResponse{}, err + nextLink := "" + if page != nil { + nextLink = *page.NextLink } - resp, err := client.internal.Pipeline().Do(req) + 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 ConfigurationsClientListByServerResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ConfigurationsClientListByServerResponse{}, runtime.NewResponseError(resp) - } return client.listByServerHandleResponse(resp) }, Tracer: client.internal.Tracer(), @@ -226,8 +139,8 @@ func (client *ConfigurationsClient) NewListByServerPager(resourceGroupName strin } // listByServerCreateRequest creates the ListByServer request. -func (client *ConfigurationsClient) listByServerCreateRequest(ctx context.Context, resourceGroupName string, serverName string, options *ConfigurationsClientListByServerOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/configurations" +func (client *ConfigurationsClient) listByServerCreateRequest(ctx context.Context, resourceGroupName string, serverName string, _ *ConfigurationsClientListByServerOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/configurations" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -245,7 +158,7 @@ func (client *ConfigurationsClient) listByServerCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2017-12-01") + reqQP.Set("api-version", "2025-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -254,8 +167,181 @@ 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, 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-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serverName - The name of the server. +// - 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 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.FinalStateViaAzureAsyncOp, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ConfigurationsClientPutResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// 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-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) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.putCreateRequest(ctx, resourceGroupName, serverName, configurationName, 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 +} + +// putCreateRequest creates the Put request. +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") + } + 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 configurationName == "" { + return nil, errors.New("parameter configurationName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{configurationName}", url.PathEscape(configurationName)) + 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["Content-Type"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} + +// 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-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serverName - The name of the server. +// - 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) { + if options == nil || options.ResumeToken == "" { + resp, err := client.update(ctx, resourceGroupName, serverName, configurationName, parameters, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ConfigurationsClientUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ConfigurationsClientUpdateResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// 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-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" + 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, configurationName, 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 *ConfigurationsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, serverName string, configurationName string, parameters ConfigurationForUpdate, _ *ConfigurationsClientBeginUpdateOptions) (*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") + } + 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 configurationName == "" { + return nil, errors.New("parameter configurationName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{configurationName}", url.PathEscape(configurationName)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, 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["Content-Type"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} diff --git a/sdk/resourcemanager/postgresql/armpostgresql/configurations_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresql/configurations_client_example_test.go index e0709149514c..c05a83efbcc0 100644 --- a/sdk/resourcemanager/postgresql/armpostgresql/configurations_client_example_test.go +++ b/sdk/resourcemanager/postgresql/armpostgresql/configurations_client_example_test.go @@ -1,107 +1,68 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armpostgresql_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/armpostgresql" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresql/v2" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/ConfigurationCreateOrUpdate.json -func ExampleConfigurationsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewConfigurationsClient().BeginCreateOrUpdate(ctx, "TestGroup", "testserver", "array_nulls", armpostgresql.Configuration{ - Properties: &armpostgresql.ConfigurationProperties{ - Source: to.Ptr("user-override"), - Value: to.Ptr("off"), - }, - }, 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.Configuration = armpostgresql.Configuration{ - // Name: to.Ptr("array_nulls"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/array_nulls"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Enable input of NULL elements in arrays."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr("Boolean"), - // DefaultValue: to.Ptr("on"), - // Source: to.Ptr("user-override"), - // Value: to.Ptr("off"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/ConfigurationGet.json +// Generated from example definition: 2025-08-01/ConfigurationsGet.json func ExampleConfigurationsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armpostgresql.NewClientFactory("", cred, nil) + clientFactory, err := armpostgresql.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewConfigurationsClient().Get(ctx, "TestGroup", "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) } // 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 = armpostgresql.Configuration{ - // Name: to.Ptr("array_nulls"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/array_nulls"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Enable input of NULL elements in arrays."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr("Boolean"), - // DefaultValue: to.Ptr("on"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("on"), + // res = armpostgresql.ConfigurationsClientGetResponse{ + // Configuration: &armpostgresql.Configuration{ + // Name: to.Ptr("array_nulls"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/array_nulls"), + // Properties: &armpostgresql.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"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeBoolean), + // DefaultValue: to.Ptr("on"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-compatible.html#GUC-ARRAY-NULLS"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("on"), + // }, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/ConfigurationListByServer.json +// Generated from example definition: 2025-08-01/ConfigurationsListByServer.json func ExampleConfigurationsClient_NewListByServerPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armpostgresql.NewClientFactory("", cred, nil) + clientFactory, err := armpostgresql.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewConfigurationsClient().NewListByServerPager("TestGroup", "testserver", nil) + pager := clientFactory.NewConfigurationsClient().NewListByServerPager("exampleresourcegroup", "exampleserver", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -112,1048 +73,7172 @@ 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 = armpostgresql.ConfigurationListResult{ - // Value: []*armpostgresql.Configuration{ - // { - // Name: to.Ptr("array_nulls"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/array_nulls"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Enable input of NULL elements in arrays."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr("Boolean"), - // DefaultValue: to.Ptr("on"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("on"), + // page = armpostgresql.ConfigurationsClientListByServerResponse{ + // ConfigurationList: armpostgresql.ConfigurationList{ + // NextLink: to.Ptr("https://management.azure.com/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff//resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations?api-version=2025-06-01-preview&$skiptoken=skiptoken"), + // Value: []*armpostgresql.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/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/allow_in_place_tablespaces"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Allows tablespaces directly inside pg_tblspc, for testing."), + // AllowedValues: to.Ptr("on,off"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeBoolean), + // DefaultValue: to.Ptr("off"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-developer.html#GUC-ALLOW-IN-PLACE-TABLESPACES"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("off"), + // }, // }, - // }, - // { - // Name: to.Ptr("backslash_quote"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/backslash_quote"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Sets whether \"\\'\" is allowed in string literals."), - // AllowedValues: to.Ptr("safe_encoding,on,off"), - // DataType: to.Ptr("Enumeration"), - // DefaultValue: to.Ptr("safe_encoding"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("safe_encoding"), + // { + // Name: to.Ptr("allow_system_table_mods"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/allow_system_table_mods"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Allows modifications of the structure of system tables."), + // AllowedValues: to.Ptr("on,off"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeBoolean), + // DefaultValue: to.Ptr("off"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-developer.html#GUC-ALLOW-SYSTEM-TABLE-MODS"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("off"), + // }, // }, - // }, - // { - // Name: to.Ptr("bytea_output"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/bytea_output"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Sets the output format for bytea."), - // AllowedValues: to.Ptr("escape,hex"), - // DataType: to.Ptr("Enumeration"), - // DefaultValue: to.Ptr("hex"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("hex"), + // { + // Name: to.Ptr("application_name"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/application_name"), + // Properties: &armpostgresql.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(armpostgresql.ConfigurationDataTypeString), + // DefaultValue: to.Ptr(""), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/libpq-connect.html#LIBPQ-CONNECT-APPLICATION-NAME"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr(""), + // }, // }, - // }, - // { - // Name: to.Ptr("check_function_bodies"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/check_function_bodies"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Check function bodies during CREATE FUNCTION."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr("Boolean"), - // DefaultValue: to.Ptr("on"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("on"), + // { + // Name: to.Ptr("archive_cleanup_command"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/archive_cleanup_command"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Sets the shell command that will be executed at every restart point."), + // AllowedValues: to.Ptr(".*"), + // DataType: to.Ptr(armpostgresql.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), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("system-default"), + // Value: to.Ptr(""), + // }, // }, - // }, - // { - // Name: to.Ptr("client_encoding"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/client_encoding"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Sets the client's character set 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"), - // DataType: to.Ptr("Enumeration"), - // DefaultValue: to.Ptr("sql_ascii"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("sql_ascii"), + // { + // Name: to.Ptr("archive_command"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/archive_command"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Sets the shell command that will be called to archive a WAL file."), + // AllowedValues: to.Ptr(".*"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeString), + // DefaultValue: to.Ptr(""), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-wal.html#GUC-ARCHIVE-COMMAND"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("user-override"), + // Value: to.Ptr("BlobLogUpload.sh %f %p"), + // }, // }, - // }, - // { - // Name: to.Ptr("client_min_messages"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/client_min_messages"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Sets the message levels that are sent to the client."), - // AllowedValues: to.Ptr("debug5,debug4,debug3,debug2,debug1,log,notice,warning,error"), - // DataType: to.Ptr("Enumeration"), - // DefaultValue: to.Ptr("notice"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("notice"), + // { + // Name: to.Ptr("archive_mode"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/archive_mode"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Allows archiving of WAL files using archive_command."), + // AllowedValues: to.Ptr("always,on,off"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeEnumeration), + // DefaultValue: to.Ptr("off"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-wal.html#GUC-ARCHIVE-MODE"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(false), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("user-override"), + // Value: to.Ptr("always"), + // }, // }, - // }, - // { - // Name: to.Ptr("constraint_exclusion"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/constraint_exclusion"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Enables the planner to use constraints to optimize queries."), - // AllowedValues: to.Ptr("partition,on,off"), - // DataType: to.Ptr("Enumeration"), - // DefaultValue: to.Ptr("partition"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("partition"), + // { + // Name: to.Ptr("archive_timeout"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/archive_timeout"), + // Properties: &armpostgresql.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"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeInteger), + // DefaultValue: to.Ptr("300"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-wal.html#GUC-ARCHIVE-TIMEOUT"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("system-default"), + // Unit: to.Ptr("seconds"), + // Value: to.Ptr("300"), + // }, // }, - // }, - // { - // Name: to.Ptr("cpu_index_tuple_cost"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/cpu_index_tuple_cost"), - // Properties: &armpostgresql.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"), - // DataType: to.Ptr("Numeric"), - // DefaultValue: to.Ptr("0.005"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("0.005"), + // { + // Name: to.Ptr("array_nulls"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/array_nulls"), + // Properties: &armpostgresql.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"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeBoolean), + // DefaultValue: to.Ptr("on"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-compatible.html#GUC-ARRAY-NULLS"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("on"), + // }, // }, - // }, - // { - // Name: to.Ptr("cpu_operator_cost"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/cpu_operator_cost"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Sets the planner's estimate of the cost of processing each operator or function call."), - // AllowedValues: to.Ptr("0-1.79769e+308"), - // DataType: to.Ptr("Numeric"), - // DefaultValue: to.Ptr("0.0025"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("0.0025"), + // { + // Name: to.Ptr("authentication_timeout"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/authentication_timeout"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Sets the maximum allowed time to complete client authentication."), + // AllowedValues: to.Ptr("1-600"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeInteger), + // DefaultValue: to.Ptr("60"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-connection.html#GUC-AUTHENTICATION-TIMEOUT"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("user-override"), + // Unit: to.Ptr("seconds"), + // Value: to.Ptr("30"), + // }, // }, - // }, - // { - // Name: to.Ptr("cpu_tuple_cost"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/cpu_tuple_cost"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Sets the planner's estimate of the cost of processing each tuple (row)."), - // AllowedValues: to.Ptr("0-1.79769e+308"), - // DataType: to.Ptr("Numeric"), - // DefaultValue: to.Ptr("0.01"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("0.01"), + // { + // Name: to.Ptr("auto_explain.log_analyze"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/auto_explain.log_analyze"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Use EXPLAIN ANALYZE for plan logging."), + // AllowedValues: to.Ptr("on,off"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeBoolean), + // DefaultValue: to.Ptr("off"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/auto-explain.html#id-1.11.7.13.5.3.2.1.3"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("off"), + // }, // }, - // }, - // { - // Name: to.Ptr("cursor_tuple_fraction"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/cursor_tuple_fraction"), - // Properties: &armpostgresql.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"), - // DataType: to.Ptr("Numeric"), - // DefaultValue: to.Ptr("0.1"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("0.1"), + // { + // Name: to.Ptr("auto_explain.log_buffers"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/auto_explain.log_buffers"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Log buffers usage."), + // AllowedValues: to.Ptr("on,off"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeBoolean), + // DefaultValue: to.Ptr("off"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/auto-explain.html#id-1.11.7.13.5.3.3.1.3"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("off"), + // }, // }, - // }, - // { - // Name: to.Ptr("datestyle"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/datestyle"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Sets the display format for date and time values."), - // AllowedValues: to.Ptr("(iso|postgres|sql|german)\\,\\s(dmy|mdy|ymd)"), - // DataType: to.Ptr("String"), - // DefaultValue: to.Ptr("iso, mdy"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("iso, mdy"), + // { + // Name: to.Ptr("auto_explain.log_format"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/auto_explain.log_format"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("EXPLAIN format to be used for plan logging."), + // AllowedValues: to.Ptr("text,xml,json,yaml"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeEnumeration), + // DefaultValue: to.Ptr("text"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/auto-explain.html#id-1.11.7.13.5.3.9.1.3"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("text"), + // }, // }, - // }, - // { - // Name: to.Ptr("deadlock_timeout"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/deadlock_timeout"), - // Properties: &armpostgresql.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"), - // DataType: to.Ptr("Integer"), - // DefaultValue: to.Ptr("1000"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("1000"), + // { + // Name: to.Ptr("auto_explain.log_level"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/auto_explain.log_level"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Log level for the plan."), + // AllowedValues: to.Ptr("debug5,debug4,debug3,debug2,debug1,debug,info,notice,warning,log"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeEnumeration), + // DefaultValue: to.Ptr("log"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/auto-explain.html#id-1.11.7.13.5.3.10.1.3"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("log"), + // }, // }, - // }, - // { - // Name: to.Ptr("debug_print_parse"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/debug_print_parse"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Logs each query's parse tree."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr("Boolean"), - // DefaultValue: to.Ptr("off"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("off"), + // { + // 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/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/auto_explain.log_min_duration"), + // Properties: &armpostgresql.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"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeInteger), + // DefaultValue: to.Ptr("-1"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/auto-explain.html#id-1.11.7.13.5.3.1.1.3"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Unit: to.Ptr("milliseconds"), + // Value: to.Ptr("-1"), + // }, // }, - // }, - // { - // Name: to.Ptr("debug_print_plan"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/debug_print_plan"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Logs each query's execution plan."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr("Boolean"), - // DefaultValue: to.Ptr("off"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("off"), + // { + // 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/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/auto_explain.log_nested_statements"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Log nested statements."), + // AllowedValues: to.Ptr("on,off"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeBoolean), + // DefaultValue: to.Ptr("off"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/auto-explain.html#id-1.11.7.13.5.3.11.1.3"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("off"), + // }, // }, - // }, - // { - // Name: to.Ptr("debug_print_rewritten"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/debug_print_rewritten"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Logs each query's rewritten parse tree."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr("Boolean"), - // DefaultValue: to.Ptr("off"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("off"), + // { + // Name: to.Ptr("auto_explain.log_settings"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/auto_explain.log_settings"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Log modified configuration parameters affecting query planning."), + // AllowedValues: to.Ptr("on,off"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeBoolean), + // DefaultValue: to.Ptr("off"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/auto-explain.html#id-1.11.7.13.5.3.8.1.3"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("off"), + // }, // }, - // }, - // { - // Name: to.Ptr("default_statistics_target"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/default_statistics_target"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Sets the default statistics target."), - // AllowedValues: to.Ptr("1-10000"), - // DataType: to.Ptr("Integer"), - // DefaultValue: to.Ptr("100"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("100"), + // { + // Name: to.Ptr("auto_explain.log_timing"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/auto_explain.log_timing"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Collect timing data, not just row counts."), + // AllowedValues: to.Ptr("on,off"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeBoolean), + // DefaultValue: to.Ptr("on"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/auto-explain.html#id-1.11.7.13.5.3.5.1.3"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("on"), + // }, // }, - // }, - // { - // Name: to.Ptr("default_text_search_config"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/default_text_search_config"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Sets default text search configuration."), - // AllowedValues: to.Ptr("[A-Za-z\\._]+"), - // DataType: to.Ptr("String"), - // DefaultValue: to.Ptr("pg_catalog.english"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("pg_catalog.english"), + // { + // Name: to.Ptr("auto_explain.log_triggers"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/auto_explain.log_triggers"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Include trigger statistics in plans. This has no effect unless log_analyze is also set."), + // AllowedValues: to.Ptr("on,off"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeBoolean), + // DefaultValue: to.Ptr("off"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/auto-explain.html#id-1.11.7.13.5.3.6.1.3"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("off"), + // }, // }, - // }, - // { - // Name: to.Ptr("default_transaction_deferrable"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/default_transaction_deferrable"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Sets the default deferrable status of new transactions."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr("Boolean"), - // DefaultValue: to.Ptr("off"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("off"), + // { + // Name: to.Ptr("auto_explain.log_verbose"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/auto_explain.log_verbose"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Use EXPLAIN VERBOSE for plan logging."), + // AllowedValues: to.Ptr("on,off"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeBoolean), + // DefaultValue: to.Ptr("off"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/auto-explain.html#id-1.11.7.13.5.3.7.1.3"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("off"), + // }, // }, - // }, - // { - // Name: to.Ptr("default_transaction_isolation"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/default_transaction_isolation"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Sets the transaction isolation level of each new transaction."), - // AllowedValues: to.Ptr("serializable,repeatable read,read committed,read uncommitted"), - // DataType: to.Ptr("Enumeration"), - // DefaultValue: to.Ptr("read committed"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("read committed"), + // { + // Name: to.Ptr("auto_explain.log_wal"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/auto_explain.log_wal"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Log WAL usage."), + // AllowedValues: to.Ptr("on,off"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeBoolean), + // DefaultValue: to.Ptr("off"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/auto-explain.html#id-1.11.7.13.5.3.4.1.3"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("off"), + // }, // }, - // }, - // { - // Name: to.Ptr("default_transaction_read_only"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/default_transaction_read_only"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Sets the default read-only status of new transactions."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr("Boolean"), - // DefaultValue: to.Ptr("off"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("off"), + // { + // Name: to.Ptr("auto_explain.sample_rate"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/auto_explain.sample_rate"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Fraction of queries to process."), + // AllowedValues: to.Ptr("0.0-1.0"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeNumeric), + // DefaultValue: to.Ptr("1.0"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/auto-explain.html#id-1.11.7.13.5.3.12.1.3"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("1.0"), + // }, // }, - // }, - // { - // Name: to.Ptr("default_with_oids"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/default_with_oids"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Create new tables with OIDs by default."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr("Boolean"), - // DefaultValue: to.Ptr("off"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("off"), + // { + // Name: to.Ptr("autovacuum"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/autovacuum"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Controls whether the server should run the autovacuum subprocess."), + // AllowedValues: to.Ptr("on,off"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeBoolean), + // DefaultValue: to.Ptr("on"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-autovacuum.html#GUC-AUTOVACUUM"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("on"), + // }, // }, - // }, - // { - // Name: to.Ptr("enable_bitmapscan"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/enable_bitmapscan"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Enables the planner's use of bitmap-scan plans."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr("Boolean"), - // DefaultValue: to.Ptr("on"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("on"), + // { + // Name: to.Ptr("autovacuum_analyze_scale_factor"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/autovacuum_analyze_scale_factor"), + // Properties: &armpostgresql.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"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeNumeric), + // DefaultValue: to.Ptr("0.1"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-autovacuum.html#GUC-AUTOVACUUM-ANALYZE-SCALE-FACTOR"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("0.1"), + // }, // }, - // }, - // { - // Name: to.Ptr("enable_hashagg"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/enable_hashagg"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Enables the planner's use of hashed aggregation plans."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr("Boolean"), - // DefaultValue: to.Ptr("on"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("on"), + // { + // Name: to.Ptr("autovacuum_analyze_threshold"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/autovacuum_analyze_threshold"), + // Properties: &armpostgresql.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"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeInteger), + // DefaultValue: to.Ptr("50"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-autovacuum.html#GUC-AUTOVACUUM-ANALYZE-THRESHOLD"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("50"), + // }, // }, - // }, - // { - // Name: to.Ptr("enable_hashjoin"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/enable_hashjoin"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Enables the planner's use of hash join plans."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr("Boolean"), - // DefaultValue: to.Ptr("on"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("on"), + // { + // Name: to.Ptr("autovacuum_freeze_max_age"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/autovacuum_freeze_max_age"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Maximum age (in transactions) before triggering autovacuum on a table to prevent transaction ID wraparound."), + // AllowedValues: to.Ptr("100000-2000000000"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeInteger), + // DefaultValue: to.Ptr("200000000"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-autovacuum.html#GUC-AUTOVACUUM-FREEZE-MAX-AGE"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(false), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("200000000"), + // }, // }, - // }, - // { - // Name: to.Ptr("enable_indexonlyscan"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/enable_indexonlyscan"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Enables the planner's use of index-only-scan plans."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr("Boolean"), - // DefaultValue: to.Ptr("on"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("on"), + // { + // Name: to.Ptr("autovacuum_max_workers"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/autovacuum_max_workers"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Sets the maximum number of simultaneously running autovacuum worker processes."), + // AllowedValues: to.Ptr("1-262143"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeInteger), + // DefaultValue: to.Ptr("3"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-autovacuum.html#GUC-AUTOVACUUM-MAX-WORKERS"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(false), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("3"), + // }, // }, - // }, - // { - // Name: to.Ptr("enable_indexscan"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/enable_indexscan"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Enables the planner's use of index-scan plans."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr("Boolean"), - // DefaultValue: to.Ptr("on"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("on"), + // { + // 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/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/autovacuum_multixact_freeze_max_age"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Maximum age (in multixact) before triggering autovacuum on a table to prevent multixact wraparound."), + // AllowedValues: to.Ptr("10000-2000000000"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeInteger), + // DefaultValue: to.Ptr("400000000"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-autovacuum.html#GUC-AUTOVACUUM-MULTIXACT-FREEZE-MAX-AGE"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(false), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("400000000"), + // }, // }, - // }, - // { - // Name: to.Ptr("enable_material"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/enable_material"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Enables the planner's use of materialization."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr("Boolean"), - // DefaultValue: to.Ptr("on"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("on"), + // { + // Name: to.Ptr("autovacuum_naptime"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/autovacuum_naptime"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Sets minimum delay between autovacuum runs on any given database."), + // AllowedValues: to.Ptr("1-2147483"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeInteger), + // DefaultValue: to.Ptr("60"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-autovacuum.html#GUC-AUTOVACUUM-NAPTIME"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Unit: to.Ptr("seconds"), + // Value: to.Ptr("60"), + // }, // }, - // }, - // { - // Name: to.Ptr("enable_mergejoin"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/enable_mergejoin"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Enables the planner's use of merge join plans."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr("Boolean"), - // DefaultValue: to.Ptr("on"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("on"), + // { + // Name: to.Ptr("autovacuum_vacuum_cost_delay"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/autovacuum_vacuum_cost_delay"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Sets cost delay value (milliseconds) that will be used in automatic VACUUM operations."), + // AllowedValues: to.Ptr("-1-100"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeInteger), + // DefaultValue: to.Ptr("2"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-autovacuum.html#GUC-AUTOVACUUM-VACUUM-COST-DELAY"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Unit: to.Ptr("milliseconds"), + // Value: to.Ptr("2"), + // }, // }, - // }, - // { - // Name: to.Ptr("enable_nestloop"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/enable_nestloop"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Enables the planner's use of nested-loop join plans."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr("Boolean"), - // DefaultValue: to.Ptr("on"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("on"), + // { + // Name: to.Ptr("autovacuum_vacuum_cost_limit"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/autovacuum_vacuum_cost_limit"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Sets cost limit value that will be used in automatic VACUUM operations."), + // AllowedValues: to.Ptr("-1-10000"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeInteger), + // DefaultValue: to.Ptr("-1"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-autovacuum.html#GUC-AUTOVACUUM-VACUUM-COST-LIMIT"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("-1"), + // }, // }, - // }, - // { - // Name: to.Ptr("enable_seqscan"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/enable_seqscan"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Enables the planner's use of sequential-scan plans."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr("Boolean"), - // DefaultValue: to.Ptr("on"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("on"), + // { + // 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/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/autovacuum_vacuum_insert_scale_factor"), + // Properties: &armpostgresql.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"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeNumeric), + // DefaultValue: to.Ptr("0.2"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-autovacuum.html#GUC-AUTOVACUUM-VACUUM-INSERT-SCALE-FACTOR"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("0.2"), + // }, // }, - // }, - // { - // Name: to.Ptr("enable_sort"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/enable_sort"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Enables the planner's use of explicit sort steps."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr("Boolean"), - // DefaultValue: to.Ptr("on"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("on"), + // { + // Name: to.Ptr("autovacuum_vacuum_insert_threshold"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/autovacuum_vacuum_insert_threshold"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Specifies the number of inserted tuples needed to trigger a VACUUM in any one table."), + // AllowedValues: to.Ptr("-1-2147483647"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeInteger), + // DefaultValue: to.Ptr("1000"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-autovacuum.html#GUC-AUTOVACUUM-VACUUM-INSERT-THRESHOLD"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("1000"), + // }, // }, - // }, - // { - // Name: to.Ptr("enable_tidscan"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/enable_tidscan"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Enables the planner's use of TID scan plans."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr("Boolean"), - // DefaultValue: to.Ptr("on"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("on"), + // { + // Name: to.Ptr("autovacuum_vacuum_scale_factor"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/autovacuum_vacuum_scale_factor"), + // Properties: &armpostgresql.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"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeNumeric), + // DefaultValue: to.Ptr("0.2"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-autovacuum.html#GUC-AUTOVACUUM-VACUUM-SCALE-FACTOR"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("0.2"), + // }, // }, - // }, - // { - // Name: to.Ptr("escape_string_warning"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/escape_string_warning"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Warn about backslash escapes in ordinary string literals."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr("Boolean"), - // DefaultValue: to.Ptr("on"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("on"), + // { + // Name: to.Ptr("autovacuum_vacuum_threshold"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/autovacuum_vacuum_threshold"), + // Properties: &armpostgresql.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"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeInteger), + // DefaultValue: to.Ptr("50"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-autovacuum.html#GUC-AUTOVACUUM-VACUUM-THRESHOLD"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("50"), + // }, // }, - // }, - // { - // Name: to.Ptr("exit_on_error"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/exit_on_error"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Terminate session on any error."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr("Boolean"), - // DefaultValue: to.Ptr("off"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("off"), + // { + // Name: to.Ptr("autovacuum_work_mem"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/autovacuum_work_mem"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Sets the maximum memory to be used by each autovacuum worker process."), + // AllowedValues: to.Ptr("-1-2097151"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeInteger), + // DefaultValue: to.Ptr("-1"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-resource.html#GUC-AUTOVACUUM-WORK-MEM"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Unit: to.Ptr("KB"), + // Value: to.Ptr("-1"), + // }, // }, - // }, - // { - // Name: to.Ptr("extra_float_digits"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/extra_float_digits"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Sets the number of digits displayed for floating-point values."), - // AllowedValues: to.Ptr("-15-3"), - // DataType: to.Ptr("Integer"), - // DefaultValue: to.Ptr("0"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("0"), + // { + // 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/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/azure.accepted_password_auth_method"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Accepted password authentication method."), + // AllowedValues: to.Ptr("md5,scram-sha-256"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeSet), + // DefaultValue: to.Ptr("md5"), + // DocumentationLink: to.Ptr("https://go.microsoft.com/fwlink/?linkid=2274147"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("md5"), + // }, // }, - // }, - // { - // Name: to.Ptr("from_collapse_limit"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/from_collapse_limit"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Sets the FROM-list size beyond which subqueries are not collapsed."), - // AllowedValues: to.Ptr("1-2147483647"), - // DataType: to.Ptr("Integer"), - // DefaultValue: to.Ptr("8"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("8"), + // { + // 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/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/azure.enable_temp_tablespaces_on_local_ssd"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Create temp tablespace on ephemeral disk."), + // AllowedValues: to.Ptr("on,off"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeBoolean), + // DefaultValue: to.Ptr("on"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("on"), + // }, // }, - // }, - // { - // Name: to.Ptr("geqo"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/geqo"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Enables genetic query optimization."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr("Boolean"), - // DefaultValue: to.Ptr("on"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("on"), + // { + // Name: to.Ptr("azure.extensions"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/azure.extensions"), + // Properties: &armpostgresql.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(armpostgresql.ConfigurationDataTypeSet), + // DefaultValue: to.Ptr(""), + // DocumentationLink: to.Ptr("https://go.microsoft.com/fwlink/?linkid=2274269"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr(""), + // }, // }, - // }, - // { - // Name: to.Ptr("geqo_effort"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/geqo_effort"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("GEQO: effort is used to set the default for other GEQO parameters."), - // AllowedValues: to.Ptr("1-10"), - // DataType: to.Ptr("Integer"), - // DefaultValue: to.Ptr("5"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("5"), + // { + // 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/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/azure.single_to_flex_migration"), + // Properties: &armpostgresql.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"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeBoolean), + // DefaultValue: to.Ptr("off"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("off"), + // }, // }, - // }, - // { - // Name: to.Ptr("geqo_generations"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/geqo_generations"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("GEQO: number of iterations of the algorithm."), - // AllowedValues: to.Ptr("0-2147483647"), - // DataType: to.Ptr("Integer"), - // DefaultValue: to.Ptr("0"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("0"), + // { + // 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/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/azure_storage.allow_network_access"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Allow accessing data from blob storage in extension azure_storage."), + // AllowedValues: to.Ptr("on,off"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeBoolean), + // DefaultValue: to.Ptr("on"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("on"), + // }, // }, - // }, - // { - // Name: to.Ptr("geqo_pool_size"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/geqo_pool_size"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("GEQO: number of individuals in the population."), - // AllowedValues: to.Ptr("0-2147483647"), - // DataType: to.Ptr("Integer"), - // DefaultValue: to.Ptr("0"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("0"), + // { + // 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/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/azure_storage.blob_block_size_mb"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Blob block size in megabytes for blob_put in extension azure_storage."), + // AllowedValues: to.Ptr("1-4000"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeInteger), + // DefaultValue: to.Ptr("512"), + // DocumentationLink: to.Ptr("https://learn.microsoft.com/en-us/rest/api/storageservices/put-block?tabs=azure-ad#remarks"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("system-default"), + // Unit: to.Ptr("megabytes"), + // Value: to.Ptr("512"), + // }, // }, - // }, - // { - // Name: to.Ptr("geqo_seed"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/geqo_seed"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("GEQO: seed for random path selection."), - // AllowedValues: to.Ptr("0-1"), - // DataType: to.Ptr("Numeric"), - // DefaultValue: to.Ptr("0.0"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("0.0"), + // { + // 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/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/azure_storage.public_account_access"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Allow all users to access data from public storage accounts in extension azure_storage."), + // AllowedValues: to.Ptr("on,off"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeBoolean), + // DefaultValue: to.Ptr("on"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("on"), + // }, // }, - // }, - // { - // Name: to.Ptr("geqo_selection_bias"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/geqo_selection_bias"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("GEQO: selective pressure within the population."), - // AllowedValues: to.Ptr("1.5-2"), - // DataType: to.Ptr("Numeric"), - // DefaultValue: to.Ptr("2.0"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("2.0"), + // { + // Name: to.Ptr("backend_flush_after"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/backend_flush_after"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Number of pages after which previously performed writes are flushed to disk."), + // AllowedValues: to.Ptr("0-256"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeInteger), + // DefaultValue: to.Ptr("256"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-resource.html#GUC-BACKEND-FLUSH-AFTER"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Unit: to.Ptr("8KB"), + // Value: to.Ptr("256"), + // }, // }, - // }, - // { - // Name: to.Ptr("geqo_threshold"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/geqo_threshold"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Sets the threshold of FROM items beyond which GEQO is used."), - // AllowedValues: to.Ptr("2-2147483647"), - // DataType: to.Ptr("Integer"), - // DefaultValue: to.Ptr("12"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("12"), + // { + // Name: to.Ptr("backslash_quote"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/backslash_quote"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Sets whether \"\\'\" is allowed in string literals."), + // AllowedValues: to.Ptr("safe_encoding,on,off"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeEnumeration), + // DefaultValue: to.Ptr("safe_encoding"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-compatible.html#GUC-BACKSLASH-QUOTE"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("safe_encoding"), + // }, // }, - // }, - // { - // Name: to.Ptr("gin_fuzzy_search_limit"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/gin_fuzzy_search_limit"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Sets the maximum allowed result for exact search by GIN."), - // AllowedValues: to.Ptr("0-2147483647"), - // DataType: to.Ptr("Integer"), - // DefaultValue: to.Ptr("0"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("0"), + // { + // Name: to.Ptr("backtrace_functions"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/backtrace_functions"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Log backtrace for errors in these functions."), + // AllowedValues: to.Ptr(".*"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeString), + // DefaultValue: to.Ptr(""), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-developer.html#GUC-BACKTRACE-FUNCTIONS"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("system-default"), + // Value: to.Ptr(""), + // }, // }, - // }, - // { - // Name: to.Ptr("intervalstyle"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/intervalstyle"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Sets the display format for interval values."), - // AllowedValues: to.Ptr("postgres,postgres_verbose,sql_standard,iso_8601"), - // DataType: to.Ptr("Enumeration"), - // DefaultValue: to.Ptr("postgres"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("postgres"), + // { + // Name: to.Ptr("bgwriter_delay"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/bgwriter_delay"), + // Properties: &armpostgresql.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"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeInteger), + // DefaultValue: to.Ptr("20"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-resource.html#GUC-BGWRITER-DELAY"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Unit: to.Ptr("milliseconds"), + // Value: to.Ptr("20"), + // }, // }, - // }, - // { - // Name: to.Ptr("join_collapse_limit"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/join_collapse_limit"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Sets the FROM-list size beyond which JOIN constructs are not flattened."), - // AllowedValues: to.Ptr("1-2147483647"), - // DataType: to.Ptr("Integer"), - // DefaultValue: to.Ptr("8"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("8"), + // { + // Name: to.Ptr("bgwriter_flush_after"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/bgwriter_flush_after"), + // Properties: &armpostgresql.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"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeInteger), + // DefaultValue: to.Ptr("64"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-resource.html#GUC-BGWRITER-FLUSH-AFTER"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Unit: to.Ptr("8KB"), + // Value: to.Ptr("64"), + // }, // }, - // }, - // { - // Name: to.Ptr("lock_timeout"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/lock_timeout"), - // Properties: &armpostgresql.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"), - // DataType: to.Ptr("Integer"), - // DefaultValue: to.Ptr("0"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("0"), + // { + // Name: to.Ptr("bgwriter_lru_maxpages"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/bgwriter_lru_maxpages"), + // Properties: &armpostgresql.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"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeInteger), + // DefaultValue: to.Ptr("100"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-resource.html#GUC-BGWRITER-LRU-MAXPAGES"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("100"), + // }, // }, - // }, - // { - // Name: to.Ptr("log_checkpoints"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/log_checkpoints"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Logs each checkpoint."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr("Boolean"), - // DefaultValue: to.Ptr("off"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("off"), + // { + // Name: to.Ptr("bgwriter_lru_multiplier"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/bgwriter_lru_multiplier"), + // Properties: &armpostgresql.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"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeNumeric), + // DefaultValue: to.Ptr("2"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-resource.html#GUC-BGWRITER-LRU-MULTIPLIER"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("2"), + // }, // }, - // }, - // { - // Name: to.Ptr("log_connections"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/log_connections"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Logs each successful connection."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr("Boolean"), - // DefaultValue: to.Ptr("off"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("off"), + // { + // Name: to.Ptr("block_size"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/block_size"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Shows the size of a disk block."), + // AllowedValues: to.Ptr("8192-8192"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeInteger), + // DefaultValue: to.Ptr("8192"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-preset.html#GUC-BLOCK-SIZE"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("8192"), + // }, // }, - // }, - // { - // Name: to.Ptr("log_disconnections"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/log_disconnections"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Logs end of a session, including duration."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr("Boolean"), - // DefaultValue: to.Ptr("off"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("off"), + // { + // Name: to.Ptr("bonjour"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/bonjour"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Enables advertising the server via Bonjour."), + // AllowedValues: to.Ptr("on,off"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeBoolean), + // DefaultValue: to.Ptr("off"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-connection.html#GUC-BONJOUR"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(false), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("off"), + // }, // }, - // }, - // { - // Name: to.Ptr("log_duration"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/log_duration"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Logs the duration of each completed SQL statement."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr("Boolean"), - // DefaultValue: to.Ptr("off"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("off"), + // { + // Name: to.Ptr("bonjour_name"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/bonjour_name"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Sets the Bonjour service name."), + // AllowedValues: to.Ptr(".*"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeString), + // DefaultValue: to.Ptr(""), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-connection.html#GUC-BONJOUR-NAME"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(false), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("system-default"), + // Value: to.Ptr(""), + // }, // }, - // }, - // { - // Name: to.Ptr("log_error_verbosity"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/log_error_verbosity"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Sets the verbosity of logged messages."), - // AllowedValues: to.Ptr("terse,default,verbose"), - // DataType: to.Ptr("Enumeration"), - // DefaultValue: to.Ptr("default"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("default"), + // { + // Name: to.Ptr("bytea_output"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/bytea_output"), + // Properties: &armpostgresql.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"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeEnumeration), + // DefaultValue: to.Ptr("hex"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-client.html#GUC-BYTEA-OUTPUT"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("hex"), + // }, // }, - // }, - // { - // Name: to.Ptr("log_lock_waits"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/log_lock_waits"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Logs long lock waits."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr("Boolean"), - // DefaultValue: to.Ptr("off"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("off"), + // { + // Name: to.Ptr("check_function_bodies"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/check_function_bodies"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Checks function bodies during CREATE FUNCTION."), + // AllowedValues: to.Ptr("on,off"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeBoolean), + // DefaultValue: to.Ptr("on"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-client.html#GUC-CHECK-FUNCTION-BODIES"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("on"), + // }, // }, - // }, - // { - // Name: to.Ptr("log_min_duration_statement"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/log_min_duration_statement"), - // Properties: &armpostgresql.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"), - // DataType: to.Ptr("Integer"), - // DefaultValue: to.Ptr("-1"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("-1"), + // { + // Name: to.Ptr("checkpoint_completion_target"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/checkpoint_completion_target"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Specifies the target of checkpoint completion, as a fraction of total time between checkpoints."), + // AllowedValues: to.Ptr("0-1"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeNumeric), + // DefaultValue: to.Ptr("0.9"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-wal.html#GUC-CHECKPOINT-COMPLETION-TARGET"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("0.9"), + // }, // }, - // }, - // { - // Name: to.Ptr("log_min_error_statement"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/log_min_error_statement"), - // Properties: &armpostgresql.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"), - // DataType: to.Ptr("Enumeration"), - // DefaultValue: to.Ptr("error"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("error"), + // { + // Name: to.Ptr("checkpoint_flush_after"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/checkpoint_flush_after"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Number of pages after which previously performed writes are flushed to disk."), + // AllowedValues: to.Ptr("0-256"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeInteger), + // DefaultValue: to.Ptr("32"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-wal.html#GUC-CHECKPOINT-FLUSH-AFTER"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("system-default"), + // Unit: to.Ptr("8KB"), + // Value: to.Ptr("32"), + // }, // }, - // }, - // { - // Name: to.Ptr("log_min_messages"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/log_min_messages"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Sets the message levels that are logged."), - // AllowedValues: to.Ptr("debug5,debug4,debug3,debug2,debug1,info,notice,warning,error,log,fatal,panic"), - // DataType: to.Ptr("Enumeration"), - // DefaultValue: to.Ptr("warning"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("warning"), + // { + // Name: to.Ptr("checkpoint_timeout"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/checkpoint_timeout"), + // Properties: &armpostgresql.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"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeInteger), + // DefaultValue: to.Ptr("600"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-wal.html#GUC-CHECKPOINT-TIMEOUT"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Unit: to.Ptr("seconds"), + // Value: to.Ptr("600"), + // }, // }, - // }, - // { - // Name: to.Ptr("log_statement"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/log_statement"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Sets the type of statements logged."), - // AllowedValues: to.Ptr("none,ddl,mod,all"), - // DataType: to.Ptr("Enumeration"), - // DefaultValue: to.Ptr("none"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("none"), + // { + // Name: to.Ptr("checkpoint_warning"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/checkpoint_warning"), + // Properties: &armpostgresql.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"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeInteger), + // DefaultValue: to.Ptr("30"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-wal.html#GUC-CHECKPOINT-WARNING"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Unit: to.Ptr("seconds"), + // Value: to.Ptr("30"), + // }, // }, - // }, - // { - // Name: to.Ptr("max_locks_per_transaction"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/max_locks_per_transaction"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Sets the maximum number of locks per transaction."), - // AllowedValues: to.Ptr("10-2147483647"), - // DataType: to.Ptr("Integer"), - // DefaultValue: to.Ptr("64"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("64"), + // { + // Name: to.Ptr("client_encoding"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/client_encoding"), + // Properties: &armpostgresql.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"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeEnumeration), + // DefaultValue: to.Ptr("UTF8"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-client.html#GUC-CLIENT-ENCODING"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("UTF8"), + // }, // }, - // }, - // { - // Name: to.Ptr("max_pred_locks_per_transaction"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/max_pred_locks_per_transaction"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Sets the maximum number of predicate locks per transaction."), - // AllowedValues: to.Ptr("10-2147483647"), - // DataType: to.Ptr("Integer"), - // DefaultValue: to.Ptr("64"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("64"), + // { + // Name: to.Ptr("client_min_messages"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/client_min_messages"), + // Properties: &armpostgresql.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"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeEnumeration), + // DefaultValue: to.Ptr("notice"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-client.html#GUC-CLIENT-MIN-MESSAGES"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("notice"), + // }, // }, - // }, - // { - // Name: to.Ptr("max_prepared_transactions"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/max_prepared_transactions"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Sets the maximum number of simultaneously prepared transactions."), - // AllowedValues: to.Ptr("0-8388607"), - // DataType: to.Ptr("Integer"), - // DefaultValue: to.Ptr("0"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("0"), + // { + // Name: to.Ptr("cluster_name"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/cluster_name"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Sets the name of the cluster, which is included in the process title."), + // AllowedValues: to.Ptr(".*"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeString), + // DefaultValue: to.Ptr(""), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(false), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("system-default"), + // Value: to.Ptr(""), + // }, // }, - // }, - // { - // Name: to.Ptr("quote_all_identifiers"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/quote_all_identifiers"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("When generating SQL fragments, quote all identifiers."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr("Boolean"), - // DefaultValue: to.Ptr("off"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("off"), + // { + // Name: to.Ptr("commit_delay"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/commit_delay"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Sets the delay in microseconds between transaction commit and flushing WAL to disk."), + // AllowedValues: to.Ptr("0-100000"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeInteger), + // DefaultValue: to.Ptr("0"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-wal.html#GUC-COMMIT-DELAY"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Unit: to.Ptr("microseconds"), + // Value: to.Ptr("0"), + // }, // }, - // }, - // { - // Name: to.Ptr("random_page_cost"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/random_page_cost"), - // Properties: &armpostgresql.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"), - // DataType: to.Ptr("Numeric"), - // DefaultValue: to.Ptr("4.0"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("4.0"), + // { + // Name: to.Ptr("commit_siblings"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/commit_siblings"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Sets the minimum concurrent open transactions before performing commit_delay."), + // AllowedValues: to.Ptr("0-1000"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeInteger), + // DefaultValue: to.Ptr("5"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-wal.html#GUC-COMMIT-SIBLINGS"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("5"), + // }, // }, - // }, - // { - // Name: to.Ptr("search_path"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/search_path"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Sets the schema search order for names that are not schema-qualified."), - // AllowedValues: to.Ptr("[A-Za-z.\"$, ]+"), - // DataType: to.Ptr("String"), - // DefaultValue: to.Ptr("\"$user\", public"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("\"$user\", public"), + // { + // Name: to.Ptr("config_file"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/config_file"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Sets the server's main configuration file."), + // AllowedValues: to.Ptr(".*"), + // DataType: to.Ptr(armpostgresql.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), + // IsDynamicConfig: to.Ptr(false), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("user-override"), + // Value: to.Ptr("/datadrive/pg/data/postgresql.conf"), + // }, // }, - // }, - // { - // Name: to.Ptr("seq_page_cost"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/seq_page_cost"), - // Properties: &armpostgresql.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"), - // DataType: to.Ptr("Numeric"), - // DefaultValue: to.Ptr("1.0"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("1.0"), + // { + // Name: to.Ptr("connection_throttle.bucket_limit"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/connection_throttle.bucket_limit"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Max login tokens per bucket."), + // AllowedValues: to.Ptr("1-2147483647"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeInteger), + // DefaultValue: to.Ptr("2000"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("2000"), + // }, // }, - // }, - // { - // Name: to.Ptr("sql_inheritance"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/sql_inheritance"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Causes subtables to be included by default in various commands."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr("Boolean"), - // DefaultValue: to.Ptr("on"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("on"), + // { + // Name: to.Ptr("connection_throttle.enable"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/connection_throttle.enable"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Enables temporary connection throttling per IP for too many login failures."), + // AllowedValues: to.Ptr("on,off"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeBoolean), + // DefaultValue: to.Ptr("off"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("off"), + // }, // }, - // }, - // { - // Name: to.Ptr("standard_conforming_strings"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/standard_conforming_strings"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Causes '...' strings to treat backslashes literally."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr("Boolean"), - // DefaultValue: to.Ptr("on"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("on"), + // { + // Name: to.Ptr("connection_throttle.factor_bias"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/connection_throttle.factor_bias"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("The factor bias for calculating number of tokens for an IP's bucket."), + // AllowedValues: to.Ptr("0.0-0.9"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeNumeric), + // DefaultValue: to.Ptr("0.8"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("0.8"), + // }, // }, - // }, - // { - // Name: to.Ptr("statement_timeout"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/statement_timeout"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Sets the maximum allowed duration (in milliseconds) of any statement. 0 turns this off."), - // AllowedValues: to.Ptr("0-2147483647"), - // DataType: to.Ptr("Integer"), - // DefaultValue: to.Ptr("0"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("0"), + // { + // 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/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/connection_throttle.hash_entries_max"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Max number of entries in the login failures hash table."), + // AllowedValues: to.Ptr("1-2147483647"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeInteger), + // DefaultValue: to.Ptr("500"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("500"), + // }, // }, - // }, - // { - // Name: to.Ptr("synchronize_seqscans"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/synchronize_seqscans"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Enable synchronized sequential scans."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr("Boolean"), - // DefaultValue: to.Ptr("on"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("on"), + // { + // Name: to.Ptr("connection_throttle.reset_time"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/connection_throttle.reset_time"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Time between resetting the login bucket."), + // AllowedValues: to.Ptr("1-2147483647"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeInteger), + // DefaultValue: to.Ptr("120"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Unit: to.Ptr("seconds"), + // Value: to.Ptr("120"), + // }, // }, - // }, - // { - // Name: to.Ptr("synchronous_commit"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/synchronous_commit"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Sets the current transaction's synchronization level."), - // AllowedValues: to.Ptr("local,remote_write,on,off"), - // DataType: to.Ptr("Enumeration"), - // DefaultValue: to.Ptr("on"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("on"), + // { + // Name: to.Ptr("connection_throttle.restore_factor"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/connection_throttle.restore_factor"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Factor to increase number of tokens by for IPs with low failure rate."), + // AllowedValues: to.Ptr("1.0-100.0"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeNumeric), + // DefaultValue: to.Ptr("2"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("2"), + // }, // }, - // }, - // { - // Name: to.Ptr("transform_null_equals"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/transform_null_equals"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Treats \"expr=NULL\" as \"expr IS NULL\"."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr("Boolean"), - // DefaultValue: to.Ptr("off"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("off"), + // { + // Name: to.Ptr("connection_throttle.update_time"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/connection_throttle.update_time"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Time between updating the login bucket."), + // AllowedValues: to.Ptr("1-2147483647"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeInteger), + // DefaultValue: to.Ptr("20"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Unit: to.Ptr("seconds"), + // Value: to.Ptr("20"), + // }, // }, - // }, - // { - // Name: to.Ptr("xmlbinary"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/xmlbinary"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Sets how binary values are to be encoded in XML."), - // AllowedValues: to.Ptr("base64,hex"), - // DataType: to.Ptr("Enumeration"), - // DefaultValue: to.Ptr("base64"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("base64"), + // { + // Name: to.Ptr("constraint_exclusion"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/constraint_exclusion"), + // Properties: &armpostgresql.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(armpostgresql.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("system-default"), + // Value: to.Ptr("partition"), + // }, // }, - // }, - // { - // Name: to.Ptr("xmloption"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/xmloption"), - // Properties: &armpostgresql.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"), - // DataType: to.Ptr("Enumeration"), - // DefaultValue: to.Ptr("content"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("content"), + // { + // Name: to.Ptr("cpu_index_tuple_cost"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/cpu_index_tuple_cost"), + // Properties: &armpostgresql.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"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeNumeric), + // DefaultValue: to.Ptr("0.005"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-query.html#GUC-CPU-INDEX-TUPLE-COST"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("0.005"), + // }, // }, - // }, - // { - // Name: to.Ptr("force_parallel_mode"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/force_parallel_mode"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Forces use of parallel query facilities."), - // AllowedValues: to.Ptr("off,on,regress"), - // DataType: to.Ptr("Enumeration"), - // DefaultValue: to.Ptr("off"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("off"), + // { + // Name: to.Ptr("cpu_operator_cost"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/cpu_operator_cost"), + // Properties: &armpostgresql.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"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeNumeric), + // DefaultValue: to.Ptr("0.0025"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-query.html#GUC-CPU-OPERATOR-COST"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("0.0025"), + // }, // }, - // }, - // { - // Name: to.Ptr("idle_in_transaction_session_timeout"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/idle_in_transaction_session_timeout"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Sets the maximum allowed duration of any idling transaction."), - // AllowedValues: to.Ptr("0-2147483647"), - // DataType: to.Ptr("Integer"), - // DefaultValue: to.Ptr("0"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("0"), + // { + // Name: to.Ptr("cpu_tuple_cost"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/cpu_tuple_cost"), + // Properties: &armpostgresql.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"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeNumeric), + // DefaultValue: to.Ptr("0.01"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-query.html#GUC-CPU-TUPLE-COST"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("0.01"), + // }, // }, - // }, - // { - // Name: to.Ptr("max_parallel_workers_per_gather"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/max_parallel_workers_per_gather"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Sets the maximum number of parallel processes per executor node."), - // AllowedValues: to.Ptr("0-1024"), - // DataType: to.Ptr("Integer"), - // DefaultValue: to.Ptr("0"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("0"), + // { + // Name: to.Ptr("cron.database_name"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/cron.database_name"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Sets the database in which pg_cron metadata is kept."), + // AllowedValues: to.Ptr("[A-Za-z0-9_]+"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeString), + // DefaultValue: to.Ptr("postgres"), + // DocumentationLink: to.Ptr("https://github.com/citusdata/pg_cron"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(false), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("postgres"), + // }, // }, - // }, - // { - // Name: to.Ptr("min_parallel_relation_size"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/min_parallel_relation_size"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Sets the minimum size of relations to be considered for parallel scan."), - // AllowedValues: to.Ptr("0-715827882"), - // DataType: to.Ptr("Integer"), - // DefaultValue: to.Ptr("8388608"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("8388608"), + // { + // Name: to.Ptr("cron.log_run"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/cron.log_run"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Log all jobs runs into the job_run_details table."), + // AllowedValues: to.Ptr("on,off"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeBoolean), + // DefaultValue: to.Ptr("on"), + // DocumentationLink: to.Ptr("https://github.com/citusdata/pg_cron"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(false), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("on"), + // }, // }, - // }, - // { - // Name: to.Ptr("parallel_setup_cost"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/parallel_setup_cost"), - // Properties: &armpostgresql.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"), - // DataType: to.Ptr("Numeric"), - // DefaultValue: to.Ptr("1000"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("1000"), + // { + // Name: to.Ptr("cron.log_statement"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/cron.log_statement"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Log all cron statements prior to execution."), + // AllowedValues: to.Ptr("on,off"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeBoolean), + // DefaultValue: to.Ptr("on"), + // DocumentationLink: to.Ptr("https://github.com/citusdata/pg_cron"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(false), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("on"), + // }, // }, - // }, - // { - // Name: to.Ptr("parallel_tuple_cost"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/parallel_tuple_cost"), - // Properties: &armpostgresql.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"), - // DataType: to.Ptr("Numeric"), - // DefaultValue: to.Ptr("0.1"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("0.1"), + // { + // Name: to.Ptr("cron.max_running_jobs"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/cron.max_running_jobs"), + // Properties: &armpostgresql.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"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeInteger), + // DefaultValue: to.Ptr("32"), + // DocumentationLink: to.Ptr("https://github.com/citusdata/pg_cron"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(false), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("32"), + // }, + // }, + // { + // Name: to.Ptr("cursor_tuple_fraction"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/cursor_tuple_fraction"), + // Properties: &armpostgresql.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"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeNumeric), + // DefaultValue: to.Ptr("0.1"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-query.html#GUC-CURSOR-TUPLE-FRACTION"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("0.1"), + // }, + // }, + // { + // Name: to.Ptr("data_checksums"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/data_checksums"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Shows whether data checksums are turned on for this cluster."), + // AllowedValues: to.Ptr("on,off"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeBoolean), + // DefaultValue: to.Ptr("off"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-preset.html#GUC-DATA-CHECKSUMS"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("user-override"), + // Value: to.Ptr("on"), + // }, + // }, + // { + // Name: to.Ptr("data_directory"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/data_directory"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Sets the server's data directory."), + // AllowedValues: to.Ptr(".*"), + // DataType: to.Ptr(armpostgresql.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), + // IsDynamicConfig: to.Ptr(false), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("user-override"), + // Value: to.Ptr("/datadrive/pg/data"), + // }, + // }, + // { + // Name: to.Ptr("data_directory_mode"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/data_directory_mode"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Mode of the data directory."), + // AllowedValues: to.Ptr("0-511"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeInteger), + // DefaultValue: to.Ptr("448"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-preset.html#GUC-DATA-DIRECTORY-MODE"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("user-override"), + // Value: to.Ptr("0700"), + // }, + // }, + // { + // Name: to.Ptr("data_sync_retry"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/data_sync_retry"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Whether to continue running after a failure to sync data files."), + // AllowedValues: to.Ptr("on,off"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeBoolean), + // DefaultValue: to.Ptr("off"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-error-handling.html#GUC-DATA-SYNC-RETRY"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(false), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("off"), + // }, + // }, + // { + // Name: to.Ptr("DateStyle"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/DateStyle"), + // Properties: &armpostgresql.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(armpostgresql.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), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("ISO, MDY"), + // }, + // }, + // { + // Name: to.Ptr("db_user_namespace"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/db_user_namespace"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Enables per-database user names."), + // AllowedValues: to.Ptr("on,off"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeBoolean), + // DefaultValue: to.Ptr("off"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-connection.html#GUC-DB-USER-NAMESPACE"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("off"), + // }, + // }, + // { + // Name: to.Ptr("deadlock_timeout"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/deadlock_timeout"), + // Properties: &armpostgresql.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"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeInteger), + // DefaultValue: to.Ptr("1000"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-locks.html#GUC-DEADLOCK-TIMEOUT"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Unit: to.Ptr("milliseconds"), + // Value: to.Ptr("1000"), + // }, + // }, + // { + // Name: to.Ptr("debug_assertions"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/debug_assertions"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Shows whether the running server has assertion checks enabled."), + // AllowedValues: to.Ptr("on,off"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeBoolean), + // DefaultValue: to.Ptr("off"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("off"), + // }, + // }, + // { + // Name: to.Ptr("debug_pretty_print"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/debug_pretty_print"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Indents parse and plan tree displays."), + // AllowedValues: to.Ptr("on,off"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeBoolean), + // DefaultValue: to.Ptr("on"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-logging.html#id-1.6.6.11.5.3.3.1.3"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("on"), + // }, + // }, + // { + // Name: to.Ptr("debug_print_parse"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/debug_print_parse"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Logs each query's parse tree."), + // AllowedValues: to.Ptr("on,off"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeBoolean), + // DefaultValue: to.Ptr("off"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-logging.html#id-1.6.6.11.5.3.2.1.3"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("off"), + // }, + // }, + // { + // Name: to.Ptr("debug_print_plan"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/debug_print_plan"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Logs each query's execution plan."), + // AllowedValues: to.Ptr("on,off"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeBoolean), + // DefaultValue: to.Ptr("off"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-logging.html#id-1.6.6.11.5.3.2.1.3"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("off"), + // }, + // }, + // { + // Name: to.Ptr("debug_print_rewritten"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/debug_print_rewritten"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Logs each query's rewritten parse tree."), + // AllowedValues: to.Ptr("on,off"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeBoolean), + // DefaultValue: to.Ptr("off"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-logging.html#id-1.6.6.11.5.3.2.1.3"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("off"), + // }, + // }, + // { + // Name: to.Ptr("default_statistics_target"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/default_statistics_target"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Sets the default statistics target for table columns without a column-specific target."), + // AllowedValues: to.Ptr("1-10000"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeInteger), + // DefaultValue: to.Ptr("100"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-query.html#GUC-DEFAULT-STATISTICS-TARGET"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("100"), + // }, + // }, + // { + // Name: to.Ptr("default_table_access_method"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/default_table_access_method"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Sets the default table access method for new tables."), + // AllowedValues: to.Ptr(".*"), + // DataType: to.Ptr(armpostgresql.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), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("heap"), + // }, + // }, + // { + // Name: to.Ptr("default_tablespace"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/default_tablespace"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Sets the default tablespace to create tables and indexes in."), + // AllowedValues: to.Ptr("[A-Za-z._]*"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeString), + // DefaultValue: to.Ptr(""), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-client.html#GUC-DEFAULT-TABLESPACE"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr(""), + // }, + // }, + // { + // Name: to.Ptr("default_text_search_config"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/default_text_search_config"), + // Properties: &armpostgresql.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(armpostgresql.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), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("pg_catalog.english"), + // }, + // }, + // { + // Name: to.Ptr("default_transaction_deferrable"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/default_transaction_deferrable"), + // Properties: &armpostgresql.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"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeBoolean), + // DefaultValue: to.Ptr("off"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-client.html#GUC-DEFAULT-TRANSACTION-DEFERRABLE"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("off"), + // }, + // }, + // { + // Name: to.Ptr("default_transaction_isolation"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/default_transaction_isolation"), + // Properties: &armpostgresql.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"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeEnumeration), + // DefaultValue: to.Ptr("read committed"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-client.html#GUC-DEFAULT-TRANSACTION-ISOLATION"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("read committed"), + // }, + // }, + // { + // Name: to.Ptr("default_transaction_read_only"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/default_transaction_read_only"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Sets the default read-only status of each new transaction."), + // AllowedValues: to.Ptr("on,off"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeBoolean), + // DefaultValue: to.Ptr("off"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-client.html#GUC-DEFAULT-TRANSACTION-READ-ONLY"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("off"), + // }, + // }, + // { + // Name: to.Ptr("dynamic_library_path"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/dynamic_library_path"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Sets the path for dynamically loadable modules."), + // AllowedValues: to.Ptr(".*"), + // DataType: to.Ptr(armpostgresql.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), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("$libdir"), + // }, + // }, + // { + // Name: to.Ptr("dynamic_shared_memory_type"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/dynamic_shared_memory_type"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Selects the dynamic shared memory implementation used."), + // AllowedValues: to.Ptr("posix,sysv,mmap"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeEnumeration), + // DefaultValue: to.Ptr("posix"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-resource.html#GUC-DYNAMIC-SHARED-MEMORY-TYPE"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(false), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("posix"), + // }, + // }, + // { + // Name: to.Ptr("effective_cache_size"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/effective_cache_size"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Sets the planner's assumption about the size of the disk cache."), + // AllowedValues: to.Ptr("1-2147483647"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeInteger), + // DefaultValue: to.Ptr("1572864"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-query.html#GUC-EFFECTIVE-CACHE-SIZE"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Unit: to.Ptr("8KB"), + // Value: to.Ptr("1572864"), + // }, + // }, + // { + // Name: to.Ptr("effective_io_concurrency"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/effective_io_concurrency"), + // Properties: &armpostgresql.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"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeInteger), + // DefaultValue: to.Ptr("1"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-resource.html#GUC-EFFECTIVE-IO-CONCURRENCY"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("1"), + // }, + // }, + // { + // Name: to.Ptr("enable_bitmapscan"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/enable_bitmapscan"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Enables the planner's use of bitmap-scan plans."), + // AllowedValues: to.Ptr("on,off"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeBoolean), + // DefaultValue: to.Ptr("on"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-query.html#GUC-ENABLE-BITMAPSCAN"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("on"), + // }, + // }, + // { + // Name: to.Ptr("enable_gathermerge"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/enable_gathermerge"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Enables the planner's use of gather merge plans."), + // AllowedValues: to.Ptr("on,off"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeBoolean), + // DefaultValue: to.Ptr("on"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-query.html#GUC-ENABLE-GATHERMERGE"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("on"), + // }, + // }, + // { + // Name: to.Ptr("enable_hashagg"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/enable_hashagg"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Enables the planner's use of hashed aggregation plans."), + // AllowedValues: to.Ptr("on,off"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeBoolean), + // DefaultValue: to.Ptr("on"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-query.html#GUC-ENABLE-HASHAGG"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("on"), + // }, + // }, + // { + // Name: to.Ptr("enable_hashjoin"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/enable_hashjoin"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Enables the planner's use of hash join plans."), + // AllowedValues: to.Ptr("on,off"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeBoolean), + // DefaultValue: to.Ptr("on"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-query.html#GUC-ENABLE-HASHJOIN"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("on"), + // }, + // }, + // { + // Name: to.Ptr("enable_incremental_sort"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/enable_incremental_sort"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Enables the planner's use of incremental sort steps."), + // AllowedValues: to.Ptr("on,off"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeBoolean), + // DefaultValue: to.Ptr("on"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-query.html#GUC-ENABLE-INCREMENTAL-SORT"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("on"), + // }, + // }, + // { + // Name: to.Ptr("enable_indexonlyscan"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/enable_indexonlyscan"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Enables the planner's use of index-only-scan plans."), + // AllowedValues: to.Ptr("on,off"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeBoolean), + // DefaultValue: to.Ptr("on"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-query.html#GUC-ENABLE-INDEXONLYSCAN"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("on"), + // }, + // }, + // { + // Name: to.Ptr("enable_indexscan"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/enable_indexscan"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Enables the planner's use of index-scan plans."), + // AllowedValues: to.Ptr("on,off"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeBoolean), + // DefaultValue: to.Ptr("on"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-query.html#GUC-ENABLE-INDEXSCAN"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("on"), + // }, + // }, + // { + // Name: to.Ptr("enable_material"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/enable_material"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Enables the planner's use of materialization."), + // AllowedValues: to.Ptr("on,off"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeBoolean), + // DefaultValue: to.Ptr("on"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-query.html#GUC-ENABLE-MATERIAL"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("on"), + // }, + // }, + // { + // Name: to.Ptr("enable_mergejoin"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/enable_mergejoin"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Enables the planner's use of merge join plans."), + // AllowedValues: to.Ptr("on,off"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeBoolean), + // DefaultValue: to.Ptr("on"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-query.html#GUC-ENABLE-MERGEJOIN"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("on"), + // }, + // }, + // { + // Name: to.Ptr("enable_nestloop"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/enable_nestloop"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Enables the planner's use of nested loop join plans."), + // AllowedValues: to.Ptr("on,off"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeBoolean), + // DefaultValue: to.Ptr("on"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-query.html#GUC-ENABLE-NESTLOOP"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("on"), + // }, + // }, + // { + // Name: to.Ptr("enable_parallel_append"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/enable_parallel_append"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Enables the planner's use of parallel append plans."), + // AllowedValues: to.Ptr("on,off"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeBoolean), + // DefaultValue: to.Ptr("on"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-query.html#GUC-ENABLE-PARALLEL-APPEND"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("on"), + // }, + // }, + // { + // Name: to.Ptr("enable_parallel_hash"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/enable_parallel_hash"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Enables the planner's use of parallel hash plans."), + // AllowedValues: to.Ptr("on,off"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeBoolean), + // DefaultValue: to.Ptr("on"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-query.html#GUC-ENABLE-PARALLEL-HASH"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("on"), + // }, + // }, + // { + // Name: to.Ptr("enable_partition_pruning"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/enable_partition_pruning"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Enables plan-time and run-time partition pruning."), + // AllowedValues: to.Ptr("on,off"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeBoolean), + // DefaultValue: to.Ptr("on"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-query.html#GUC-ENABLE-PARTITION-PRUNING"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("on"), + // }, + // }, + // { + // Name: to.Ptr("enable_partitionwise_aggregate"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/enable_partitionwise_aggregate"), + // Properties: &armpostgresql.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"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeBoolean), + // DefaultValue: to.Ptr("off"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-query.html#GUC-ENABLE-PARTITIONWISE-AGGREGATE"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("off"), + // }, + // }, + // { + // Name: to.Ptr("enable_partitionwise_join"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/enable_partitionwise_join"), + // Properties: &armpostgresql.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"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeBoolean), + // DefaultValue: to.Ptr("off"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-query.html#GUC-ENABLE-PARTITIONWISE-JOIN"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("off"), + // }, + // }, + // { + // Name: to.Ptr("enable_seqscan"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/enable_seqscan"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Enables the planner's use of sequential-scan plans."), + // AllowedValues: to.Ptr("on,off"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeBoolean), + // DefaultValue: to.Ptr("on"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-query.html#GUC-ENABLE-SEQSCAN"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("on"), + // }, + // }, + // { + // Name: to.Ptr("enable_sort"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/enable_sort"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Enables the planner's use of explicit sort steps."), + // AllowedValues: to.Ptr("on,off"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeBoolean), + // DefaultValue: to.Ptr("on"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-query.html#GUC-ENABLE-SORT"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("on"), + // }, + // }, + // { + // Name: to.Ptr("enable_tidscan"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/enable_tidscan"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Enables the planner's use of TID scan plans."), + // AllowedValues: to.Ptr("on,off"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeBoolean), + // DefaultValue: to.Ptr("on"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-query.html#GUC-ENABLE-TIDSCAN"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("on"), + // }, + // }, + // { + // Name: to.Ptr("escape_string_warning"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/escape_string_warning"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Warns about backslash escapes in ordinary string literals."), + // AllowedValues: to.Ptr("on,off"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeBoolean), + // DefaultValue: to.Ptr("on"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-compatible.html#GUC-ESCAPE-STRING-WARNING"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("on"), + // }, + // }, + // { + // Name: to.Ptr("event_source"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/event_source"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Sets the application name used to identify PostgreSQL messages in the event log."), + // AllowedValues: to.Ptr(".*"), + // DataType: to.Ptr(armpostgresql.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), + // IsDynamicConfig: to.Ptr(false), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("PostgreSQL"), + // }, + // }, + // { + // Name: to.Ptr("exit_on_error"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/exit_on_error"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Terminates session on any error."), + // AllowedValues: to.Ptr("on,off"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeBoolean), + // DefaultValue: to.Ptr("off"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-error-handling.html#GUC-EXIT-ON-ERROR"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("off"), + // }, + // }, + // { + // Name: to.Ptr("external_pid_file"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/external_pid_file"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Writes the postmaster PID to the specified file."), + // AllowedValues: to.Ptr(".*"), + // DataType: to.Ptr(armpostgresql.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), + // IsDynamicConfig: to.Ptr(false), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("system-default"), + // Value: to.Ptr(""), + // }, + // }, + // { + // Name: to.Ptr("extra_float_digits"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/extra_float_digits"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Sets the number of digits displayed for floating-point values."), + // AllowedValues: to.Ptr("-15-3"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeInteger), + // DefaultValue: to.Ptr("1"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-client.html#GUC-EXTRA-FLOAT-DIGITS"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("1"), + // }, + // }, + // { + // Name: to.Ptr("force_parallel_mode"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/force_parallel_mode"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Forces use of parallel query facilities."), + // AllowedValues: to.Ptr("off,on,regress"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeEnumeration), + // DefaultValue: to.Ptr("off"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-query.html#GUC-FORCE-PARALLEL-MODE"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("off"), + // }, + // }, + // { + // Name: to.Ptr("from_collapse_limit"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/from_collapse_limit"), + // Properties: &armpostgresql.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"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeInteger), + // DefaultValue: to.Ptr("8"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-query.html#GUC-FROM-COLLAPSE-LIMIT"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("8"), + // }, + // }, + // { + // Name: to.Ptr("fsync"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/fsync"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Forces synchronization of updates to disk."), + // AllowedValues: to.Ptr("on,off"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeBoolean), + // DefaultValue: to.Ptr("on"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-wal.html#GUC-FSYNC"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("on"), + // }, + // }, + // { + // Name: to.Ptr("full_page_writes"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/full_page_writes"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Writes full pages to WAL when first modified after a checkpoint."), + // AllowedValues: to.Ptr("on,off"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeBoolean), + // DefaultValue: to.Ptr("on"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-wal.html#GUC-FULL-PAGE-WRITES"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("on"), + // }, + // }, + // { + // Name: to.Ptr("geqo"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/geqo"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Enables genetic query optimization."), + // AllowedValues: to.Ptr("on,off"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeBoolean), + // DefaultValue: to.Ptr("on"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-query.html#GUC-GEQO"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("on"), + // }, + // }, + // { + // Name: to.Ptr("geqo_effort"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/geqo_effort"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("GEQO: effort is used to set the default for other GEQO parameters."), + // AllowedValues: to.Ptr("1-10"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeInteger), + // DefaultValue: to.Ptr("5"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-query.html#GUC-GEQO-EFFORT"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("5"), + // }, + // }, + // { + // Name: to.Ptr("geqo_generations"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/geqo_generations"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("GEQO: number of iterations of the algorithm."), + // AllowedValues: to.Ptr("0-2147483647"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeInteger), + // DefaultValue: to.Ptr("0"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-query.html#GUC-GEQO-GENERATIONS"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("0"), + // }, + // }, + // { + // Name: to.Ptr("geqo_pool_size"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/geqo_pool_size"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("GEQO: number of individuals in the population."), + // AllowedValues: to.Ptr("0-2147483647"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeInteger), + // DefaultValue: to.Ptr("0"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-query.html#GUC-GEQO-POOL-SIZE"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("0"), + // }, + // }, + // { + // Name: to.Ptr("geqo_seed"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/geqo_seed"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("GEQO: seed for random path selection."), + // AllowedValues: to.Ptr("0-1"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeNumeric), + // DefaultValue: to.Ptr("0"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-query.html#GUC-GEQO-SEED"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("0"), + // }, + // }, + // { + // Name: to.Ptr("geqo_selection_bias"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/geqo_selection_bias"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("GEQO: selective pressure within the population."), + // AllowedValues: to.Ptr("1.5-2"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeNumeric), + // DefaultValue: to.Ptr("2"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-query.html#GUC-GEQO-SELECTION-BIAS"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("2"), + // }, + // }, + // { + // Name: to.Ptr("geqo_threshold"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/geqo_threshold"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Sets the threshold of FROM items beyond which GEQO is used."), + // AllowedValues: to.Ptr("2-2147483647"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeInteger), + // DefaultValue: to.Ptr("12"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-query.html#GUC-GEQO-THRESHOLD"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("12"), + // }, + // }, + // { + // Name: to.Ptr("gin_fuzzy_search_limit"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/gin_fuzzy_search_limit"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Sets the maximum allowed result for exact search by GIN."), + // AllowedValues: to.Ptr("0-2147483647"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeInteger), + // DefaultValue: to.Ptr("0"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-client.html#GUC-GIN-FUZZY-SEARCH-LIMIT"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("0"), + // }, + // }, + // { + // Name: to.Ptr("gin_pending_list_limit"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/gin_pending_list_limit"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Sets the maximum size of the pending list for GIN index."), + // AllowedValues: to.Ptr("64-2097151"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeInteger), + // DefaultValue: to.Ptr("4096"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-client.html#GUC-GIN-PENDING-LIST-LIMIT"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Unit: to.Ptr("KB"), + // Value: to.Ptr("4096"), + // }, + // }, + // { + // Name: to.Ptr("hash_mem_multiplier"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/hash_mem_multiplier"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Multiple of work_mem to use for hash tables."), + // AllowedValues: to.Ptr("1-1000"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeNumeric), + // DefaultValue: to.Ptr("1"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-resource.html#GUC-HASH-MEM-MULTIPLIER"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("1"), + // }, + // }, + // { + // Name: to.Ptr("hba_file"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/hba_file"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Sets the server's \"hba\" configuration file."), + // AllowedValues: to.Ptr(".*"), + // DataType: to.Ptr(armpostgresql.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), + // IsDynamicConfig: to.Ptr(false), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("user-override"), + // Value: to.Ptr("/datadrive/pg/data/pg_hba.conf"), + // }, + // }, + // { + // Name: to.Ptr("hot_standby"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/hot_standby"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Allows connections and queries during recovery."), + // AllowedValues: to.Ptr("on,off"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeBoolean), + // DefaultValue: to.Ptr("on"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-replication.html#GUC-HOT-STANDBY"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(false), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("on"), + // }, + // }, + // { + // Name: to.Ptr("hot_standby_feedback"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/hot_standby_feedback"), + // Properties: &armpostgresql.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"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeBoolean), + // DefaultValue: to.Ptr("off"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-replication.html#GUC-HOT-STANDBY-FEEDBACK"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("off"), + // }, + // }, + // { + // Name: to.Ptr("huge_pages"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/huge_pages"), + // Properties: &armpostgresql.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"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeEnumeration), + // DefaultValue: to.Ptr("try"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-resource.html#GUC-HUGE-PAGES"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(false), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("try"), + // }, + // }, + // { + // Name: to.Ptr("ident_file"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/ident_file"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Sets the server's \"ident\" configuration file."), + // AllowedValues: to.Ptr(".*"), + // DataType: to.Ptr(armpostgresql.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), + // IsDynamicConfig: to.Ptr(false), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("user-override"), + // Value: to.Ptr("/datadrive/pg/data/pg_ident.conf"), + // }, + // }, + // { + // 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/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/idle_in_transaction_session_timeout"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Sets the maximum allowed duration of any idling transaction."), + // AllowedValues: to.Ptr("0-2147483647"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeInteger), + // DefaultValue: to.Ptr("0"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-client.html#GUC-IDLE-IN-TRANSACTION-SESSION-TIMEOUT"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Unit: to.Ptr("milliseconds"), + // Value: to.Ptr("0"), + // }, + // }, + // { + // Name: to.Ptr("ignore_checksum_failure"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/ignore_checksum_failure"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Continues processing after a checksum failure."), + // AllowedValues: to.Ptr("on,off"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeBoolean), + // DefaultValue: to.Ptr("off"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-developer.html#GUC-IGNORE-CHECKSUM-FAILURE"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("off"), + // }, + // }, + // { + // Name: to.Ptr("ignore_invalid_pages"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/ignore_invalid_pages"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Continues recovery after an invalid pages failure."), + // AllowedValues: to.Ptr("on,off"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeBoolean), + // DefaultValue: to.Ptr("off"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-developer.html#GUC-IGNORE-INVALID-PAGES"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(false), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("off"), + // }, + // }, + // { + // Name: to.Ptr("ignore_system_indexes"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/ignore_system_indexes"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Disables reading from system indexes."), + // AllowedValues: to.Ptr("on,off"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeBoolean), + // DefaultValue: to.Ptr("off"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-developer.html#GUC-IGNORE-SYSTEM-INDEXES"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("off"), + // }, + // }, + // { + // Name: to.Ptr("index_tuning.analysis_interval"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/index_tuning.analysis_interval"), + // Properties: &armpostgresql.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"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeInteger), + // DefaultValue: to.Ptr("720"), + // DocumentationLink: to.Ptr("https://go.microsoft.com/fwlink/?linkid=2274149"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Unit: to.Ptr("minutes"), + // Value: to.Ptr("720"), + // }, + // }, + // { + // 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/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/index_tuning.max_columns_per_index"), + // Properties: &armpostgresql.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"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeInteger), + // DefaultValue: to.Ptr("2"), + // DocumentationLink: to.Ptr("https://go.microsoft.com/fwlink/?linkid=2274149"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("2"), + // }, + // }, + // { + // 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/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/index_tuning.max_index_count"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Maximum number of indexes that can be recommended for each database during one optimization session."), + // AllowedValues: to.Ptr("1-25"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeInteger), + // DefaultValue: to.Ptr("10"), + // DocumentationLink: to.Ptr("https://go.microsoft.com/fwlink/?linkid=2274149"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("10"), + // }, + // }, + // { + // 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/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/index_tuning.max_indexes_per_table"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Maximum number of indexes that can be recommended for each table."), + // AllowedValues: to.Ptr("1-25"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeInteger), + // DefaultValue: to.Ptr("10"), + // DocumentationLink: to.Ptr("https://go.microsoft.com/fwlink/?linkid=2274149"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("10"), + // }, + // }, + // { + // 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/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/index_tuning.max_queries_per_database"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Number of slowest queries per database for which indexes can be recommended."), + // AllowedValues: to.Ptr("5-100"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeInteger), + // DefaultValue: to.Ptr("25"), + // DocumentationLink: to.Ptr("https://go.microsoft.com/fwlink/?linkid=2274149"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("25"), + // }, + // }, + // { + // 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/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/index_tuning.max_regression_factor"), + // Properties: &armpostgresql.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"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeNumeric), + // DefaultValue: to.Ptr("0.1"), + // DocumentationLink: to.Ptr("https://go.microsoft.com/fwlink/?linkid=2274149"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Unit: to.Ptr("percentage"), + // Value: to.Ptr("0.1"), + // }, + // }, + // { + // 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/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/index_tuning.max_total_size_factor"), + // Properties: &armpostgresql.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"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeNumeric), + // DefaultValue: to.Ptr("0.1"), + // DocumentationLink: to.Ptr("https://go.microsoft.com/fwlink/?linkid=2274149"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Unit: to.Ptr("percentage"), + // Value: to.Ptr("0.1"), + // }, + // }, + // { + // 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/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/index_tuning.min_improvement_factor"), + // Properties: &armpostgresql.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"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeNumeric), + // DefaultValue: to.Ptr("0.2"), + // DocumentationLink: to.Ptr("https://go.microsoft.com/fwlink/?linkid=2274149"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Unit: to.Ptr("percentage"), + // Value: to.Ptr("0.2"), + // }, + // }, + // { + // Name: to.Ptr("index_tuning.mode"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/index_tuning.mode"), + // Properties: &armpostgresql.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"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeEnumeration), + // DefaultValue: to.Ptr("off"), + // DocumentationLink: to.Ptr("https://go.microsoft.com/fwlink/?linkid=2274149"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("off"), + // }, + // }, + // { + // 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/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/index_tuning.unused_dml_per_table"), + // Properties: &armpostgresql.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"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeInteger), + // DefaultValue: to.Ptr("1000"), + // DocumentationLink: to.Ptr("https://go.microsoft.com/fwlink/?linkid=2274149"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("1000"), + // }, + // }, + // { + // 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/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/index_tuning.unused_min_period"), + // Properties: &armpostgresql.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"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeInteger), + // DefaultValue: to.Ptr("35"), + // DocumentationLink: to.Ptr("https://go.microsoft.com/fwlink/?linkid=2274149"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Unit: to.Ptr("days"), + // Value: to.Ptr("35"), + // }, + // }, + // { + // 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/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/index_tuning.unused_reads_per_table"), + // Properties: &armpostgresql.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"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeInteger), + // DefaultValue: to.Ptr("1000"), + // DocumentationLink: to.Ptr("https://go.microsoft.com/fwlink/?linkid=2274149"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("1000"), + // }, + // }, + // { + // Name: to.Ptr("integer_datetimes"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/integer_datetimes"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Datetimes are integer based."), + // AllowedValues: to.Ptr("on,off"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeBoolean), + // DefaultValue: to.Ptr("on"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-preset.html#GUC-INTEGER-DATETIMES"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("on"), + // }, + // }, + // { + // Name: to.Ptr("intelligent_tuning"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/intelligent_tuning"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Enables intelligent tuning"), + // AllowedValues: to.Ptr("on,off"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeBoolean), + // DefaultValue: to.Ptr("off"), + // DocumentationLink: to.Ptr("https://go.microsoft.com/fwlink/?linkid=2274150"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("off"), + // }, + // }, + // { + // Name: to.Ptr("intelligent_tuning.metric_targets"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/intelligent_tuning.metric_targets"), + // Properties: &armpostgresql.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(armpostgresql.ConfigurationDataTypeSet), + // DefaultValue: to.Ptr("none"), + // DocumentationLink: to.Ptr("https://go.microsoft.com/fwlink/?linkid=2274150"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("none"), + // }, + // }, + // { + // Name: to.Ptr("IntervalStyle"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/IntervalStyle"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Sets the display format for interval values."), + // AllowedValues: to.Ptr("postgres,postgres_verbose,sql_standard,iso_8601"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeEnumeration), + // DefaultValue: to.Ptr("postgres"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-client.html#GUC-INTERVALSTYLE"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("postgres"), + // }, + // }, + // { + // Name: to.Ptr("jit"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/jit"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Determines whether JIT compilation may be used by PostgreSQL."), + // AllowedValues: to.Ptr("on, off"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeBoolean), + // DefaultValue: to.Ptr("off"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-query.html#GUC-JIT"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("off"), + // }, + // }, + // { + // Name: to.Ptr("jit_above_cost"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/jit_above_cost"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Sets the query cost above which JIT compilation is activated, if enabled."), + // AllowedValues: to.Ptr("-1-2147483647"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeInteger), + // DefaultValue: to.Ptr("100000"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-query.html#GUC-JIT-ABOVE-COST"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("100000"), + // }, + // }, + // { + // Name: to.Ptr("jit_debugging_support"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/jit_debugging_support"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Register JIT compiled function with debugger."), + // AllowedValues: to.Ptr("on,off"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeBoolean), + // DefaultValue: to.Ptr("off"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-developer.html#GUC-JIT-DEBUGGING-SUPPORT"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("off"), + // }, + // }, + // { + // Name: to.Ptr("jit_dump_bitcode"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/jit_dump_bitcode"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Write out LLVM bitcode to facilitate JIT debugging."), + // AllowedValues: to.Ptr("on,off"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeBoolean), + // DefaultValue: to.Ptr("off"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-developer.html#GUC-JIT-DUMP-BITCODE"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("off"), + // }, + // }, + // { + // Name: to.Ptr("jit_expressions"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/jit_expressions"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Allow JIT compilation of expressions."), + // AllowedValues: to.Ptr("on,off"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeBoolean), + // DefaultValue: to.Ptr("on"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-developer.html#GUC-JIT-EXPRESSIONS"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("on"), + // }, + // }, + // { + // Name: to.Ptr("jit_inline_above_cost"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/jit_inline_above_cost"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Sets the query cost above which JIT compilation attempts to inline functions and operators."), + // AllowedValues: to.Ptr("-1-2147483647"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeInteger), + // DefaultValue: to.Ptr("500000"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-query.html#GUC-JIT-INLINE-ABOVE-COST"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("500000"), + // }, + // }, + // { + // Name: to.Ptr("jit_optimize_above_cost"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/jit_optimize_above_cost"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Sets the query cost above which JIT compilation applies expensive optimizations."), + // AllowedValues: to.Ptr("-1-2147483647"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeInteger), + // DefaultValue: to.Ptr("500000"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-query.html#GUC-JIT-OPTIMIZE-ABOVE-COST"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("500000"), + // }, + // }, + // { + // Name: to.Ptr("jit_profiling_support"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/jit_profiling_support"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Register JIT compiled function with perf profiler."), + // AllowedValues: to.Ptr("on,off"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeBoolean), + // DefaultValue: to.Ptr("off"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-developer.html#GUC-JIT-PROFILING-SUPPORT"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("off"), + // }, + // }, + // { + // Name: to.Ptr("jit_provider"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/jit_provider"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("JIT provider to use."), + // AllowedValues: to.Ptr(".*"), + // DataType: to.Ptr(armpostgresql.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), + // IsDynamicConfig: to.Ptr(false), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("llvmjit"), + // }, + // }, + // { + // Name: to.Ptr("jit_tuple_deforming"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/jit_tuple_deforming"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Allow JIT compilation of tuple deforming."), + // AllowedValues: to.Ptr("on,off"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeBoolean), + // DefaultValue: to.Ptr("on"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-developer.html#GUC-JIT-TUPLE-DEFORMING"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("on"), + // }, + // }, + // { + // Name: to.Ptr("join_collapse_limit"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/join_collapse_limit"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Sets the FROM-list size beyond which JOIN constructs are not flattened."), + // AllowedValues: to.Ptr("1-2147483647"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeInteger), + // DefaultValue: to.Ptr("8"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-query.html#GUC-JOIN-COLLAPSE-LIMIT"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("8"), + // }, + // }, + // { + // Name: to.Ptr("krb_caseins_users"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/krb_caseins_users"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Sets whether Kerberos and GSSAPI user names should be treated as case-insensitive."), + // AllowedValues: to.Ptr("on,off"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeBoolean), + // DefaultValue: to.Ptr("off"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-connection.html#GUC-KRB-CASEINS-USERS"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("off"), + // }, + // }, + // { + // Name: to.Ptr("krb_server_keyfile"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/krb_server_keyfile"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Sets the location of the Kerberos server key file."), + // AllowedValues: to.Ptr(".*"), + // DataType: to.Ptr(armpostgresql.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), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("system-default"), + // Value: to.Ptr(""), + // }, + // }, + // { + // Name: to.Ptr("lc_collate"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/lc_collate"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Shows the collation order locale."), + // AllowedValues: to.Ptr(".*"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeString), + // DefaultValue: to.Ptr("C"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/locale.html"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("user-override"), + // Value: to.Ptr("en_US.utf8"), + // }, + // }, + // { + // Name: to.Ptr("lc_ctype"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/lc_ctype"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Shows the character classification and case conversion locale."), + // AllowedValues: to.Ptr(".*"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeString), + // DefaultValue: to.Ptr("C"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/locale.html"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("user-override"), + // Value: to.Ptr("en_US.utf8"), + // }, + // }, + // { + // Name: to.Ptr("lc_messages"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/lc_messages"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Sets the language in which messages are displayed."), + // AllowedValues: to.Ptr(".*"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeString), + // DefaultValue: to.Ptr(""), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-client.html#GUC-LC-MESSAGES"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("user-override"), + // Value: to.Ptr("en_US.utf8"), + // }, + // }, + // { + // Name: to.Ptr("lc_monetary"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/lc_monetary"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Sets the locale for formatting monetary amounts."), + // AllowedValues: to.Ptr("[A-Za-z0-9._ -]+"), + // DataType: to.Ptr(armpostgresql.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), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("en_US.utf-8"), + // }, + // }, + // { + // Name: to.Ptr("lc_numeric"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/lc_numeric"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Sets the locale for formatting numbers."), + // AllowedValues: to.Ptr("[A-Za-z0-9._ -]+"), + // DataType: to.Ptr(armpostgresql.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), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("en_US.utf-8"), + // }, + // }, + // { + // Name: to.Ptr("lc_time"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/lc_time"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Sets the locale for formatting date and time values."), + // AllowedValues: to.Ptr(".*"), + // DataType: to.Ptr(armpostgresql.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), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("user-override"), + // Value: to.Ptr("en_US.utf8"), + // }, + // }, + // { + // Name: to.Ptr("listen_addresses"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/listen_addresses"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Sets the host name or IP address(es) to listen to."), + // AllowedValues: to.Ptr(".*"), + // DataType: to.Ptr(armpostgresql.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), + // IsDynamicConfig: to.Ptr(false), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("user-override"), + // Value: to.Ptr("*"), + // }, + // }, + // { + // Name: to.Ptr("lo_compat_privileges"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/lo_compat_privileges"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Enables backward compatibility mode for privilege checks on large objects."), + // AllowedValues: to.Ptr("on,off"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeBoolean), + // DefaultValue: to.Ptr("off"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-compatible.html#GUC-LO-COMPAT-PRIVILEGES"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("off"), + // }, + // }, + // { + // Name: to.Ptr("local_preload_libraries"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/local_preload_libraries"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Lists unprivileged shared libraries to preload into each backend."), + // AllowedValues: to.Ptr(".*"), + // DataType: to.Ptr(armpostgresql.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), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("system-default"), + // Value: to.Ptr(""), + // }, + // }, + // { + // Name: to.Ptr("lock_timeout"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/lock_timeout"), + // Properties: &armpostgresql.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"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeInteger), + // DefaultValue: to.Ptr("0"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-client.html#GUC-LOCK-TIMEOUT"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Unit: to.Ptr("milliseconds"), + // Value: to.Ptr("0"), + // }, + // }, + // { + // Name: to.Ptr("log_autovacuum_min_duration"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/log_autovacuum_min_duration"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Sets the minimum execution time above which autovacuum actions will be logged."), + // AllowedValues: to.Ptr("-1-2147483647"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeInteger), + // DefaultValue: to.Ptr("-1"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-autovacuum.html#id-1.6.6.13.4.2.1.3"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Unit: to.Ptr("milliseconds"), + // Value: to.Ptr("-1"), + // }, + // }, + // { + // Name: to.Ptr("log_checkpoints"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/log_checkpoints"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Logs each checkpoint."), + // AllowedValues: to.Ptr("on,off"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeBoolean), + // DefaultValue: to.Ptr("on"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-logging.html#GUC-LOG-CHECKPOINTS"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("on"), + // }, + // }, + // { + // Name: to.Ptr("log_connections"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/log_connections"), + // Properties: &armpostgresql.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"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeBoolean), + // DefaultValue: to.Ptr("on"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-logging.html#GUC-LOG-CONNECTIONS"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("on"), + // }, + // }, + // { + // Name: to.Ptr("log_destination"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/log_destination"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Sets the destination for server log output."), + // AllowedValues: to.Ptr("stderr,csvlog"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeEnumeration), + // DefaultValue: to.Ptr("stderr"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-logging.html#GUC-LOG-DESTINATION"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("stderr"), + // }, + // }, + // { + // Name: to.Ptr("log_directory"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/log_directory"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Sets the destination directory for log files."), + // AllowedValues: to.Ptr(".*"), + // DataType: to.Ptr(armpostgresql.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), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("log"), + // }, + // }, + // { + // Name: to.Ptr("log_disconnections"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/log_disconnections"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Logs end of a session, including duration."), + // AllowedValues: to.Ptr("on,off"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeBoolean), + // DefaultValue: to.Ptr("on"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-logging.html#GUC-LOG-DISCONNECTIONS"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("on"), + // }, + // }, + // { + // Name: to.Ptr("log_duration"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/log_duration"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Logs the duration of each completed SQL statement."), + // AllowedValues: to.Ptr("on,off"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeBoolean), + // DefaultValue: to.Ptr("off"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-logging.html#GUC-LOG-DURATION"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("off"), + // }, + // }, + // { + // Name: to.Ptr("log_error_verbosity"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/log_error_verbosity"), + // Properties: &armpostgresql.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"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeEnumeration), + // DefaultValue: to.Ptr("default"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-logging.html#GUC-LOG-ERROR-VERBOSITY"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("default"), + // }, + // }, + // { + // Name: to.Ptr("log_executor_stats"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/log_executor_stats"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Writes executor performance statistics to the server log."), + // AllowedValues: to.Ptr("on,off"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeBoolean), + // DefaultValue: to.Ptr("off"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-statistics.html#id-1.6.6.12.3.2.1.4.3"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("off"), + // }, + // }, + // { + // Name: to.Ptr("log_file_mode"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/log_file_mode"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Sets the file permissions for log files."), + // AllowedValues: to.Ptr("0-511"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeInteger), + // DefaultValue: to.Ptr("384"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-logging.html#GUC-LOG-FILE-MODE"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("user-override"), + // Value: to.Ptr("0600"), + // }, + // }, + // { + // Name: to.Ptr("log_filename"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/log_filename"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Sets the file name pattern for log files."), + // AllowedValues: to.Ptr(".*"), + // DataType: to.Ptr(armpostgresql.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), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("postgresql-%Y-%m-%d_%H%M%S.log"), + // }, + // }, + // { + // Name: to.Ptr("log_hostname"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/log_hostname"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Logs the host name in the connection logs."), + // AllowedValues: to.Ptr("on,off"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeBoolean), + // DefaultValue: to.Ptr("off"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-logging.html#GUC-LOG-HOSTNAME"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("off"), + // }, + // }, + // { + // Name: to.Ptr("log_line_prefix"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/log_line_prefix"), + // Properties: &armpostgresql.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(armpostgresql.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), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("%t-%c-"), + // }, + // }, + // { + // Name: to.Ptr("log_lock_waits"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/log_lock_waits"), + // Properties: &armpostgresql.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"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeBoolean), + // DefaultValue: to.Ptr("off"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-logging.html#GUC-LOG-LOCK-WAITS"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("off"), + // }, + // }, + // { + // Name: to.Ptr("log_min_duration_sample"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/log_min_duration_sample"), + // Properties: &armpostgresql.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"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeInteger), + // DefaultValue: to.Ptr("-1"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-logging.html#GUC-LOG-MIN-DURATION-SAMPLE"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Unit: to.Ptr("milliseconds"), + // Value: to.Ptr("-1"), + // }, + // }, + // { + // Name: to.Ptr("log_min_duration_statement"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/log_min_duration_statement"), + // Properties: &armpostgresql.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"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeInteger), + // DefaultValue: to.Ptr("-1"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-logging.html#GUC-LOG-MIN-DURATION-STATEMENT"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Unit: to.Ptr("milliseconds"), + // Value: to.Ptr("-1"), + // }, + // }, + // { + // Name: to.Ptr("log_min_error_statement"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/log_min_error_statement"), + // Properties: &armpostgresql.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"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeEnumeration), + // DefaultValue: to.Ptr("error"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-logging.html#GUC-LOG-MIN-ERROR-STATEMENT"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("error"), + // }, + // }, + // { + // Name: to.Ptr("log_min_messages"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/log_min_messages"), + // Properties: &armpostgresql.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"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeEnumeration), + // DefaultValue: to.Ptr("warning"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-logging.html#GUC-LOG-MIN-MESSAGES"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("warning"), + // }, + // }, + // { + // Name: to.Ptr("log_parameter_max_length"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/log_parameter_max_length"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("When logging statements, limit logged parameter values to first N bytes."), + // AllowedValues: to.Ptr("-1-1073741823"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeInteger), + // DefaultValue: to.Ptr("-1"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-logging.html#GUC-LOG-PARAMETER-MAX-LENGTH"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Unit: to.Ptr("bytes"), + // Value: to.Ptr("-1"), + // }, + // }, + // { + // 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/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/log_parameter_max_length_on_error"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("When reporting an error, limit logged parameter values to first N bytes."), + // AllowedValues: to.Ptr("-1-1073741823"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeInteger), + // DefaultValue: to.Ptr("0"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-logging.html#GUC-LOG-PARAMETER-MAX-LENGTH-ON-ERROR"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Unit: to.Ptr("bytes"), + // Value: to.Ptr("0"), + // }, + // }, + // { + // Name: to.Ptr("log_parser_stats"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/log_parser_stats"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Writes parser performance statistics to the server log."), + // AllowedValues: to.Ptr("on,off"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeBoolean), + // DefaultValue: to.Ptr("off"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-statistics.html#id-1.6.6.12.3.2.1.4.3"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("off"), + // }, + // }, + // { + // Name: to.Ptr("log_planner_stats"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/log_planner_stats"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Writes planner performance statistics to the server log."), + // AllowedValues: to.Ptr("on,off"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeBoolean), + // DefaultValue: to.Ptr("off"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-statistics.html#id-1.6.6.12.3.2.1.4.3"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("off"), + // }, + // }, + // { + // Name: to.Ptr("log_replication_commands"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/log_replication_commands"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Logs each replication command."), + // AllowedValues: to.Ptr("on,off"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeBoolean), + // DefaultValue: to.Ptr("on"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-logging.html#GUC-LOG-REPLICATION-COMMANDS"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("on"), + // }, + // }, + // { + // Name: to.Ptr("log_rotation_age"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/log_rotation_age"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Automatic log file rotation will occur after N minutes."), + // AllowedValues: to.Ptr("0-35791394"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeInteger), + // DefaultValue: to.Ptr("1440"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-logging.html#GUC-LOG-ROTATION-AGE"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("user-override"), + // Unit: to.Ptr("minutes"), + // Value: to.Ptr("60"), + // }, + // }, + // { + // Name: to.Ptr("log_rotation_size"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/log_rotation_size"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Automatic log file rotation will occur after N kilobytes."), + // AllowedValues: to.Ptr("0-2097151"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeInteger), + // DefaultValue: to.Ptr("10240"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-logging.html#GUC-LOG-ROTATION-SIZE"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("user-override"), + // Unit: to.Ptr("KB"), + // Value: to.Ptr("102400"), + // }, + // }, + // { + // Name: to.Ptr("log_statement"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/log_statement"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Sets the type of statements logged."), + // AllowedValues: to.Ptr("none,ddl,mod,all"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeEnumeration), + // DefaultValue: to.Ptr("none"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-logging.html#GUC-LOG-STATEMENT"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("none"), + // }, + // }, + // { + // Name: to.Ptr("log_statement_sample_rate"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/log_statement_sample_rate"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Fraction of statements exceeding log_min_duration_sample to be logged."), + // AllowedValues: to.Ptr("0-1"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeNumeric), + // DefaultValue: to.Ptr("1"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-logging.html#GUC-LOG-STATEMENT-SAMPLE-RATE"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("1"), + // }, + // }, + // { + // Name: to.Ptr("log_statement_stats"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/log_statement_stats"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("For each query, writes cumulative performance statistics to the server log."), + // AllowedValues: to.Ptr("on,off"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeBoolean), + // DefaultValue: to.Ptr("off"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-statistics.html#id-1.6.6.12.3.2.1.4.3"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("off"), + // }, + // }, + // { + // Name: to.Ptr("log_temp_files"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/log_temp_files"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Logs the use of temporary files larger than this number of kilobytes."), + // AllowedValues: to.Ptr("-1-2147483647"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeInteger), + // DefaultValue: to.Ptr("-1"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-logging.html#GUC-LOG-TEMP-FILES"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Unit: to.Ptr("KB"), + // Value: to.Ptr("-1"), + // }, + // }, + // { + // Name: to.Ptr("log_timezone"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/log_timezone"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Sets the time zone to use in log messages."), + // AllowedValues: to.Ptr(".*"), + // DataType: to.Ptr(armpostgresql.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), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("user-override"), + // Value: to.Ptr("UTC"), + // }, + // }, + // { + // Name: to.Ptr("log_transaction_sample_rate"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/log_transaction_sample_rate"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Set the fraction of transactions to log for new transactions."), + // AllowedValues: to.Ptr("0-1"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeNumeric), + // DefaultValue: to.Ptr("0"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-logging.html#GUC-LOG-TRANSACTION-SAMPLE-RATE"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("0"), + // }, + // }, + // { + // Name: to.Ptr("log_truncate_on_rotation"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/log_truncate_on_rotation"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Truncate existing log files of same name during log rotation."), + // AllowedValues: to.Ptr("on,off"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeBoolean), + // DefaultValue: to.Ptr("off"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-logging.html#GUC-LOG-TRUNCATE-ON-ROTATION"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("off"), + // }, + // }, + // { + // Name: to.Ptr("logfiles.download_enable"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/logfiles.download_enable"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Enables or disables server logs functionality."), + // AllowedValues: to.Ptr("on,off"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeBoolean), + // DefaultValue: to.Ptr("off"), + // DocumentationLink: to.Ptr("https://go.microsoft.com/fwlink/?linkid=2274270"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("off"), + // }, + // }, + // { + // Name: to.Ptr("logfiles.retention_days"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/logfiles.retention_days"), + // Properties: &armpostgresql.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"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeInteger), + // DefaultValue: to.Ptr("3"), + // DocumentationLink: to.Ptr("https://go.microsoft.com/fwlink/?linkid=2274270"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("3"), + // }, + // }, + // { + // Name: to.Ptr("logging_collector"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/logging_collector"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Start a subprocess to capture stderr output and/or csvlogs into log files."), + // AllowedValues: to.Ptr("on,off"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeBoolean), + // DefaultValue: to.Ptr("off"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-logging.html#GUC-LOGGING-COLLECTOR"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(false), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("off"), + // }, + // }, + // { + // Name: to.Ptr("logical_decoding_work_mem"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/logical_decoding_work_mem"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Sets the maximum memory to be used for logical decoding."), + // AllowedValues: to.Ptr("64-2147483647"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeInteger), + // DefaultValue: to.Ptr("65536"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-resource.html#GUC-LOGICAL-DECODING-WORK-MEM"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Unit: to.Ptr("KB"), + // Value: to.Ptr("65536"), + // }, + // }, + // { + // Name: to.Ptr("maintenance_io_concurrency"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/maintenance_io_concurrency"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("A variant of effective_io_concurrency that is used for maintenance work."), + // AllowedValues: to.Ptr("0-1000"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeInteger), + // DefaultValue: to.Ptr("10"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-resource.html#GUC-MAINTENANCE-IO-CONCURRENCY"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("10"), + // }, + // }, + // { + // Name: to.Ptr("maintenance_work_mem"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/maintenance_work_mem"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Sets the maximum memory to be used for maintenance operations such as VACUUM, Create Index."), + // AllowedValues: to.Ptr("1024-2097151"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeInteger), + // DefaultValue: to.Ptr("274432"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-resource.html#GUC-MAINTENANCE-WORK-MEM"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Unit: to.Ptr("KB"), + // Value: to.Ptr("274432"), + // }, + // }, + // { + // Name: to.Ptr("max_connections"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/max_connections"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Sets the maximum number of concurrent connections to the database server."), + // AllowedValues: to.Ptr("25-5000"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeInteger), + // DefaultValue: to.Ptr("1718"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-connection.html#GUC-MAX-CONNECTIONS"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(false), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("1718"), + // }, + // }, + // { + // Name: to.Ptr("max_files_per_process"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/max_files_per_process"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Sets the maximum number of simultaneously open files for each server process."), + // AllowedValues: to.Ptr("64-2147483647"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeInteger), + // DefaultValue: to.Ptr("1000"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-resource.html#GUC-MAX-FILES-PER-PROCESS"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(false), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("1000"), + // }, + // }, + // { + // Name: to.Ptr("max_function_args"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/max_function_args"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Shows the maximum number of function arguments."), + // AllowedValues: to.Ptr("100-100"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeInteger), + // DefaultValue: to.Ptr("100"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-preset.html#GUC-MAX-FUNCTION-ARGS"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("100"), + // }, + // }, + // { + // Name: to.Ptr("max_identifier_length"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/max_identifier_length"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Shows the maximum identifier length."), + // AllowedValues: to.Ptr("63-63"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeInteger), + // DefaultValue: to.Ptr("63"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-preset.html#GUC-MAX-IDENTIFIER-LENGTH"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("63"), + // }, + // }, + // { + // Name: to.Ptr("max_index_keys"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/max_index_keys"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Shows the maximum number of index keys."), + // AllowedValues: to.Ptr("32-32"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeInteger), + // DefaultValue: to.Ptr("32"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-preset.html#GUC-MAX-INDEX-KEYS"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("32"), + // }, + // }, + // { + // Name: to.Ptr("max_locks_per_transaction"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/max_locks_per_transaction"), + // Properties: &armpostgresql.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"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeInteger), + // DefaultValue: to.Ptr("64"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-locks.html#GUC-MAX-LOCKS-PER-TRANSACTION"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(false), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("64"), + // }, + // }, + // { + // Name: to.Ptr("max_logical_replication_workers"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/max_logical_replication_workers"), + // Properties: &armpostgresql.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"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeInteger), + // DefaultValue: to.Ptr("4"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-replication.html#GUC-MAX-LOGICAL-REPLICATION-WORKERS"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(false), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("4"), + // }, + // }, + // { + // Name: to.Ptr("max_parallel_maintenance_workers"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/max_parallel_maintenance_workers"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Sets the maximum number of parallel processes per maintenance operation."), + // AllowedValues: to.Ptr("0-64"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeInteger), + // DefaultValue: to.Ptr("2"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-resource.html#GUC-MAX-PARALLEL-WORKERS-MAINTENANCE"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("2"), + // }, + // }, + // { + // Name: to.Ptr("max_parallel_workers"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/max_parallel_workers"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Sets the maximum number of workers than can be supported for parallel operations."), + // AllowedValues: to.Ptr("0-1024"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeInteger), + // DefaultValue: to.Ptr("8"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-resource.html#GUC-MAX-PARALLEL-WORKERS"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("8"), + // }, + // }, + // { + // 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/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/max_parallel_workers_per_gather"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Sets the maximum number of parallel processes per executor node."), + // AllowedValues: to.Ptr("0-1024"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeInteger), + // DefaultValue: to.Ptr("2"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-resource.html#GUC-MAX-PARALLEL-WORKERS-PER-GATHER"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("2"), + // }, + // }, + // { + // 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/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/max_pred_locks_per_page"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Sets the maximum number of predicate-locked tuples per page."), + // AllowedValues: to.Ptr("0-2147483647"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeInteger), + // DefaultValue: to.Ptr("2"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-locks.html#GUC-MAX-PRED-LOCKS-PER-PAGE"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("2"), + // }, + // }, + // { + // 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/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/max_pred_locks_per_relation"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Sets the maximum number of predicate-locked pages and tuples per relation."), + // AllowedValues: to.Ptr("-2147483648-2147483647"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeInteger), + // DefaultValue: to.Ptr("-2"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-locks.html#GUC-MAX-PRED-LOCKS-PER-RELATION"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("-2"), + // }, + // }, + // { + // 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/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/max_pred_locks_per_transaction"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Sets the maximum number of predicate locks per transaction."), + // AllowedValues: to.Ptr("10-2147483647"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeInteger), + // DefaultValue: to.Ptr("64"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-locks.html#GUC-MAX-PRED-LOCKS-PER-TRANSACTION"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(false), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("64"), + // }, + // }, + // { + // Name: to.Ptr("max_prepared_transactions"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/max_prepared_transactions"), + // Properties: &armpostgresql.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"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeInteger), + // DefaultValue: to.Ptr("0"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-resource.html#GUC-MAX-PREPARED-TRANSACTIONS"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(false), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("0"), + // }, + // }, + // { + // Name: to.Ptr("max_replication_slots"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/max_replication_slots"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Specifies the maximum number of replication slots that the server can support."), + // AllowedValues: to.Ptr("2-262143"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeInteger), + // DefaultValue: to.Ptr("10"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-replication.html#GUC-MAX-REPLICATION-SLOTS"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(false), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("10"), + // }, + // }, + // { + // 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/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/max_slot_wal_keep_size"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Sets the maximum WAL size that can be reserved by replication slots."), + // AllowedValues: to.Ptr("-1-2147483647"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeInteger), + // DefaultValue: to.Ptr("-1"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-replication.html#GUC-MAX-SLOT-WAL-KEEP-SIZE"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("system-default"), + // Unit: to.Ptr("megabytes"), + // Value: to.Ptr("-1"), + // }, + // }, + // { + // Name: to.Ptr("max_stack_depth"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/max_stack_depth"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Sets the maximum stack depth, in kilobytes."), + // AllowedValues: to.Ptr("100-2147483647"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeInteger), + // DefaultValue: to.Ptr("100"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-resource.html#GUC-MAX-STACK-DEPTH"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("user-override"), + // Unit: to.Ptr("KB"), + // Value: to.Ptr("2048"), + // }, + // }, + // { + // Name: to.Ptr("max_standby_archive_delay"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/max_standby_archive_delay"), + // Properties: &armpostgresql.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"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeInteger), + // DefaultValue: to.Ptr("30000"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-replication.html#GUC-MAX-STANDBY-ARCHIVE-DELAY"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Unit: to.Ptr("milliseconds"), + // Value: to.Ptr("30000"), + // }, + // }, + // { + // Name: to.Ptr("max_standby_streaming_delay"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/max_standby_streaming_delay"), + // Properties: &armpostgresql.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"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeInteger), + // DefaultValue: to.Ptr("30000"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-replication.html#GUC-MAX-STANDBY-STREAMING-DELAY"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Unit: to.Ptr("milliseconds"), + // Value: to.Ptr("30000"), + // }, + // }, + // { + // 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/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/max_sync_workers_per_subscription"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Maximum number of table synchronization workers per subscription."), + // AllowedValues: to.Ptr("0-262143"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeInteger), + // DefaultValue: to.Ptr("2"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-replication.html#GUC-MAX-SYNC-WORKERS-PER-SUBSCRIPTION"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("2"), + // }, + // }, + // { + // Name: to.Ptr("max_wal_senders"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/max_wal_senders"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Sets the maximum number of simultaneously running WAL sender processes."), + // AllowedValues: to.Ptr("5-100"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeInteger), + // DefaultValue: to.Ptr("10"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-replication.html#GUC-MAX-WAL-SENDERS"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(false), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("10"), + // }, + // }, + // { + // Name: to.Ptr("max_wal_size"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/max_wal_size"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Maximum size to let the WAL grow before triggering automatic checkpoint."), + // AllowedValues: to.Ptr("32-65536"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeInteger), + // DefaultValue: to.Ptr("2048"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-wal.html#GUC-MAX-WAL-SIZE"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Unit: to.Ptr("megabytes"), + // Value: to.Ptr("2048"), + // }, + // }, + // { + // Name: to.Ptr("max_worker_processes"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/max_worker_processes"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Sets the maximum number of background processes that the system can support."), + // AllowedValues: to.Ptr("0-262143"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeInteger), + // DefaultValue: to.Ptr("8"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-resource.html#GUC-MAX-WORKER-PROCESSES"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(false), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("8"), + // }, + // }, + // { + // Name: to.Ptr("metrics.autovacuum_diagnostics"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/metrics.autovacuum_diagnostics"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Enables metrics collection for all table statistics within a database"), + // AllowedValues: to.Ptr("on,off"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeBoolean), + // DefaultValue: to.Ptr("off"), + // DocumentationLink: to.Ptr("https://go.microsoft.com/fwlink/?linkid=2274151"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("off"), + // }, + // }, + // { + // Name: to.Ptr("metrics.collector_database_activity"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/metrics.collector_database_activity"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Enables metrics collection for database and activity statistics"), + // AllowedValues: to.Ptr("on,off"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeBoolean), + // DefaultValue: to.Ptr("off"), + // DocumentationLink: to.Ptr("https://go.microsoft.com/fwlink/?linkid=2274151"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("off"), + // }, + // }, + // { + // Name: to.Ptr("metrics.pgbouncer_diagnostics"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/metrics.pgbouncer_diagnostics"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Enables metrics collection for PgBouncer."), + // AllowedValues: to.Ptr("on,off"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeBoolean), + // DefaultValue: to.Ptr("off"), + // DocumentationLink: to.Ptr("https://go.microsoft.com/fwlink/?linkid=2274151"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("off"), + // }, + // }, + // { + // 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/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/min_parallel_index_scan_size"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Sets the minimum amount of index data for a parallel scan."), + // AllowedValues: to.Ptr("0-715827882"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeInteger), + // DefaultValue: to.Ptr("64"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-query.html#GUC-MIN-PARALLEL-INDEX-SCAN-SIZE"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Unit: to.Ptr("8KB"), + // Value: to.Ptr("64"), + // }, + // }, + // { + // 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/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/min_parallel_table_scan_size"), + // Properties: &armpostgresql.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"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeInteger), + // DefaultValue: to.Ptr("1024"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-query.html#GUC-MIN-PARALLEL-TABLE-SCAN-SIZE"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Unit: to.Ptr("8KB"), + // Value: to.Ptr("1024"), + // }, + // }, + // { + // Name: to.Ptr("min_wal_size"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/min_wal_size"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Sets the minimum size to shrink the WAL to."), + // AllowedValues: to.Ptr("32-2097151"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeInteger), + // DefaultValue: to.Ptr("80"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-wal.html#GUC-MIN-WAL-SIZE"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Unit: to.Ptr("megabytes"), + // Value: to.Ptr("80"), + // }, + // }, + // { + // Name: to.Ptr("parallel_leader_participation"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/parallel_leader_participation"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Controls whether Gather and Gather Merge also run subplans."), + // AllowedValues: to.Ptr("on,off"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeBoolean), + // DefaultValue: to.Ptr("on"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("on"), + // }, + // }, + // { + // Name: to.Ptr("parallel_setup_cost"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/parallel_setup_cost"), + // Properties: &armpostgresql.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"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeNumeric), + // DefaultValue: to.Ptr("1000"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-query.html#GUC-PARALLEL-SETUP-COST"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("1000"), + // }, + // }, + // { + // Name: to.Ptr("parallel_tuple_cost"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/parallel_tuple_cost"), + // Properties: &armpostgresql.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"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeNumeric), + // DefaultValue: to.Ptr("0.1"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-query.html#GUC-PARALLEL-TUPLE-COST"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("0.1"), + // }, + // }, + // { + // Name: to.Ptr("password_encryption"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/password_encryption"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Determines the algorithm to use to encrypt the password."), + // AllowedValues: to.Ptr("md5,scram-sha-256"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeEnumeration), + // DefaultValue: to.Ptr("md5"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-connection.html#GUC-PASSWORD-ENCRYPTION"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("md5"), + // }, + // }, + // { + // Name: to.Ptr("pg_partman_bgw.analyze"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/pg_partman_bgw.analyze"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Same purpose as the p_analyze argument to run_maintenance()."), + // AllowedValues: to.Ptr("on,off"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeBoolean), + // DefaultValue: to.Ptr("off"), + // DocumentationLink: to.Ptr("https://github.com/pgpartman/pg_partman"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("off"), + // }, + // }, + // { + // Name: to.Ptr("pg_partman_bgw.dbname"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/pg_partman_bgw.dbname"), + // Properties: &armpostgresql.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(armpostgresql.ConfigurationDataTypeString), + // DefaultValue: to.Ptr(""), + // DocumentationLink: to.Ptr("https://github.com/pgpartman/pg_partman"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr(""), + // }, + // }, + // { + // Name: to.Ptr("pg_partman_bgw.interval"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/pg_partman_bgw.interval"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Number of seconds between calls to run_maintenance()."), + // AllowedValues: to.Ptr("1-315360000"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeInteger), + // DefaultValue: to.Ptr("3600"), + // DocumentationLink: to.Ptr("https://github.com/pgpartman/pg_partman"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Unit: to.Ptr("seconds"), + // Value: to.Ptr("3600"), + // }, + // }, + // { + // Name: to.Ptr("pg_partman_bgw.jobmon"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/pg_partman_bgw.jobmon"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Same purpose as the p_jobmon argument to run_maintenance()."), + // AllowedValues: to.Ptr("on,off"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeBoolean), + // DefaultValue: to.Ptr("on"), + // DocumentationLink: to.Ptr("https://github.com/pgpartman/pg_partman"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("on"), + // }, + // }, + // { + // Name: to.Ptr("pg_partman_bgw.role"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/pg_partman_bgw.role"), + // Properties: &armpostgresql.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(armpostgresql.ConfigurationDataTypeString), + // DefaultValue: to.Ptr(""), + // DocumentationLink: to.Ptr("https://github.com/pgpartman/pg_partman"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr(""), + // }, + // }, + // { + // 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/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/pg_qs.interval_length_minutes"), + // Properties: &armpostgresql.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"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeInteger), + // DefaultValue: to.Ptr("15"), + // DocumentationLink: to.Ptr("https://go.microsoft.com/fwlink/?linkid=2274607"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(false), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Unit: to.Ptr("minutes"), + // Value: to.Ptr("15"), + // }, + // }, + // { + // 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/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/pg_qs.is_enabled_fs"), + // Properties: &armpostgresql.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"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeBoolean), + // DefaultValue: to.Ptr("on"), + // DocumentationLink: to.Ptr("https://go.microsoft.com/fwlink/?linkid=2274607"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("on"), + // }, + // }, + // { + // 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/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/pg_qs.max_plan_size"), + // Properties: &armpostgresql.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"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeInteger), + // DefaultValue: to.Ptr("7500"), + // DocumentationLink: to.Ptr("https://go.microsoft.com/fwlink/?linkid=2274607"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Unit: to.Ptr("bytes"), + // Value: to.Ptr("7500"), + // }, + // }, + // { + // 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/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/pg_qs.max_query_text_length"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Sets the maximum query text length that will be saved; longer queries will be truncated."), + // AllowedValues: to.Ptr("100-10000"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeInteger), + // DefaultValue: to.Ptr("6000"), + // DocumentationLink: to.Ptr("https://go.microsoft.com/fwlink/?linkid=2274607"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Unit: to.Ptr("bytes"), + // Value: to.Ptr("6000"), + // }, + // }, + // { + // 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/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/pg_qs.parameters_capture_mode"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Whether and when to capture query positional parameters."), + // AllowedValues: to.Ptr("capture_parameterless_only,capture_first_sample"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeEnumeration), + // DefaultValue: to.Ptr("capture_parameterless_only"), + // DocumentationLink: to.Ptr("https://go.microsoft.com/fwlink/?linkid=2274607"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("capture_parameterless_only"), + // }, + // }, + // { + // 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/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/pg_qs.query_capture_mode"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Sets query capture mode for query store. None disables any capturing."), + // AllowedValues: to.Ptr("top,all,none"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeEnumeration), + // DefaultValue: to.Ptr("none"), + // DocumentationLink: to.Ptr("https://go.microsoft.com/fwlink/?linkid=2274607"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("none"), + // }, + // }, + // { + // 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/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/pg_qs.retention_period_in_days"), + // Properties: &armpostgresql.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"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeInteger), + // DefaultValue: to.Ptr("7"), + // DocumentationLink: to.Ptr("https://go.microsoft.com/fwlink/?linkid=2274607"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("7"), + // }, + // }, + // { + // 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/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/pg_qs.store_query_plans"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Turns saving query plans on or off for pg_qs "), + // AllowedValues: to.Ptr("on,off"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeBoolean), + // DefaultValue: to.Ptr("off"), + // DocumentationLink: to.Ptr("https://go.microsoft.com/fwlink/?linkid=2274607"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("off"), + // }, + // }, + // { + // Name: to.Ptr("pg_qs.track_utility"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/pg_qs.track_utility"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Selects whether utility commands are tracked by pg_qs."), + // AllowedValues: to.Ptr("on,off"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeBoolean), + // DefaultValue: to.Ptr("on"), + // DocumentationLink: to.Ptr("https://go.microsoft.com/fwlink/?linkid=2274607"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("on"), + // }, + // }, + // { + // Name: to.Ptr("pg_stat_statements.max"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/pg_stat_statements.max"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Sets the maximum number of statements tracked by pg_stat_statements."), + // AllowedValues: to.Ptr("100-2147483647"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeInteger), + // DefaultValue: to.Ptr("5000"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/pgstatstatements.html"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(false), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("5000"), + // }, + // }, + // { + // Name: to.Ptr("pg_stat_statements.save"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/pg_stat_statements.save"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Save pg_stat_statements statistics across server shutdowns."), + // AllowedValues: to.Ptr("on,off"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeBoolean), + // DefaultValue: to.Ptr("on"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/pgstatstatements.html"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("on"), + // }, + // }, + // { + // Name: to.Ptr("pg_stat_statements.track"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/pg_stat_statements.track"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Controls which statements are counted by pg_stat_statements."), + // AllowedValues: to.Ptr("top,all,none"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeEnumeration), + // DefaultValue: to.Ptr("none"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/pgstatstatements.html"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("none"), + // }, + // }, + // { + // 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/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/pg_stat_statements.track_utility"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Selects whether utility commands are tracked by pg_stat_statements."), + // AllowedValues: to.Ptr("on,off"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeBoolean), + // DefaultValue: to.Ptr("on"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/pgstatstatements.html"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("on"), + // }, + // }, + // { + // Name: to.Ptr("pgaudit.log"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/pgaudit.log"), + // Properties: &armpostgresql.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(armpostgresql.ConfigurationDataTypeSet), + // DefaultValue: to.Ptr("none"), + // DocumentationLink: to.Ptr("https://github.com/pgaudit/pgaudit/blob/master/README.md"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("none"), + // }, + // }, + // { + // Name: to.Ptr("pgaudit.log_catalog"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/pgaudit.log_catalog"), + // Properties: &armpostgresql.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"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeBoolean), + // DefaultValue: to.Ptr("on"), + // DocumentationLink: to.Ptr("https://github.com/pgaudit/pgaudit/blob/master/README.md"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("on"), + // }, + // }, + // { + // Name: to.Ptr("pgaudit.log_client"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/pgaudit.log_client"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Specifies whether audit messages should be visible to client."), + // AllowedValues: to.Ptr("on,off"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeBoolean), + // DefaultValue: to.Ptr("off"), + // DocumentationLink: to.Ptr("https://github.com/pgaudit/pgaudit/blob/master/README.md"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("off"), + // }, + // }, + // { + // Name: to.Ptr("pgaudit.log_level"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/pgaudit.log_level"), + // Properties: &armpostgresql.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"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeEnumeration), + // DefaultValue: to.Ptr("log"), + // DocumentationLink: to.Ptr("https://github.com/pgaudit/pgaudit/blob/master/README.md"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("log"), + // }, + // }, + // { + // Name: to.Ptr("pgaudit.log_parameter"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/pgaudit.log_parameter"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Specifies that audit logging should include the parameters that were passed with the statement."), + // AllowedValues: to.Ptr("on,off"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeBoolean), + // DefaultValue: to.Ptr("off"), + // DocumentationLink: to.Ptr("https://github.com/pgaudit/pgaudit/blob/master/README.md"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("off"), + // }, + // }, + // { + // Name: to.Ptr("pgaudit.log_relation"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/pgaudit.log_relation"), + // Properties: &armpostgresql.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"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeBoolean), + // DefaultValue: to.Ptr("off"), + // DocumentationLink: to.Ptr("https://github.com/pgaudit/pgaudit/blob/master/README.md"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("off"), + // }, + // }, + // { + // Name: to.Ptr("pgaudit.log_statement_once"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/pgaudit.log_statement_once"), + // Properties: &armpostgresql.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"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeBoolean), + // DefaultValue: to.Ptr("off"), + // DocumentationLink: to.Ptr("https://github.com/pgaudit/pgaudit/blob/master/README.md"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("off"), + // }, + // }, + // { + // Name: to.Ptr("pgaudit.role"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/pgaudit.role"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Specifies the master role to use for object audit logging."), + // AllowedValues: to.Ptr("[A-Za-z\\._]*"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeString), + // DefaultValue: to.Ptr(""), + // DocumentationLink: to.Ptr("https://github.com/pgaudit/pgaudit/blob/master/README.md"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr(""), + // }, + // }, + // { + // Name: to.Ptr("pgbouncer.enabled"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/pgbouncer.enabled"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Denotes if pgBouncer service is enabled."), + // AllowedValues: to.Ptr("true, false"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeBoolean), + // DefaultValue: to.Ptr("false"), + // DocumentationLink: to.Ptr("https://www.pgbouncer.org/config.html"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("false"), + // }, + // }, + // { + // Name: to.Ptr("pglogical.batch_inserts"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/pglogical.batch_inserts"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Tells PGLogical to use batch insert mechanism if possible."), + // AllowedValues: to.Ptr("on,off"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeBoolean), + // DefaultValue: to.Ptr("on"), + // DocumentationLink: to.Ptr("https://github.com/ArmMbedCloud/pglogical"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("on"), + // }, + // }, + // { + // Name: to.Ptr("pglogical.conflict_log_level"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/pglogical.conflict_log_level"), + // Properties: &armpostgresql.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"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeEnumeration), + // DefaultValue: to.Ptr("log"), + // DocumentationLink: to.Ptr("https://github.com/ArmMbedCloud/pglogical"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("log"), + // }, + // }, + // { + // Name: to.Ptr("pglogical.conflict_resolution"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/pglogical.conflict_resolution"), + // Properties: &armpostgresql.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"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeEnumeration), + // DefaultValue: to.Ptr("apply_remote"), + // DocumentationLink: to.Ptr("https://github.com/ArmMbedCloud/pglogical"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("apply_remote"), + // }, + // }, + // { + // Name: to.Ptr("pglogical.use_spi"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/pglogical.use_spi"), + // Properties: &armpostgresql.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"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeBoolean), + // DefaultValue: to.Ptr("off"), + // DocumentationLink: to.Ptr("https://github.com/ArmMbedCloud/pglogical"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("off"), + // }, + // }, + // { + // 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/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/pgms_stats.is_enabled_fs"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Internal Use Only: This parameter is used as a feature override switch."), + // AllowedValues: to.Ptr("on,off"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeBoolean), + // DefaultValue: to.Ptr("on"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("on"), + // }, + // }, + // { + // 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/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/pgms_wait_sampling.history_period"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Set the frequency, in milliseconds, at which wait events are sampled."), + // AllowedValues: to.Ptr("1-600000"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeInteger), + // DefaultValue: to.Ptr("100"), + // DocumentationLink: to.Ptr("https://go.microsoft.com/fwlink/?linkid=2274607"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Unit: to.Ptr("milliseconds"), + // Value: to.Ptr("100"), + // }, + // }, + // { + // 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/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/pgms_wait_sampling.is_enabled_fs"), + // Properties: &armpostgresql.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"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeBoolean), + // DefaultValue: to.Ptr("on"), + // DocumentationLink: to.Ptr("https://go.microsoft.com/fwlink/?linkid=2274607"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("on"), + // }, + // }, + // { + // 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/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/pgms_wait_sampling.query_capture_mode"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Selects which statements are tracked by the pgms_wait_sampling extension."), + // AllowedValues: to.Ptr("all,none"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeEnumeration), + // DefaultValue: to.Ptr("none"), + // DocumentationLink: to.Ptr("https://go.microsoft.com/fwlink/?linkid=2274607"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("none"), + // }, + // }, + // { + // Name: to.Ptr("plan_cache_mode"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/plan_cache_mode"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Controls the planner's selection of custom or generic plan."), + // AllowedValues: to.Ptr("auto,force_generic_plan,force_custom_plan"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeEnumeration), + // DefaultValue: to.Ptr("auto"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-query.html#id-1.6.6.10.5.2.9.1.3"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("auto"), + // }, + // }, + // { + // Name: to.Ptr("port"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/port"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Sets the TCP port the server listens on."), + // AllowedValues: to.Ptr("1-65535"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeInteger), + // DefaultValue: to.Ptr("5432"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-connection.html#GUC-PORT"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(false), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("5432"), + // }, + // }, + // { + // Name: to.Ptr("post_auth_delay"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/post_auth_delay"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Waits N seconds on connection startup after authentication."), + // AllowedValues: to.Ptr("0-2147"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeInteger), + // DefaultValue: to.Ptr("0"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-developer.html#GUC-POST-AUTH-DELAY"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("system-default"), + // Unit: to.Ptr("seconds"), + // Value: to.Ptr("0"), + // }, + // }, + // { + // Name: to.Ptr("postgis.gdal_enabled_drivers"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/postgis.gdal_enabled_drivers"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Controls postgis GDAL enabled driver settings."), + // AllowedValues: to.Ptr("DISABLE_ALL,ENABLE_ALL"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeEnumeration), + // DefaultValue: to.Ptr("DISABLE_ALL"), + // DocumentationLink: to.Ptr("https://postgis.net/docs/postgis_gdal_enabled_drivers.html"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("DISABLE_ALL"), + // }, + // }, + // { + // Name: to.Ptr("pre_auth_delay"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/pre_auth_delay"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Waits N seconds on connection startup before authentication."), + // AllowedValues: to.Ptr("0-60"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeInteger), + // DefaultValue: to.Ptr("0"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-developer.html#GUC-PRE-AUTH-DELAY"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("system-default"), + // Unit: to.Ptr("seconds"), + // Value: to.Ptr("0"), + // }, + // }, + // { + // Name: to.Ptr("primary_conninfo"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/primary_conninfo"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Sets the connection string to be used to connect to the sending server."), + // AllowedValues: to.Ptr(".*"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeString), + // DefaultValue: to.Ptr(""), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-replication.html#GUC-PRIMARY-CONNINFO"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("system-default"), + // Value: to.Ptr(""), + // }, + // }, + // { + // Name: to.Ptr("primary_slot_name"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/primary_slot_name"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Sets the name of the replication slot to use on the sending server."), + // AllowedValues: to.Ptr(".*"), + // DataType: to.Ptr(armpostgresql.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), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("system-default"), + // Value: to.Ptr(""), + // }, + // }, + // { + // Name: to.Ptr("promote_trigger_file"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/promote_trigger_file"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Specifies a file name whose presence ends recovery in the standby."), + // AllowedValues: to.Ptr(".*"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeString), + // DefaultValue: to.Ptr(""), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("system-default"), + // Value: to.Ptr(""), + // }, + // }, + // { + // Name: to.Ptr("quote_all_identifiers"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/quote_all_identifiers"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("When generating SQL fragments, quotes all identifiers."), + // AllowedValues: to.Ptr("on,off"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeBoolean), + // DefaultValue: to.Ptr("off"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-compatible.html#GUC-QUOTE-ALL-IDENTIFIERS"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("off"), + // }, + // }, + // { + // Name: to.Ptr("random_page_cost"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/random_page_cost"), + // Properties: &armpostgresql.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"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeNumeric), + // DefaultValue: to.Ptr("2"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-query.html#GUC-RANDOM-PAGE-COST"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("2"), + // }, + // }, + // { + // Name: to.Ptr("recovery_end_command"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/recovery_end_command"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Sets the shell command that will be executed once at the end of recovery."), + // AllowedValues: to.Ptr(".*"), + // DataType: to.Ptr(armpostgresql.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), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("system-default"), + // Value: to.Ptr(""), + // }, + // }, + // { + // Name: to.Ptr("recovery_min_apply_delay"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/recovery_min_apply_delay"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Sets the minimum delay for applying changes during recovery."), + // AllowedValues: to.Ptr("0-2147483647"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeInteger), + // DefaultValue: to.Ptr("0"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-replication.html#GUC-RECOVERY-MIN-APPLY-DELAY"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("system-default"), + // Unit: to.Ptr("milliseconds"), + // Value: to.Ptr("0"), + // }, + // }, + // { + // Name: to.Ptr("recovery_target"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/recovery_target"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Set to \"immediate\" to end recovery as soon as a consistent state is reached."), + // AllowedValues: to.Ptr(".*"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeString), + // DefaultValue: to.Ptr(""), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-wal.html#GUC-RECOVERY-TARGET"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(false), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("system-default"), + // Value: to.Ptr(""), + // }, + // }, + // { + // Name: to.Ptr("recovery_target_action"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/recovery_target_action"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Sets the action to perform upon reaching the recovery target."), + // AllowedValues: to.Ptr("pause,promote,shutdown"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeEnumeration), + // DefaultValue: to.Ptr("pause"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-wal.html#GUC-RECOVERY-TARGET-ACTION"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(false), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("pause"), + // }, + // }, + // { + // Name: to.Ptr("recovery_target_inclusive"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/recovery_target_inclusive"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Sets whether to include or exclude transaction with recovery target."), + // AllowedValues: to.Ptr("on,off"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeBoolean), + // DefaultValue: to.Ptr("on"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-wal.html#GUC-RECOVERY-TARGET-INCLUSIVE"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(false), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("on"), + // }, + // }, + // { + // Name: to.Ptr("recovery_target_lsn"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/recovery_target_lsn"), + // Properties: &armpostgresql.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(armpostgresql.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), + // IsDynamicConfig: to.Ptr(false), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("system-default"), + // Value: to.Ptr(""), + // }, + // }, + // { + // Name: to.Ptr("recovery_target_name"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/recovery_target_name"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Sets the named restore point up to which recovery will proceed."), + // AllowedValues: to.Ptr(".*"), + // DataType: to.Ptr(armpostgresql.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), + // IsDynamicConfig: to.Ptr(false), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("system-default"), + // Value: to.Ptr(""), + // }, + // }, + // { + // Name: to.Ptr("recovery_target_time"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/recovery_target_time"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Sets the time stamp up to which recovery will proceed."), + // AllowedValues: to.Ptr(".*"), + // DataType: to.Ptr(armpostgresql.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), + // IsDynamicConfig: to.Ptr(false), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("system-default"), + // Value: to.Ptr(""), + // }, + // }, + // { + // Name: to.Ptr("recovery_target_timeline"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/recovery_target_timeline"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Specifies the timeline to recover into."), + // AllowedValues: to.Ptr(".*"), + // DataType: to.Ptr(armpostgresql.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), + // IsDynamicConfig: to.Ptr(false), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("latest"), + // }, + // }, + // { + // Name: to.Ptr("recovery_target_xid"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/recovery_target_xid"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Sets the transaction ID up to which recovery will proceed."), + // AllowedValues: to.Ptr(".*"), + // DataType: to.Ptr(armpostgresql.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), + // IsDynamicConfig: to.Ptr(false), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("system-default"), + // Value: to.Ptr(""), + // }, + // }, + // { + // Name: to.Ptr("require_secure_transport"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/require_secure_transport"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Whether client connections to the server are required to use some form of secure transport."), + // AllowedValues: to.Ptr("on,off"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeBoolean), + // DefaultValue: to.Ptr("on"), + // DocumentationLink: to.Ptr("https://go.microsoft.com/fwlink/?linkid=2282200"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("on"), + // }, + // }, + // { + // Name: to.Ptr("reserved_connections"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/reserved_connections"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Sets the number of connections slots reserved for replication users and super users."), + // AllowedValues: to.Ptr("0-262143"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeInteger), + // DefaultValue: to.Ptr("5"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(false), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("5"), + // }, + // }, + // { + // Name: to.Ptr("restart_after_crash"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/restart_after_crash"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Reinitialize server after backend crash."), + // AllowedValues: to.Ptr("on,off"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeBoolean), + // DefaultValue: to.Ptr("on"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-error-handling.html#GUC-RESTART-AFTER-CRASH"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("on"), + // }, + // }, + // { + // Name: to.Ptr("restore_command"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/restore_command"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Sets the shell command that will be called to retrieve an archived WAL file."), + // AllowedValues: to.Ptr(".*"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeString), + // DefaultValue: to.Ptr(""), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("system-default"), + // Value: to.Ptr(""), + // }, + // }, + // { + // Name: to.Ptr("row_security"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/row_security"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Enables row security."), + // AllowedValues: to.Ptr("on,off"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeBoolean), + // DefaultValue: to.Ptr("on"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("on"), + // }, + // }, + // { + // Name: to.Ptr("search_path"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/search_path"), + // Properties: &armpostgresql.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(armpostgresql.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), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("\"$user\", public"), + // }, + // }, + // { + // Name: to.Ptr("segment_size"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/segment_size"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Shows the number of pages per disk file."), + // AllowedValues: to.Ptr("131072-131072"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeInteger), + // DefaultValue: to.Ptr("131072"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-preset.html#GUC-SEGMENT-SIZE"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("system-default"), + // Unit: to.Ptr("8KB"), + // Value: to.Ptr("131072"), + // }, + // }, + // { + // Name: to.Ptr("seq_page_cost"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/seq_page_cost"), + // Properties: &armpostgresql.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"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeNumeric), + // DefaultValue: to.Ptr("1"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-query.html#GUC-SEQ-PAGE-COST"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("1"), + // }, + // }, + // { + // Name: to.Ptr("server_encoding"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/server_encoding"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Sets the server (database) character set encoding."), + // AllowedValues: to.Ptr(".*"), + // DataType: to.Ptr(armpostgresql.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), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("user-override"), + // Value: to.Ptr("UTF8"), + // }, + // }, + // { + // Name: to.Ptr("server_version"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/server_version"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Shows the server version."), + // AllowedValues: to.Ptr(".*"), + // DataType: to.Ptr(armpostgresql.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), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("user-override"), + // Value: to.Ptr("13.16"), + // }, + // }, + // { + // Name: to.Ptr("server_version_num"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/server_version_num"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Shows the server version as an integer."), + // AllowedValues: to.Ptr("130011-130011"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeInteger), + // DefaultValue: to.Ptr("130011"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-preset.html#GUC-SERVER-VERSION-NUM"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("user-override"), + // Value: to.Ptr("130016"), + // }, + // }, + // { + // Name: to.Ptr("session_preload_libraries"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/session_preload_libraries"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Lists shared libraries to preload into each backend."), + // AllowedValues: to.Ptr(",login_hook"), + // DataType: to.Ptr(armpostgresql.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), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr(""), + // }, + // }, + // { + // Name: to.Ptr("session_replication_role"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/session_replication_role"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Controls firing of replication-related triggers and rules for the current session."), + // AllowedValues: to.Ptr("origin,replica,local"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeEnumeration), + // DefaultValue: to.Ptr("origin"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-client.html#GUC-SESSION-REPLICATION-ROLE"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("origin"), + // }, + // }, + // { + // Name: to.Ptr("shared_buffers"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/shared_buffers"), + // Properties: &armpostgresql.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"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeInteger), + // DefaultValue: to.Ptr("524288"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-resource.html#GUC-SHARED-BUFFERS"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(false), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Unit: to.Ptr("8KB"), + // Value: to.Ptr("524288"), + // }, + // }, + // { + // Name: to.Ptr("shared_memory_type"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/shared_memory_type"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Selects the shared memory implementation used for the main shared memory region."), + // AllowedValues: to.Ptr("sysv,mmap"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeEnumeration), + // DefaultValue: to.Ptr("mmap"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-resource.html#GUC-SHARED-MEMORY-TYPE"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(false), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("mmap"), + // }, + // }, + // { + // Name: to.Ptr("shared_preload_libraries"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/shared_preload_libraries"), + // Properties: &armpostgresql.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(armpostgresql.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), + // IsDynamicConfig: to.Ptr(false), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("pg_cron,pg_stat_statements"), + // }, + // }, + // { + // Name: to.Ptr("ssl"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/ssl"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Enables SSL connections."), + // AllowedValues: to.Ptr("on,off"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeBoolean), + // DefaultValue: to.Ptr("off"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-connection.html#GUC-SSL"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("user-override"), + // Value: to.Ptr("on"), + // }, + // }, + // { + // Name: to.Ptr("ssl_ca_file"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/ssl_ca_file"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Location of the SSL certificate authority file."), + // AllowedValues: to.Ptr(".*"), + // DataType: to.Ptr(armpostgresql.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), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("user-override"), + // Value: to.Ptr("/datadrive/certs/ca.pem"), + // }, + // }, + // { + // Name: to.Ptr("ssl_cert_file"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/ssl_cert_file"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Location of the SSL server certificate file."), + // AllowedValues: to.Ptr(".*"), + // DataType: to.Ptr(armpostgresql.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), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("user-override"), + // Value: to.Ptr("/datadrive/certs/cert.pem"), + // }, + // }, + // { + // Name: to.Ptr("ssl_ciphers"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/ssl_ciphers"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Sets the list of allowed SSL ciphers."), + // AllowedValues: to.Ptr(".*"), + // DataType: to.Ptr(armpostgresql.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), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("user-override"), + // Value: to.Ptr("ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256"), + // }, + // }, + // { + // Name: to.Ptr("ssl_crl_file"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/ssl_crl_file"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Location of the SSL certificate revocation list file."), + // AllowedValues: to.Ptr(".*"), + // DataType: to.Ptr(armpostgresql.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), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("system-default"), + // Value: to.Ptr(""), + // }, + // }, + // { + // Name: to.Ptr("ssl_dh_params_file"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/ssl_dh_params_file"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Location of the SSL DH parameters file."), + // AllowedValues: to.Ptr(".*"), + // DataType: to.Ptr(armpostgresql.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), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("system-default"), + // Value: to.Ptr(""), + // }, + // }, + // { + // Name: to.Ptr("ssl_ecdh_curve"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/ssl_ecdh_curve"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Sets the curve to use for ECDH."), + // AllowedValues: to.Ptr(".*"), + // DataType: to.Ptr(armpostgresql.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), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("prime256v1"), + // }, + // }, + // { + // Name: to.Ptr("ssl_key_file"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/ssl_key_file"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Location of the SSL server private key file."), + // AllowedValues: to.Ptr(".*"), + // DataType: to.Ptr(armpostgresql.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), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("user-override"), + // Value: to.Ptr("/datadrive/certs/key.pem"), + // }, + // }, + // { + // Name: to.Ptr("ssl_library"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/ssl_library"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Name of the SSL library."), + // AllowedValues: to.Ptr(".*"), + // DataType: to.Ptr(armpostgresql.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), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("OpenSSL"), + // }, + // }, + // { + // Name: to.Ptr("ssl_max_protocol_version"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/ssl_max_protocol_version"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Sets the maximum SSL/TLS protocol version to use."), + // AllowedValues: to.Ptr(",TLSv1.2,TLSv1.3"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeEnumeration), + // DefaultValue: to.Ptr(""), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-connection.html#GUC-SSL-MAX-PROTOCOL-VERSION"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr(""), + // }, + // }, + // { + // Name: to.Ptr("ssl_min_protocol_version"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/ssl_min_protocol_version"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Sets the minimum SSL/TLS protocol version to use."), + // AllowedValues: to.Ptr("TLSv1.2,TLSv1.3"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeEnumeration), + // DefaultValue: to.Ptr("TLSv1.2"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-connection.html#GUC-SSL-MIN-PROTOCOL-VERSION"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("TLSv1.2"), + // }, + // }, + // { + // Name: to.Ptr("ssl_passphrase_command"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/ssl_passphrase_command"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Command to obtain passphrases for SSL."), + // AllowedValues: to.Ptr(".*"), + // DataType: to.Ptr(armpostgresql.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), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("system-default"), + // Value: to.Ptr(""), + // }, + // }, + // { + // 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/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/ssl_passphrase_command_supports_reload"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Also use ssl_passphrase_command during server reload."), + // AllowedValues: to.Ptr("on,off"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeBoolean), + // DefaultValue: to.Ptr("off"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-connection.html#GUC-SSL-PASSPHRASE-COMMAND-SUPPORTS-RELOAD"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("off"), + // }, + // }, + // { + // Name: to.Ptr("ssl_prefer_server_ciphers"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/ssl_prefer_server_ciphers"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Give priority to server ciphersuite order."), + // AllowedValues: to.Ptr("on,off"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeBoolean), + // DefaultValue: to.Ptr("on"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-connection.html#GUC-SSL-PREFER-SERVER-CIPHERS"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("on"), + // }, + // }, + // { + // Name: to.Ptr("standard_conforming_strings"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/standard_conforming_strings"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Causes '...' strings to treat backslashes literally."), + // AllowedValues: to.Ptr("on,off"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeBoolean), + // DefaultValue: to.Ptr("on"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-compatible.html#GUC-STANDARD-CONFORMING-STRINGS"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("on"), + // }, + // }, + // { + // Name: to.Ptr("statement_timeout"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/statement_timeout"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Sets the maximum allowed duration (in milliseconds) of any statement. 0 turns this off."), + // AllowedValues: to.Ptr("0-2147483647"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeInteger), + // DefaultValue: to.Ptr("0"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-client.html#GUC-STATEMENT-TIMEOUT"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Unit: to.Ptr("milliseconds"), + // Value: to.Ptr("0"), + // }, + // }, + // { + // Name: to.Ptr("stats_temp_directory"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/stats_temp_directory"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Writes temporary statistics files to the specified directory."), + // AllowedValues: to.Ptr(".*"), + // DataType: to.Ptr(armpostgresql.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), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("pg_stat_tmp"), + // }, + // }, + // { + // Name: to.Ptr("superuser_reserved_connections"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/superuser_reserved_connections"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Sets the number of connection slots reserved for superusers."), + // AllowedValues: to.Ptr("0-262143"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeInteger), + // DefaultValue: to.Ptr("10"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-connection.html#GUC-SUPERUSER-RESERVED-CONNECTIONS"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(false), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("10"), + // }, + // }, + // { + // Name: to.Ptr("synchronize_seqscans"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/synchronize_seqscans"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Enables synchronized sequential scans."), + // AllowedValues: to.Ptr("on,off"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeBoolean), + // DefaultValue: to.Ptr("on"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-compatible.html#GUC-SYNCHRONIZE-SEQSCANS"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("on"), + // }, + // }, + // { + // Name: to.Ptr("synchronous_commit"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/synchronous_commit"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Sets the current transaction's synchronization level."), + // AllowedValues: to.Ptr("local,remote_write,on,off"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeEnumeration), + // DefaultValue: to.Ptr("on"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-wal.html#GUC-SYNCHRONOUS-COMMIT"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("on"), + // }, + // }, + // { + // Name: to.Ptr("synchronous_standby_names"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/synchronous_standby_names"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Number of synchronous standbys and list of names of potential synchronous ones."), + // AllowedValues: to.Ptr(".*"), + // DataType: to.Ptr(armpostgresql.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), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("system-default"), + // Value: to.Ptr(""), + // }, + // }, + // { + // Name: to.Ptr("syslog_facility"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/syslog_facility"), + // Properties: &armpostgresql.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"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeEnumeration), + // DefaultValue: to.Ptr("local0"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-logging.html#GUC-SYSLOG-FACILITY"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("local0"), + // }, + // }, + // { + // Name: to.Ptr("syslog_ident"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/syslog_ident"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Sets the program name used to identify PostgreSQL messages in syslog."), + // AllowedValues: to.Ptr(".*"), + // DataType: to.Ptr(armpostgresql.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), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("postgres"), + // }, + // }, + // { + // Name: to.Ptr("syslog_sequence_numbers"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/syslog_sequence_numbers"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Add sequence number to syslog messages to avoid duplicate suppression."), + // AllowedValues: to.Ptr("on,off"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeBoolean), + // DefaultValue: to.Ptr("on"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-logging.html#GUC-SYSLOG-SEQUENCE-NUMBERS"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("on"), + // }, + // }, + // { + // Name: to.Ptr("syslog_split_messages"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/syslog_split_messages"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Split messages sent to syslog by lines and to fit into 1024 bytes."), + // AllowedValues: to.Ptr("on,off"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeBoolean), + // DefaultValue: to.Ptr("on"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-logging.html#GUC-SYSLOG-SPLIT-MESSAGES"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("on"), + // }, + // }, + // { + // Name: to.Ptr("tcp_keepalives_count"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/tcp_keepalives_count"), + // Properties: &armpostgresql.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"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeInteger), + // DefaultValue: to.Ptr("9"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-connection.html#GUC-TCP-KEEPALIVES-COUNT"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("9"), + // }, + // }, + // { + // Name: to.Ptr("tcp_keepalives_idle"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/tcp_keepalives_idle"), + // Properties: &armpostgresql.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"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeInteger), + // DefaultValue: to.Ptr("120"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-connection.html#GUC-TCP-KEEPALIVES-IDLE"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Unit: to.Ptr("seconds"), + // Value: to.Ptr("120"), + // }, + // }, + // { + // Name: to.Ptr("tcp_keepalives_interval"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/tcp_keepalives_interval"), + // Properties: &armpostgresql.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"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeInteger), + // DefaultValue: to.Ptr("30"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-connection.html#GUC-TCP-KEEPALIVES-INTERVAL"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Unit: to.Ptr("seconds"), + // Value: to.Ptr("30"), + // }, + // }, + // { + // Name: to.Ptr("tcp_user_timeout"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/tcp_user_timeout"), + // Properties: &armpostgresql.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"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeInteger), + // DefaultValue: to.Ptr("0"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-connection.html#GUC-TCP-USER-TIMEOUT"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Unit: to.Ptr("milliseconds"), + // Value: to.Ptr("0"), + // }, + // }, + // { + // Name: to.Ptr("temp_buffers"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/temp_buffers"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Sets the maximum number of temporary buffers used by each database session."), + // AllowedValues: to.Ptr("100-1073741823"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeInteger), + // DefaultValue: to.Ptr("1024"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-resource.html#GUC-TEMP-BUFFERS"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Unit: to.Ptr("8KB"), + // Value: to.Ptr("1024"), + // }, + // }, + // { + // Name: to.Ptr("temp_file_limit"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/temp_file_limit"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Limits the total size of all temporary files used by each process."), + // AllowedValues: to.Ptr("-1-2147483647"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeInteger), + // DefaultValue: to.Ptr("-1"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-resource.html#GUC-TEMP-FILE-LIMIT"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Unit: to.Ptr("KB"), + // Value: to.Ptr("-1"), + // }, + // }, + // { + // Name: to.Ptr("temp_tablespaces"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/temp_tablespaces"), + // Properties: &armpostgresql.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(armpostgresql.ConfigurationDataTypeString), + // DefaultValue: to.Ptr(""), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-client.html#GUC-TEMP-TABLESPACES"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("user-override"), + // Value: to.Ptr("temptblspace"), + // }, + // }, + // { + // Name: to.Ptr("TimeZone"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/TimeZone"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Sets the time zone for displaying and interpreting time stamps."), + // AllowedValues: to.Ptr("[A-Za-z0-9/+_-]+"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeString), + // DefaultValue: to.Ptr("UTC"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-client.html#GUC-TIMEZONE"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("UTC"), + // }, + // }, + // { + // Name: to.Ptr("timezone_abbreviations"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/timezone_abbreviations"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Selects a file of time zone abbreviations."), + // AllowedValues: to.Ptr(".*"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeString), + // DefaultValue: to.Ptr(""), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-client.html#GUC-TIMEZONE-ABBREVIATIONS"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("user-override"), + // Value: to.Ptr("Default"), + // }, + // }, + // { + // Name: to.Ptr("trace_notify"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/trace_notify"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Generates debugging output for LISTEN and NOTIFY."), + // AllowedValues: to.Ptr("on,off"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeBoolean), + // DefaultValue: to.Ptr("off"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-developer.html#GUC-TRACE-NOTIFY"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("off"), + // }, + // }, + // { + // Name: to.Ptr("trace_recovery_messages"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/trace_recovery_messages"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Enables logging of recovery-related debugging information."), + // AllowedValues: to.Ptr("debug5,debug4,debug3,debug2,debug1,log,notice,warning,error"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeEnumeration), + // DefaultValue: to.Ptr("log"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-developer.html#GUC-TRACE-RECOVERY-MESSAGES"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("log"), + // }, + // }, + // { + // Name: to.Ptr("trace_sort"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/trace_sort"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Emit information about resource usage in sorting."), + // AllowedValues: to.Ptr("on,off"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeBoolean), + // DefaultValue: to.Ptr("off"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-developer.html#GUC-TRACE-SORT"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("off"), + // }, + // }, + // { + // Name: to.Ptr("track_activities"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/track_activities"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Collects information about executing commands for each session."), + // AllowedValues: to.Ptr("on,off"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeBoolean), + // DefaultValue: to.Ptr("on"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-statistics.html#GUC-TRACK-ACTIVITIES"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("on"), + // }, + // }, + // { + // Name: to.Ptr("track_activity_query_size"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/track_activity_query_size"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Sets the amount of memory reserved for pg_stat_activity.query, in bytes."), + // AllowedValues: to.Ptr("100-102400"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeInteger), + // DefaultValue: to.Ptr("1024"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-statistics.html#GUC-TRACK-ACTIVITY-QUERY-SIZE"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(false), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Unit: to.Ptr("bytes"), + // Value: to.Ptr("1024"), + // }, + // }, + // { + // Name: to.Ptr("track_commit_timestamp"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/track_commit_timestamp"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Collects transaction commit time."), + // AllowedValues: to.Ptr("on,off"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeBoolean), + // DefaultValue: to.Ptr("off"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-replication.html#GUC-TRACK-COMMIT-TIMESTAMP"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(false), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("off"), + // }, + // }, + // { + // Name: to.Ptr("track_counts"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/track_counts"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Enables collection of statistics on database activity"), + // AllowedValues: to.Ptr("on,off"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeBoolean), + // DefaultValue: to.Ptr("on"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-statistics.html#GUC-TRACK-COUNTS"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("on"), + // }, + // }, + // { + // Name: to.Ptr("track_functions"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/track_functions"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Enables tracking of function call counts and time used."), + // AllowedValues: to.Ptr("none,pl,all"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeEnumeration), + // DefaultValue: to.Ptr("none"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-statistics.html#GUC-TRACK-FUNCTIONS"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("none"), + // }, + // }, + // { + // Name: to.Ptr("track_io_timing"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/track_io_timing"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Enables timing of database I/O calls."), + // AllowedValues: to.Ptr("on,off"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeBoolean), + // DefaultValue: to.Ptr("off"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-statistics.html#GUC-TRACK-IO-TIMING"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("off"), + // }, + // }, + // { + // Name: to.Ptr("transaction_deferrable"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/transaction_deferrable"), + // Properties: &armpostgresql.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"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeBoolean), + // DefaultValue: to.Ptr("off"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-client.html#GUC-TRANSACTION-DEFERRABLE"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("off"), + // }, + // }, + // { + // Name: to.Ptr("transaction_isolation"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/transaction_isolation"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Sets the current transaction's isolation level."), + // AllowedValues: to.Ptr("serializable,repeatable read,read committed,read uncommitted"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeEnumeration), + // DefaultValue: to.Ptr("read committed"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-client.html#GUC-TRANSACTION-ISOLATION"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("read committed"), + // }, + // }, + // { + // Name: to.Ptr("transaction_read_only"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/transaction_read_only"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Sets the current transaction's read-only status."), + // AllowedValues: to.Ptr("on,off"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeBoolean), + // DefaultValue: to.Ptr("off"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-client.html#GUC-TRANSACTION-READ-ONLY"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("off"), + // }, + // }, + // { + // Name: to.Ptr("transform_null_equals"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/transform_null_equals"), + // Properties: &armpostgresql.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"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeBoolean), + // DefaultValue: to.Ptr("off"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-compatible.html#GUC-TRANSFORM-NULL-EQUALS"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("off"), + // }, + // }, + // { + // Name: to.Ptr("unix_socket_directories"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/unix_socket_directories"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Sets the directories where Unix-domain sockets will be created."), + // AllowedValues: to.Ptr(".*"), + // DataType: to.Ptr(armpostgresql.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), + // IsDynamicConfig: to.Ptr(false), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("/tmp"), + // }, + // }, + // { + // Name: to.Ptr("unix_socket_group"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/unix_socket_group"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Sets the owning group of the Unix-domain socket."), + // AllowedValues: to.Ptr(".*"), + // DataType: to.Ptr(armpostgresql.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), + // IsDynamicConfig: to.Ptr(false), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("system-default"), + // Value: to.Ptr(""), + // }, + // }, + // { + // Name: to.Ptr("unix_socket_permissions"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/unix_socket_permissions"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Sets the access permissions of the Unix-domain socket."), + // AllowedValues: to.Ptr("0-511"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeInteger), + // DefaultValue: to.Ptr("511"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-connection.html#GUC-UNIX-SOCKET-PERMISSIONS"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(false), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("user-override"), + // Value: to.Ptr("0777"), + // }, + // }, + // { + // Name: to.Ptr("update_process_title"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/update_process_title"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Updates the process title to show the active SQL command."), + // AllowedValues: to.Ptr("on,off"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeBoolean), + // DefaultValue: to.Ptr("on"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-logging.html#GUC-UPDATE-PROCESS-TITLE"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("on"), + // }, + // }, + // { + // 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/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/vacuum_cleanup_index_scale_factor"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Number of tuple inserts prior to index cleanup as a fraction of reltuples."), + // AllowedValues: to.Ptr("0-1e+10"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeNumeric), + // DefaultValue: to.Ptr("0.1"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("0.1"), + // }, + // }, + // { + // Name: to.Ptr("vacuum_cost_delay"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/vacuum_cost_delay"), + // Properties: &armpostgresql.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"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeInteger), + // DefaultValue: to.Ptr("0"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-resource.html#GUC-VACUUM-COST-DELAY"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Unit: to.Ptr("milliseconds"), + // Value: to.Ptr("0"), + // }, + // }, + // { + // Name: to.Ptr("vacuum_cost_limit"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/vacuum_cost_limit"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("The accumulated cost that will cause the vacuuming process to sleep."), + // AllowedValues: to.Ptr("1-10000"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeInteger), + // DefaultValue: to.Ptr("200"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-resource.html#GUC-VACUUM-COST-LIMIT"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("200"), + // }, + // }, + // { + // Name: to.Ptr("vacuum_cost_page_dirty"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/vacuum_cost_page_dirty"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("The estimated cost charged when vacuum modifies a block that was previously clean."), + // AllowedValues: to.Ptr("0-10000"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeInteger), + // DefaultValue: to.Ptr("20"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-resource.html#GUC-VACUUM-COST-PAGE-DIRTY"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("20"), + // }, + // }, + // { + // Name: to.Ptr("vacuum_cost_page_hit"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/vacuum_cost_page_hit"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("The estimated cost for vacuuming a buffer found in the shared buffer cache."), + // AllowedValues: to.Ptr("0-10000"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeInteger), + // DefaultValue: to.Ptr("1"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-resource.html#GUC-VACUUM-COST-PAGE-HIT"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("1"), + // }, + // }, + // { + // Name: to.Ptr("vacuum_cost_page_miss"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/vacuum_cost_page_miss"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("The estimated cost for vacuuming a buffer that must be read from disk."), + // AllowedValues: to.Ptr("0-10000"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeInteger), + // DefaultValue: to.Ptr("10"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-resource.html#GUC-VACUUM-COST-PAGE-MISS"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("10"), + // }, + // }, + // { + // Name: to.Ptr("vacuum_defer_cleanup_age"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/vacuum_defer_cleanup_age"), + // Properties: &armpostgresql.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"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeInteger), + // DefaultValue: to.Ptr("0"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-replication.html#GUC-VACUUM-DEFER-CLEANUP-AGE"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("0"), + // }, + // }, + // { + // Name: to.Ptr("vacuum_freeze_min_age"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/vacuum_freeze_min_age"), + // Properties: &armpostgresql.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"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeInteger), + // DefaultValue: to.Ptr("50000000"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-client.html#GUC-VACUUM-FREEZE-MIN-AGE"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("50000000"), + // }, + // }, + // { + // Name: to.Ptr("vacuum_freeze_table_age"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/vacuum_freeze_table_age"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Age at which VACUUM should scan whole table to freeze tuples."), + // AllowedValues: to.Ptr("0-2000000000"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeInteger), + // DefaultValue: to.Ptr("150000000"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-client.html#GUC-VACUUM-FREEZE-TABLE-AGE"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("150000000"), + // }, + // }, + // { + // 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/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/vacuum_multixact_freeze_min_age"), + // Properties: &armpostgresql.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"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeInteger), + // DefaultValue: to.Ptr("5000000"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-client.html#GUC-VACUUM-MULTIXACT-FREEZE-MIN-AGE"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("5000000"), + // }, + // }, + // { + // 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/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/vacuum_multixact_freeze_table_age"), + // Properties: &armpostgresql.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"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeInteger), + // DefaultValue: to.Ptr("150000000"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-client.html#GUC-VACUUM-MULTIXACT-FREEZE-TABLE-AGE"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("150000000"), + // }, + // }, + // { + // Name: to.Ptr("wal_block_size"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/wal_block_size"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Shows the block size in the write ahead log."), + // AllowedValues: to.Ptr("8192-8192"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeInteger), + // DefaultValue: to.Ptr("8192"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-preset.html#GUC-WAL-BLOCK-SIZE"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("8192"), + // }, + // }, + // { + // Name: to.Ptr("wal_buffers"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/wal_buffers"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Sets the number of disk-page buffers in shared memory for WAL. Unit is 8kb."), + // AllowedValues: to.Ptr("-1-262143"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeInteger), + // DefaultValue: to.Ptr("2048"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-wal.html#GUC-WAL-BUFFERS"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(false), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Unit: to.Ptr("8KB"), + // Value: to.Ptr("2048"), + // }, + // }, + // { + // Name: to.Ptr("wal_compression"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/wal_compression"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Compresses full-page writes written in WAL file."), + // AllowedValues: to.Ptr("on,off"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeBoolean), + // DefaultValue: to.Ptr("on"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-wal.html#GUC-WAL-COMPRESSION"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("on"), + // }, + // }, + // { + // Name: to.Ptr("wal_consistency_checking"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/wal_consistency_checking"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Sets the WAL resource managers for which WAL consistency checks are done."), + // AllowedValues: to.Ptr(".*"), + // DataType: to.Ptr(armpostgresql.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), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("system-default"), + // Value: to.Ptr(""), + // }, + // }, + // { + // Name: to.Ptr("wal_init_zero"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/wal_init_zero"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Writes zeroes to new WAL files before first use."), + // AllowedValues: to.Ptr("on,off"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeBoolean), + // DefaultValue: to.Ptr("on"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-wal.html#GUC-WAL-INIT-ZERO"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("on"), + // }, + // }, + // { + // Name: to.Ptr("wal_keep_size"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/wal_keep_size"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Sets the size of WAL files held for standby servers."), + // AllowedValues: to.Ptr("0-2147483647"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeInteger), + // DefaultValue: to.Ptr("0"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-replication.html#GUC-WAL-KEEP-SIZE"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("user-override"), + // Unit: to.Ptr("megabytes"), + // Value: to.Ptr("400"), + // }, + // }, + // { + // Name: to.Ptr("wal_level"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/wal_level"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("It determines how much information is written to the WAL."), + // AllowedValues: to.Ptr("replica,logical"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeEnumeration), + // DefaultValue: to.Ptr("replica"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-wal.html#GUC-WAL-LEVEL"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(false), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("replica"), + // }, + // }, + // { + // Name: to.Ptr("wal_log_hints"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/wal_log_hints"), + // Properties: &armpostgresql.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"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeBoolean), + // DefaultValue: to.Ptr("off"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-wal.html#GUC-WAL-LOG-HINTS"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(false), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("off"), + // }, + // }, + // { + // 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/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/wal_receiver_create_temp_slot"), + // Properties: &armpostgresql.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"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeBoolean), + // DefaultValue: to.Ptr("off"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-replication.html#GUC-WAL-RECEIVER-CREATE-TEMP-SLOT"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("off"), + // }, + // }, + // { + // Name: to.Ptr("wal_receiver_status_interval"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/wal_receiver_status_interval"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Sets the maximum interval between WAL receiver status reports to the primary."), + // AllowedValues: to.Ptr("0-2147483"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeInteger), + // DefaultValue: to.Ptr("10"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-replication.html#GUC-WAL-RECEIVER-STATUS-INTERVAL"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Unit: to.Ptr("seconds"), + // Value: to.Ptr("10"), + // }, + // }, + // { + // Name: to.Ptr("wal_receiver_timeout"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/wal_receiver_timeout"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Sets the maximum wait time to receive data from the sending server."), + // AllowedValues: to.Ptr("0-2147483647"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeInteger), + // DefaultValue: to.Ptr("60000"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-replication.html#GUC-WAL-RECEIVER-TIMEOUT"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Unit: to.Ptr("milliseconds"), + // Value: to.Ptr("60000"), + // }, + // }, + // { + // Name: to.Ptr("wal_recycle"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/wal_recycle"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Recycles WAL files by renaming them."), + // AllowedValues: to.Ptr("on,off"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeBoolean), + // DefaultValue: to.Ptr("on"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-wal.html#GUC-WAL-RECYCLE"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("on"), + // }, + // }, + // { + // Name: to.Ptr("wal_retrieve_retry_interval"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/wal_retrieve_retry_interval"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Sets the time to wait before retrying to retrieve WAL after a failed attempt."), + // AllowedValues: to.Ptr("1-2147483647"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeInteger), + // DefaultValue: to.Ptr("5000"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-replication.html#GUC-WAL-RETRIEVE-RETRY-INTERVAL"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("system-default"), + // Unit: to.Ptr("milliseconds"), + // Value: to.Ptr("5000"), + // }, + // }, + // { + // Name: to.Ptr("wal_segment_size"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/wal_segment_size"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Shows the size of write ahead log segments."), + // AllowedValues: to.Ptr("1048576-1073741824"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeInteger), + // DefaultValue: to.Ptr("16777216"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-preset.html#GUC-WAL-SEGMENT-SIZE"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("system-default"), + // Unit: to.Ptr("bytes"), + // Value: to.Ptr("16777216"), + // }, + // }, + // { + // Name: to.Ptr("wal_sender_timeout"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/wal_sender_timeout"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Sets the maximum time to wait for WAL replication."), + // AllowedValues: to.Ptr("0-2147483647"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeInteger), + // DefaultValue: to.Ptr("60000"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-replication.html#GUC-WAL-SENDER-TIMEOUT"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Unit: to.Ptr("milliseconds"), + // Value: to.Ptr("60000"), + // }, + // }, + // { + // Name: to.Ptr("wal_skip_threshold"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/wal_skip_threshold"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Size of new file to fsync instead of writing WAL."), + // AllowedValues: to.Ptr("0-2147483647"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeInteger), + // DefaultValue: to.Ptr("2048"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-wal.html#GUC-WAL-SKIP-THRESHOLD"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("system-default"), + // Unit: to.Ptr("KB"), + // Value: to.Ptr("2048"), + // }, + // }, + // { + // Name: to.Ptr("wal_sync_method"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/wal_sync_method"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Selects the method used for forcing WAL updates to disk."), + // AllowedValues: to.Ptr("fsync,fdatasync,open_sync,open_datasync"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeEnumeration), + // DefaultValue: to.Ptr("fdatasync"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-wal.html#GUC-WAL-SYNC-METHOD"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("fdatasync"), + // }, + // }, + // { + // Name: to.Ptr("wal_writer_delay"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/wal_writer_delay"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Time interval between WAL flushes performed by the WAL writer."), + // AllowedValues: to.Ptr("1-10000"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeInteger), + // DefaultValue: to.Ptr("200"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-wal.html#GUC-WAL-WRITER-DELAY"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Unit: to.Ptr("milliseconds"), + // Value: to.Ptr("200"), + // }, + // }, + // { + // Name: to.Ptr("wal_writer_flush_after"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/wal_writer_flush_after"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Amount of WAL written out by WAL writer that triggers a flush."), + // AllowedValues: to.Ptr("0-2147483647"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeInteger), + // DefaultValue: to.Ptr("128"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-wal.html#GUC-WAL-WRITER-FLUSH-AFTER"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Unit: to.Ptr("8KB"), + // Value: to.Ptr("128"), + // }, + // }, + // { + // Name: to.Ptr("work_mem"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/work_mem"), + // Properties: &armpostgresql.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"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeInteger), + // DefaultValue: to.Ptr("4096"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-resource.html#GUC-WORK-MEM"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Unit: to.Ptr("KB"), + // Value: to.Ptr("4096"), + // }, + // }, + // { + // Name: to.Ptr("xmlbinary"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/xmlbinary"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Sets how binary values are to be encoded in XML."), + // AllowedValues: to.Ptr("base64,hex"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeEnumeration), + // DefaultValue: to.Ptr("base64"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-client.html#GUC-XMLBINARY"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("base64"), + // }, + // }, + // { + // Name: to.Ptr("xmloption"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/xmloption"), + // Properties: &armpostgresql.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"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeEnumeration), + // DefaultValue: to.Ptr("content"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-client.html#GUC-XMLOPTION"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(false), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("content"), + // }, + // }, + // { + // Name: to.Ptr("zero_damaged_pages"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/configurations/zero_damaged_pages"), + // Properties: &armpostgresql.ConfigurationProperties{ + // Description: to.Ptr("Continues processing past damaged page headers."), + // AllowedValues: to.Ptr("on,off"), + // DataType: to.Ptr(armpostgresql.ConfigurationDataTypeBoolean), + // DefaultValue: to.Ptr("off"), + // DocumentationLink: to.Ptr("https://www.postgresql.org/docs/13/runtime-config-developer.html#GUC-ZERO-DAMAGED-PAGES"), + // IsConfigPendingRestart: to.Ptr(false), + // IsDynamicConfig: to.Ptr(true), + // IsReadOnly: to.Ptr(true), + // Source: to.Ptr("system-default"), + // Value: to.Ptr("off"), + // }, // }, // }, - // { - // Name: to.Ptr("log_retention_days"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/log_retention_days"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Sets how many days a log file is saved for."), - // AllowedValues: to.Ptr("1-7"), - // DataType: to.Ptr("Integer"), - // DefaultValue: to.Ptr("3"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("3"), - // }, - // }}, + // }, // } } } + +// Generated from example definition: 2025-08-01/ConfigurationsUpdateUsingPut.json +func ExampleConfigurationsClient_BeginPut() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armpostgresql.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewConfigurationsClient().BeginPut(ctx, "exampleresourcegroup", "exampleserver", "constraint_exclusion", armpostgresql.ConfigurationForUpdate{ + Properties: &armpostgresql.ConfigurationProperties{ + Source: to.Ptr("user-override"), + Value: to.Ptr("on"), + }, + }, 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: 2025-08-01/ConfigurationsUpdate.json +func ExampleConfigurationsClient_BeginUpdate() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armpostgresql.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewConfigurationsClient().BeginUpdate(ctx, "exampleresourcegroup", "exampleserver", "constraint_exclusion", armpostgresql.ConfigurationForUpdate{ + Properties: &armpostgresql.ConfigurationProperties{ + Source: to.Ptr("user-override"), + Value: to.Ptr("on"), + }, + }, 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/armpostgresql/constants.go b/sdk/resourcemanager/postgresql/armpostgresql/constants.go index bd7f93bc2ce2..62fe37ae7cc4 100644 --- a/sdk/resourcemanager/postgresql/armpostgresql/constants.go +++ b/sdk/resourcemanager/postgresql/armpostgresql/constants.go @@ -1,106 +1,664 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armpostgresql +// AzureManagedDiskPerformanceTier - Storage tier of a server. +type AzureManagedDiskPerformanceTier string + const ( - moduleName = "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresql" - moduleVersion = "v1.2.0" + AzureManagedDiskPerformanceTierP1 AzureManagedDiskPerformanceTier = "P1" + AzureManagedDiskPerformanceTierP10 AzureManagedDiskPerformanceTier = "P10" + AzureManagedDiskPerformanceTierP15 AzureManagedDiskPerformanceTier = "P15" + AzureManagedDiskPerformanceTierP2 AzureManagedDiskPerformanceTier = "P2" + AzureManagedDiskPerformanceTierP20 AzureManagedDiskPerformanceTier = "P20" + AzureManagedDiskPerformanceTierP3 AzureManagedDiskPerformanceTier = "P3" + AzureManagedDiskPerformanceTierP30 AzureManagedDiskPerformanceTier = "P30" + AzureManagedDiskPerformanceTierP4 AzureManagedDiskPerformanceTier = "P4" + AzureManagedDiskPerformanceTierP40 AzureManagedDiskPerformanceTier = "P40" + AzureManagedDiskPerformanceTierP50 AzureManagedDiskPerformanceTier = "P50" + AzureManagedDiskPerformanceTierP6 AzureManagedDiskPerformanceTier = "P6" + AzureManagedDiskPerformanceTierP60 AzureManagedDiskPerformanceTier = "P60" + AzureManagedDiskPerformanceTierP70 AzureManagedDiskPerformanceTier = "P70" + AzureManagedDiskPerformanceTierP80 AzureManagedDiskPerformanceTier = "P80" ) -// CreateMode - The mode to create a new server. +// 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, + } +} + +// BackupType - Type of backup. +type BackupType string + +const ( + BackupTypeCustomerOnDemand BackupType = "Customer On-Demand" + BackupTypeFull BackupType = "Full" +) + +// PossibleBackupTypeValues returns the possible values for the BackupType const type. +func PossibleBackupTypeValues() []BackupType { + return []BackupType{ + BackupTypeCustomerOnDemand, + BackupTypeFull, + } +} + +// Cancel - Indicates if cancel must be triggered for the entire migration. +type Cancel string + +const ( + CancelFalse Cancel = "False" + CancelTrue Cancel = "True" +) + +// PossibleCancelValues returns the possible values for the Cancel const type. +func PossibleCancelValues() []Cancel { + return []Cancel{ + CancelFalse, + CancelTrue, + } +} + +// CapabilityStatus - The status of the capability. +type CapabilityStatus string + +const ( + CapabilityStatusAvailable CapabilityStatus = "Available" + CapabilityStatusDefault CapabilityStatus = "Default" + CapabilityStatusDisabled CapabilityStatus = "Disabled" + CapabilityStatusVisible CapabilityStatus = "Visible" +) + +// PossibleCapabilityStatusValues returns the possible values for the CapabilityStatus const type. +func PossibleCapabilityStatusValues() []CapabilityStatus { + return []CapabilityStatus{ + CapabilityStatusAvailable, + CapabilityStatusDefault, + CapabilityStatusDisabled, + CapabilityStatusVisible, + } +} + +// CheckNameAvailabilityReason - Possible reasons for a name not being available. +type CheckNameAvailabilityReason string + +const ( + // CheckNameAvailabilityReasonAlreadyExists - Name already exists. + CheckNameAvailabilityReasonAlreadyExists CheckNameAvailabilityReason = "AlreadyExists" + // CheckNameAvailabilityReasonInvalid - Name is invalid. + CheckNameAvailabilityReasonInvalid CheckNameAvailabilityReason = "Invalid" +) + +// PossibleCheckNameAvailabilityReasonValues returns the possible values for the CheckNameAvailabilityReason const type. +func PossibleCheckNameAvailabilityReasonValues() []CheckNameAvailabilityReason { + return []CheckNameAvailabilityReason{ + CheckNameAvailabilityReasonAlreadyExists, + CheckNameAvailabilityReasonInvalid, + } +} + +// ConfigurationDataType - Data type of the configuration (also known as server parameter). +type ConfigurationDataType string + +const ( + ConfigurationDataTypeBoolean ConfigurationDataType = "Boolean" + ConfigurationDataTypeEnumeration ConfigurationDataType = "Enumeration" + ConfigurationDataTypeInteger ConfigurationDataType = "Integer" + ConfigurationDataTypeNumeric ConfigurationDataType = "Numeric" + ConfigurationDataTypeSet ConfigurationDataType = "Set" + ConfigurationDataTypeString ConfigurationDataType = "String" +) + +// PossibleConfigurationDataTypeValues returns the possible values for the ConfigurationDataType const type. +func PossibleConfigurationDataTypeValues() []ConfigurationDataType { + return []ConfigurationDataType{ + ConfigurationDataTypeBoolean, + ConfigurationDataTypeEnumeration, + ConfigurationDataTypeInteger, + ConfigurationDataTypeNumeric, + ConfigurationDataTypeSet, + ConfigurationDataTypeString, + } +} + +// CreateMode - Creation mode of a new server. type CreateMode string const ( + CreateModeCreate CreateMode = "Create" CreateModeDefault CreateMode = "Default" CreateModeGeoRestore CreateMode = "GeoRestore" CreateModePointInTimeRestore CreateMode = "PointInTimeRestore" CreateModeReplica CreateMode = "Replica" + CreateModeReviveDropped CreateMode = "ReviveDropped" + CreateModeUpdate CreateMode = "Update" ) // PossibleCreateModeValues returns the possible values for the CreateMode const type. func PossibleCreateModeValues() []CreateMode { return []CreateMode{ + CreateModeCreate, CreateModeDefault, CreateModeGeoRestore, CreateModePointInTimeRestore, CreateModeReplica, + CreateModeReviveDropped, + CreateModeUpdate, + } +} + +// CreateModeForPatch - Update mode of an existing server. +type CreateModeForPatch string + +const ( + CreateModeForPatchDefault CreateModeForPatch = "Default" + CreateModeForPatchUpdate CreateModeForPatch = "Update" +) + +// PossibleCreateModeForPatchValues returns the possible values for the CreateModeForPatch const type. +func PossibleCreateModeForPatchValues() []CreateModeForPatch { + return []CreateModeForPatch{ + CreateModeForPatchDefault, + CreateModeForPatchUpdate, + } +} + +// CreatedByType - The kind of entity that created the resource. +type CreatedByType string + +const ( + // CreatedByTypeApplication - The entity was created by an application. + CreatedByTypeApplication CreatedByType = "Application" + // CreatedByTypeKey - The entity was created by a key. + CreatedByTypeKey CreatedByType = "Key" + // CreatedByTypeManagedIdentity - The entity was created by a managed identity. + CreatedByTypeManagedIdentity CreatedByType = "ManagedIdentity" + // CreatedByTypeUser - The entity was created by a user. + CreatedByTypeUser CreatedByType = "User" +) + +// PossibleCreatedByTypeValues returns the possible values for the CreatedByType const type. +func PossibleCreatedByTypeValues() []CreatedByType { + return []CreatedByType{ + CreatedByTypeApplication, + CreatedByTypeKey, + CreatedByTypeManagedIdentity, + CreatedByTypeUser, + } +} + +// DataEncryptionType - Data encryption type used by a server. +type DataEncryptionType string + +const ( + DataEncryptionTypeAzureKeyVault DataEncryptionType = "AzureKeyVault" + 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 EncryptionKeyStatus = "Invalid" + 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 ExecutionStatus = "Cancelled" + ExecutionStatusFailed ExecutionStatus = "Failed" + ExecutionStatusRunning ExecutionStatus = "Running" + ExecutionStatusSucceeded ExecutionStatus = "Succeeded" +) + +// PossibleExecutionStatusValues returns the possible values for the ExecutionStatus const type. +func PossibleExecutionStatusValues() []ExecutionStatus { + return []ExecutionStatus{ + ExecutionStatusCancelled, + ExecutionStatusFailed, + ExecutionStatusRunning, + ExecutionStatusSucceeded, + } +} + +// FailoverMode - Failover mode. +type FailoverMode string + +const ( + FailoverModeForcedFailover FailoverMode = "ForcedFailover" + FailoverModeForcedSwitchover FailoverMode = "ForcedSwitchover" + FailoverModePlannedFailover FailoverMode = "PlannedFailover" + FailoverModePlannedSwitchover FailoverMode = "PlannedSwitchover" +) + +// PossibleFailoverModeValues returns the possible values for the FailoverMode const type. +func PossibleFailoverModeValues() []FailoverMode { + return []FailoverMode{ + FailoverModeForcedFailover, + FailoverModeForcedSwitchover, + FailoverModePlannedFailover, + FailoverModePlannedSwitchover, } } -// GeoRedundantBackup - Enable Geo-redundant or not for server backup. -type GeoRedundantBackup 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 ( - GeoRedundantBackupDisabled GeoRedundantBackup = "Disabled" - GeoRedundantBackupEnabled GeoRedundantBackup = "Enabled" + FastProvisioningSupportDisabled FastProvisioningSupport = "Disabled" + FastProvisioningSupportEnabled FastProvisioningSupport = "Enabled" ) -// PossibleGeoRedundantBackupValues returns the possible values for the GeoRedundantBackup const type. -func PossibleGeoRedundantBackupValues() []GeoRedundantBackup { - return []GeoRedundantBackup{ - GeoRedundantBackupDisabled, - GeoRedundantBackupEnabled, +// PossibleFastProvisioningSupportValues returns the possible values for the FastProvisioningSupport const type. +func PossibleFastProvisioningSupportValues() []FastProvisioningSupport { + return []FastProvisioningSupport{ + FastProvisioningSupportDisabled, + FastProvisioningSupportEnabled, } } -// IdentityType - The identity type. Set this to 'SystemAssigned' in order to automatically create and assign an Azure Active -// Directory principal for the resource. +// FeatureStatus - Status of the feature. Indicates if the feature is enabled or not. +type FeatureStatus string + +const ( + FeatureStatusDisabled FeatureStatus = "Disabled" + FeatureStatusEnabled FeatureStatus = "Enabled" +) + +// PossibleFeatureStatusValues returns the possible values for the FeatureStatus const type. +func PossibleFeatureStatusValues() []FeatureStatus { + return []FeatureStatus{ + FeatureStatusDisabled, + FeatureStatusEnabled, + } +} + +// FlexibleServerHighAvailabilityMode - Modes of high availability supported for this compute. +type FlexibleServerHighAvailabilityMode string + +const ( + FlexibleServerHighAvailabilityModeDisabled FlexibleServerHighAvailabilityMode = "Disabled" + FlexibleServerHighAvailabilityModeSameZone FlexibleServerHighAvailabilityMode = "SameZone" + FlexibleServerHighAvailabilityModeZoneRedundant FlexibleServerHighAvailabilityMode = "ZoneRedundant" +) + +// PossibleFlexibleServerHighAvailabilityModeValues returns the possible values for the FlexibleServerHighAvailabilityMode const type. +func PossibleFlexibleServerHighAvailabilityModeValues() []FlexibleServerHighAvailabilityMode { + return []FlexibleServerHighAvailabilityMode{ + FlexibleServerHighAvailabilityModeDisabled, + FlexibleServerHighAvailabilityModeSameZone, + FlexibleServerHighAvailabilityModeZoneRedundant, + } +} + +// GeographicallyRedundantBackup - Indicates if the server is configured to create geographically redundant backups. +type GeographicallyRedundantBackup string + +const ( + GeographicallyRedundantBackupDisabled GeographicallyRedundantBackup = "Disabled" + GeographicallyRedundantBackupEnabled GeographicallyRedundantBackup = "Enabled" +) + +// PossibleGeographicallyRedundantBackupValues returns the possible values for the GeographicallyRedundantBackup const type. +func PossibleGeographicallyRedundantBackupValues() []GeographicallyRedundantBackup { + return []GeographicallyRedundantBackup{ + GeographicallyRedundantBackupDisabled, + GeographicallyRedundantBackupEnabled, + } +} + +// 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 ( + GeographicallyRedundantBackupSupportDisabled GeographicallyRedundantBackupSupport = "Disabled" + GeographicallyRedundantBackupSupportEnabled GeographicallyRedundantBackupSupport = "Enabled" +) + +// PossibleGeographicallyRedundantBackupSupportValues returns the possible values for the GeographicallyRedundantBackupSupport const type. +func PossibleGeographicallyRedundantBackupSupportValues() []GeographicallyRedundantBackupSupport { + return []GeographicallyRedundantBackupSupport{ + GeographicallyRedundantBackupSupportDisabled, + GeographicallyRedundantBackupSupportEnabled, + } +} + +// HighAvailabilityMode - Modes of high availability supported for this compute. +type HighAvailabilityMode string + +const ( + HighAvailabilityModeSameZone HighAvailabilityMode = "SameZone" + HighAvailabilityModeZoneRedundant HighAvailabilityMode = "ZoneRedundant" +) + +// PossibleHighAvailabilityModeValues returns the possible values for the HighAvailabilityMode const type. +func PossibleHighAvailabilityModeValues() []HighAvailabilityMode { + return []HighAvailabilityMode{ + HighAvailabilityModeSameZone, + HighAvailabilityModeZoneRedundant, + } +} + +// HighAvailabilityState - Possible states of the standby server created when high availability is set to SameZone or ZoneRedundant. +type HighAvailabilityState string + +const ( + HighAvailabilityStateCreatingStandby HighAvailabilityState = "CreatingStandby" + HighAvailabilityStateFailingOver HighAvailabilityState = "FailingOver" + HighAvailabilityStateHealthy HighAvailabilityState = "Healthy" + HighAvailabilityStateNotEnabled HighAvailabilityState = "NotEnabled" + HighAvailabilityStateRemovingStandby HighAvailabilityState = "RemovingStandby" + 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 ( - IdentityTypeSystemAssigned IdentityType = "SystemAssigned" + IdentityTypeNone IdentityType = "None" + IdentityTypeSystemAssigned IdentityType = "SystemAssigned" + IdentityTypeSystemAssignedUserAssigned IdentityType = "SystemAssigned,UserAssigned" + IdentityTypeUserAssigned IdentityType = "UserAssigned" ) // PossibleIdentityTypeValues returns the possible values for the IdentityType const type. func PossibleIdentityTypeValues() []IdentityType { return []IdentityType{ + IdentityTypeNone, IdentityTypeSystemAssigned, + IdentityTypeSystemAssignedUserAssigned, + IdentityTypeUserAssigned, + } +} + +// 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 ( + LocationRestrictedDisabled LocationRestricted = "Disabled" + LocationRestrictedEnabled LocationRestricted = "Enabled" +) + +// PossibleLocationRestrictedValues returns the possible values for the LocationRestricted const type. +func PossibleLocationRestrictedValues() []LocationRestricted { + return []LocationRestricted{ + LocationRestrictedDisabled, + LocationRestrictedEnabled, + } +} + +// LogicalReplicationOnSourceServer - Indicates whether to setup logical replication on source server, if needed. +type LogicalReplicationOnSourceServer string + +const ( + LogicalReplicationOnSourceServerFalse LogicalReplicationOnSourceServer = "False" + LogicalReplicationOnSourceServerTrue LogicalReplicationOnSourceServer = "True" +) + +// PossibleLogicalReplicationOnSourceServerValues returns the possible values for the LogicalReplicationOnSourceServer const type. +func PossibleLogicalReplicationOnSourceServerValues() []LogicalReplicationOnSourceServer { + return []LogicalReplicationOnSourceServer{ + LogicalReplicationOnSourceServerFalse, + LogicalReplicationOnSourceServerTrue, + } +} + +// MicrosoftEntraAuth - Indicates if the server supports Microsoft Entra authentication. +type MicrosoftEntraAuth string + +const ( + MicrosoftEntraAuthDisabled MicrosoftEntraAuth = "Disabled" + MicrosoftEntraAuthEnabled MicrosoftEntraAuth = "Enabled" +) + +// PossibleMicrosoftEntraAuthValues returns the possible values for the MicrosoftEntraAuth const type. +func PossibleMicrosoftEntraAuthValues() []MicrosoftEntraAuth { + return []MicrosoftEntraAuth{ + MicrosoftEntraAuthDisabled, + MicrosoftEntraAuthEnabled, + } +} + +// MigrateRolesAndPermissions - Indicates if roles and permissions must be migrated. +type MigrateRolesAndPermissions string + +const ( + MigrateRolesAndPermissionsFalse MigrateRolesAndPermissions = "False" + MigrateRolesAndPermissionsTrue MigrateRolesAndPermissions = "True" +) + +// PossibleMigrateRolesAndPermissionsValues returns the possible values for the MigrateRolesAndPermissions const type. +func PossibleMigrateRolesAndPermissionsValues() []MigrateRolesAndPermissions { + return []MigrateRolesAndPermissions{ + MigrateRolesAndPermissionsFalse, + MigrateRolesAndPermissionsTrue, } } -// InfrastructureEncryption - Add a second layer of encryption for your data using new encryption algorithm which gives additional -// data protection. Value is optional but if passed in, must be 'Disabled' or 'Enabled'. -type InfrastructureEncryption string +// MigrationDatabaseState - Migration state of a database. +type MigrationDatabaseState string const ( - // InfrastructureEncryptionDisabled - Additional (2nd) layer of encryption for data at rest - InfrastructureEncryptionDisabled InfrastructureEncryption = "Disabled" - // InfrastructureEncryptionEnabled - Default value for single layer of encryption for data at rest. - InfrastructureEncryptionEnabled InfrastructureEncryption = "Enabled" + MigrationDatabaseStateCanceled MigrationDatabaseState = "Canceled" + MigrationDatabaseStateCanceling MigrationDatabaseState = "Canceling" + MigrationDatabaseStateFailed MigrationDatabaseState = "Failed" + MigrationDatabaseStateInProgress MigrationDatabaseState = "InProgress" + MigrationDatabaseStateSucceeded MigrationDatabaseState = "Succeeded" + MigrationDatabaseStateWaitingForCutoverTrigger MigrationDatabaseState = "WaitingForCutoverTrigger" ) -// PossibleInfrastructureEncryptionValues returns the possible values for the InfrastructureEncryption const type. -func PossibleInfrastructureEncryptionValues() []InfrastructureEncryption { - return []InfrastructureEncryption{ - InfrastructureEncryptionDisabled, - InfrastructureEncryptionEnabled, +// PossibleMigrationDatabaseStateValues returns the possible values for the MigrationDatabaseState const type. +func PossibleMigrationDatabaseStateValues() []MigrationDatabaseState { + return []MigrationDatabaseState{ + MigrationDatabaseStateCanceled, + MigrationDatabaseStateCanceling, + MigrationDatabaseStateFailed, + MigrationDatabaseStateInProgress, + MigrationDatabaseStateSucceeded, + MigrationDatabaseStateWaitingForCutoverTrigger, } } -// MinimalTLSVersionEnum - Enforce a minimal Tls version for the server. -type MinimalTLSVersionEnum string +type MigrationListFilter string const ( - MinimalTLSVersionEnumTLS10 MinimalTLSVersionEnum = "TLS1_0" - MinimalTLSVersionEnumTLS11 MinimalTLSVersionEnum = "TLS1_1" - MinimalTLSVersionEnumTLS12 MinimalTLSVersionEnum = "TLS1_2" - MinimalTLSVersionEnumTLSEnforcementDisabled MinimalTLSVersionEnum = "TLSEnforcementDisabled" + MigrationListFilterActive MigrationListFilter = "Active" + MigrationListFilterAll MigrationListFilter = "All" ) -// PossibleMinimalTLSVersionEnumValues returns the possible values for the MinimalTLSVersionEnum const type. -func PossibleMinimalTLSVersionEnumValues() []MinimalTLSVersionEnum { - return []MinimalTLSVersionEnum{ - MinimalTLSVersionEnumTLS10, - MinimalTLSVersionEnumTLS11, - MinimalTLSVersionEnumTLS12, - MinimalTLSVersionEnumTLSEnforcementDisabled, +// PossibleMigrationListFilterValues returns the possible values for the MigrationListFilter const type. +func PossibleMigrationListFilterValues() []MigrationListFilter { + return []MigrationListFilter{ + MigrationListFilterActive, + MigrationListFilterAll, } } -// OperationOrigin - The intended executor of the operation. +// MigrationMode - Mode used to perform the migration: Online or Offline. +type MigrationMode string + +const ( + MigrationModeOffline MigrationMode = "Offline" + MigrationModeOnline MigrationMode = "Online" +) + +// PossibleMigrationModeValues returns the possible values for the MigrationMode const type. +func PossibleMigrationModeValues() []MigrationMode { + return []MigrationMode{ + MigrationModeOffline, + MigrationModeOnline, + } +} + +// MigrationNameAvailabilityReason - Migration name availability reason. +type MigrationNameAvailabilityReason string + +const ( + MigrationNameAvailabilityReasonAlreadyExists MigrationNameAvailabilityReason = "AlreadyExists" + MigrationNameAvailabilityReasonInvalid MigrationNameAvailabilityReason = "Invalid" +) + +// PossibleMigrationNameAvailabilityReasonValues returns the possible values for the MigrationNameAvailabilityReason const type. +func PossibleMigrationNameAvailabilityReasonValues() []MigrationNameAvailabilityReason { + return []MigrationNameAvailabilityReason{ + MigrationNameAvailabilityReasonAlreadyExists, + MigrationNameAvailabilityReasonInvalid, + } +} + +// MigrationOption - Supported option for a migration +type MigrationOption string + +const ( + MigrationOptionMigrate MigrationOption = "Migrate" + MigrationOptionValidate MigrationOption = "Validate" + MigrationOptionValidateAndMigrate MigrationOption = "ValidateAndMigrate" +) + +// PossibleMigrationOptionValues returns the possible values for the MigrationOption const type. +func PossibleMigrationOptionValues() []MigrationOption { + return []MigrationOption{ + MigrationOptionMigrate, + MigrationOptionValidate, + MigrationOptionValidateAndMigrate, + } +} + +// 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" + MigrationStateWaitingForUserAction MigrationState = "WaitingForUserAction" +) + +// PossibleMigrationStateValues returns the possible values for the MigrationState const type. +func PossibleMigrationStateValues() []MigrationState { + return []MigrationState{ + MigrationStateCanceled, + MigrationStateCleaningUp, + MigrationStateFailed, + MigrationStateInProgress, + MigrationStateSucceeded, + MigrationStateValidationFailed, + MigrationStateWaitingForUserAction, + } +} + +// MigrationSubstate - Substate of migration. +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, + } +} + +// 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 ( + OnlineStorageResizeSupportDisabled OnlineStorageResizeSupport = "Disabled" + OnlineStorageResizeSupportEnabled OnlineStorageResizeSupport = "Enabled" +) + +// PossibleOnlineStorageResizeSupportValues returns the possible values for the OnlineStorageResizeSupport const type. +func PossibleOnlineStorageResizeSupportValues() []OnlineStorageResizeSupport { + return []OnlineStorageResizeSupport{ + OnlineStorageResizeSupportDisabled, + OnlineStorageResizeSupportEnabled, + } +} + +// OperationOrigin - Intended executor of the operation. type OperationOrigin string const ( @@ -118,164 +676,340 @@ func PossibleOperationOriginValues() []OperationOrigin { } } -// PrivateEndpointProvisioningState - State of the private endpoint connection. -type PrivateEndpointProvisioningState 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 ( - PrivateEndpointProvisioningStateApproving PrivateEndpointProvisioningState = "Approving" - PrivateEndpointProvisioningStateDropping PrivateEndpointProvisioningState = "Dropping" - PrivateEndpointProvisioningStateFailed PrivateEndpointProvisioningState = "Failed" - PrivateEndpointProvisioningStateReady PrivateEndpointProvisioningState = "Ready" - PrivateEndpointProvisioningStateRejecting PrivateEndpointProvisioningState = "Rejecting" + OverwriteDatabasesOnTargetServerFalse OverwriteDatabasesOnTargetServer = "False" + OverwriteDatabasesOnTargetServerTrue OverwriteDatabasesOnTargetServer = "True" ) -// PossiblePrivateEndpointProvisioningStateValues returns the possible values for the PrivateEndpointProvisioningState const type. -func PossiblePrivateEndpointProvisioningStateValues() []PrivateEndpointProvisioningState { - return []PrivateEndpointProvisioningState{ - PrivateEndpointProvisioningStateApproving, - PrivateEndpointProvisioningStateDropping, - PrivateEndpointProvisioningStateFailed, - PrivateEndpointProvisioningStateReady, - PrivateEndpointProvisioningStateRejecting, +// PossibleOverwriteDatabasesOnTargetServerValues returns the possible values for the OverwriteDatabasesOnTargetServer const type. +func PossibleOverwriteDatabasesOnTargetServerValues() []OverwriteDatabasesOnTargetServer { + return []OverwriteDatabasesOnTargetServer{ + OverwriteDatabasesOnTargetServerFalse, + OverwriteDatabasesOnTargetServerTrue, } } -// PrivateLinkServiceConnectionStateActionsRequire - The actions required for private link service connection. -type PrivateLinkServiceConnectionStateActionsRequire string +// PasswordBasedAuth - Indicates if the server supports password based authentication. +type PasswordBasedAuth string const ( - PrivateLinkServiceConnectionStateActionsRequireNone PrivateLinkServiceConnectionStateActionsRequire = "None" + PasswordBasedAuthDisabled PasswordBasedAuth = "Disabled" + PasswordBasedAuthEnabled PasswordBasedAuth = "Enabled" ) -// PossiblePrivateLinkServiceConnectionStateActionsRequireValues returns the possible values for the PrivateLinkServiceConnectionStateActionsRequire const type. -func PossiblePrivateLinkServiceConnectionStateActionsRequireValues() []PrivateLinkServiceConnectionStateActionsRequire { - return []PrivateLinkServiceConnectionStateActionsRequire{ - PrivateLinkServiceConnectionStateActionsRequireNone, +// PossiblePasswordBasedAuthValues returns the possible values for the PasswordBasedAuth const type. +func PossiblePasswordBasedAuthValues() []PasswordBasedAuth { + return []PasswordBasedAuth{ + PasswordBasedAuthDisabled, + PasswordBasedAuthEnabled, } } -// PrivateLinkServiceConnectionStateStatus - The private link service connection status. -type PrivateLinkServiceConnectionStateStatus string +// PostgresMajorVersion - Major version of PostgreSQL database engine. +type PostgresMajorVersion string const ( - PrivateLinkServiceConnectionStateStatusApproved PrivateLinkServiceConnectionStateStatus = "Approved" - PrivateLinkServiceConnectionStateStatusDisconnected PrivateLinkServiceConnectionStateStatus = "Disconnected" - PrivateLinkServiceConnectionStateStatusPending PrivateLinkServiceConnectionStateStatus = "Pending" - PrivateLinkServiceConnectionStateStatusRejected PrivateLinkServiceConnectionStateStatus = "Rejected" + PostgresMajorVersion11 PostgresMajorVersion = "11" + PostgresMajorVersion12 PostgresMajorVersion = "12" + PostgresMajorVersion13 PostgresMajorVersion = "13" + PostgresMajorVersion14 PostgresMajorVersion = "14" + PostgresMajorVersion15 PostgresMajorVersion = "15" + PostgresMajorVersion16 PostgresMajorVersion = "16" + PostgresMajorVersion17 PostgresMajorVersion = "17" + PostgresMajorVersion18 PostgresMajorVersion = "18" ) -// PossiblePrivateLinkServiceConnectionStateStatusValues returns the possible values for the PrivateLinkServiceConnectionStateStatus const type. -func PossiblePrivateLinkServiceConnectionStateStatusValues() []PrivateLinkServiceConnectionStateStatus { - return []PrivateLinkServiceConnectionStateStatus{ - PrivateLinkServiceConnectionStateStatusApproved, - PrivateLinkServiceConnectionStateStatusDisconnected, - PrivateLinkServiceConnectionStateStatusPending, - PrivateLinkServiceConnectionStateStatusRejected, +// PossiblePostgresMajorVersionValues returns the possible values for the PostgresMajorVersion const type. +func PossiblePostgresMajorVersionValues() []PostgresMajorVersion { + return []PostgresMajorVersion{ + PostgresMajorVersion11, + PostgresMajorVersion12, + PostgresMajorVersion13, + PostgresMajorVersion14, + PostgresMajorVersion15, + PostgresMajorVersion16, + PostgresMajorVersion17, + PostgresMajorVersion18, } } -// PublicNetworkAccessEnum - Whether or not public network access is allowed for this server. Value is optional but if passed -// in, must be 'Enabled' or 'Disabled' -type PublicNetworkAccessEnum string +// PrincipalType - Type of Microsoft Entra principal to which the server administrator is associated. +type PrincipalType string const ( - PublicNetworkAccessEnumDisabled PublicNetworkAccessEnum = "Disabled" - PublicNetworkAccessEnumEnabled PublicNetworkAccessEnum = "Enabled" + // 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 - The principal type is not known or not specified. + PrincipalTypeUnknown PrincipalType = "Unknown" + // PrincipalTypeUser - A Microsoft Entra user. + PrincipalTypeUser PrincipalType = "User" ) -// PossiblePublicNetworkAccessEnumValues returns the possible values for the PublicNetworkAccessEnum const type. -func PossiblePublicNetworkAccessEnumValues() []PublicNetworkAccessEnum { - return []PublicNetworkAccessEnum{ - PublicNetworkAccessEnumDisabled, - PublicNetworkAccessEnumEnabled, +// PossiblePrincipalTypeValues returns the possible values for the PrincipalType const type. +func PossiblePrincipalTypeValues() []PrincipalType { + return []PrincipalType{ + PrincipalTypeGroup, + PrincipalTypeServicePrincipal, + PrincipalTypeUnknown, + PrincipalTypeUser, } } -// SKUTier - The tier of the particular SKU, e.g. Basic. -type SKUTier string +// PrivateEndpointConnectionProvisioningState - The current provisioning state. +type PrivateEndpointConnectionProvisioningState string const ( - SKUTierBasic SKUTier = "Basic" - SKUTierGeneralPurpose SKUTier = "GeneralPurpose" - SKUTierMemoryOptimized SKUTier = "MemoryOptimized" + // PrivateEndpointConnectionProvisioningStateCreating - Connection is being created + PrivateEndpointConnectionProvisioningStateCreating PrivateEndpointConnectionProvisioningState = "Creating" + // PrivateEndpointConnectionProvisioningStateDeleting - Connection is being deleted + PrivateEndpointConnectionProvisioningStateDeleting PrivateEndpointConnectionProvisioningState = "Deleting" + // PrivateEndpointConnectionProvisioningStateFailed - Connection provisioning has failed + PrivateEndpointConnectionProvisioningStateFailed PrivateEndpointConnectionProvisioningState = "Failed" + // PrivateEndpointConnectionProvisioningStateSucceeded - Connection has been provisioned + PrivateEndpointConnectionProvisioningStateSucceeded PrivateEndpointConnectionProvisioningState = "Succeeded" ) -// PossibleSKUTierValues returns the possible values for the SKUTier const type. -func PossibleSKUTierValues() []SKUTier { - return []SKUTier{ - SKUTierBasic, - SKUTierGeneralPurpose, - SKUTierMemoryOptimized, +// PossiblePrivateEndpointConnectionProvisioningStateValues returns the possible values for the PrivateEndpointConnectionProvisioningState const type. +func PossiblePrivateEndpointConnectionProvisioningStateValues() []PrivateEndpointConnectionProvisioningState { + return []PrivateEndpointConnectionProvisioningState{ + PrivateEndpointConnectionProvisioningStateCreating, + PrivateEndpointConnectionProvisioningStateDeleting, + PrivateEndpointConnectionProvisioningStateFailed, + PrivateEndpointConnectionProvisioningStateSucceeded, + } +} + +// PrivateEndpointServiceConnectionStatus - The private endpoint connection status. +type PrivateEndpointServiceConnectionStatus string + +const ( + // PrivateEndpointServiceConnectionStatusApproved - Connection approved + PrivateEndpointServiceConnectionStatusApproved PrivateEndpointServiceConnectionStatus = "Approved" + // PrivateEndpointServiceConnectionStatusPending - Connection waiting for approval or rejection + PrivateEndpointServiceConnectionStatusPending PrivateEndpointServiceConnectionStatus = "Pending" + // PrivateEndpointServiceConnectionStatusRejected - Connection Rejected + PrivateEndpointServiceConnectionStatusRejected PrivateEndpointServiceConnectionStatus = "Rejected" +) + +// PossiblePrivateEndpointServiceConnectionStatusValues returns the possible values for the PrivateEndpointServiceConnectionStatus const type. +func PossiblePrivateEndpointServiceConnectionStatusValues() []PrivateEndpointServiceConnectionStatus { + return []PrivateEndpointServiceConnectionStatus{ + PrivateEndpointServiceConnectionStatusApproved, + PrivateEndpointServiceConnectionStatusPending, + PrivateEndpointServiceConnectionStatusRejected, + } +} + +// 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 - 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. +func PossibleReadReplicaPromoteModeValues() []ReadReplicaPromoteMode { + return []ReadReplicaPromoteMode{ + ReadReplicaPromoteModeStandalone, + ReadReplicaPromoteModeSwitchover, + } +} + +// ReadReplicaPromoteOption - Data synchronization option to use when processing the operation specified in the promoteMode +// property. This property is write only. +type ReadReplicaPromoteOption string + +const ( + // 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" +) + +// PossibleReadReplicaPromoteOptionValues returns the possible values for the ReadReplicaPromoteOption const type. +func PossibleReadReplicaPromoteOptionValues() []ReadReplicaPromoteOption { + return []ReadReplicaPromoteOption{ + ReadReplicaPromoteOptionForced, + ReadReplicaPromoteOptionPlanned, + } +} + +// RecommendationTypeEnum - Type for this recommendation. +type RecommendationTypeEnum string + +const ( + 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, + } +} + +// RecommendationTypeParameterEnum - Recommendations list filter. Retrieves recommendations based on type. +type RecommendationTypeParameterEnum string + +const ( + RecommendationTypeParameterEnumAnalyzeTable RecommendationTypeParameterEnum = "AnalyzeTable" + RecommendationTypeParameterEnumCreateIndex RecommendationTypeParameterEnum = "CreateIndex" + RecommendationTypeParameterEnumDropIndex RecommendationTypeParameterEnum = "DropIndex" + RecommendationTypeParameterEnumReIndex RecommendationTypeParameterEnum = "ReIndex" +) + +// PossibleRecommendationTypeParameterEnumValues returns the possible values for the RecommendationTypeParameterEnum const type. +func PossibleRecommendationTypeParameterEnumValues() []RecommendationTypeParameterEnum { + return []RecommendationTypeParameterEnum{ + RecommendationTypeParameterEnumAnalyzeTable, + RecommendationTypeParameterEnumCreateIndex, + RecommendationTypeParameterEnumDropIndex, + RecommendationTypeParameterEnumReIndex, + } +} + +// ReplicationRole - Role of the server in a replication set. +type ReplicationRole string + +const ( + ReplicationRoleAsyncReplica ReplicationRole = "AsyncReplica" + ReplicationRoleGeoAsyncReplica ReplicationRole = "GeoAsyncReplica" + ReplicationRoleNone ReplicationRole = "None" + ReplicationRolePrimary ReplicationRole = "Primary" +) + +// PossibleReplicationRoleValues returns the possible values for the ReplicationRole const type. +func PossibleReplicationRoleValues() []ReplicationRole { + return []ReplicationRole{ + ReplicationRoleAsyncReplica, + ReplicationRoleGeoAsyncReplica, + ReplicationRoleNone, + ReplicationRolePrimary, } } -// SSLEnforcementEnum - Enable ssl enforcement or not when connect to server. -type SSLEnforcementEnum string +// 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 ( - SSLEnforcementEnumDisabled SSLEnforcementEnum = "Disabled" - SSLEnforcementEnumEnabled SSLEnforcementEnum = "Enabled" + // ReplicationStateActive - The read replica server 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 - The read replica server is behind the primary server and is currently catching up with pending + // changes. + ReplicationStateCatchup ReplicationState = "Catchup" + // ReplicationStateProvisioning - The read replica server is being created and is in process of getting initialized. + ReplicationStateProvisioning ReplicationState = "Provisioning" + // ReplicationStateReconfiguring - The read replica server is being reconfigured, possibly due to changes in source or settings. + ReplicationStateReconfiguring ReplicationState = "Reconfiguring" + // ReplicationStateUpdating - The read replica server is undergoing some changes it can be changing compute size of promoting + // it to primary server. + ReplicationStateUpdating ReplicationState = "Updating" ) -// PossibleSSLEnforcementEnumValues returns the possible values for the SSLEnforcementEnum const type. -func PossibleSSLEnforcementEnumValues() []SSLEnforcementEnum { - return []SSLEnforcementEnum{ - SSLEnforcementEnumDisabled, - SSLEnforcementEnumEnabled, +// PossibleReplicationStateValues returns the possible values for the ReplicationState const type. +func PossibleReplicationStateValues() []ReplicationState { + return []ReplicationState{ + ReplicationStateActive, + ReplicationStateBroken, + ReplicationStateCatchup, + ReplicationStateProvisioning, + ReplicationStateReconfiguring, + ReplicationStateUpdating, } } -type SecurityAlertPolicyName string +// SKUTier - Tier of the compute assigned to a server. +type SKUTier string const ( - SecurityAlertPolicyNameDefault SecurityAlertPolicyName = "Default" + SKUTierBurstable SKUTier = "Burstable" + SKUTierGeneralPurpose SKUTier = "GeneralPurpose" + SKUTierMemoryOptimized SKUTier = "MemoryOptimized" ) -// PossibleSecurityAlertPolicyNameValues returns the possible values for the SecurityAlertPolicyName const type. -func PossibleSecurityAlertPolicyNameValues() []SecurityAlertPolicyName { - return []SecurityAlertPolicyName{ - SecurityAlertPolicyNameDefault, +// PossibleSKUTierValues returns the possible values for the SKUTier const type. +func PossibleSKUTierValues() []SKUTier { + return []SKUTier{ + SKUTierBurstable, + SKUTierGeneralPurpose, + SKUTierMemoryOptimized, } } -// ServerKeyType - The key type like 'AzureKeyVault'. -type ServerKeyType string +// 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 ( - ServerKeyTypeAzureKeyVault ServerKeyType = "AzureKeyVault" + SSLModePrefer SSLMode = "Prefer" + SSLModeRequire SSLMode = "Require" + SSLModeVerifyCA SSLMode = "VerifyCA" + SSLModeVerifyFull SSLMode = "VerifyFull" ) -// PossibleServerKeyTypeValues returns the possible values for the ServerKeyType const type. -func PossibleServerKeyTypeValues() []ServerKeyType { - return []ServerKeyType{ - ServerKeyTypeAzureKeyVault, +// PossibleSSLModeValues returns the possible values for the SSLMode const type. +func PossibleSSLModeValues() []SSLMode { + return []SSLMode{ + SSLModePrefer, + SSLModeRequire, + SSLModeVerifyCA, + SSLModeVerifyFull, } } -// ServerSecurityAlertPolicyState - Specifies the state of the policy, whether it is enabled or disabled. -type ServerSecurityAlertPolicyState string +// ServerPublicNetworkAccessState - Indicates if public network access is enabled or not. +type ServerPublicNetworkAccessState string const ( - ServerSecurityAlertPolicyStateDisabled ServerSecurityAlertPolicyState = "Disabled" - ServerSecurityAlertPolicyStateEnabled ServerSecurityAlertPolicyState = "Enabled" + ServerPublicNetworkAccessStateDisabled ServerPublicNetworkAccessState = "Disabled" + ServerPublicNetworkAccessStateEnabled ServerPublicNetworkAccessState = "Enabled" ) -// PossibleServerSecurityAlertPolicyStateValues returns the possible values for the ServerSecurityAlertPolicyState const type. -func PossibleServerSecurityAlertPolicyStateValues() []ServerSecurityAlertPolicyState { - return []ServerSecurityAlertPolicyState{ - ServerSecurityAlertPolicyStateDisabled, - ServerSecurityAlertPolicyStateEnabled, +// PossibleServerPublicNetworkAccessStateValues returns the possible values for the ServerPublicNetworkAccessState const type. +func PossibleServerPublicNetworkAccessStateValues() []ServerPublicNetworkAccessState { + return []ServerPublicNetworkAccessState{ + ServerPublicNetworkAccessStateDisabled, + ServerPublicNetworkAccessStateEnabled, } } -// 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" ServerStateInaccessible ServerState = "Inaccessible" + ServerStateProvisioning ServerState = "Provisioning" ServerStateReady ServerState = "Ready" + ServerStateRestarting ServerState = "Restarting" + ServerStateStarting ServerState = "Starting" + ServerStateStopped ServerState = "Stopped" + ServerStateStopping ServerState = "Stopping" + ServerStateUpdating ServerState = "Updating" ) // PossibleServerStateValues returns the possible values for the ServerState const type. @@ -284,68 +1018,277 @@ func PossibleServerStateValues() []ServerState { ServerStateDisabled, ServerStateDropping, ServerStateInaccessible, + ServerStateProvisioning, ServerStateReady, + ServerStateRestarting, + ServerStateStarting, + ServerStateStopped, + ServerStateStopping, + ServerStateUpdating, + } +} + +// SourceType - Source server type used for the migration: ApsaraDB_RDS, AWS, AWS_AURORA, AWS_EC2, AWS_RDS, AzureVM, Crunchy_PostgreSQL, +// Digital_Ocean_Droplets, Digital_Ocean_PostgreSQL, EDB, EDB_Oracle_Server, EDB_PostgreSQL, GCP, GCP_AlloyDB, GCP_CloudSQL, +// GCP_Compute, Heroku_PostgreSQL, Huawei_Compute, Huawei_RDS, 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" + SourceTypePostgreSQLFlexibleServer SourceType = "PostgreSQLFlexibleServer" + SourceTypePostgreSQLSingleServer SourceType = "PostgreSQLSingleServer" + SourceTypeSupabasePostgreSQL SourceType = "Supabase_PostgreSQL" +) + +// PossibleSourceTypeValues returns the possible values for the SourceType const type. +func PossibleSourceTypeValues() []SourceType { + return []SourceType{ + SourceTypeAWS, + SourceTypeAWSAURORA, + SourceTypeAWSEC2, + SourceTypeAWSRDS, + SourceTypeApsaraDBRDS, + SourceTypeAzureVM, + SourceTypeCrunchyPostgreSQL, + SourceTypeDigitalOceanDroplets, + SourceTypeDigitalOceanPostgreSQL, + SourceTypeEDB, + SourceTypeEDBOracleServer, + SourceTypeEDBPostgreSQL, + SourceTypeGCP, + SourceTypeGCPAlloyDB, + SourceTypeGCPCloudSQL, + SourceTypeGCPCompute, + SourceTypeHerokuPostgreSQL, + SourceTypeHuaweiCompute, + SourceTypeHuaweiRDS, + SourceTypeOnPremises, + SourceTypePostgreSQLCosmosDB, + SourceTypePostgreSQLFlexibleServer, + SourceTypePostgreSQLSingleServer, + SourceTypeSupabasePostgreSQL, + } +} + +// StartDataMigration - Indicates if data migration must start right away. +type StartDataMigration string + +const ( + StartDataMigrationFalse StartDataMigration = "False" + StartDataMigrationTrue StartDataMigration = "True" +) + +// PossibleStartDataMigrationValues returns the possible values for the StartDataMigration const type. +func PossibleStartDataMigrationValues() []StartDataMigration { + return []StartDataMigration{ + StartDataMigrationFalse, + StartDataMigrationTrue, + } +} + +// 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 StorageAutoGrow = "Disabled" + StorageAutoGrowEnabled StorageAutoGrow = "Enabled" +) + +// PossibleStorageAutoGrowValues returns the possible values for the StorageAutoGrow const type. +func PossibleStorageAutoGrowValues() []StorageAutoGrow { + return []StorageAutoGrow{ + StorageAutoGrowDisabled, + StorageAutoGrowEnabled, + } +} + +// 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 ( + StorageAutoGrowthSupportDisabled StorageAutoGrowthSupport = "Disabled" + StorageAutoGrowthSupportEnabled StorageAutoGrowthSupport = "Enabled" +) + +// PossibleStorageAutoGrowthSupportValues returns the possible values for the StorageAutoGrowthSupport const type. +func PossibleStorageAutoGrowthSupportValues() []StorageAutoGrowthSupport { + return []StorageAutoGrowthSupport{ + StorageAutoGrowthSupportDisabled, + StorageAutoGrowthSupportEnabled, + } +} + +// StorageType - Type of storage assigned to a server. Allowed values are Premium_LRS, PremiumV2_LRS, or UltraSSD_LRS. If +// not specified, it defaults to Premium_LRS. +type StorageType string + +const ( + StorageTypePremiumLRS StorageType = "Premium_LRS" + StorageTypePremiumV2LRS StorageType = "PremiumV2_LRS" + StorageTypeUltraSSDLRS StorageType = "UltraSSD_LRS" +) + +// PossibleStorageTypeValues returns the possible values for the StorageType const type. +func PossibleStorageTypeValues() []StorageType { + return []StorageType{ + StorageTypePremiumLRS, + StorageTypePremiumV2LRS, + StorageTypeUltraSSDLRS, + } +} + +type ThreatProtectionName string + +const ( + ThreatProtectionNameDefault ThreatProtectionName = "Default" +) + +// PossibleThreatProtectionNameValues returns the possible values for the ThreatProtectionName const type. +func PossibleThreatProtectionNameValues() []ThreatProtectionName { + return []ThreatProtectionName{ + ThreatProtectionNameDefault, + } +} + +// 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 ThreatProtectionState = "Disabled" + ThreatProtectionStateEnabled ThreatProtectionState = "Enabled" +) + +// PossibleThreatProtectionStateValues returns the possible values for the ThreatProtectionState const type. +func PossibleThreatProtectionStateValues() []ThreatProtectionState { + return []ThreatProtectionState{ + ThreatProtectionStateDisabled, + ThreatProtectionStateEnabled, + } +} + +// TriggerCutover - Indicates if cutover must be triggered for the entire migration. +type TriggerCutover string + +const ( + TriggerCutoverFalse TriggerCutover = "False" + TriggerCutoverTrue TriggerCutover = "True" +) + +// PossibleTriggerCutoverValues returns the possible values for the TriggerCutover const type. +func PossibleTriggerCutoverValues() []TriggerCutover { + return []TriggerCutover{ + TriggerCutoverFalse, + TriggerCutoverTrue, + } +} + +// TuningOptionParameterEnum - The name of the tuning option. +type TuningOptionParameterEnum string + +const ( + TuningOptionParameterEnumIndex TuningOptionParameterEnum = "index" + TuningOptionParameterEnumTable TuningOptionParameterEnum = "table" +) + +// PossibleTuningOptionParameterEnumValues returns the possible values for the TuningOptionParameterEnum const type. +func PossibleTuningOptionParameterEnumValues() []TuningOptionParameterEnum { + return []TuningOptionParameterEnum{ + TuningOptionParameterEnumIndex, + TuningOptionParameterEnumTable, + } +} + +// ValidationState - Validation status for migration. +type ValidationState string + +const ( + ValidationStateFailed ValidationState = "Failed" + ValidationStateSucceeded ValidationState = "Succeeded" + ValidationStateWarning ValidationState = "Warning" +) + +// PossibleValidationStateValues returns the possible values for the ValidationState const type. +func PossibleValidationStateValues() []ValidationState { + return []ValidationState{ + ValidationStateFailed, + ValidationStateSucceeded, + ValidationStateWarning, } } -// ServerVersion - The version of a server. -type ServerVersion string +// VirtualEndpointType - Type of endpoint for the virtual endpoints. +type VirtualEndpointType string const ( - ServerVersionEleven ServerVersion = "11" - ServerVersionNine5 ServerVersion = "9.5" - ServerVersionNine6 ServerVersion = "9.6" - ServerVersionTen ServerVersion = "10" - ServerVersionTen0 ServerVersion = "10.0" - ServerVersionTen2 ServerVersion = "10.2" + VirtualEndpointTypeReadWrite VirtualEndpointType = "ReadWrite" ) -// PossibleServerVersionValues returns the possible values for the ServerVersion const type. -func PossibleServerVersionValues() []ServerVersion { - return []ServerVersion{ - ServerVersionEleven, - ServerVersionNine5, - ServerVersionNine6, - ServerVersionTen, - ServerVersionTen0, - ServerVersionTen2, +// PossibleVirtualEndpointTypeValues returns the possible values for the VirtualEndpointType const type. +func PossibleVirtualEndpointTypeValues() []VirtualEndpointType { + return []VirtualEndpointType{ + VirtualEndpointTypeReadWrite, } } -// StorageAutogrow - Enable Storage Auto Grow. -type StorageAutogrow 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 ( - StorageAutogrowDisabled StorageAutogrow = "Disabled" - StorageAutogrowEnabled StorageAutogrow = "Enabled" + ZoneRedundantHighAvailabilityAndGeographicallyRedundantBackupSupportDisabled ZoneRedundantHighAvailabilityAndGeographicallyRedundantBackupSupport = "Disabled" + ZoneRedundantHighAvailabilityAndGeographicallyRedundantBackupSupportEnabled ZoneRedundantHighAvailabilityAndGeographicallyRedundantBackupSupport = "Enabled" ) -// PossibleStorageAutogrowValues returns the possible values for the StorageAutogrow const type. -func PossibleStorageAutogrowValues() []StorageAutogrow { - return []StorageAutogrow{ - StorageAutogrowDisabled, - StorageAutogrowEnabled, +// PossibleZoneRedundantHighAvailabilityAndGeographicallyRedundantBackupSupportValues returns the possible values for the ZoneRedundantHighAvailabilityAndGeographicallyRedundantBackupSupport const type. +func PossibleZoneRedundantHighAvailabilityAndGeographicallyRedundantBackupSupportValues() []ZoneRedundantHighAvailabilityAndGeographicallyRedundantBackupSupport { + return []ZoneRedundantHighAvailabilityAndGeographicallyRedundantBackupSupport{ + ZoneRedundantHighAvailabilityAndGeographicallyRedundantBackupSupportDisabled, + ZoneRedundantHighAvailabilityAndGeographicallyRedundantBackupSupportEnabled, } } -// VirtualNetworkRuleState - Virtual Network Rule State -type VirtualNetworkRuleState 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 ( - VirtualNetworkRuleStateDeleting VirtualNetworkRuleState = "Deleting" - VirtualNetworkRuleStateInProgress VirtualNetworkRuleState = "InProgress" - VirtualNetworkRuleStateInitializing VirtualNetworkRuleState = "Initializing" - VirtualNetworkRuleStateReady VirtualNetworkRuleState = "Ready" - VirtualNetworkRuleStateUnknown VirtualNetworkRuleState = "Unknown" + ZoneRedundantHighAvailabilitySupportDisabled ZoneRedundantHighAvailabilitySupport = "Disabled" + ZoneRedundantHighAvailabilitySupportEnabled ZoneRedundantHighAvailabilitySupport = "Enabled" ) -// PossibleVirtualNetworkRuleStateValues returns the possible values for the VirtualNetworkRuleState const type. -func PossibleVirtualNetworkRuleStateValues() []VirtualNetworkRuleState { - return []VirtualNetworkRuleState{ - VirtualNetworkRuleStateDeleting, - VirtualNetworkRuleStateInProgress, - VirtualNetworkRuleStateInitializing, - VirtualNetworkRuleStateReady, - VirtualNetworkRuleStateUnknown, +// PossibleZoneRedundantHighAvailabilitySupportValues returns the possible values for the ZoneRedundantHighAvailabilitySupport const type. +func PossibleZoneRedundantHighAvailabilitySupportValues() []ZoneRedundantHighAvailabilitySupport { + return []ZoneRedundantHighAvailabilitySupport{ + ZoneRedundantHighAvailabilitySupportDisabled, + ZoneRedundantHighAvailabilitySupportEnabled, } } diff --git a/sdk/resourcemanager/postgresql/armpostgresql/databases_client.go b/sdk/resourcemanager/postgresql/armpostgresql/databases_client.go index b2f57350f8de..81c006f6b057 100644 --- a/sdk/resourcemanager/postgresql/armpostgresql/databases_client.go +++ b/sdk/resourcemanager/postgresql/armpostgresql/databases_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armpostgresql @@ -25,9 +24,9 @@ type DatabasesClient struct { } // NewDatabasesClient creates a new instance of DatabasesClient with the specified values. -// - subscriptionID - The ID of the target subscription. +// - 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,44 +39,45 @@ func NewDatabasesClient(subscriptionID string, credential azcore.TokenCredential return client, nil } -// BeginCreateOrUpdate - 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 2017-12-01 +// 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. -// - options - DatabasesClientBeginCreateOrUpdateOptions contains the optional parameters for the DatabasesClient.BeginCreateOrUpdate -// method. -func (client *DatabasesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters Database, options *DatabasesClientBeginCreateOrUpdateOptions) (*runtime.Poller[DatabasesClientCreateOrUpdateResponse], error) { +// - 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 == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, serverName, databaseName, parameters, options) + resp, err := client.create(ctx, resourceGroupName, serverName, databaseName, parameters, options) if err != nil { return nil, err } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DatabasesClientCreateOrUpdateResponse]{ - Tracer: client.internal.Tracer(), + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DatabasesClientCreateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + Tracer: client.internal.Tracer(), }) return poller, err } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[DatabasesClientCreateOrUpdateResponse]{ + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[DatabasesClientCreateResponse]{ Tracer: client.internal.Tracer(), }) } } -// CreateOrUpdate - 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 2017-12-01 -func (client *DatabasesClient) createOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters Database, options *DatabasesClientBeginCreateOrUpdateOptions) (*http.Response, error) { +// 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.BeginCreateOrUpdate" + const operationName = "DatabasesClient.BeginCreate" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) defer func() { endSpan(err) }() - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, databaseName, parameters, options) + req, err := client.createCreateRequest(ctx, resourceGroupName, serverName, databaseName, parameters, options) if err != nil { return nil, err } @@ -85,16 +85,16 @@ func (client *DatabasesClient) createOrUpdate(ctx context.Context, resourceGroup 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 } -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *DatabasesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters Database, options *DatabasesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/databases/{databaseName}" +// createCreateRequest creates the Create request. +func (client *DatabasesClient) createCreateRequest(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters Database, _ *DatabasesClientBeginCreateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/databases/{databaseName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -116,22 +116,23 @@ func (client *DatabasesClient) createOrUpdateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2017-12-01") + reqQP.Set("api-version", "2025-08-01") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } 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 2017-12-01 +// 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 == "" { @@ -150,10 +151,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 2017-12-01 +// 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" @@ -168,7 +169,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 } @@ -176,8 +177,8 @@ func (client *DatabasesClient) deleteOperation(ctx context.Context, resourceGrou } // deleteCreateRequest creates the Delete request. -func (client *DatabasesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, serverName string, databaseName string, options *DatabasesClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/databases/{databaseName}" +func (client *DatabasesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, serverName string, databaseName string, _ *DatabasesClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/databases/{databaseName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -199,19 +200,19 @@ func (client *DatabasesClient) deleteCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2017-12-01") + 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 2017-12-01 +// 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 @@ -236,8 +237,8 @@ func (client *DatabasesClient) Get(ctx context.Context, resourceGroupName string } // getCreateRequest creates the Get request. -func (client *DatabasesClient) getCreateRequest(ctx context.Context, resourceGroupName string, serverName string, databaseName string, options *DatabasesClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/databases/{databaseName}" +func (client *DatabasesClient) getCreateRequest(ctx context.Context, resourceGroupName string, serverName string, databaseName string, _ *DatabasesClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/databases/{databaseName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -259,7 +260,7 @@ func (client *DatabasesClient) getCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2017-12-01") + reqQP.Set("api-version", "2025-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -274,9 +275,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 2017-12-01 +// 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 @@ -284,21 +285,20 @@ func (client *DatabasesClient) getHandleResponse(resp *http.Response) (Databases func (client *DatabasesClient) NewListByServerPager(resourceGroupName string, serverName string, options *DatabasesClientListByServerOptions) *runtime.Pager[DatabasesClientListByServerResponse] { return runtime.NewPager(runtime.PagingHandler[DatabasesClientListByServerResponse]{ More: func(page DatabasesClientListByServerResponse) bool { - return false + return page.NextLink != nil && len(*page.NextLink) > 0 }, Fetcher: func(ctx context.Context, page *DatabasesClientListByServerResponse) (DatabasesClientListByServerResponse, error) { ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "DatabasesClient.NewListByServerPager") - req, err := client.listByServerCreateRequest(ctx, resourceGroupName, serverName, options) - if err != nil { - return DatabasesClientListByServerResponse{}, err + nextLink := "" + if page != nil { + nextLink = *page.NextLink } - resp, err := client.internal.Pipeline().Do(req) + 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 DatabasesClientListByServerResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return DatabasesClientListByServerResponse{}, runtime.NewResponseError(resp) - } return client.listByServerHandleResponse(resp) }, Tracer: client.internal.Tracer(), @@ -306,8 +306,8 @@ func (client *DatabasesClient) NewListByServerPager(resourceGroupName string, se } // listByServerCreateRequest creates the ListByServer request. -func (client *DatabasesClient) listByServerCreateRequest(ctx context.Context, resourceGroupName string, serverName string, options *DatabasesClientListByServerOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/databases" +func (client *DatabasesClient) listByServerCreateRequest(ctx context.Context, resourceGroupName string, serverName string, _ *DatabasesClientListByServerOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/databases" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -325,7 +325,7 @@ func (client *DatabasesClient) listByServerCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2017-12-01") + 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 +334,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/armpostgresql/databases_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresql/databases_client_example_test.go index 4ec5d3276e39..97d8b333700b 100644 --- a/sdk/resourcemanager/postgresql/armpostgresql/databases_client_example_test.go +++ b/sdk/resourcemanager/postgresql/armpostgresql/databases_client_example_test.go @@ -1,70 +1,55 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armpostgresql_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/armpostgresql" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresql/v2" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/DatabaseCreate.json -func ExampleDatabasesClient_BeginCreateOrUpdate() { +// Generated from example definition: 2025-08-01/DatabasesCreate.json +func ExampleDatabasesClient_BeginCreate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armpostgresql.NewClientFactory("", cred, nil) + clientFactory, err := armpostgresql.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewDatabasesClient().BeginCreateOrUpdate(ctx, "TestGroup", "testserver", "db1", armpostgresql.Database{ + poller, err := clientFactory.NewDatabasesClient().BeginCreate(ctx, "exampleresourcegroup", "exampleserver", "exampledatabase", armpostgresql.Database{ Properties: &armpostgresql.DatabaseProperties{ - Charset: to.Ptr("UTF8"), - Collation: to.Ptr("English_United States.1252"), + Charset: to.Ptr("utf8"), + Collation: to.Ptr("en_US.utf8"), }, }, 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.Database = armpostgresql.Database{ - // Name: to.Ptr("db1"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/databases"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/databases/db1"), - // Properties: &armpostgresql.DatabaseProperties{ - // Charset: to.Ptr("UTF8"), - // Collation: to.Ptr("English_United States.1252"), - // }, - // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/DatabaseDelete.json +// Generated from example definition: 2025-08-01/DatabasesDelete.json func ExampleDatabasesClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armpostgresql.NewClientFactory("", cred, nil) + clientFactory, err := armpostgresql.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) 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) } @@ -74,47 +59,49 @@ func ExampleDatabasesClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/DatabaseGet.json +// Generated from example definition: 2025-08-01/DatabasesGet.json func ExampleDatabasesClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armpostgresql.NewClientFactory("", cred, nil) + clientFactory, err := armpostgresql.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) 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) } // 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 = armpostgresql.Database{ - // Name: to.Ptr("db1"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/databases"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/databases/db1"), - // Properties: &armpostgresql.DatabaseProperties{ - // Charset: to.Ptr("UTF8"), - // Collation: to.Ptr("English_United States.1252"), + // res = armpostgresql.DatabasesClientGetResponse{ + // Database: &armpostgresql.Database{ + // Name: to.Ptr("exampledatabase"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/databases"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/databases/exampledatabase"), + // Properties: &armpostgresql.DatabaseProperties{ + // Charset: to.Ptr("utf8"), + // Collation: to.Ptr("en_US.utf8"), + // }, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/DatabaseListByServer.json +// Generated from example definition: 2025-08-01/DatabasesListByServer.json func ExampleDatabasesClient_NewListByServerPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armpostgresql.NewClientFactory("", cred, nil) + clientFactory, err := armpostgresql.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) 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 { @@ -125,26 +112,29 @@ 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 = armpostgresql.DatabaseListResult{ - // Value: []*armpostgresql.Database{ - // { - // Name: to.Ptr("db1"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/databases"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/databases/db1"), - // Properties: &armpostgresql.DatabaseProperties{ - // Charset: to.Ptr("UTF8"), - // Collation: to.Ptr("English_United States.1252"), + // page = armpostgresql.DatabasesClientListByServerResponse{ + // DatabaseList: armpostgresql.DatabaseList{ + // Value: []*armpostgresql.Database{ + // { + // Name: to.Ptr("exampledatabase1"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/databases"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/databases/exampledatabase1"), + // Properties: &armpostgresql.DatabaseProperties{ + // Charset: to.Ptr("utf8"), + // Collation: to.Ptr("en_US.utf8"), + // }, // }, - // }, - // { - // Name: to.Ptr("db2"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/databases"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/databases/db2"), - // Properties: &armpostgresql.DatabaseProperties{ - // Charset: to.Ptr("UTF8"), - // Collation: to.Ptr("English_United States.1252"), + // { + // Name: to.Ptr("exampledatabase2"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/databases"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/databases/exampledatabase2"), + // Properties: &armpostgresql.DatabaseProperties{ + // Charset: to.Ptr("utf8"), + // Collation: to.Ptr("en_US.utf8"), + // }, // }, - // }}, + // }, + // }, // } } } diff --git a/sdk/resourcemanager/postgresql/armpostgresql/fake/administratorsmicrosoftentra_server.go b/sdk/resourcemanager/postgresql/armpostgresql/fake/administratorsmicrosoftentra_server.go new file mode 100644 index 000000000000..3c102fed247f --- /dev/null +++ b/sdk/resourcemanager/postgresql/armpostgresql/fake/administratorsmicrosoftentra_server.go @@ -0,0 +1,293 @@ +// 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) Go Code Generator. DO NOT EDIT. + +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/armpostgresql/v2" + "net/http" + "net/url" + "regexp" +) + +// AdministratorsMicrosoftEntraServer is a fake server for instances of the armpostgresql.AdministratorsMicrosoftEntraClient type. +type AdministratorsMicrosoftEntraServer struct { + // BeginCreateOrUpdate is the fake for method AdministratorsMicrosoftEntraClient.BeginCreateOrUpdate + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + BeginCreateOrUpdate func(ctx context.Context, resourceGroupName string, serverName string, objectID string, parameters armpostgresql.AdministratorMicrosoftEntraAdd, options *armpostgresql.AdministratorsMicrosoftEntraClientBeginCreateOrUpdateOptions) (resp azfake.PollerResponder[armpostgresql.AdministratorsMicrosoftEntraClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) + + // 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 *armpostgresql.AdministratorsMicrosoftEntraClientBeginDeleteOptions) (resp azfake.PollerResponder[armpostgresql.AdministratorsMicrosoftEntraClientDeleteResponse], errResp azfake.ErrorResponder) + + // 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 *armpostgresql.AdministratorsMicrosoftEntraClientGetOptions) (resp azfake.Responder[armpostgresql.AdministratorsMicrosoftEntraClientGetResponse], errResp azfake.ErrorResponder) + + // NewListByServerPager is the fake for method AdministratorsMicrosoftEntraClient.NewListByServerPager + // HTTP status codes to indicate success: http.StatusOK + NewListByServerPager func(resourceGroupName string, serverName string, options *armpostgresql.AdministratorsMicrosoftEntraClientListByServerOptions) (resp azfake.PagerResponder[armpostgresql.AdministratorsMicrosoftEntraClientListByServerResponse]) +} + +// NewAdministratorsMicrosoftEntraServerTransport creates a new instance of AdministratorsMicrosoftEntraServerTransport with the provided implementation. +// The returned AdministratorsMicrosoftEntraServerTransport instance is connected to an instance of armpostgresql.AdministratorsMicrosoftEntraClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewAdministratorsMicrosoftEntraServerTransport(srv *AdministratorsMicrosoftEntraServer) *AdministratorsMicrosoftEntraServerTransport { + return &AdministratorsMicrosoftEntraServerTransport{ + srv: srv, + beginCreateOrUpdate: newTracker[azfake.PollerResponder[armpostgresql.AdministratorsMicrosoftEntraClientCreateOrUpdateResponse]](), + beginDelete: newTracker[azfake.PollerResponder[armpostgresql.AdministratorsMicrosoftEntraClientDeleteResponse]](), + newListByServerPager: newTracker[azfake.PagerResponder[armpostgresql.AdministratorsMicrosoftEntraClientListByServerResponse]](), + } +} + +// AdministratorsMicrosoftEntraServerTransport connects instances of armpostgresql.AdministratorsMicrosoftEntraClient to instances of AdministratorsMicrosoftEntraServer. +// Don't use this type directly, use NewAdministratorsMicrosoftEntraServerTransport instead. +type AdministratorsMicrosoftEntraServerTransport struct { + srv *AdministratorsMicrosoftEntraServer + beginCreateOrUpdate *tracker[azfake.PollerResponder[armpostgresql.AdministratorsMicrosoftEntraClientCreateOrUpdateResponse]] + beginDelete *tracker[azfake.PollerResponder[armpostgresql.AdministratorsMicrosoftEntraClientDeleteResponse]] + newListByServerPager *tracker[azfake.PagerResponder[armpostgresql.AdministratorsMicrosoftEntraClientListByServerResponse]] +} + +// 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 { + return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} + } + + return a.dispatchToMethodFake(req, method) +} + +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 administratorsMicrosoftEntraServerTransportInterceptor != nil { + res.resp, res.err, intercepted = administratorsMicrosoftEntraServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "AdministratorsMicrosoftEntraClient.BeginCreateOrUpdate": + res.resp, res.err = a.dispatchBeginCreateOrUpdate(req) + case "AdministratorsMicrosoftEntraClient.BeginDelete": + res.resp, res.err = a.dispatchBeginDelete(req) + case "AdministratorsMicrosoftEntraClient.Get": + res.resp, res.err = a.dispatchGet(req) + case "AdministratorsMicrosoftEntraClient.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 *AdministratorsMicrosoftEntraServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { + if a.srv.BeginCreateOrUpdate == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginCreateOrUpdate not implemented")} + } + 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 len(matches) < 5 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armpostgresql.AdministratorMicrosoftEntraAdd](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 + } + objectIDParam, err := url.PathUnescape(matches[regex.SubexpIndex("objectId")]) + if err != nil { + return nil, err + } + respr, errRespr := a.srv.BeginCreateOrUpdate(req.Context(), resourceGroupNameParam, serverNameParam, objectIDParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginCreateOrUpdate = &respr + a.beginCreateOrUpdate.add(req, beginCreateOrUpdate) + } + + resp, err := server.PollerResponderNext(beginCreateOrUpdate, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + a.beginCreateOrUpdate.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + } + if !server.PollerResponderMore(beginCreateOrUpdate) { + a.beginCreateOrUpdate.remove(req) + } + + return resp, nil +} + +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")} + } + beginDelete := a.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~%@]+)/administrators/(?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 + } + objectIDParam, err := url.PathUnescape(matches[regex.SubexpIndex("objectId")]) + if err != nil { + return nil, err + } + respr, errRespr := a.srv.BeginDelete(req.Context(), resourceGroupNameParam, serverNameParam, objectIDParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginDelete = &respr + a.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) { + a.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) { + a.beginDelete.remove(req) + } + + return resp, nil +} + +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 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 + } + objectIDParam, err := url.PathUnescape(matches[regex.SubexpIndex("objectId")]) + if err != nil { + return nil, err + } + respr, errRespr := a.srv.Get(req.Context(), resourceGroupNameParam, serverNameParam, objectIDParam, 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).AdministratorMicrosoftEntra, req) + if err != nil { + return nil, err + } + return resp, nil +} + +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")} + } + 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~%@]+)/administrators` + 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 *armpostgresql.AdministratorsMicrosoftEntraClientListByServerResponse, 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 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/armpostgresql/fake/advancedthreatprotectionsettings_server.go b/sdk/resourcemanager/postgresql/armpostgresql/fake/advancedthreatprotectionsettings_server.go new file mode 100644 index 000000000000..1b645a41c22e --- /dev/null +++ b/sdk/resourcemanager/postgresql/armpostgresql/fake/advancedthreatprotectionsettings_server.go @@ -0,0 +1,183 @@ +// 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) Go Code Generator. DO NOT EDIT. + +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/armpostgresql/v2" + "net/http" + "net/url" + "regexp" +) + +// AdvancedThreatProtectionSettingsServer is a fake server for instances of the armpostgresql.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 armpostgresql.ThreatProtectionName, options *armpostgresql.AdvancedThreatProtectionSettingsClientGetOptions) (resp azfake.Responder[armpostgresql.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 *armpostgresql.AdvancedThreatProtectionSettingsClientListByServerOptions) (resp azfake.PagerResponder[armpostgresql.AdvancedThreatProtectionSettingsClientListByServerResponse]) +} + +// NewAdvancedThreatProtectionSettingsServerTransport creates a new instance of AdvancedThreatProtectionSettingsServerTransport with the provided implementation. +// The returned AdvancedThreatProtectionSettingsServerTransport instance is connected to an instance of armpostgresql.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[armpostgresql.AdvancedThreatProtectionSettingsClientListByServerResponse]](), + } +} + +// AdvancedThreatProtectionSettingsServerTransport connects instances of armpostgresql.AdvancedThreatProtectionSettingsClient to instances of AdvancedThreatProtectionSettingsServer. +// Don't use this type directly, use NewAdvancedThreatProtectionSettingsServerTransport instead. +type AdvancedThreatProtectionSettingsServerTransport struct { + srv *AdvancedThreatProtectionSettingsServer + newListByServerPager *tracker[azfake.PagerResponder[armpostgresql.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) (armpostgresql.ThreatProtectionName, error) { + p, unescapeErr := url.PathUnescape(v) + if unescapeErr != nil { + return "", unescapeErr + } + return armpostgresql.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 *armpostgresql.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/armpostgresql/fake/backupsautomaticandondemand_server.go b/sdk/resourcemanager/postgresql/armpostgresql/fake/backupsautomaticandondemand_server.go new file mode 100644 index 000000000000..a3c923c89d3a --- /dev/null +++ b/sdk/resourcemanager/postgresql/armpostgresql/fake/backupsautomaticandondemand_server.go @@ -0,0 +1,289 @@ +// 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) Go Code Generator. DO NOT EDIT. + +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/armpostgresql/v2" + "net/http" + "net/url" + "regexp" +) + +// BackupsAutomaticAndOnDemandServer is a fake server for instances of the armpostgresql.BackupsAutomaticAndOnDemandClient type. +type BackupsAutomaticAndOnDemandServer struct { + // BeginCreate is the fake for method BackupsAutomaticAndOnDemandClient.BeginCreate + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + BeginCreate func(ctx context.Context, resourceGroupName string, serverName string, backupName string, options *armpostgresql.BackupsAutomaticAndOnDemandClientBeginCreateOptions) (resp azfake.PollerResponder[armpostgresql.BackupsAutomaticAndOnDemandClientCreateResponse], errResp azfake.ErrorResponder) + + // 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 *armpostgresql.BackupsAutomaticAndOnDemandClientBeginDeleteOptions) (resp azfake.PollerResponder[armpostgresql.BackupsAutomaticAndOnDemandClientDeleteResponse], errResp azfake.ErrorResponder) + + // 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 *armpostgresql.BackupsAutomaticAndOnDemandClientGetOptions) (resp azfake.Responder[armpostgresql.BackupsAutomaticAndOnDemandClientGetResponse], errResp azfake.ErrorResponder) + + // NewListByServerPager is the fake for method BackupsAutomaticAndOnDemandClient.NewListByServerPager + // HTTP status codes to indicate success: http.StatusOK + NewListByServerPager func(resourceGroupName string, serverName string, options *armpostgresql.BackupsAutomaticAndOnDemandClientListByServerOptions) (resp azfake.PagerResponder[armpostgresql.BackupsAutomaticAndOnDemandClientListByServerResponse]) +} + +// NewBackupsAutomaticAndOnDemandServerTransport creates a new instance of BackupsAutomaticAndOnDemandServerTransport with the provided implementation. +// The returned BackupsAutomaticAndOnDemandServerTransport instance is connected to an instance of armpostgresql.BackupsAutomaticAndOnDemandClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewBackupsAutomaticAndOnDemandServerTransport(srv *BackupsAutomaticAndOnDemandServer) *BackupsAutomaticAndOnDemandServerTransport { + return &BackupsAutomaticAndOnDemandServerTransport{ + srv: srv, + beginCreate: newTracker[azfake.PollerResponder[armpostgresql.BackupsAutomaticAndOnDemandClientCreateResponse]](), + beginDelete: newTracker[azfake.PollerResponder[armpostgresql.BackupsAutomaticAndOnDemandClientDeleteResponse]](), + newListByServerPager: newTracker[azfake.PagerResponder[armpostgresql.BackupsAutomaticAndOnDemandClientListByServerResponse]](), + } +} + +// BackupsAutomaticAndOnDemandServerTransport connects instances of armpostgresql.BackupsAutomaticAndOnDemandClient to instances of BackupsAutomaticAndOnDemandServer. +// Don't use this type directly, use NewBackupsAutomaticAndOnDemandServerTransport instead. +type BackupsAutomaticAndOnDemandServerTransport struct { + srv *BackupsAutomaticAndOnDemandServer + beginCreate *tracker[azfake.PollerResponder[armpostgresql.BackupsAutomaticAndOnDemandClientCreateResponse]] + beginDelete *tracker[azfake.PollerResponder[armpostgresql.BackupsAutomaticAndOnDemandClientDeleteResponse]] + newListByServerPager *tracker[azfake.PagerResponder[armpostgresql.BackupsAutomaticAndOnDemandClientListByServerResponse]] +} + +// 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 { + return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} + } + + return b.dispatchToMethodFake(req, method) +} + +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 backupsAutomaticAndOnDemandServerTransportInterceptor != nil { + res.resp, res.err, intercepted = backupsAutomaticAndOnDemandServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "BackupsAutomaticAndOnDemandClient.BeginCreate": + res.resp, res.err = b.dispatchBeginCreate(req) + case "BackupsAutomaticAndOnDemandClient.BeginDelete": + res.resp, res.err = b.dispatchBeginDelete(req) + case "BackupsAutomaticAndOnDemandClient.Get": + res.resp, res.err = b.dispatchGet(req) + case "BackupsAutomaticAndOnDemandClient.NewListByServerPager": + res.resp, res.err = b.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 (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")} + } + beginCreate := b.beginCreate.get(req) + if beginCreate == nil { + 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 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.BeginCreate(req.Context(), resourceGroupNameParam, serverNameParam, backupNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginCreate = &respr + b.beginCreate.add(req, beginCreate) + } + + resp, err := server.PollerResponderNext(beginCreate, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + b.beginCreate.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + } + if !server.PollerResponderMore(beginCreate) { + b.beginCreate.remove(req) + } + + return resp, nil +} + +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")} + } + beginDelete := b.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~%@]+)/backups/(?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.BeginDelete(req.Context(), resourceGroupNameParam, serverNameParam, backupNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginDelete = &respr + b.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) { + b.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) { + b.beginDelete.remove(req) + } + + return resp, nil +} + +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 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).BackupAutomaticAndOnDemand, req) + if err != nil { + return nil, err + } + return resp, nil +} + +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")} + } + 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~%@]+)/backups` + 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 *armpostgresql.BackupsAutomaticAndOnDemandClientListByServerResponse, 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 +} + +// 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/armpostgresql/fake/backupslongtermretention_server.go b/sdk/resourcemanager/postgresql/armpostgresql/fake/backupslongtermretention_server.go new file mode 100644 index 000000000000..0162b268a51b --- /dev/null +++ b/sdk/resourcemanager/postgresql/armpostgresql/fake/backupslongtermretention_server.go @@ -0,0 +1,279 @@ +// 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) Go Code Generator. DO NOT EDIT. + +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/armpostgresql/v2" + "net/http" + "net/url" + "regexp" +) + +// BackupsLongTermRetentionServer is a fake server for instances of the armpostgresql.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 armpostgresql.LtrPreBackupRequest, options *armpostgresql.BackupsLongTermRetentionClientCheckPrerequisitesOptions) (resp azfake.Responder[armpostgresql.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 *armpostgresql.BackupsLongTermRetentionClientGetOptions) (resp azfake.Responder[armpostgresql.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 *armpostgresql.BackupsLongTermRetentionClientListByServerOptions) (resp azfake.PagerResponder[armpostgresql.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 armpostgresql.BackupsLongTermRetentionRequest, options *armpostgresql.BackupsLongTermRetentionClientBeginStartOptions) (resp azfake.PollerResponder[armpostgresql.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 armpostgresql.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[armpostgresql.BackupsLongTermRetentionClientListByServerResponse]](), + beginStart: newTracker[azfake.PollerResponder[armpostgresql.BackupsLongTermRetentionClientStartResponse]](), + } +} + +// BackupsLongTermRetentionServerTransport connects instances of armpostgresql.BackupsLongTermRetentionClient to instances of BackupsLongTermRetentionServer. +// Don't use this type directly, use NewBackupsLongTermRetentionServerTransport instead. +type BackupsLongTermRetentionServerTransport struct { + srv *BackupsLongTermRetentionServer + newListByServerPager *tracker[azfake.PagerResponder[armpostgresql.BackupsLongTermRetentionClientListByServerResponse]] + beginStart *tracker[azfake.PollerResponder[armpostgresql.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[armpostgresql.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 *armpostgresql.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[armpostgresql.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/armpostgresql/fake/capabilitiesbylocation_server.go b/sdk/resourcemanager/postgresql/armpostgresql/fake/capabilitiesbylocation_server.go new file mode 100644 index 000000000000..df9e4622fbc9 --- /dev/null +++ b/sdk/resourcemanager/postgresql/armpostgresql/fake/capabilitiesbylocation_server.go @@ -0,0 +1,129 @@ +// 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) Go Code Generator. DO NOT EDIT. + +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/armpostgresql/v2" + "net/http" + "net/url" + "regexp" +) + +// CapabilitiesByLocationServer is a fake server for instances of the armpostgresql.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 *armpostgresql.CapabilitiesByLocationClientListOptions) (resp azfake.PagerResponder[armpostgresql.CapabilitiesByLocationClientListResponse]) +} + +// NewCapabilitiesByLocationServerTransport creates a new instance of CapabilitiesByLocationServerTransport with the provided implementation. +// The returned CapabilitiesByLocationServerTransport instance is connected to an instance of armpostgresql.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[armpostgresql.CapabilitiesByLocationClientListResponse]](), + } +} + +// CapabilitiesByLocationServerTransport connects instances of armpostgresql.CapabilitiesByLocationClient to instances of CapabilitiesByLocationServer. +// Don't use this type directly, use NewCapabilitiesByLocationServerTransport instead. +type CapabilitiesByLocationServerTransport struct { + srv *CapabilitiesByLocationServer + newListPager *tracker[azfake.PagerResponder[armpostgresql.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 *armpostgresql.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/armpostgresql/fake/capabilitiesbyserver_server.go b/sdk/resourcemanager/postgresql/armpostgresql/fake/capabilitiesbyserver_server.go new file mode 100644 index 000000000000..b34ab96a18c8 --- /dev/null +++ b/sdk/resourcemanager/postgresql/armpostgresql/fake/capabilitiesbyserver_server.go @@ -0,0 +1,133 @@ +// 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) Go Code Generator. DO NOT EDIT. + +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/armpostgresql/v2" + "net/http" + "net/url" + "regexp" +) + +// CapabilitiesByServerServer is a fake server for instances of the armpostgresql.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 *armpostgresql.CapabilitiesByServerClientListOptions) (resp azfake.PagerResponder[armpostgresql.CapabilitiesByServerClientListResponse]) +} + +// NewCapabilitiesByServerServerTransport creates a new instance of CapabilitiesByServerServerTransport with the provided implementation. +// The returned CapabilitiesByServerServerTransport instance is connected to an instance of armpostgresql.CapabilitiesByServerClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewCapabilitiesByServerServerTransport(srv *CapabilitiesByServerServer) *CapabilitiesByServerServerTransport { + return &CapabilitiesByServerServerTransport{ + srv: srv, + newListPager: newTracker[azfake.PagerResponder[armpostgresql.CapabilitiesByServerClientListResponse]](), + } +} + +// CapabilitiesByServerServerTransport connects instances of armpostgresql.CapabilitiesByServerClient to instances of CapabilitiesByServerServer. +// Don't use this type directly, use NewCapabilitiesByServerServerTransport instead. +type CapabilitiesByServerServerTransport struct { + srv *CapabilitiesByServerServer + newListPager *tracker[azfake.PagerResponder[armpostgresql.CapabilitiesByServerClientListResponse]] +} + +// 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 c.dispatchToMethodFake(req, method) +} + +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 capabilitiesByServerTransportInterceptor != nil { + res.resp, res.err, intercepted = capabilitiesByServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "CapabilitiesByServerClient.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 *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 := 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 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 := c.srv.NewListPager(resourceGroupNameParam, serverNameParam, nil) + newListPager = &resp + c.newListPager.add(req, newListPager) + server.PagerResponderInjectNextLinks(newListPager, req, func(page *armpostgresql.CapabilitiesByServerClientListResponse, 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 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/armpostgresql/fake/capturedlogs_server.go b/sdk/resourcemanager/postgresql/armpostgresql/fake/capturedlogs_server.go new file mode 100644 index 000000000000..5f9432a4480e --- /dev/null +++ b/sdk/resourcemanager/postgresql/armpostgresql/fake/capturedlogs_server.go @@ -0,0 +1,133 @@ +// 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) Go Code Generator. DO NOT EDIT. + +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/armpostgresql/v2" + "net/http" + "net/url" + "regexp" +) + +// CapturedLogsServer is a fake server for instances of the armpostgresql.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 *armpostgresql.CapturedLogsClientListByServerOptions) (resp azfake.PagerResponder[armpostgresql.CapturedLogsClientListByServerResponse]) +} + +// NewCapturedLogsServerTransport creates a new instance of CapturedLogsServerTransport with the provided implementation. +// The returned CapturedLogsServerTransport instance is connected to an instance of armpostgresql.CapturedLogsClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewCapturedLogsServerTransport(srv *CapturedLogsServer) *CapturedLogsServerTransport { + return &CapturedLogsServerTransport{ + srv: srv, + newListByServerPager: newTracker[azfake.PagerResponder[armpostgresql.CapturedLogsClientListByServerResponse]](), + } +} + +// CapturedLogsServerTransport connects instances of armpostgresql.CapturedLogsClient to instances of CapturedLogsServer. +// Don't use this type directly, use NewCapturedLogsServerTransport instead. +type CapturedLogsServerTransport struct { + srv *CapturedLogsServer + newListByServerPager *tracker[azfake.PagerResponder[armpostgresql.CapturedLogsClientListByServerResponse]] +} + +// 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 c.dispatchToMethodFake(req, method) +} + +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 capturedLogsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = capturedLogsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "CapturedLogsClient.NewListByServerPager": + res.resp, res.err = c.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 (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 := 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 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 := c.srv.NewListByServerPager(resourceGroupNameParam, serverNameParam, nil) + newListByServerPager = &resp + c.newListByServerPager.add(req, newListByServerPager) + server.PagerResponderInjectNextLinks(newListByServerPager, req, func(page *armpostgresql.CapturedLogsClientListByServerResponse, 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) { + c.newListByServerPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListByServerPager) { + c.newListByServerPager.remove(req) + } + return resp, nil +} + +// 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/armpostgresql/fake/checknameavailability_server.go b/sdk/resourcemanager/postgresql/armpostgresql/fake/checknameavailability_server.go deleted file mode 100644 index 5592fb332989..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresql/fake/checknameavailability_server.go +++ /dev/null @@ -1,92 +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/armpostgresql" - "net/http" - "regexp" -) - -// CheckNameAvailabilityServer is a fake server for instances of the armpostgresql.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 armpostgresql.NameAvailabilityRequest, options *armpostgresql.CheckNameAvailabilityClientExecuteOptions) (resp azfake.Responder[armpostgresql.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 armpostgresql.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 armpostgresql.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")} - } - - var resp *http.Response - var err error - - switch method { - case "CheckNameAvailabilityClient.Execute": - resp, err = c.dispatchExecute(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } - - if err != nil { - return nil, err - } - - return resp, nil -} - -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[armpostgresql.NameAvailabilityRequest](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 -} diff --git a/sdk/resourcemanager/postgresql/armpostgresql/fake/configurations_server.go b/sdk/resourcemanager/postgresql/armpostgresql/fake/configurations_server.go index 2b92b2ee8985..f77ab5dbc5c3 100644 --- a/sdk/resourcemanager/postgresql/armpostgresql/fake/configurations_server.go +++ b/sdk/resourcemanager/postgresql/armpostgresql/fake/configurations_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -12,7 +11,8 @@ 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/resourcemanager/postgresql/armpostgresql" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresql/v2" "net/http" "net/url" "regexp" @@ -20,17 +20,21 @@ import ( // ConfigurationsServer is a fake server for instances of the armpostgresql.ConfigurationsClient type. type ConfigurationsServer struct { - // BeginCreateOrUpdate is the fake for method ConfigurationsClient.BeginCreateOrUpdate - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted - BeginCreateOrUpdate func(ctx context.Context, resourceGroupName string, serverName string, configurationName string, parameters armpostgresql.Configuration, options *armpostgresql.ConfigurationsClientBeginCreateOrUpdateOptions) (resp azfake.PollerResponder[armpostgresql.ConfigurationsClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) - // Get is the fake for method ConfigurationsClient.Get // HTTP status codes to indicate success: http.StatusOK - Get func(ctx context.Context, resourceGroupName string, serverName string, configurationName string, options *armpostgresql.ConfigurationsClientGetOptions) (resp azfake.Responder[armpostgresql.ConfigurationsClientGetResponse], errResp azfake.ErrorResponder) + Get func(ctx context.Context, resourceGroupName string, serverName string, configurationName string, options *armpostgresql.ConfigurationsClientGetOptions) (resp azfake.Responder[armpostgresql.ConfigurationsClientGetResponse], errResp azfake.ErrorResponder) // NewListByServerPager is the fake for method ConfigurationsClient.NewListByServerPager // HTTP status codes to indicate success: http.StatusOK - NewListByServerPager func(resourceGroupName string, serverName string, options *armpostgresql.ConfigurationsClientListByServerOptions) (resp azfake.PagerResponder[armpostgresql.ConfigurationsClientListByServerResponse]) + NewListByServerPager func(resourceGroupName string, serverName string, options *armpostgresql.ConfigurationsClientListByServerOptions) (resp azfake.PagerResponder[armpostgresql.ConfigurationsClientListByServerResponse]) + + // BeginPut is the fake for method ConfigurationsClient.BeginPut + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + BeginPut func(ctx context.Context, resourceGroupName string, serverName string, configurationName string, parameters armpostgresql.ConfigurationForUpdate, options *armpostgresql.ConfigurationsClientBeginPutOptions) (resp azfake.PollerResponder[armpostgresql.ConfigurationsClientPutResponse], errResp azfake.ErrorResponder) + + // BeginUpdate is the fake for method ConfigurationsClient.BeginUpdate + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + BeginUpdate func(ctx context.Context, resourceGroupName string, serverName string, configurationName string, parameters armpostgresql.ConfigurationForUpdate, options *armpostgresql.ConfigurationsClientBeginUpdateOptions) (resp azfake.PollerResponder[armpostgresql.ConfigurationsClientUpdateResponse], errResp azfake.ErrorResponder) } // NewConfigurationsServerTransport creates a new instance of ConfigurationsServerTransport with the provided implementation. @@ -38,18 +42,20 @@ type ConfigurationsServer struct { // azcore.ClientOptions.Transporter field in the client's constructor parameters. func NewConfigurationsServerTransport(srv *ConfigurationsServer) *ConfigurationsServerTransport { return &ConfigurationsServerTransport{ - srv: srv, - beginCreateOrUpdate: newTracker[azfake.PollerResponder[armpostgresql.ConfigurationsClientCreateOrUpdateResponse]](), - newListByServerPager: newTracker[azfake.PagerResponder[armpostgresql.ConfigurationsClientListByServerResponse]](), + srv: srv, + newListByServerPager: newTracker[azfake.PagerResponder[armpostgresql.ConfigurationsClientListByServerResponse]](), + beginPut: newTracker[azfake.PollerResponder[armpostgresql.ConfigurationsClientPutResponse]](), + beginUpdate: newTracker[azfake.PollerResponder[armpostgresql.ConfigurationsClientUpdateResponse]](), } } // ConfigurationsServerTransport connects instances of armpostgresql.ConfigurationsClient to instances of ConfigurationsServer. // Don't use this type directly, use NewConfigurationsServerTransport instead. type ConfigurationsServerTransport struct { - srv *ConfigurationsServer - beginCreateOrUpdate *tracker[azfake.PollerResponder[armpostgresql.ConfigurationsClientCreateOrUpdateResponse]] - newListByServerPager *tracker[azfake.PagerResponder[armpostgresql.ConfigurationsClientListByServerResponse]] + srv *ConfigurationsServer + newListByServerPager *tracker[azfake.PagerResponder[armpostgresql.ConfigurationsClientListByServerResponse]] + beginPut *tracker[azfake.PollerResponder[armpostgresql.ConfigurationsClientPutResponse]] + beginUpdate *tracker[azfake.PollerResponder[armpostgresql.ConfigurationsClientUpdateResponse]] } // Do implements the policy.Transporter interface for ConfigurationsServerTransport. @@ -60,87 +66,56 @@ func (c *ConfigurationsServerTransport) Do(req *http.Request) (*http.Response, e return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error - - switch method { - case "ConfigurationsClient.BeginCreateOrUpdate": - resp, err = c.dispatchBeginCreateOrUpdate(req) - case "ConfigurationsClient.Get": - resp, err = c.dispatchGet(req) - case "ConfigurationsClient.NewListByServerPager": - resp, err = c.dispatchNewListByServerPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } - - if err != nil { - return nil, err - } - - return resp, nil + return c.dispatchToMethodFake(req, method) } -func (c *ConfigurationsServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { - if c.srv.BeginCreateOrUpdate == nil { - return nil, &nonRetriableError{errors.New("fake for method BeginCreateOrUpdate not implemented")} - } - beginCreateOrUpdate := c.beginCreateOrUpdate.get(req) - if beginCreateOrUpdate == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/servers/(?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 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - body, err := server.UnmarshalRequestAsJSON[armpostgresql.Configuration](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 +func (c *ConfigurationsServerTransport) 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 configurationsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = configurationsServerTransportInterceptor.Do(req) } - configurationNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("configurationName")]) - if err != nil { - return nil, err + if !intercepted { + switch method { + case "ConfigurationsClient.Get": + res.resp, res.err = c.dispatchGet(req) + case "ConfigurationsClient.NewListByServerPager": + res.resp, res.err = c.dispatchNewListByServerPager(req) + case "ConfigurationsClient.BeginPut": + res.resp, res.err = c.dispatchBeginPut(req) + case "ConfigurationsClient.BeginUpdate": + res.resp, res.err = c.dispatchBeginUpdate(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } + } - respr, errRespr := c.srv.BeginCreateOrUpdate(req.Context(), resourceGroupNameParam, serverNameParam, configurationNameParam, body, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr + select { + case resultChan <- res: + case <-req.Context().Done(): } - beginCreateOrUpdate = &respr - c.beginCreateOrUpdate.add(req, beginCreateOrUpdate) - } + }() - resp, err := server.PollerResponderNext(beginCreateOrUpdate, req) - if err != nil { - return nil, err + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err } - - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { - c.beginCreateOrUpdate.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} - } - if !server.PollerResponderMore(beginCreateOrUpdate) { - c.beginCreateOrUpdate.remove(req) - } - - return resp, nil } func (c *ConfigurationsServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { if c.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/servers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/configurations/(?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~%@]+)/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")]) @@ -176,10 +151,10 @@ func (c *ConfigurationsServerTransport) dispatchNewListByServerPager(req *http.R } 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/servers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/configurations` + 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")]) @@ -193,6 +168,9 @@ func (c *ConfigurationsServerTransport) dispatchNewListByServerPager(req *http.R resp := c.srv.NewListByServerPager(resourceGroupNameParam, serverNameParam, nil) newListByServerPager = &resp c.newListByServerPager.add(req, newListByServerPager) + server.PagerResponderInjectNextLinks(newListByServerPager, req, func(page *armpostgresql.ConfigurationsClientListByServerResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) } resp, err := server.PagerResponderNext(newListByServerPager, req) if err != nil { @@ -207,3 +185,113 @@ func (c *ConfigurationsServerTransport) dispatchNewListByServerPager(req *http.R } return resp, nil } + +func (c *ConfigurationsServerTransport) dispatchBeginPut(req *http.Request) (*http.Response, error) { + if c.srv.BeginPut == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginPut not implemented")} + } + beginPut := c.beginPut.get(req) + if beginPut == nil { + 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 len(matches) < 5 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armpostgresql.ConfigurationForUpdate](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 + } + configurationNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("configurationName")]) + if err != nil { + return nil, err + } + respr, errRespr := c.srv.BeginPut(req.Context(), resourceGroupNameParam, serverNameParam, configurationNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginPut = &respr + c.beginPut.add(req, beginPut) + } + + resp, err := server.PollerResponderNext(beginPut, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + c.beginPut.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + } + if !server.PollerResponderMore(beginPut) { + c.beginPut.remove(req) + } + + return resp, nil +} + +func (c *ConfigurationsServerTransport) dispatchBeginUpdate(req *http.Request) (*http.Response, error) { + if c.srv.BeginUpdate == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginUpdate not implemented")} + } + beginUpdate := c.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~%@]+)/configurations/(?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[armpostgresql.ConfigurationForUpdate](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 + } + configurationNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("configurationName")]) + if err != nil { + return nil, err + } + respr, errRespr := c.srv.BeginUpdate(req.Context(), resourceGroupNameParam, serverNameParam, configurationNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginUpdate = &respr + c.beginUpdate.add(req, beginUpdate) + } + + resp, err := server.PollerResponderNext(beginUpdate, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + c.beginUpdate.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + } + if !server.PollerResponderMore(beginUpdate) { + c.beginUpdate.remove(req) + } + + return resp, nil +} + +// set this to conditionally intercept incoming requests to ConfigurationsServerTransport +var configurationsServerTransportInterceptor 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/armpostgresql/fake/databases_server.go b/sdk/resourcemanager/postgresql/armpostgresql/fake/databases_server.go index 85985a0d8dfc..505745303781 100644 --- a/sdk/resourcemanager/postgresql/armpostgresql/fake/databases_server.go +++ b/sdk/resourcemanager/postgresql/armpostgresql/fake/databases_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -12,7 +11,8 @@ 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/resourcemanager/postgresql/armpostgresql" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresql/v2" "net/http" "net/url" "regexp" @@ -20,21 +20,21 @@ import ( // DatabasesServer is a fake server for instances of the armpostgresql.DatabasesClient type. type DatabasesServer struct { - // BeginCreateOrUpdate is the fake for method DatabasesClient.BeginCreateOrUpdate - // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated, http.StatusAccepted - BeginCreateOrUpdate func(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters armpostgresql.Database, options *armpostgresql.DatabasesClientBeginCreateOrUpdateOptions) (resp azfake.PollerResponder[armpostgresql.DatabasesClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) + // BeginCreate is the fake for method DatabasesClient.BeginCreate + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + BeginCreate func(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters armpostgresql.Database, options *armpostgresql.DatabasesClientBeginCreateOptions) (resp azfake.PollerResponder[armpostgresql.DatabasesClientCreateResponse], errResp azfake.ErrorResponder) // BeginDelete is the fake for method DatabasesClient.BeginDelete // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent - BeginDelete func(ctx context.Context, resourceGroupName string, serverName string, databaseName string, options *armpostgresql.DatabasesClientBeginDeleteOptions) (resp azfake.PollerResponder[armpostgresql.DatabasesClientDeleteResponse], errResp azfake.ErrorResponder) + BeginDelete func(ctx context.Context, resourceGroupName string, serverName string, databaseName string, options *armpostgresql.DatabasesClientBeginDeleteOptions) (resp azfake.PollerResponder[armpostgresql.DatabasesClientDeleteResponse], errResp azfake.ErrorResponder) // Get is the fake for method DatabasesClient.Get // HTTP status codes to indicate success: http.StatusOK - Get func(ctx context.Context, resourceGroupName string, serverName string, databaseName string, options *armpostgresql.DatabasesClientGetOptions) (resp azfake.Responder[armpostgresql.DatabasesClientGetResponse], errResp azfake.ErrorResponder) + Get func(ctx context.Context, resourceGroupName string, serverName string, databaseName string, options *armpostgresql.DatabasesClientGetOptions) (resp azfake.Responder[armpostgresql.DatabasesClientGetResponse], errResp azfake.ErrorResponder) // NewListByServerPager is the fake for method DatabasesClient.NewListByServerPager // HTTP status codes to indicate success: http.StatusOK - NewListByServerPager func(resourceGroupName string, serverName string, options *armpostgresql.DatabasesClientListByServerOptions) (resp azfake.PagerResponder[armpostgresql.DatabasesClientListByServerResponse]) + NewListByServerPager func(resourceGroupName string, serverName string, options *armpostgresql.DatabasesClientListByServerOptions) (resp azfake.PagerResponder[armpostgresql.DatabasesClientListByServerResponse]) } // NewDatabasesServerTransport creates a new instance of DatabasesServerTransport with the provided implementation. @@ -42,20 +42,20 @@ type DatabasesServer struct { // azcore.ClientOptions.Transporter field in the client's constructor parameters. func NewDatabasesServerTransport(srv *DatabasesServer) *DatabasesServerTransport { return &DatabasesServerTransport{ - srv: srv, - beginCreateOrUpdate: newTracker[azfake.PollerResponder[armpostgresql.DatabasesClientCreateOrUpdateResponse]](), - beginDelete: newTracker[azfake.PollerResponder[armpostgresql.DatabasesClientDeleteResponse]](), - newListByServerPager: newTracker[azfake.PagerResponder[armpostgresql.DatabasesClientListByServerResponse]](), + srv: srv, + beginCreate: newTracker[azfake.PollerResponder[armpostgresql.DatabasesClientCreateResponse]](), + beginDelete: newTracker[azfake.PollerResponder[armpostgresql.DatabasesClientDeleteResponse]](), + newListByServerPager: newTracker[azfake.PagerResponder[armpostgresql.DatabasesClientListByServerResponse]](), } } // DatabasesServerTransport connects instances of armpostgresql.DatabasesClient to instances of DatabasesServer. // Don't use this type directly, use NewDatabasesServerTransport instead. type DatabasesServerTransport struct { - srv *DatabasesServer - beginCreateOrUpdate *tracker[azfake.PollerResponder[armpostgresql.DatabasesClientCreateOrUpdateResponse]] - beginDelete *tracker[azfake.PollerResponder[armpostgresql.DatabasesClientDeleteResponse]] - newListByServerPager *tracker[azfake.PagerResponder[armpostgresql.DatabasesClientListByServerResponse]] + srv *DatabasesServer + beginCreate *tracker[azfake.PollerResponder[armpostgresql.DatabasesClientCreateResponse]] + beginDelete *tracker[azfake.PollerResponder[armpostgresql.DatabasesClientDeleteResponse]] + newListByServerPager *tracker[azfake.PagerResponder[armpostgresql.DatabasesClientListByServerResponse]] } // Do implements the policy.Transporter interface for DatabasesServerTransport. @@ -66,39 +66,58 @@ func (d *DatabasesServerTransport) Do(req *http.Request) (*http.Response, error) return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return d.dispatchToMethodFake(req, method) +} - switch method { - case "DatabasesClient.BeginCreateOrUpdate": - resp, err = d.dispatchBeginCreateOrUpdate(req) - case "DatabasesClient.BeginDelete": - resp, err = d.dispatchBeginDelete(req) - case "DatabasesClient.Get": - resp, err = d.dispatchGet(req) - case "DatabasesClient.NewListByServerPager": - resp, err = d.dispatchNewListByServerPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (d *DatabasesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if databasesServerTransportInterceptor != nil { + res.resp, res.err, intercepted = databasesServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "DatabasesClient.BeginCreate": + res.resp, res.err = d.dispatchBeginCreate(req) + case "DatabasesClient.BeginDelete": + res.resp, res.err = d.dispatchBeginDelete(req) + case "DatabasesClient.Get": + res.resp, res.err = d.dispatchGet(req) + case "DatabasesClient.NewListByServerPager": + res.resp, res.err = d.dispatchNewListByServerPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + 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 (d *DatabasesServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { - if d.srv.BeginCreateOrUpdate == nil { - return nil, &nonRetriableError{errors.New("fake for method BeginCreateOrUpdate not implemented")} +func (d *DatabasesServerTransport) dispatchBeginCreate(req *http.Request) (*http.Response, error) { + if d.srv.BeginCreate == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginCreate not implemented")} } - beginCreateOrUpdate := d.beginCreateOrUpdate.get(req) - if beginCreateOrUpdate == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/servers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/databases/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + beginCreate := d.beginCreate.get(req) + if beginCreate == nil { + 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[armpostgresql.Database](req) @@ -117,25 +136,25 @@ func (d *DatabasesServerTransport) dispatchBeginCreateOrUpdate(req *http.Request if err != nil { return nil, err } - respr, errRespr := d.srv.BeginCreateOrUpdate(req.Context(), resourceGroupNameParam, serverNameParam, databaseNameParam, body, nil) + respr, errRespr := d.srv.BeginCreate(req.Context(), resourceGroupNameParam, serverNameParam, databaseNameParam, body, nil) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } - beginCreateOrUpdate = &respr - d.beginCreateOrUpdate.add(req, beginCreateOrUpdate) + beginCreate = &respr + d.beginCreate.add(req, beginCreate) } - resp, err := server.PollerResponderNext(beginCreateOrUpdate, req) + resp, err := server.PollerResponderNext(beginCreate, req) if err != nil { return nil, err } - if !contains([]int{http.StatusOK, http.StatusCreated, http.StatusAccepted}, resp.StatusCode) { - d.beginCreateOrUpdate.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}, resp.StatusCode) { + d.beginCreate.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } - if !server.PollerResponderMore(beginCreateOrUpdate) { - d.beginCreateOrUpdate.remove(req) + if !server.PollerResponderMore(beginCreate) { + d.beginCreate.remove(req) } return resp, nil @@ -147,10 +166,10 @@ func (d *DatabasesServerTransport) dispatchBeginDelete(req *http.Request) (*http } beginDelete := d.beginDelete.get(req) if beginDelete == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/servers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/databases/(?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~%@]+)/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")]) @@ -193,10 +212,10 @@ func (d *DatabasesServerTransport) dispatchGet(req *http.Request) (*http.Respons if d.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/servers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/databases/(?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~%@]+)/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")]) @@ -232,10 +251,10 @@ func (d *DatabasesServerTransport) dispatchNewListByServerPager(req *http.Reques } newListByServerPager := d.newListByServerPager.get(req) if newListByServerPager == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/servers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/databases` + 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")]) @@ -249,6 +268,9 @@ func (d *DatabasesServerTransport) dispatchNewListByServerPager(req *http.Reques resp := d.srv.NewListByServerPager(resourceGroupNameParam, serverNameParam, nil) newListByServerPager = &resp d.newListByServerPager.add(req, newListByServerPager) + server.PagerResponderInjectNextLinks(newListByServerPager, req, func(page *armpostgresql.DatabasesClientListByServerResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) } resp, err := server.PagerResponderNext(newListByServerPager, req) if err != nil { @@ -263,3 +285,9 @@ func (d *DatabasesServerTransport) dispatchNewListByServerPager(req *http.Reques } return resp, nil } + +// set this to conditionally intercept incoming requests to DatabasesServerTransport +var databasesServerTransportInterceptor 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/armpostgresql/fake/firewallrules_server.go b/sdk/resourcemanager/postgresql/armpostgresql/fake/firewallrules_server.go index b4dc519631cd..88eb8bc81c59 100644 --- a/sdk/resourcemanager/postgresql/armpostgresql/fake/firewallrules_server.go +++ b/sdk/resourcemanager/postgresql/armpostgresql/fake/firewallrules_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -12,7 +11,8 @@ 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/resourcemanager/postgresql/armpostgresql" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresql/v2" "net/http" "net/url" "regexp" @@ -21,20 +21,20 @@ import ( // FirewallRulesServer is a fake server for instances of the armpostgresql.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 - BeginCreateOrUpdate func(ctx context.Context, resourceGroupName string, serverName string, firewallRuleName string, parameters armpostgresql.FirewallRule, options *armpostgresql.FirewallRulesClientBeginCreateOrUpdateOptions) (resp azfake.PollerResponder[armpostgresql.FirewallRulesClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + BeginCreateOrUpdate func(ctx context.Context, resourceGroupName string, serverName string, firewallRuleName string, parameters armpostgresql.FirewallRule, options *armpostgresql.FirewallRulesClientBeginCreateOrUpdateOptions) (resp azfake.PollerResponder[armpostgresql.FirewallRulesClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) // BeginDelete is the fake for method FirewallRulesClient.BeginDelete // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent - BeginDelete func(ctx context.Context, resourceGroupName string, serverName string, firewallRuleName string, options *armpostgresql.FirewallRulesClientBeginDeleteOptions) (resp azfake.PollerResponder[armpostgresql.FirewallRulesClientDeleteResponse], errResp azfake.ErrorResponder) + BeginDelete func(ctx context.Context, resourceGroupName string, serverName string, firewallRuleName string, options *armpostgresql.FirewallRulesClientBeginDeleteOptions) (resp azfake.PollerResponder[armpostgresql.FirewallRulesClientDeleteResponse], errResp azfake.ErrorResponder) // Get is the fake for method FirewallRulesClient.Get // HTTP status codes to indicate success: http.StatusOK - Get func(ctx context.Context, resourceGroupName string, serverName string, firewallRuleName string, options *armpostgresql.FirewallRulesClientGetOptions) (resp azfake.Responder[armpostgresql.FirewallRulesClientGetResponse], errResp azfake.ErrorResponder) + Get func(ctx context.Context, resourceGroupName string, serverName string, firewallRuleName string, options *armpostgresql.FirewallRulesClientGetOptions) (resp azfake.Responder[armpostgresql.FirewallRulesClientGetResponse], errResp azfake.ErrorResponder) // NewListByServerPager is the fake for method FirewallRulesClient.NewListByServerPager // HTTP status codes to indicate success: http.StatusOK - NewListByServerPager func(resourceGroupName string, serverName string, options *armpostgresql.FirewallRulesClientListByServerOptions) (resp azfake.PagerResponder[armpostgresql.FirewallRulesClientListByServerResponse]) + NewListByServerPager func(resourceGroupName string, serverName string, options *armpostgresql.FirewallRulesClientListByServerOptions) (resp azfake.PagerResponder[armpostgresql.FirewallRulesClientListByServerResponse]) } // NewFirewallRulesServerTransport creates a new instance of FirewallRulesServerTransport with the provided implementation. @@ -42,20 +42,20 @@ type FirewallRulesServer struct { // azcore.ClientOptions.Transporter field in the client's constructor parameters. func NewFirewallRulesServerTransport(srv *FirewallRulesServer) *FirewallRulesServerTransport { return &FirewallRulesServerTransport{ - srv: srv, - beginCreateOrUpdate: newTracker[azfake.PollerResponder[armpostgresql.FirewallRulesClientCreateOrUpdateResponse]](), - beginDelete: newTracker[azfake.PollerResponder[armpostgresql.FirewallRulesClientDeleteResponse]](), - newListByServerPager: newTracker[azfake.PagerResponder[armpostgresql.FirewallRulesClientListByServerResponse]](), + srv: srv, + beginCreateOrUpdate: newTracker[azfake.PollerResponder[armpostgresql.FirewallRulesClientCreateOrUpdateResponse]](), + beginDelete: newTracker[azfake.PollerResponder[armpostgresql.FirewallRulesClientDeleteResponse]](), + newListByServerPager: newTracker[azfake.PagerResponder[armpostgresql.FirewallRulesClientListByServerResponse]](), } } // FirewallRulesServerTransport connects instances of armpostgresql.FirewallRulesClient to instances of FirewallRulesServer. // Don't use this type directly, use NewFirewallRulesServerTransport instead. type FirewallRulesServerTransport struct { - srv *FirewallRulesServer - beginCreateOrUpdate *tracker[azfake.PollerResponder[armpostgresql.FirewallRulesClientCreateOrUpdateResponse]] - beginDelete *tracker[azfake.PollerResponder[armpostgresql.FirewallRulesClientDeleteResponse]] - newListByServerPager *tracker[azfake.PagerResponder[armpostgresql.FirewallRulesClientListByServerResponse]] + srv *FirewallRulesServer + beginCreateOrUpdate *tracker[azfake.PollerResponder[armpostgresql.FirewallRulesClientCreateOrUpdateResponse]] + beginDelete *tracker[azfake.PollerResponder[armpostgresql.FirewallRulesClientDeleteResponse]] + newListByServerPager *tracker[azfake.PagerResponder[armpostgresql.FirewallRulesClientListByServerResponse]] } // Do implements the policy.Transporter interface for FirewallRulesServerTransport. @@ -66,27 +66,46 @@ func (f *FirewallRulesServerTransport) Do(req *http.Request) (*http.Response, er return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return f.dispatchToMethodFake(req, method) +} - switch method { - case "FirewallRulesClient.BeginCreateOrUpdate": - resp, err = f.dispatchBeginCreateOrUpdate(req) - case "FirewallRulesClient.BeginDelete": - resp, err = f.dispatchBeginDelete(req) - case "FirewallRulesClient.Get": - resp, err = f.dispatchGet(req) - case "FirewallRulesClient.NewListByServerPager": - resp, err = f.dispatchNewListByServerPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (f *FirewallRulesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if firewallRulesServerTransportInterceptor != nil { + res.resp, res.err, intercepted = firewallRulesServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "FirewallRulesClient.BeginCreateOrUpdate": + res.resp, res.err = f.dispatchBeginCreateOrUpdate(req) + case "FirewallRulesClient.BeginDelete": + res.resp, res.err = f.dispatchBeginDelete(req) + case "FirewallRulesClient.Get": + res.resp, res.err = f.dispatchGet(req) + case "FirewallRulesClient.NewListByServerPager": + res.resp, res.err = f.dispatchNewListByServerPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + 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 *FirewallRulesServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -95,10 +114,10 @@ func (f *FirewallRulesServerTransport) dispatchBeginCreateOrUpdate(req *http.Req } beginCreateOrUpdate := f.beginCreateOrUpdate.get(req) if beginCreateOrUpdate == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/servers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/firewallRules/(?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~%@]+)/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[armpostgresql.FirewallRule](req) @@ -130,9 +149,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}, 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", resp.StatusCode)} } if !server.PollerResponderMore(beginCreateOrUpdate) { f.beginCreateOrUpdate.remove(req) @@ -147,10 +166,10 @@ func (f *FirewallRulesServerTransport) dispatchBeginDelete(req *http.Request) (* } beginDelete := f.beginDelete.get(req) if beginDelete == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/servers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/firewallRules/(?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~%@]+)/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")]) @@ -193,10 +212,10 @@ func (f *FirewallRulesServerTransport) dispatchGet(req *http.Request) (*http.Res if f.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/servers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/firewallRules/(?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~%@]+)/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")]) @@ -232,10 +251,10 @@ func (f *FirewallRulesServerTransport) dispatchNewListByServerPager(req *http.Re } newListByServerPager := f.newListByServerPager.get(req) if newListByServerPager == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/servers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/firewallRules` + 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")]) @@ -249,6 +268,9 @@ func (f *FirewallRulesServerTransport) dispatchNewListByServerPager(req *http.Re resp := f.srv.NewListByServerPager(resourceGroupNameParam, serverNameParam, nil) newListByServerPager = &resp f.newListByServerPager.add(req, newListByServerPager) + server.PagerResponderInjectNextLinks(newListByServerPager, req, func(page *armpostgresql.FirewallRulesClientListByServerResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) } resp, err := server.PagerResponderNext(newListByServerPager, req) if err != nil { @@ -263,3 +285,9 @@ func (f *FirewallRulesServerTransport) dispatchNewListByServerPager(req *http.Re } return resp, nil } + +// set this to conditionally intercept incoming requests to FirewallRulesServerTransport +var firewallRulesServerTransportInterceptor 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/armpostgresql/fake/internal.go b/sdk/resourcemanager/postgresql/armpostgresql/fake/internal.go index bc4792925ba9..048d31a43d14 100644 --- a/sdk/resourcemanager/postgresql/armpostgresql/fake/internal.go +++ b/sdk/resourcemanager/postgresql/armpostgresql/fake/internal.go @@ -1,16 +1,21 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "net/http" + "reflect" "sync" ) +type result struct { + resp *http.Response + err error +} + type nonRetriableError struct { error } @@ -28,6 +33,13 @@ func contains[T comparable](s []T, v T) bool { return false } +func getOptional[T any](v T) *T { + if reflect.ValueOf(v).IsZero() { + return nil + } + return &v +} + func parseWithCast[T any](v string, parse func(v string) (T, error)) (T, error) { t, err := parse(v) if err != nil { diff --git a/sdk/resourcemanager/postgresql/armpostgresql/fake/locationbasedperformancetier_server.go b/sdk/resourcemanager/postgresql/armpostgresql/fake/locationbasedperformancetier_server.go deleted file mode 100644 index 5d52c672b80f..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresql/fake/locationbasedperformancetier_server.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 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/resourcemanager/postgresql/armpostgresql" - "net/http" - "net/url" - "regexp" -) - -// LocationBasedPerformanceTierServer is a fake server for instances of the armpostgresql.LocationBasedPerformanceTierClient type. -type LocationBasedPerformanceTierServer struct { - // NewListPager is the fake for method LocationBasedPerformanceTierClient.NewListPager - // HTTP status codes to indicate success: http.StatusOK - NewListPager func(locationName string, options *armpostgresql.LocationBasedPerformanceTierClientListOptions) (resp azfake.PagerResponder[armpostgresql.LocationBasedPerformanceTierClientListResponse]) -} - -// NewLocationBasedPerformanceTierServerTransport creates a new instance of LocationBasedPerformanceTierServerTransport with the provided implementation. -// The returned LocationBasedPerformanceTierServerTransport instance is connected to an instance of armpostgresql.LocationBasedPerformanceTierClient via the -// azcore.ClientOptions.Transporter field in the client's constructor parameters. -func NewLocationBasedPerformanceTierServerTransport(srv *LocationBasedPerformanceTierServer) *LocationBasedPerformanceTierServerTransport { - return &LocationBasedPerformanceTierServerTransport{ - srv: srv, - newListPager: newTracker[azfake.PagerResponder[armpostgresql.LocationBasedPerformanceTierClientListResponse]](), - } -} - -// LocationBasedPerformanceTierServerTransport connects instances of armpostgresql.LocationBasedPerformanceTierClient to instances of LocationBasedPerformanceTierServer. -// Don't use this type directly, use NewLocationBasedPerformanceTierServerTransport instead. -type LocationBasedPerformanceTierServerTransport struct { - srv *LocationBasedPerformanceTierServer - newListPager *tracker[azfake.PagerResponder[armpostgresql.LocationBasedPerformanceTierClientListResponse]] -} - -// Do implements the policy.Transporter interface for LocationBasedPerformanceTierServerTransport. -func (l *LocationBasedPerformanceTierServerTransport) 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")} - } - - var resp *http.Response - var err error - - switch method { - case "LocationBasedPerformanceTierClient.NewListPager": - resp, err = l.dispatchNewListPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } - - if err != nil { - return nil, err - } - - return resp, nil -} - -func (l *LocationBasedPerformanceTierServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { - if l.srv.NewListPager == nil { - return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} - } - newListPager := l.newListPager.get(req) - if newListPager == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/locations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/performanceTiers` - 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.NewListPager(locationNameParam, nil) - newListPager = &resp - l.newListPager.add(req, newListPager) - } - resp, err := server.PagerResponderNext(newListPager, req) - if err != nil { - return nil, err - } - if !contains([]int{http.StatusOK}, resp.StatusCode) { - l.newListPager.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} - } - if !server.PagerResponderMore(newListPager) { - l.newListPager.remove(req) - } - return resp, nil -} diff --git a/sdk/resourcemanager/postgresql/armpostgresql/fake/logfiles_server.go b/sdk/resourcemanager/postgresql/armpostgresql/fake/logfiles_server.go deleted file mode 100644 index 9e03fd4272a5..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresql/fake/logfiles_server.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 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/resourcemanager/postgresql/armpostgresql" - "net/http" - "net/url" - "regexp" -) - -// LogFilesServer is a fake server for instances of the armpostgresql.LogFilesClient type. -type LogFilesServer struct { - // NewListByServerPager is the fake for method LogFilesClient.NewListByServerPager - // HTTP status codes to indicate success: http.StatusOK - NewListByServerPager func(resourceGroupName string, serverName string, options *armpostgresql.LogFilesClientListByServerOptions) (resp azfake.PagerResponder[armpostgresql.LogFilesClientListByServerResponse]) -} - -// NewLogFilesServerTransport creates a new instance of LogFilesServerTransport with the provided implementation. -// The returned LogFilesServerTransport instance is connected to an instance of armpostgresql.LogFilesClient via the -// azcore.ClientOptions.Transporter field in the client's constructor parameters. -func NewLogFilesServerTransport(srv *LogFilesServer) *LogFilesServerTransport { - return &LogFilesServerTransport{ - srv: srv, - newListByServerPager: newTracker[azfake.PagerResponder[armpostgresql.LogFilesClientListByServerResponse]](), - } -} - -// LogFilesServerTransport connects instances of armpostgresql.LogFilesClient to instances of LogFilesServer. -// Don't use this type directly, use NewLogFilesServerTransport instead. -type LogFilesServerTransport struct { - srv *LogFilesServer - newListByServerPager *tracker[azfake.PagerResponder[armpostgresql.LogFilesClientListByServerResponse]] -} - -// Do implements the policy.Transporter interface for LogFilesServerTransport. -func (l *LogFilesServerTransport) 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")} - } - - var resp *http.Response - var err error - - switch method { - case "LogFilesClient.NewListByServerPager": - resp, err = l.dispatchNewListByServerPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } - - if err != nil { - return nil, err - } - - return resp, nil -} - -func (l *LogFilesServerTransport) 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/servers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/logFiles` - 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) - } - 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 -} diff --git a/sdk/resourcemanager/postgresql/armpostgresql/fake/migrations_server.go b/sdk/resourcemanager/postgresql/armpostgresql/fake/migrations_server.go new file mode 100644 index 000000000000..41337044eb38 --- /dev/null +++ b/sdk/resourcemanager/postgresql/armpostgresql/fake/migrations_server.go @@ -0,0 +1,369 @@ +// 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) Go Code Generator. DO NOT EDIT. + +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/armpostgresql/v2" + "net/http" + "net/url" + "regexp" +) + +// MigrationsServer is a fake server for instances of the armpostgresql.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 *armpostgresql.MigrationsClientCancelOptions) (resp azfake.Responder[armpostgresql.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 armpostgresql.MigrationNameAvailability, options *armpostgresql.MigrationsClientCheckNameAvailabilityOptions) (resp azfake.Responder[armpostgresql.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, resourceGroupName string, serverName string, migrationName string, parameters armpostgresql.Migration, options *armpostgresql.MigrationsClientCreateOptions) (resp azfake.Responder[armpostgresql.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, resourceGroupName string, serverName string, migrationName string, options *armpostgresql.MigrationsClientGetOptions) (resp azfake.Responder[armpostgresql.MigrationsClientGetResponse], errResp azfake.ErrorResponder) + + // NewListByTargetServerPager is the fake for method MigrationsClient.NewListByTargetServerPager + // HTTP status codes to indicate success: http.StatusOK + NewListByTargetServerPager func(resourceGroupName string, serverName string, options *armpostgresql.MigrationsClientListByTargetServerOptions) (resp azfake.PagerResponder[armpostgresql.MigrationsClientListByTargetServerResponse]) + + // Update is the fake for method MigrationsClient.Update + // HTTP status codes to indicate success: http.StatusOK + Update func(ctx context.Context, resourceGroupName string, serverName string, migrationName string, parameters armpostgresql.MigrationResourceForPatch, options *armpostgresql.MigrationsClientUpdateOptions) (resp azfake.Responder[armpostgresql.MigrationsClientUpdateResponse], errResp azfake.ErrorResponder) +} + +// NewMigrationsServerTransport creates a new instance of MigrationsServerTransport with the provided implementation. +// The returned MigrationsServerTransport instance is connected to an instance of armpostgresql.MigrationsClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewMigrationsServerTransport(srv *MigrationsServer) *MigrationsServerTransport { + return &MigrationsServerTransport{ + srv: srv, + newListByTargetServerPager: newTracker[azfake.PagerResponder[armpostgresql.MigrationsClientListByTargetServerResponse]](), + } +} + +// MigrationsServerTransport connects instances of armpostgresql.MigrationsClient to instances of MigrationsServer. +// Don't use this type directly, use NewMigrationsServerTransport instead. +type MigrationsServerTransport struct { + srv *MigrationsServer + newListByTargetServerPager *tracker[azfake.PagerResponder[armpostgresql.MigrationsClientListByTargetServerResponse]] +} + +// Do implements the policy.Transporter interface for MigrationsServerTransport. +func (m *MigrationsServerTransport) 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 m.dispatchToMethodFake(req, method) +} + +func (m *MigrationsServerTransport) 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 migrationsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = migrationsServerTransportInterceptor.Do(req) + } + 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.Get": + res.resp, res.err = m.dispatchGet(req) + case "MigrationsClient.NewListByTargetServerPager": + res.resp, res.err = m.dispatchNewListByTargetServerPager(req) + case "MigrationsClient.Update": + res.resp, res.err = m.dispatchUpdate(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 (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~%@]+)` + 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 + } + migrationNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("migrationName")]) + if err != nil { + return nil, err + } + 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 + } + 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[armpostgresql.MigrationNameAvailability](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 := 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}, 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).MigrationNameAvailability, req) + if err != nil { + return nil, err + } + return resp, nil +} + +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~%@]+)` + 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[armpostgresql.Migration](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 + } + migrationNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("migrationName")]) + if err != nil { + return nil, err + } + 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.StatusCreated}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).Migration, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (m *MigrationsServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { + 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~%@]+)` + 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 + } + migrationNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("migrationName")]) + if err != nil { + return nil, err + } + respr, errRespr := m.srv.Get(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}, 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).Migration, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (m *MigrationsServerTransport) dispatchNewListByTargetServerPager(req *http.Request) (*http.Response, error) { + if m.srv.NewListByTargetServerPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListByTargetServerPager not implemented")} + } + 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` + 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) + } + 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 + } + migrationListFilterUnescaped, err := url.QueryUnescape(qp.Get("migrationListFilter")) + if err != nil { + return nil, err + } + migrationListFilterParam := getOptional(armpostgresql.MigrationListFilter(migrationListFilterUnescaped)) + var options *armpostgresql.MigrationsClientListByTargetServerOptions + if migrationListFilterParam != nil { + options = &armpostgresql.MigrationsClientListByTargetServerOptions{ + MigrationListFilter: migrationListFilterParam, + } + } + resp := m.srv.NewListByTargetServerPager(resourceGroupNameParam, serverNameParam, options) + newListByTargetServerPager = &resp + m.newListByTargetServerPager.add(req, newListByTargetServerPager) + server.PagerResponderInjectNextLinks(newListByTargetServerPager, req, func(page *armpostgresql.MigrationsClientListByTargetServerResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListByTargetServerPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + m.newListByTargetServerPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListByTargetServerPager) { + m.newListByTargetServerPager.remove(req) + } + return resp, nil +} + +func (m *MigrationsServerTransport) dispatchUpdate(req *http.Request) (*http.Response, error) { + 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~%@]+)` + 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[armpostgresql.MigrationResourceForPatch](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 + } + migrationNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("migrationName")]) + if err != nil { + return nil, err + } + respr, errRespr := m.srv.Update(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}, 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).Migration, req) + if err != nil { + return nil, err + } + return resp, nil +} + +// set this to conditionally intercept incoming requests to MigrationsServerTransport +var migrationsServerTransportInterceptor 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/armpostgresql/fake/nameavailability_server.go b/sdk/resourcemanager/postgresql/armpostgresql/fake/nameavailability_server.go new file mode 100644 index 000000000000..0cba6df55207 --- /dev/null +++ b/sdk/resourcemanager/postgresql/armpostgresql/fake/nameavailability_server.go @@ -0,0 +1,156 @@ +// 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) Go Code Generator. DO NOT EDIT. + +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/armpostgresql/v2" + "net/http" + "net/url" + "regexp" +) + +// NameAvailabilityServer is a fake server for instances of the armpostgresql.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 armpostgresql.CheckNameAvailabilityRequest, options *armpostgresql.NameAvailabilityClientCheckGloballyOptions) (resp azfake.Responder[armpostgresql.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 armpostgresql.CheckNameAvailabilityRequest, options *armpostgresql.NameAvailabilityClientCheckWithLocationOptions) (resp azfake.Responder[armpostgresql.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 armpostgresql.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 armpostgresql.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[armpostgresql.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[armpostgresql.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/armpostgresql/fake/operations_server.go b/sdk/resourcemanager/postgresql/armpostgresql/fake/operations_server.go index cdc5832f173b..e3abb43d1c05 100644 --- a/sdk/resourcemanager/postgresql/armpostgresql/fake/operations_server.go +++ b/sdk/resourcemanager/postgresql/armpostgresql/fake/operations_server.go @@ -1,39 +1,42 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. 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/armpostgresql" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresql/v2" "net/http" ) // OperationsServer is a fake server for instances of the armpostgresql.OperationsClient type. type OperationsServer struct { - // List is the fake for method OperationsClient.List + // NewListPager is the fake for method OperationsClient.NewListPager // HTTP status codes to indicate success: http.StatusOK - List func(ctx context.Context, options *armpostgresql.OperationsClientListOptions) (resp azfake.Responder[armpostgresql.OperationsClientListResponse], errResp azfake.ErrorResponder) + NewListPager func(options *armpostgresql.OperationsClientListOptions) (resp azfake.PagerResponder[armpostgresql.OperationsClientListResponse]) } // NewOperationsServerTransport creates a new instance of OperationsServerTransport with the provided implementation. // The returned OperationsServerTransport instance is connected to an instance of armpostgresql.OperationsClient via the // azcore.ClientOptions.Transporter field in the client's constructor parameters. func NewOperationsServerTransport(srv *OperationsServer) *OperationsServerTransport { - return &OperationsServerTransport{srv: srv} + return &OperationsServerTransport{ + srv: srv, + newListPager: newTracker[azfake.PagerResponder[armpostgresql.OperationsClientListResponse]](), + } } // OperationsServerTransport connects instances of armpostgresql.OperationsClient to instances of OperationsServer. // Don't use this type directly, use NewOperationsServerTransport instead. type OperationsServerTransport struct { - srv *OperationsServer + srv *OperationsServer + newListPager *tracker[azfake.PagerResponder[armpostgresql.OperationsClientListResponse]] } // Do implements the policy.Transporter interface for OperationsServerTransport. @@ -44,38 +47,71 @@ func (o *OperationsServerTransport) Do(req *http.Request) (*http.Response, error return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return o.dispatchToMethodFake(req, method) +} - switch method { - case "OperationsClient.List": - resp, err = o.dispatchList(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (o *OperationsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if operationsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = operationsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "OperationsClient.NewListPager": + res.resp, res.err = o.dispatchNewListPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil -} + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() -func (o *OperationsServerTransport) dispatchList(req *http.Request) (*http.Response, error) { - if o.srv.List == nil { - return nil, &nonRetriableError{errors.New("fake for method List not implemented")} + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err } - respr, errRespr := o.srv.List(req.Context(), nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr +} + +func (o *OperationsServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { + if o.srv.NewListPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} } - 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)} + newListPager := o.newListPager.get(req) + if newListPager == nil { + resp := o.srv.NewListPager(nil) + newListPager = &resp + o.newListPager.add(req, newListPager) + server.PagerResponderInjectNextLinks(newListPager, req, func(page *armpostgresql.OperationsClientListResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) } - resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).OperationListResult, req) + resp, err := server.PagerResponderNext(newListPager, req) if err != nil { return nil, err } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + o.newListPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListPager) { + o.newListPager.remove(req) + } return resp, nil } + +// set this to conditionally intercept incoming requests to OperationsServerTransport +var operationsServerTransportInterceptor 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/armpostgresql/fake/privatednszonesuffix_server.go b/sdk/resourcemanager/postgresql/armpostgresql/fake/privatednszonesuffix_server.go new file mode 100644 index 000000000000..52fd0b8ac2ff --- /dev/null +++ b/sdk/resourcemanager/postgresql/armpostgresql/fake/privatednszonesuffix_server.go @@ -0,0 +1,105 @@ +// 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) Go Code Generator. DO NOT EDIT. + +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/armpostgresql/v2" + "net/http" +) + +// PrivateDNSZoneSuffixServer is a fake server for instances of the armpostgresql.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 *armpostgresql.PrivateDNSZoneSuffixClientGetOptions) (resp azfake.Responder[armpostgresql.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 armpostgresql.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 armpostgresql.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/armpostgresql/fake/privateendpointconnections_server.go b/sdk/resourcemanager/postgresql/armpostgresql/fake/privateendpointconnections_server.go index 03ac83a776c9..f98b2e68ed7f 100644 --- a/sdk/resourcemanager/postgresql/armpostgresql/fake/privateendpointconnections_server.go +++ b/sdk/resourcemanager/postgresql/armpostgresql/fake/privateendpointconnections_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -13,7 +12,7 @@ import ( "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/armpostgresql" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresql/v2" "net/http" "net/url" "regexp" @@ -21,25 +20,21 @@ import ( // PrivateEndpointConnectionsServer is a fake server for instances of the armpostgresql.PrivateEndpointConnectionsClient type. type PrivateEndpointConnectionsServer struct { - // BeginCreateOrUpdate is the fake for method PrivateEndpointConnectionsClient.BeginCreateOrUpdate - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted - BeginCreateOrUpdate func(ctx context.Context, resourceGroupName string, serverName string, privateEndpointConnectionName string, parameters armpostgresql.PrivateEndpointConnection, options *armpostgresql.PrivateEndpointConnectionsClientBeginCreateOrUpdateOptions) (resp azfake.PollerResponder[armpostgresql.PrivateEndpointConnectionsClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) - // 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 *armpostgresql.PrivateEndpointConnectionsClientBeginDeleteOptions) (resp azfake.PollerResponder[armpostgresql.PrivateEndpointConnectionsClientDeleteResponse], errResp azfake.ErrorResponder) + BeginDelete func(ctx context.Context, resourceGroupName string, serverName string, privateEndpointConnectionName string, options *armpostgresql.PrivateEndpointConnectionsClientBeginDeleteOptions) (resp azfake.PollerResponder[armpostgresql.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 *armpostgresql.PrivateEndpointConnectionsClientGetOptions) (resp azfake.Responder[armpostgresql.PrivateEndpointConnectionsClientGetResponse], errResp azfake.ErrorResponder) + Get func(ctx context.Context, resourceGroupName string, serverName string, privateEndpointConnectionName string, options *armpostgresql.PrivateEndpointConnectionsClientGetOptions) (resp azfake.Responder[armpostgresql.PrivateEndpointConnectionsClientGetResponse], errResp azfake.ErrorResponder) // NewListByServerPager is the fake for method PrivateEndpointConnectionsClient.NewListByServerPager // HTTP status codes to indicate success: http.StatusOK - NewListByServerPager func(resourceGroupName string, serverName string, options *armpostgresql.PrivateEndpointConnectionsClientListByServerOptions) (resp azfake.PagerResponder[armpostgresql.PrivateEndpointConnectionsClientListByServerResponse]) + NewListByServerPager func(resourceGroupName string, serverName string, options *armpostgresql.PrivateEndpointConnectionsClientListByServerOptions) (resp azfake.PagerResponder[armpostgresql.PrivateEndpointConnectionsClientListByServerResponse]) - // BeginUpdateTags is the fake for method PrivateEndpointConnectionsClient.BeginUpdateTags - // HTTP status codes to indicate success: http.StatusOK - BeginUpdateTags func(ctx context.Context, resourceGroupName string, serverName string, privateEndpointConnectionName string, parameters armpostgresql.TagsObject, options *armpostgresql.PrivateEndpointConnectionsClientBeginUpdateTagsOptions) (resp azfake.PollerResponder[armpostgresql.PrivateEndpointConnectionsClientUpdateTagsResponse], errResp azfake.ErrorResponder) + // BeginUpdate is the fake for method PrivateEndpointConnectionsClient.BeginUpdate + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + BeginUpdate func(ctx context.Context, resourceGroupName string, serverName string, privateEndpointConnectionName string, parameters armpostgresql.PrivateEndpointConnection, options *armpostgresql.PrivateEndpointConnectionsClientBeginUpdateOptions) (resp azfake.PollerResponder[armpostgresql.PrivateEndpointConnectionsClientUpdateResponse], errResp azfake.ErrorResponder) } // NewPrivateEndpointConnectionsServerTransport creates a new instance of PrivateEndpointConnectionsServerTransport with the provided implementation. @@ -47,22 +42,20 @@ type PrivateEndpointConnectionsServer struct { // azcore.ClientOptions.Transporter field in the client's constructor parameters. func NewPrivateEndpointConnectionsServerTransport(srv *PrivateEndpointConnectionsServer) *PrivateEndpointConnectionsServerTransport { return &PrivateEndpointConnectionsServerTransport{ - srv: srv, - beginCreateOrUpdate: newTracker[azfake.PollerResponder[armpostgresql.PrivateEndpointConnectionsClientCreateOrUpdateResponse]](), - beginDelete: newTracker[azfake.PollerResponder[armpostgresql.PrivateEndpointConnectionsClientDeleteResponse]](), - newListByServerPager: newTracker[azfake.PagerResponder[armpostgresql.PrivateEndpointConnectionsClientListByServerResponse]](), - beginUpdateTags: newTracker[azfake.PollerResponder[armpostgresql.PrivateEndpointConnectionsClientUpdateTagsResponse]](), + srv: srv, + beginDelete: newTracker[azfake.PollerResponder[armpostgresql.PrivateEndpointConnectionsClientDeleteResponse]](), + newListByServerPager: newTracker[azfake.PagerResponder[armpostgresql.PrivateEndpointConnectionsClientListByServerResponse]](), + beginUpdate: newTracker[azfake.PollerResponder[armpostgresql.PrivateEndpointConnectionsClientUpdateResponse]](), } } // PrivateEndpointConnectionsServerTransport connects instances of armpostgresql.PrivateEndpointConnectionsClient to instances of PrivateEndpointConnectionsServer. // Don't use this type directly, use NewPrivateEndpointConnectionsServerTransport instead. type PrivateEndpointConnectionsServerTransport struct { - srv *PrivateEndpointConnectionsServer - beginCreateOrUpdate *tracker[azfake.PollerResponder[armpostgresql.PrivateEndpointConnectionsClientCreateOrUpdateResponse]] - beginDelete *tracker[azfake.PollerResponder[armpostgresql.PrivateEndpointConnectionsClientDeleteResponse]] - newListByServerPager *tracker[azfake.PagerResponder[armpostgresql.PrivateEndpointConnectionsClientListByServerResponse]] - beginUpdateTags *tracker[azfake.PollerResponder[armpostgresql.PrivateEndpointConnectionsClientUpdateTagsResponse]] + srv *PrivateEndpointConnectionsServer + beginDelete *tracker[azfake.PollerResponder[armpostgresql.PrivateEndpointConnectionsClientDeleteResponse]] + newListByServerPager *tracker[azfake.PagerResponder[armpostgresql.PrivateEndpointConnectionsClientListByServerResponse]] + beginUpdate *tracker[azfake.PollerResponder[armpostgresql.PrivateEndpointConnectionsClientUpdateResponse]] } // Do implements the policy.Transporter interface for PrivateEndpointConnectionsServerTransport. @@ -73,81 +66,46 @@ func (p *PrivateEndpointConnectionsServerTransport) Do(req *http.Request) (*http return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error - - switch method { - case "PrivateEndpointConnectionsClient.BeginCreateOrUpdate": - resp, err = p.dispatchBeginCreateOrUpdate(req) - case "PrivateEndpointConnectionsClient.BeginDelete": - resp, err = p.dispatchBeginDelete(req) - case "PrivateEndpointConnectionsClient.Get": - resp, err = p.dispatchGet(req) - case "PrivateEndpointConnectionsClient.NewListByServerPager": - resp, err = p.dispatchNewListByServerPager(req) - case "PrivateEndpointConnectionsClient.BeginUpdateTags": - resp, err = p.dispatchBeginUpdateTags(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } - - if err != nil { - return nil, err - } - - return resp, nil + return p.dispatchToMethodFake(req, method) } -func (p *PrivateEndpointConnectionsServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { - if p.srv.BeginCreateOrUpdate == nil { - return nil, &nonRetriableError{errors.New("fake for method BeginCreateOrUpdate not implemented")} - } - beginCreateOrUpdate := p.beginCreateOrUpdate.get(req) - if beginCreateOrUpdate == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/servers/(?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[armpostgresql.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 +func (p *PrivateEndpointConnectionsServerTransport) 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 privateEndpointConnectionsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = privateEndpointConnectionsServerTransportInterceptor.Do(req) } - privateEndpointConnectionNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("privateEndpointConnectionName")]) - if err != nil { - return nil, err + 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) + } + } - respr, errRespr := p.srv.BeginCreateOrUpdate(req.Context(), resourceGroupNameParam, serverNameParam, privateEndpointConnectionNameParam, body, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr + select { + case resultChan <- res: + case <-req.Context().Done(): } - beginCreateOrUpdate = &respr - p.beginCreateOrUpdate.add(req, beginCreateOrUpdate) - } - - resp, err := server.PollerResponderNext(beginCreateOrUpdate, req) - if err != nil { - return nil, err - } + }() - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { - p.beginCreateOrUpdate.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} - } - if !server.PollerResponderMore(beginCreateOrUpdate) { - p.beginCreateOrUpdate.remove(req) + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err } - - return resp, nil } func (p *PrivateEndpointConnectionsServerTransport) dispatchBeginDelete(req *http.Request) (*http.Response, error) { @@ -156,10 +114,10 @@ func (p *PrivateEndpointConnectionsServerTransport) dispatchBeginDelete(req *htt } 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/servers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/privateEndpointConnections/(?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~%@]+)/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")]) @@ -202,10 +160,10 @@ func (p *PrivateEndpointConnectionsServerTransport) dispatchGet(req *http.Reques if p.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/servers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/privateEndpointConnections/(?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~%@]+)/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")]) @@ -241,10 +199,10 @@ func (p *PrivateEndpointConnectionsServerTransport) dispatchNewListByServerPager } newListByServerPager := p.newListByServerPager.get(req) if newListByServerPager == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/servers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/privateEndpointConnections` + 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")]) @@ -276,19 +234,19 @@ func (p *PrivateEndpointConnectionsServerTransport) dispatchNewListByServerPager return resp, nil } -func (p *PrivateEndpointConnectionsServerTransport) dispatchBeginUpdateTags(req *http.Request) (*http.Response, error) { - if p.srv.BeginUpdateTags == nil { - return nil, &nonRetriableError{errors.New("fake for method BeginUpdateTags not implemented")} +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")} } - beginUpdateTags := p.beginUpdateTags.get(req) - if beginUpdateTags == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/servers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/privateEndpointConnections/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + 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 { + if len(matches) < 5 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } - body, err := server.UnmarshalRequestAsJSON[armpostgresql.TagsObject](req) + body, err := server.UnmarshalRequestAsJSON[armpostgresql.PrivateEndpointConnection](req) if err != nil { return nil, err } @@ -304,26 +262,32 @@ func (p *PrivateEndpointConnectionsServerTransport) dispatchBeginUpdateTags(req if err != nil { return nil, err } - respr, errRespr := p.srv.BeginUpdateTags(req.Context(), resourceGroupNameParam, serverNameParam, privateEndpointConnectionNameParam, body, nil) + respr, errRespr := p.srv.BeginUpdate(req.Context(), resourceGroupNameParam, serverNameParam, privateEndpointConnectionNameParam, body, nil) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } - beginUpdateTags = &respr - p.beginUpdateTags.add(req, beginUpdateTags) + beginUpdate = &respr + p.beginUpdate.add(req, beginUpdate) } - resp, err := server.PollerResponderNext(beginUpdateTags, req) + resp, err := server.PollerResponderNext(beginUpdate, req) if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { - p.beginUpdateTags.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + p.beginUpdate.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } - if !server.PollerResponderMore(beginUpdateTags) { - p.beginUpdateTags.remove(req) + 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 + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/postgresql/armpostgresql/fake/privatelinkresources_server.go b/sdk/resourcemanager/postgresql/armpostgresql/fake/privatelinkresources_server.go index 5bbb322eb82d..e00a0008cafb 100644 --- a/sdk/resourcemanager/postgresql/armpostgresql/fake/privatelinkresources_server.go +++ b/sdk/resourcemanager/postgresql/armpostgresql/fake/privatelinkresources_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -13,7 +12,7 @@ import ( "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/armpostgresql" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresql/v2" "net/http" "net/url" "regexp" @@ -23,11 +22,11 @@ import ( type PrivateLinkResourcesServer struct { // Get is the fake for method PrivateLinkResourcesClient.Get // HTTP status codes to indicate success: http.StatusOK - Get func(ctx context.Context, resourceGroupName string, serverName string, groupName string, options *armpostgresql.PrivateLinkResourcesClientGetOptions) (resp azfake.Responder[armpostgresql.PrivateLinkResourcesClientGetResponse], errResp azfake.ErrorResponder) + Get func(ctx context.Context, resourceGroupName string, serverName string, groupName string, options *armpostgresql.PrivateLinkResourcesClientGetOptions) (resp azfake.Responder[armpostgresql.PrivateLinkResourcesClientGetResponse], errResp azfake.ErrorResponder) // NewListByServerPager is the fake for method PrivateLinkResourcesClient.NewListByServerPager // HTTP status codes to indicate success: http.StatusOK - NewListByServerPager func(resourceGroupName string, serverName string, options *armpostgresql.PrivateLinkResourcesClientListByServerOptions) (resp azfake.PagerResponder[armpostgresql.PrivateLinkResourcesClientListByServerResponse]) + NewListByServerPager func(resourceGroupName string, serverName string, options *armpostgresql.PrivateLinkResourcesClientListByServerOptions) (resp azfake.PagerResponder[armpostgresql.PrivateLinkResourcesClientListByServerResponse]) } // NewPrivateLinkResourcesServerTransport creates a new instance of PrivateLinkResourcesServerTransport with the provided implementation. @@ -35,16 +34,16 @@ type PrivateLinkResourcesServer struct { // azcore.ClientOptions.Transporter field in the client's constructor parameters. func NewPrivateLinkResourcesServerTransport(srv *PrivateLinkResourcesServer) *PrivateLinkResourcesServerTransport { return &PrivateLinkResourcesServerTransport{ - srv: srv, - newListByServerPager: newTracker[azfake.PagerResponder[armpostgresql.PrivateLinkResourcesClientListByServerResponse]](), + srv: srv, + newListByServerPager: newTracker[azfake.PagerResponder[armpostgresql.PrivateLinkResourcesClientListByServerResponse]](), } } // PrivateLinkResourcesServerTransport connects instances of armpostgresql.PrivateLinkResourcesClient to instances of PrivateLinkResourcesServer. // Don't use this type directly, use NewPrivateLinkResourcesServerTransport instead. type PrivateLinkResourcesServerTransport struct { - srv *PrivateLinkResourcesServer - newListByServerPager *tracker[azfake.PagerResponder[armpostgresql.PrivateLinkResourcesClientListByServerResponse]] + srv *PrivateLinkResourcesServer + newListByServerPager *tracker[azfake.PagerResponder[armpostgresql.PrivateLinkResourcesClientListByServerResponse]] } // Do implements the policy.Transporter interface for PrivateLinkResourcesServerTransport. @@ -55,33 +54,52 @@ func (p *PrivateLinkResourcesServerTransport) Do(req *http.Request) (*http.Respo return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return p.dispatchToMethodFake(req, method) +} - switch method { - case "PrivateLinkResourcesClient.Get": - resp, err = p.dispatchGet(req) - case "PrivateLinkResourcesClient.NewListByServerPager": - resp, err = p.dispatchNewListByServerPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (p *PrivateLinkResourcesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if privateLinkResourcesServerTransportInterceptor != nil { + res.resp, res.err, intercepted = privateLinkResourcesServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "PrivateLinkResourcesClient.Get": + res.resp, res.err = p.dispatchGet(req) + case "PrivateLinkResourcesClient.NewListByServerPager": + res.resp, res.err = p.dispatchNewListByServerPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + 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 *PrivateLinkResourcesServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { if p.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/servers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/privateLinkResources/(?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~%@]+)/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")]) @@ -117,10 +135,10 @@ func (p *PrivateLinkResourcesServerTransport) dispatchNewListByServerPager(req * } newListByServerPager := p.newListByServerPager.get(req) if newListByServerPager == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/servers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/privateLinkResources` + 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")]) @@ -151,3 +169,9 @@ func (p *PrivateLinkResourcesServerTransport) dispatchNewListByServerPager(req * } return resp, nil } + +// set this to conditionally intercept incoming requests to PrivateLinkResourcesServerTransport +var privateLinkResourcesServerTransportInterceptor 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/armpostgresql/fake/quotausages_server.go b/sdk/resourcemanager/postgresql/armpostgresql/fake/quotausages_server.go new file mode 100644 index 000000000000..1f272096cdd6 --- /dev/null +++ b/sdk/resourcemanager/postgresql/armpostgresql/fake/quotausages_server.go @@ -0,0 +1,129 @@ +// 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) Go Code Generator. DO NOT EDIT. + +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/armpostgresql/v2" + "net/http" + "net/url" + "regexp" +) + +// QuotaUsagesServer is a fake server for instances of the armpostgresql.QuotaUsagesClient type. +type QuotaUsagesServer struct { + // NewListPager is the fake for method QuotaUsagesClient.NewListPager + // HTTP status codes to indicate success: http.StatusOK + NewListPager func(locationName string, options *armpostgresql.QuotaUsagesClientListOptions) (resp azfake.PagerResponder[armpostgresql.QuotaUsagesClientListResponse]) +} + +// NewQuotaUsagesServerTransport creates a new instance of QuotaUsagesServerTransport with the provided implementation. +// The returned QuotaUsagesServerTransport instance is connected to an instance of armpostgresql.QuotaUsagesClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewQuotaUsagesServerTransport(srv *QuotaUsagesServer) *QuotaUsagesServerTransport { + return &QuotaUsagesServerTransport{ + srv: srv, + newListPager: newTracker[azfake.PagerResponder[armpostgresql.QuotaUsagesClientListResponse]](), + } +} + +// QuotaUsagesServerTransport connects instances of armpostgresql.QuotaUsagesClient to instances of QuotaUsagesServer. +// Don't use this type directly, use NewQuotaUsagesServerTransport instead. +type QuotaUsagesServerTransport struct { + srv *QuotaUsagesServer + newListPager *tracker[azfake.PagerResponder[armpostgresql.QuotaUsagesClientListResponse]] +} + +// Do implements the policy.Transporter interface for QuotaUsagesServerTransport. +func (q *QuotaUsagesServerTransport) 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 q.dispatchToMethodFake(req, method) +} + +func (q *QuotaUsagesServerTransport) 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 quotaUsagesServerTransportInterceptor != nil { + res.resp, res.err, intercepted = quotaUsagesServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "QuotaUsagesClient.NewListPager": + res.resp, res.err = q.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 (q *QuotaUsagesServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { + if q.srv.NewListPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} + } + newListPager := q.newListPager.get(req) + if newListPager == nil { + 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 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 := q.srv.NewListPager(locationNameParam, nil) + newListPager = &resp + q.newListPager.add(req, newListPager) + server.PagerResponderInjectNextLinks(newListPager, req, func(page *armpostgresql.QuotaUsagesClientListResponse, 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) { + q.newListPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListPager) { + q.newListPager.remove(req) + } + return resp, nil +} + +// set this to conditionally intercept incoming requests to QuotaUsagesServerTransport +var quotaUsagesServerTransportInterceptor 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/armpostgresql/fake/recoverableservers_server.go b/sdk/resourcemanager/postgresql/armpostgresql/fake/recoverableservers_server.go deleted file mode 100644 index eb1cf9ea1c6f..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresql/fake/recoverableservers_server.go +++ /dev/null @@ -1,97 +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/armpostgresql" - "net/http" - "net/url" - "regexp" -) - -// RecoverableServersServer is a fake server for instances of the armpostgresql.RecoverableServersClient type. -type RecoverableServersServer struct { - // Get is the fake for method RecoverableServersClient.Get - // HTTP status codes to indicate success: http.StatusOK - Get func(ctx context.Context, resourceGroupName string, serverName string, options *armpostgresql.RecoverableServersClientGetOptions) (resp azfake.Responder[armpostgresql.RecoverableServersClientGetResponse], errResp azfake.ErrorResponder) -} - -// NewRecoverableServersServerTransport creates a new instance of RecoverableServersServerTransport with the provided implementation. -// The returned RecoverableServersServerTransport instance is connected to an instance of armpostgresql.RecoverableServersClient via the -// azcore.ClientOptions.Transporter field in the client's constructor parameters. -func NewRecoverableServersServerTransport(srv *RecoverableServersServer) *RecoverableServersServerTransport { - return &RecoverableServersServerTransport{srv: srv} -} - -// RecoverableServersServerTransport connects instances of armpostgresql.RecoverableServersClient to instances of RecoverableServersServer. -// Don't use this type directly, use NewRecoverableServersServerTransport instead. -type RecoverableServersServerTransport struct { - srv *RecoverableServersServer -} - -// Do implements the policy.Transporter interface for RecoverableServersServerTransport. -func (r *RecoverableServersServerTransport) 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")} - } - - var resp *http.Response - var err error - - switch method { - case "RecoverableServersClient.Get": - resp, err = r.dispatchGet(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } - - if err != nil { - return nil, err - } - - return resp, nil -} - -func (r *RecoverableServersServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { - if r.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/servers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/recoverableServers` - 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 - } - respr, errRespr := r.srv.Get(req.Context(), resourceGroupNameParam, serverNameParam, 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).RecoverableServerResource, req) - if err != nil { - return nil, err - } - return resp, nil -} diff --git a/sdk/resourcemanager/postgresql/armpostgresql/fake/replicas_server.go b/sdk/resourcemanager/postgresql/armpostgresql/fake/replicas_server.go index c16839e62e0c..8d8e9bf20a6a 100644 --- a/sdk/resourcemanager/postgresql/armpostgresql/fake/replicas_server.go +++ b/sdk/resourcemanager/postgresql/armpostgresql/fake/replicas_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -11,7 +10,8 @@ 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/resourcemanager/postgresql/armpostgresql" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresql/v2" "net/http" "net/url" "regexp" @@ -29,16 +29,16 @@ type ReplicasServer struct { // azcore.ClientOptions.Transporter field in the client's constructor parameters. func NewReplicasServerTransport(srv *ReplicasServer) *ReplicasServerTransport { return &ReplicasServerTransport{ - srv: srv, - newListByServerPager: newTracker[azfake.PagerResponder[armpostgresql.ReplicasClientListByServerResponse]](), + srv: srv, + newListByServerPager: newTracker[azfake.PagerResponder[armpostgresql.ReplicasClientListByServerResponse]](), } } // ReplicasServerTransport connects instances of armpostgresql.ReplicasClient to instances of ReplicasServer. // Don't use this type directly, use NewReplicasServerTransport instead. type ReplicasServerTransport struct { - srv *ReplicasServer - newListByServerPager *tracker[azfake.PagerResponder[armpostgresql.ReplicasClientListByServerResponse]] + srv *ReplicasServer + newListByServerPager *tracker[azfake.PagerResponder[armpostgresql.ReplicasClientListByServerResponse]] } // Do implements the policy.Transporter interface for ReplicasServerTransport. @@ -49,21 +49,40 @@ func (r *ReplicasServerTransport) Do(req *http.Request) (*http.Response, error) return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return r.dispatchToMethodFake(req, method) +} - switch method { - case "ReplicasClient.NewListByServerPager": - resp, err = r.dispatchNewListByServerPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (r *ReplicasServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if replicasServerTransportInterceptor != nil { + res.resp, res.err, intercepted = replicasServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "ReplicasClient.NewListByServerPager": + res.resp, res.err = r.dispatchNewListByServerPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + 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 (r *ReplicasServerTransport) dispatchNewListByServerPager(req *http.Request) (*http.Response, error) { @@ -72,10 +91,10 @@ func (r *ReplicasServerTransport) dispatchNewListByServerPager(req *http.Request } newListByServerPager := r.newListByServerPager.get(req) if newListByServerPager == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/servers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/replicas` + 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")]) @@ -89,6 +108,9 @@ func (r *ReplicasServerTransport) dispatchNewListByServerPager(req *http.Request resp := r.srv.NewListByServerPager(resourceGroupNameParam, serverNameParam, nil) newListByServerPager = &resp r.newListByServerPager.add(req, newListByServerPager) + server.PagerResponderInjectNextLinks(newListByServerPager, req, func(page *armpostgresql.ReplicasClientListByServerResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) } resp, err := server.PagerResponderNext(newListByServerPager, req) if err != nil { @@ -103,3 +125,9 @@ func (r *ReplicasServerTransport) dispatchNewListByServerPager(req *http.Request } return resp, nil } + +// set this to conditionally intercept incoming requests to ReplicasServerTransport +var replicasServerTransportInterceptor 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/armpostgresql/fake/server_factory.go b/sdk/resourcemanager/postgresql/armpostgresql/fake/server_factory.go index fefb657baf64..042e744aeaae 100644 --- a/sdk/resourcemanager/postgresql/armpostgresql/fake/server_factory.go +++ b/sdk/resourcemanager/postgresql/armpostgresql/fake/server_factory.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -16,24 +15,74 @@ import ( // ServerFactory is a fake server for instances of the armpostgresql.ClientFactory type. type ServerFactory struct { - CheckNameAvailabilityServer CheckNameAvailabilityServer - ConfigurationsServer ConfigurationsServer - DatabasesServer DatabasesServer - FirewallRulesServer FirewallRulesServer - LocationBasedPerformanceTierServer LocationBasedPerformanceTierServer - LogFilesServer LogFilesServer - OperationsServer OperationsServer - PrivateEndpointConnectionsServer PrivateEndpointConnectionsServer - PrivateLinkResourcesServer PrivateLinkResourcesServer - RecoverableServersServer RecoverableServersServer - ReplicasServer ReplicasServer - ServerAdministratorsServer ServerAdministratorsServer - ServerBasedPerformanceTierServer ServerBasedPerformanceTierServer - ServerKeysServer ServerKeysServer - ServerParametersServer ServerParametersServer - ServerSecurityAlertPoliciesServer ServerSecurityAlertPoliciesServer - ServersServer ServersServer - VirtualNetworkRulesServer VirtualNetworkRulesServer + // AdministratorsMicrosoftEntraServer contains the fakes for client AdministratorsMicrosoftEntraClient + AdministratorsMicrosoftEntraServer AdministratorsMicrosoftEntraServer + + // AdvancedThreatProtectionSettingsServer contains the fakes for client AdvancedThreatProtectionSettingsClient + AdvancedThreatProtectionSettingsServer AdvancedThreatProtectionSettingsServer + + // BackupsAutomaticAndOnDemandServer contains the fakes for client BackupsAutomaticAndOnDemandClient + BackupsAutomaticAndOnDemandServer BackupsAutomaticAndOnDemandServer + + // 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 + + // DatabasesServer contains the fakes for client DatabasesClient + DatabasesServer DatabasesServer + + // FirewallRulesServer contains the fakes for client FirewallRulesClient + FirewallRulesServer FirewallRulesServer + + // 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 + + // PrivateDNSZoneSuffixServer contains the fakes for client PrivateDNSZoneSuffixClient + PrivateDNSZoneSuffixServer PrivateDNSZoneSuffixServer + + // PrivateEndpointConnectionsServer contains the fakes for client PrivateEndpointConnectionsClient + PrivateEndpointConnectionsServer PrivateEndpointConnectionsServer + + // PrivateLinkResourcesServer contains the fakes for client PrivateLinkResourcesClient + PrivateLinkResourcesServer PrivateLinkResourcesServer + + // QuotaUsagesServer contains the fakes for client QuotaUsagesClient + QuotaUsagesServer QuotaUsagesServer + + // ReplicasServer contains the fakes for client ReplicasClient + ReplicasServer ReplicasServer + + // ServerThreatProtectionSettingsServer contains the fakes for client ServerThreatProtectionSettingsClient + ServerThreatProtectionSettingsServer ServerThreatProtectionSettingsServer + + // ServersServer contains the fakes for client ServersClient + ServersServer ServersServer + + // TuningOptionsServer contains the fakes for client TuningOptionsClient + TuningOptionsServer TuningOptionsServer + + // VirtualEndpointsServer contains the fakes for client VirtualEndpointsClient + VirtualEndpointsServer VirtualEndpointsServer + + // VirtualNetworkSubnetUsageServer contains the fakes for client VirtualNetworkSubnetUsageClient + VirtualNetworkSubnetUsageServer VirtualNetworkSubnetUsageServer } // NewServerFactoryTransport creates a new instance of ServerFactoryTransport with the provided implementation. @@ -48,26 +97,31 @@ func NewServerFactoryTransport(srv *ServerFactory) *ServerFactoryTransport { // ServerFactoryTransport connects instances of armpostgresql.ClientFactory to instances of ServerFactory. // Don't use this type directly, use NewServerFactoryTransport instead. type ServerFactoryTransport struct { - srv *ServerFactory - trMu sync.Mutex - trCheckNameAvailabilityServer *CheckNameAvailabilityServerTransport - trConfigurationsServer *ConfigurationsServerTransport - trDatabasesServer *DatabasesServerTransport - trFirewallRulesServer *FirewallRulesServerTransport - trLocationBasedPerformanceTierServer *LocationBasedPerformanceTierServerTransport - trLogFilesServer *LogFilesServerTransport - trOperationsServer *OperationsServerTransport - trPrivateEndpointConnectionsServer *PrivateEndpointConnectionsServerTransport - trPrivateLinkResourcesServer *PrivateLinkResourcesServerTransport - trRecoverableServersServer *RecoverableServersServerTransport - trReplicasServer *ReplicasServerTransport - trServerAdministratorsServer *ServerAdministratorsServerTransport - trServerBasedPerformanceTierServer *ServerBasedPerformanceTierServerTransport - trServerKeysServer *ServerKeysServerTransport - trServerParametersServer *ServerParametersServerTransport - trServerSecurityAlertPoliciesServer *ServerSecurityAlertPoliciesServerTransport - trServersServer *ServersServerTransport - trVirtualNetworkRulesServer *VirtualNetworkRulesServerTransport + 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. @@ -83,11 +137,39 @@ func (s *ServerFactoryTransport) Do(req *http.Request) (*http.Response, error) { var err error switch client { - case "CheckNameAvailabilityClient": - initServer(s, &s.trCheckNameAvailabilityServer, func() *CheckNameAvailabilityServerTransport { - return NewCheckNameAvailabilityServerTransport(&s.srv.CheckNameAvailabilityServer) + 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.trBackupsAutomaticAndOnDemandServer.Do(req) + case "BackupsLongTermRetentionClient": + initServer(s, &s.trBackupsLongTermRetentionServer, func() *BackupsLongTermRetentionServerTransport { + return NewBackupsLongTermRetentionServerTransport(&s.srv.BackupsLongTermRetentionServer) }) - resp, err = s.trCheckNameAvailabilityServer.Do(req) + resp, err = s.trBackupsLongTermRetentionServer.Do(req) + case "CapabilitiesByLocationClient": + initServer(s, &s.trCapabilitiesByLocationServer, func() *CapabilitiesByLocationServerTransport { + return NewCapabilitiesByLocationServerTransport(&s.srv.CapabilitiesByLocationServer) + }) + 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) @@ -101,17 +183,22 @@ func (s *ServerFactoryTransport) Do(req *http.Request) (*http.Response, error) { return NewFirewallRulesServerTransport(&s.srv.FirewallRulesServer) }) resp, err = s.trFirewallRulesServer.Do(req) - case "LocationBasedPerformanceTierClient": - initServer(s, &s.trLocationBasedPerformanceTierServer, func() *LocationBasedPerformanceTierServerTransport { - return NewLocationBasedPerformanceTierServerTransport(&s.srv.LocationBasedPerformanceTierServer) - }) - resp, err = s.trLocationBasedPerformanceTierServer.Do(req) - case "LogFilesClient": - initServer(s, &s.trLogFilesServer, func() *LogFilesServerTransport { return NewLogFilesServerTransport(&s.srv.LogFilesServer) }) - resp, err = s.trLogFilesServer.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 "PrivateDNSZoneSuffixClient": + initServer(s, &s.trPrivateDNSZoneSuffixServer, func() *PrivateDNSZoneSuffixServerTransport { + return NewPrivateDNSZoneSuffixServerTransport(&s.srv.PrivateDNSZoneSuffixServer) + }) + resp, err = s.trPrivateDNSZoneSuffixServer.Do(req) case "PrivateEndpointConnectionsClient": initServer(s, &s.trPrivateEndpointConnectionsServer, func() *PrivateEndpointConnectionsServerTransport { return NewPrivateEndpointConnectionsServerTransport(&s.srv.PrivateEndpointConnectionsServer) @@ -122,45 +209,35 @@ func (s *ServerFactoryTransport) Do(req *http.Request) (*http.Response, error) { return NewPrivateLinkResourcesServerTransport(&s.srv.PrivateLinkResourcesServer) }) resp, err = s.trPrivateLinkResourcesServer.Do(req) - case "RecoverableServersClient": - initServer(s, &s.trRecoverableServersServer, func() *RecoverableServersServerTransport { - return NewRecoverableServersServerTransport(&s.srv.RecoverableServersServer) - }) - resp, err = s.trRecoverableServersServer.Do(req) + case "QuotaUsagesClient": + initServer(s, &s.trQuotaUsagesServer, func() *QuotaUsagesServerTransport { return NewQuotaUsagesServerTransport(&s.srv.QuotaUsagesServer) }) + resp, err = s.trQuotaUsagesServer.Do(req) case "ReplicasClient": initServer(s, &s.trReplicasServer, func() *ReplicasServerTransport { return NewReplicasServerTransport(&s.srv.ReplicasServer) }) resp, err = s.trReplicasServer.Do(req) - case "ServerAdministratorsClient": - initServer(s, &s.trServerAdministratorsServer, func() *ServerAdministratorsServerTransport { - return NewServerAdministratorsServerTransport(&s.srv.ServerAdministratorsServer) - }) - resp, err = s.trServerAdministratorsServer.Do(req) - case "ServerBasedPerformanceTierClient": - initServer(s, &s.trServerBasedPerformanceTierServer, func() *ServerBasedPerformanceTierServerTransport { - return NewServerBasedPerformanceTierServerTransport(&s.srv.ServerBasedPerformanceTierServer) - }) - resp, err = s.trServerBasedPerformanceTierServer.Do(req) - case "ServerKeysClient": - initServer(s, &s.trServerKeysServer, func() *ServerKeysServerTransport { return NewServerKeysServerTransport(&s.srv.ServerKeysServer) }) - resp, err = s.trServerKeysServer.Do(req) - case "ServerParametersClient": - initServer(s, &s.trServerParametersServer, func() *ServerParametersServerTransport { - return NewServerParametersServerTransport(&s.srv.ServerParametersServer) - }) - resp, err = s.trServerParametersServer.Do(req) - case "ServerSecurityAlertPoliciesClient": - initServer(s, &s.trServerSecurityAlertPoliciesServer, func() *ServerSecurityAlertPoliciesServerTransport { - return NewServerSecurityAlertPoliciesServerTransport(&s.srv.ServerSecurityAlertPoliciesServer) - }) - resp, err = s.trServerSecurityAlertPoliciesServer.Do(req) + case "ServerThreatProtectionSettingsClient": + initServer(s, &s.trServerThreatProtectionSettingsServer, func() *ServerThreatProtectionSettingsServerTransport { + return NewServerThreatProtectionSettingsServerTransport(&s.srv.ServerThreatProtectionSettingsServer) + }) + resp, err = s.trServerThreatProtectionSettingsServer.Do(req) case "ServersClient": initServer(s, &s.trServersServer, func() *ServersServerTransport { return NewServersServerTransport(&s.srv.ServersServer) }) resp, err = s.trServersServer.Do(req) - case "VirtualNetworkRulesClient": - initServer(s, &s.trVirtualNetworkRulesServer, func() *VirtualNetworkRulesServerTransport { - return NewVirtualNetworkRulesServerTransport(&s.srv.VirtualNetworkRulesServer) + case "TuningOptionsClient": + initServer(s, &s.trTuningOptionsServer, func() *TuningOptionsServerTransport { + return NewTuningOptionsServerTransport(&s.srv.TuningOptionsServer) + }) + resp, err = s.trTuningOptionsServer.Do(req) + case "VirtualEndpointsClient": + initServer(s, &s.trVirtualEndpointsServer, func() *VirtualEndpointsServerTransport { + return NewVirtualEndpointsServerTransport(&s.srv.VirtualEndpointsServer) + }) + resp, err = s.trVirtualEndpointsServer.Do(req) + case "VirtualNetworkSubnetUsageClient": + initServer(s, &s.trVirtualNetworkSubnetUsageServer, func() *VirtualNetworkSubnetUsageServerTransport { + return NewVirtualNetworkSubnetUsageServerTransport(&s.srv.VirtualNetworkSubnetUsageServer) }) - resp, err = s.trVirtualNetworkRulesServer.Do(req) + resp, err = s.trVirtualNetworkSubnetUsageServer.Do(req) default: err = fmt.Errorf("unhandled client %s", client) } diff --git a/sdk/resourcemanager/postgresql/armpostgresql/fake/serveradministrators_server.go b/sdk/resourcemanager/postgresql/armpostgresql/fake/serveradministrators_server.go deleted file mode 100644 index 557fa58be5ca..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresql/fake/serveradministrators_server.go +++ /dev/null @@ -1,253 +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/armpostgresql" - "net/http" - "net/url" - "regexp" -) - -// ServerAdministratorsServer is a fake server for instances of the armpostgresql.ServerAdministratorsClient type. -type ServerAdministratorsServer struct { - // BeginCreateOrUpdate is the fake for method ServerAdministratorsClient.BeginCreateOrUpdate - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted - BeginCreateOrUpdate func(ctx context.Context, resourceGroupName string, serverName string, properties armpostgresql.ServerAdministratorResource, options *armpostgresql.ServerAdministratorsClientBeginCreateOrUpdateOptions) (resp azfake.PollerResponder[armpostgresql.ServerAdministratorsClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) - - // BeginDelete is the fake for method ServerAdministratorsClient.BeginDelete - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent - BeginDelete func(ctx context.Context, resourceGroupName string, serverName string, options *armpostgresql.ServerAdministratorsClientBeginDeleteOptions) (resp azfake.PollerResponder[armpostgresql.ServerAdministratorsClientDeleteResponse], errResp azfake.ErrorResponder) - - // Get is the fake for method ServerAdministratorsClient.Get - // HTTP status codes to indicate success: http.StatusOK - Get func(ctx context.Context, resourceGroupName string, serverName string, options *armpostgresql.ServerAdministratorsClientGetOptions) (resp azfake.Responder[armpostgresql.ServerAdministratorsClientGetResponse], errResp azfake.ErrorResponder) - - // NewListPager is the fake for method ServerAdministratorsClient.NewListPager - // HTTP status codes to indicate success: http.StatusOK - NewListPager func(resourceGroupName string, serverName string, options *armpostgresql.ServerAdministratorsClientListOptions) (resp azfake.PagerResponder[armpostgresql.ServerAdministratorsClientListResponse]) -} - -// NewServerAdministratorsServerTransport creates a new instance of ServerAdministratorsServerTransport with the provided implementation. -// The returned ServerAdministratorsServerTransport instance is connected to an instance of armpostgresql.ServerAdministratorsClient via the -// azcore.ClientOptions.Transporter field in the client's constructor parameters. -func NewServerAdministratorsServerTransport(srv *ServerAdministratorsServer) *ServerAdministratorsServerTransport { - return &ServerAdministratorsServerTransport{ - srv: srv, - beginCreateOrUpdate: newTracker[azfake.PollerResponder[armpostgresql.ServerAdministratorsClientCreateOrUpdateResponse]](), - beginDelete: newTracker[azfake.PollerResponder[armpostgresql.ServerAdministratorsClientDeleteResponse]](), - newListPager: newTracker[azfake.PagerResponder[armpostgresql.ServerAdministratorsClientListResponse]](), - } -} - -// ServerAdministratorsServerTransport connects instances of armpostgresql.ServerAdministratorsClient to instances of ServerAdministratorsServer. -// Don't use this type directly, use NewServerAdministratorsServerTransport instead. -type ServerAdministratorsServerTransport struct { - srv *ServerAdministratorsServer - beginCreateOrUpdate *tracker[azfake.PollerResponder[armpostgresql.ServerAdministratorsClientCreateOrUpdateResponse]] - beginDelete *tracker[azfake.PollerResponder[armpostgresql.ServerAdministratorsClientDeleteResponse]] - newListPager *tracker[azfake.PagerResponder[armpostgresql.ServerAdministratorsClientListResponse]] -} - -// Do implements the policy.Transporter interface for ServerAdministratorsServerTransport. -func (s *ServerAdministratorsServerTransport) 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")} - } - - var resp *http.Response - var err error - - switch method { - case "ServerAdministratorsClient.BeginCreateOrUpdate": - resp, err = s.dispatchBeginCreateOrUpdate(req) - case "ServerAdministratorsClient.BeginDelete": - resp, err = s.dispatchBeginDelete(req) - case "ServerAdministratorsClient.Get": - resp, err = s.dispatchGet(req) - case "ServerAdministratorsClient.NewListPager": - resp, err = s.dispatchNewListPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } - - if err != nil { - return nil, err - } - - return resp, nil -} - -func (s *ServerAdministratorsServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { - if s.srv.BeginCreateOrUpdate == nil { - return nil, &nonRetriableError{errors.New("fake for method BeginCreateOrUpdate not implemented")} - } - 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/servers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/administrators/activeDirectory` - 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[armpostgresql.ServerAdministratorResource](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 := s.srv.BeginCreateOrUpdate(req.Context(), resourceGroupNameParam, serverNameParam, body, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - beginCreateOrUpdate = &respr - s.beginCreateOrUpdate.add(req, beginCreateOrUpdate) - } - - resp, err := server.PollerResponderNext(beginCreateOrUpdate, req) - if err != nil { - return nil, err - } - - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { - s.beginCreateOrUpdate.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} - } - if !server.PollerResponderMore(beginCreateOrUpdate) { - s.beginCreateOrUpdate.remove(req) - } - - return resp, nil -} - -func (s *ServerAdministratorsServerTransport) dispatchBeginDelete(req *http.Request) (*http.Response, error) { - if s.srv.BeginDelete == nil { - return nil, &nonRetriableError{errors.New("fake for method BeginDelete not implemented")} - } - beginDelete := s.beginDelete.get(req) - if beginDelete == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/servers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/administrators/activeDirectory` - 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 - } - respr, errRespr := s.srv.BeginDelete(req.Context(), resourceGroupNameParam, serverNameParam, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - beginDelete = &respr - s.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) { - s.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) { - s.beginDelete.remove(req) - } - - return resp, nil -} - -func (s *ServerAdministratorsServerTransport) 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/servers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/administrators/activeDirectory` - 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 - } - respr, errRespr := s.srv.Get(req.Context(), resourceGroupNameParam, serverNameParam, 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).ServerAdministratorResource, req) - if err != nil { - return nil, err - } - return resp, nil -} - -func (s *ServerAdministratorsServerTransport) 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~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/servers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/administrators` - 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.NewListPager(resourceGroupNameParam, serverNameParam, nil) - newListPager = &resp - s.newListPager.add(req, newListPager) - } - 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 -} diff --git a/sdk/resourcemanager/postgresql/armpostgresql/fake/serverbasedperformancetier_server.go b/sdk/resourcemanager/postgresql/armpostgresql/fake/serverbasedperformancetier_server.go deleted file mode 100644 index 2eb9d56bb9be..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresql/fake/serverbasedperformancetier_server.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 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/resourcemanager/postgresql/armpostgresql" - "net/http" - "net/url" - "regexp" -) - -// ServerBasedPerformanceTierServer is a fake server for instances of the armpostgresql.ServerBasedPerformanceTierClient type. -type ServerBasedPerformanceTierServer struct { - // NewListPager is the fake for method ServerBasedPerformanceTierClient.NewListPager - // HTTP status codes to indicate success: http.StatusOK - NewListPager func(resourceGroupName string, serverName string, options *armpostgresql.ServerBasedPerformanceTierClientListOptions) (resp azfake.PagerResponder[armpostgresql.ServerBasedPerformanceTierClientListResponse]) -} - -// NewServerBasedPerformanceTierServerTransport creates a new instance of ServerBasedPerformanceTierServerTransport with the provided implementation. -// The returned ServerBasedPerformanceTierServerTransport instance is connected to an instance of armpostgresql.ServerBasedPerformanceTierClient via the -// azcore.ClientOptions.Transporter field in the client's constructor parameters. -func NewServerBasedPerformanceTierServerTransport(srv *ServerBasedPerformanceTierServer) *ServerBasedPerformanceTierServerTransport { - return &ServerBasedPerformanceTierServerTransport{ - srv: srv, - newListPager: newTracker[azfake.PagerResponder[armpostgresql.ServerBasedPerformanceTierClientListResponse]](), - } -} - -// ServerBasedPerformanceTierServerTransport connects instances of armpostgresql.ServerBasedPerformanceTierClient to instances of ServerBasedPerformanceTierServer. -// Don't use this type directly, use NewServerBasedPerformanceTierServerTransport instead. -type ServerBasedPerformanceTierServerTransport struct { - srv *ServerBasedPerformanceTierServer - newListPager *tracker[azfake.PagerResponder[armpostgresql.ServerBasedPerformanceTierClientListResponse]] -} - -// Do implements the policy.Transporter interface for ServerBasedPerformanceTierServerTransport. -func (s *ServerBasedPerformanceTierServerTransport) 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")} - } - - var resp *http.Response - var err error - - switch method { - case "ServerBasedPerformanceTierClient.NewListPager": - resp, err = s.dispatchNewListPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } - - if err != nil { - return nil, err - } - - return resp, nil -} - -func (s *ServerBasedPerformanceTierServerTransport) 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~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/servers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/performanceTiers` - 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.NewListPager(resourceGroupNameParam, serverNameParam, nil) - newListPager = &resp - s.newListPager.add(req, newListPager) - } - 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 -} diff --git a/sdk/resourcemanager/postgresql/armpostgresql/fake/serverkeys_server.go b/sdk/resourcemanager/postgresql/armpostgresql/fake/serverkeys_server.go deleted file mode 100644 index 57cd1a4a0b86..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresql/fake/serverkeys_server.go +++ /dev/null @@ -1,269 +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/armpostgresql" - "net/http" - "net/url" - "regexp" -) - -// ServerKeysServer is a fake server for instances of the armpostgresql.ServerKeysClient type. -type ServerKeysServer struct { - // BeginCreateOrUpdate is the fake for method ServerKeysClient.BeginCreateOrUpdate - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted - BeginCreateOrUpdate func(ctx context.Context, serverName string, keyName string, resourceGroupName string, parameters armpostgresql.ServerKey, options *armpostgresql.ServerKeysClientBeginCreateOrUpdateOptions) (resp azfake.PollerResponder[armpostgresql.ServerKeysClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) - - // BeginDelete is the fake for method ServerKeysClient.BeginDelete - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent - BeginDelete func(ctx context.Context, serverName string, keyName string, resourceGroupName string, options *armpostgresql.ServerKeysClientBeginDeleteOptions) (resp azfake.PollerResponder[armpostgresql.ServerKeysClientDeleteResponse], errResp azfake.ErrorResponder) - - // Get is the fake for method ServerKeysClient.Get - // HTTP status codes to indicate success: http.StatusOK - Get func(ctx context.Context, resourceGroupName string, serverName string, keyName string, options *armpostgresql.ServerKeysClientGetOptions) (resp azfake.Responder[armpostgresql.ServerKeysClientGetResponse], errResp azfake.ErrorResponder) - - // NewListPager is the fake for method ServerKeysClient.NewListPager - // HTTP status codes to indicate success: http.StatusOK - NewListPager func(resourceGroupName string, serverName string, options *armpostgresql.ServerKeysClientListOptions) (resp azfake.PagerResponder[armpostgresql.ServerKeysClientListResponse]) -} - -// NewServerKeysServerTransport creates a new instance of ServerKeysServerTransport with the provided implementation. -// The returned ServerKeysServerTransport instance is connected to an instance of armpostgresql.ServerKeysClient via the -// azcore.ClientOptions.Transporter field in the client's constructor parameters. -func NewServerKeysServerTransport(srv *ServerKeysServer) *ServerKeysServerTransport { - return &ServerKeysServerTransport{ - srv: srv, - beginCreateOrUpdate: newTracker[azfake.PollerResponder[armpostgresql.ServerKeysClientCreateOrUpdateResponse]](), - beginDelete: newTracker[azfake.PollerResponder[armpostgresql.ServerKeysClientDeleteResponse]](), - newListPager: newTracker[azfake.PagerResponder[armpostgresql.ServerKeysClientListResponse]](), - } -} - -// ServerKeysServerTransport connects instances of armpostgresql.ServerKeysClient to instances of ServerKeysServer. -// Don't use this type directly, use NewServerKeysServerTransport instead. -type ServerKeysServerTransport struct { - srv *ServerKeysServer - beginCreateOrUpdate *tracker[azfake.PollerResponder[armpostgresql.ServerKeysClientCreateOrUpdateResponse]] - beginDelete *tracker[azfake.PollerResponder[armpostgresql.ServerKeysClientDeleteResponse]] - newListPager *tracker[azfake.PagerResponder[armpostgresql.ServerKeysClientListResponse]] -} - -// Do implements the policy.Transporter interface for ServerKeysServerTransport. -func (s *ServerKeysServerTransport) 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")} - } - - var resp *http.Response - var err error - - switch method { - case "ServerKeysClient.BeginCreateOrUpdate": - resp, err = s.dispatchBeginCreateOrUpdate(req) - case "ServerKeysClient.BeginDelete": - resp, err = s.dispatchBeginDelete(req) - case "ServerKeysClient.Get": - resp, err = s.dispatchGet(req) - case "ServerKeysClient.NewListPager": - resp, err = s.dispatchNewListPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } - - if err != nil { - return nil, err - } - - return resp, nil -} - -func (s *ServerKeysServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { - if s.srv.BeginCreateOrUpdate == nil { - return nil, &nonRetriableError{errors.New("fake for method BeginCreateOrUpdate not implemented")} - } - 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/servers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/keys/(?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[armpostgresql.ServerKey](req) - if err != nil { - return nil, err - } - serverNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("serverName")]) - if err != nil { - return nil, err - } - keyNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("keyName")]) - if err != nil { - return nil, err - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - respr, errRespr := s.srv.BeginCreateOrUpdate(req.Context(), serverNameParam, keyNameParam, resourceGroupNameParam, body, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - beginCreateOrUpdate = &respr - s.beginCreateOrUpdate.add(req, beginCreateOrUpdate) - } - - resp, err := server.PollerResponderNext(beginCreateOrUpdate, req) - if err != nil { - return nil, err - } - - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { - s.beginCreateOrUpdate.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} - } - if !server.PollerResponderMore(beginCreateOrUpdate) { - s.beginCreateOrUpdate.remove(req) - } - - return resp, nil -} - -func (s *ServerKeysServerTransport) dispatchBeginDelete(req *http.Request) (*http.Response, error) { - if s.srv.BeginDelete == nil { - return nil, &nonRetriableError{errors.New("fake for method BeginDelete not implemented")} - } - beginDelete := s.beginDelete.get(req) - if beginDelete == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/servers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/keys/(?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) - } - serverNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("serverName")]) - if err != nil { - return nil, err - } - keyNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("keyName")]) - if err != nil { - return nil, err - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - respr, errRespr := s.srv.BeginDelete(req.Context(), serverNameParam, keyNameParam, resourceGroupNameParam, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - beginDelete = &respr - s.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) { - s.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) { - s.beginDelete.remove(req) - } - - return resp, nil -} - -func (s *ServerKeysServerTransport) 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/servers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/keys/(?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 - } - keyNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("keyName")]) - if err != nil { - return nil, err - } - respr, errRespr := s.srv.Get(req.Context(), resourceGroupNameParam, serverNameParam, keyNameParam, 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).ServerKey, req) - if err != nil { - return nil, err - } - return resp, nil -} - -func (s *ServerKeysServerTransport) 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~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/servers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/keys` - 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.NewListPager(resourceGroupNameParam, serverNameParam, nil) - newListPager = &resp - s.newListPager.add(req, newListPager) - server.PagerResponderInjectNextLinks(newListPager, req, func(page *armpostgresql.ServerKeysClientListResponse, 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 -} diff --git a/sdk/resourcemanager/postgresql/armpostgresql/fake/serverparameters_server.go b/sdk/resourcemanager/postgresql/armpostgresql/fake/serverparameters_server.go deleted file mode 100644 index 3fb6f520664d..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresql/fake/serverparameters_server.go +++ /dev/null @@ -1,116 +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/armpostgresql" - "net/http" - "net/url" - "regexp" -) - -// ServerParametersServer is a fake server for instances of the armpostgresql.ServerParametersClient type. -type ServerParametersServer struct { - // BeginListUpdateConfigurations is the fake for method ServerParametersClient.BeginListUpdateConfigurations - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted - BeginListUpdateConfigurations func(ctx context.Context, resourceGroupName string, serverName string, value armpostgresql.ConfigurationListResult, options *armpostgresql.ServerParametersClientBeginListUpdateConfigurationsOptions) (resp azfake.PollerResponder[armpostgresql.ServerParametersClientListUpdateConfigurationsResponse], errResp azfake.ErrorResponder) -} - -// NewServerParametersServerTransport creates a new instance of ServerParametersServerTransport with the provided implementation. -// The returned ServerParametersServerTransport instance is connected to an instance of armpostgresql.ServerParametersClient via the -// azcore.ClientOptions.Transporter field in the client's constructor parameters. -func NewServerParametersServerTransport(srv *ServerParametersServer) *ServerParametersServerTransport { - return &ServerParametersServerTransport{ - srv: srv, - beginListUpdateConfigurations: newTracker[azfake.PollerResponder[armpostgresql.ServerParametersClientListUpdateConfigurationsResponse]](), - } -} - -// ServerParametersServerTransport connects instances of armpostgresql.ServerParametersClient to instances of ServerParametersServer. -// Don't use this type directly, use NewServerParametersServerTransport instead. -type ServerParametersServerTransport struct { - srv *ServerParametersServer - beginListUpdateConfigurations *tracker[azfake.PollerResponder[armpostgresql.ServerParametersClientListUpdateConfigurationsResponse]] -} - -// Do implements the policy.Transporter interface for ServerParametersServerTransport. -func (s *ServerParametersServerTransport) 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")} - } - - var resp *http.Response - var err error - - switch method { - case "ServerParametersClient.BeginListUpdateConfigurations": - resp, err = s.dispatchBeginListUpdateConfigurations(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } - - if err != nil { - return nil, err - } - - return resp, nil -} - -func (s *ServerParametersServerTransport) dispatchBeginListUpdateConfigurations(req *http.Request) (*http.Response, error) { - if s.srv.BeginListUpdateConfigurations == nil { - return nil, &nonRetriableError{errors.New("fake for method BeginListUpdateConfigurations not implemented")} - } - beginListUpdateConfigurations := s.beginListUpdateConfigurations.get(req) - if beginListUpdateConfigurations == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/servers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/updateConfigurations` - 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[armpostgresql.ConfigurationListResult](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 := s.srv.BeginListUpdateConfigurations(req.Context(), resourceGroupNameParam, serverNameParam, body, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - beginListUpdateConfigurations = &respr - s.beginListUpdateConfigurations.add(req, beginListUpdateConfigurations) - } - - resp, err := server.PollerResponderNext(beginListUpdateConfigurations, req) - if err != nil { - return nil, err - } - - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { - s.beginListUpdateConfigurations.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} - } - if !server.PollerResponderMore(beginListUpdateConfigurations) { - s.beginListUpdateConfigurations.remove(req) - } - - return resp, nil -} diff --git a/sdk/resourcemanager/postgresql/armpostgresql/fake/servers_server.go b/sdk/resourcemanager/postgresql/armpostgresql/fake/servers_server.go index 7dd7e9c6b146..1e7bb859e3fc 100644 --- a/sdk/resourcemanager/postgresql/armpostgresql/fake/servers_server.go +++ b/sdk/resourcemanager/postgresql/armpostgresql/fake/servers_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -12,41 +11,51 @@ 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/resourcemanager/postgresql/armpostgresql" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresql/v2" "net/http" "net/url" + "reflect" "regexp" ) // ServersServer is a fake server for instances of the armpostgresql.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 armpostgresql.ServerForCreate, options *armpostgresql.ServersClientBeginCreateOptions) (resp azfake.PollerResponder[armpostgresql.ServersClientCreateResponse], errResp azfake.ErrorResponder) + // BeginCreateOrUpdate is the fake for method ServersClient.BeginCreateOrUpdate + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + BeginCreateOrUpdate func(ctx context.Context, resourceGroupName string, serverName string, parameters armpostgresql.Server, options *armpostgresql.ServersClientBeginCreateOrUpdateOptions) (resp azfake.PollerResponder[armpostgresql.ServersClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) // BeginDelete is the fake for method ServersClient.BeginDelete // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent - BeginDelete func(ctx context.Context, resourceGroupName string, serverName string, options *armpostgresql.ServersClientBeginDeleteOptions) (resp azfake.PollerResponder[armpostgresql.ServersClientDeleteResponse], errResp azfake.ErrorResponder) + BeginDelete func(ctx context.Context, resourceGroupName string, serverName string, options *armpostgresql.ServersClientBeginDeleteOptions) (resp azfake.PollerResponder[armpostgresql.ServersClientDeleteResponse], errResp azfake.ErrorResponder) // Get is the fake for method ServersClient.Get // HTTP status codes to indicate success: http.StatusOK - Get func(ctx context.Context, resourceGroupName string, serverName string, options *armpostgresql.ServersClientGetOptions) (resp azfake.Responder[armpostgresql.ServersClientGetResponse], errResp azfake.ErrorResponder) + Get func(ctx context.Context, resourceGroupName string, serverName string, options *armpostgresql.ServersClientGetOptions) (resp azfake.Responder[armpostgresql.ServersClientGetResponse], errResp azfake.ErrorResponder) - // NewListPager is the fake for method ServersClient.NewListPager + // NewListByResourceGroupPager is the fake for method ServersClient.NewListByResourceGroupPager // HTTP status codes to indicate success: http.StatusOK - NewListPager func(options *armpostgresql.ServersClientListOptions) (resp azfake.PagerResponder[armpostgresql.ServersClientListResponse]) + NewListByResourceGroupPager func(resourceGroupName string, options *armpostgresql.ServersClientListByResourceGroupOptions) (resp azfake.PagerResponder[armpostgresql.ServersClientListByResourceGroupResponse]) - // NewListByResourceGroupPager is the fake for method ServersClient.NewListByResourceGroupPager + // NewListBySubscriptionPager is the fake for method ServersClient.NewListBySubscriptionPager // HTTP status codes to indicate success: http.StatusOK - NewListByResourceGroupPager func(resourceGroupName string, options *armpostgresql.ServersClientListByResourceGroupOptions) (resp azfake.PagerResponder[armpostgresql.ServersClientListByResourceGroupResponse]) + NewListBySubscriptionPager func(options *armpostgresql.ServersClientListBySubscriptionOptions) (resp azfake.PagerResponder[armpostgresql.ServersClientListBySubscriptionResponse]) // BeginRestart is the fake for method ServersClient.BeginRestart - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted - BeginRestart func(ctx context.Context, resourceGroupName string, serverName string, options *armpostgresql.ServersClientBeginRestartOptions) (resp azfake.PollerResponder[armpostgresql.ServersClientRestartResponse], errResp azfake.ErrorResponder) + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent + BeginRestart func(ctx context.Context, resourceGroupName string, serverName string, options *armpostgresql.ServersClientBeginRestartOptions) (resp azfake.PollerResponder[armpostgresql.ServersClientRestartResponse], errResp azfake.ErrorResponder) + + // BeginStart is the fake for method ServersClient.BeginStart + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent + BeginStart func(ctx context.Context, resourceGroupName string, serverName string, options *armpostgresql.ServersClientBeginStartOptions) (resp azfake.PollerResponder[armpostgresql.ServersClientStartResponse], errResp azfake.ErrorResponder) + + // BeginStop is the fake for method ServersClient.BeginStop + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent + BeginStop func(ctx context.Context, resourceGroupName string, serverName string, options *armpostgresql.ServersClientBeginStopOptions) (resp azfake.PollerResponder[armpostgresql.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 armpostgresql.ServerUpdateParameters, options *armpostgresql.ServersClientBeginUpdateOptions) (resp azfake.PollerResponder[armpostgresql.ServersClientUpdateResponse], errResp azfake.ErrorResponder) + BeginUpdate func(ctx context.Context, resourceGroupName string, serverName string, parameters armpostgresql.ServerForPatch, options *armpostgresql.ServersClientBeginUpdateOptions) (resp azfake.PollerResponder[armpostgresql.ServersClientUpdateResponse], errResp azfake.ErrorResponder) } // NewServersServerTransport creates a new instance of ServersServerTransport with the provided implementation. @@ -54,26 +63,30 @@ type ServersServer struct { // azcore.ClientOptions.Transporter field in the client's constructor parameters. func NewServersServerTransport(srv *ServersServer) *ServersServerTransport { return &ServersServerTransport{ - srv: srv, - beginCreate: newTracker[azfake.PollerResponder[armpostgresql.ServersClientCreateResponse]](), - beginDelete: newTracker[azfake.PollerResponder[armpostgresql.ServersClientDeleteResponse]](), - newListPager: newTracker[azfake.PagerResponder[armpostgresql.ServersClientListResponse]](), - newListByResourceGroupPager: newTracker[azfake.PagerResponder[armpostgresql.ServersClientListByResourceGroupResponse]](), - beginRestart: newTracker[azfake.PollerResponder[armpostgresql.ServersClientRestartResponse]](), - beginUpdate: newTracker[azfake.PollerResponder[armpostgresql.ServersClientUpdateResponse]](), + srv: srv, + beginCreateOrUpdate: newTracker[azfake.PollerResponder[armpostgresql.ServersClientCreateOrUpdateResponse]](), + beginDelete: newTracker[azfake.PollerResponder[armpostgresql.ServersClientDeleteResponse]](), + newListByResourceGroupPager: newTracker[azfake.PagerResponder[armpostgresql.ServersClientListByResourceGroupResponse]](), + newListBySubscriptionPager: newTracker[azfake.PagerResponder[armpostgresql.ServersClientListBySubscriptionResponse]](), + beginRestart: newTracker[azfake.PollerResponder[armpostgresql.ServersClientRestartResponse]](), + beginStart: newTracker[azfake.PollerResponder[armpostgresql.ServersClientStartResponse]](), + beginStop: newTracker[azfake.PollerResponder[armpostgresql.ServersClientStopResponse]](), + beginUpdate: newTracker[azfake.PollerResponder[armpostgresql.ServersClientUpdateResponse]](), } } // ServersServerTransport connects instances of armpostgresql.ServersClient to instances of ServersServer. // Don't use this type directly, use NewServersServerTransport instead. type ServersServerTransport struct { - srv *ServersServer - beginCreate *tracker[azfake.PollerResponder[armpostgresql.ServersClientCreateResponse]] - beginDelete *tracker[azfake.PollerResponder[armpostgresql.ServersClientDeleteResponse]] - newListPager *tracker[azfake.PagerResponder[armpostgresql.ServersClientListResponse]] - newListByResourceGroupPager *tracker[azfake.PagerResponder[armpostgresql.ServersClientListByResourceGroupResponse]] - beginRestart *tracker[azfake.PollerResponder[armpostgresql.ServersClientRestartResponse]] - beginUpdate *tracker[azfake.PollerResponder[armpostgresql.ServersClientUpdateResponse]] + srv *ServersServer + beginCreateOrUpdate *tracker[azfake.PollerResponder[armpostgresql.ServersClientCreateOrUpdateResponse]] + beginDelete *tracker[azfake.PollerResponder[armpostgresql.ServersClientDeleteResponse]] + newListByResourceGroupPager *tracker[azfake.PagerResponder[armpostgresql.ServersClientListByResourceGroupResponse]] + newListBySubscriptionPager *tracker[azfake.PagerResponder[armpostgresql.ServersClientListBySubscriptionResponse]] + beginRestart *tracker[azfake.PollerResponder[armpostgresql.ServersClientRestartResponse]] + beginStart *tracker[azfake.PollerResponder[armpostgresql.ServersClientStartResponse]] + beginStop *tracker[azfake.PollerResponder[armpostgresql.ServersClientStopResponse]] + beginUpdate *tracker[azfake.PollerResponder[armpostgresql.ServersClientUpdateResponse]] } // Do implements the policy.Transporter interface for ServersServerTransport. @@ -84,48 +97,71 @@ func (s *ServersServerTransport) Do(req *http.Request) (*http.Response, error) { return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error - - switch method { - case "ServersClient.BeginCreate": - resp, err = s.dispatchBeginCreate(req) - case "ServersClient.BeginDelete": - resp, err = s.dispatchBeginDelete(req) - case "ServersClient.Get": - resp, err = s.dispatchGet(req) - case "ServersClient.NewListPager": - resp, err = s.dispatchNewListPager(req) - case "ServersClient.NewListByResourceGroupPager": - resp, err = s.dispatchNewListByResourceGroupPager(req) - case "ServersClient.BeginRestart": - resp, err = s.dispatchBeginRestart(req) - case "ServersClient.BeginUpdate": - resp, err = s.dispatchBeginUpdate(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } + return s.dispatchToMethodFake(req, method) +} - if err != nil { - return nil, err - } +func (s *ServersServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - return resp, nil + go func() { + var intercepted bool + var res result + if serversServerTransportInterceptor != nil { + res.resp, res.err, intercepted = serversServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + 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.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": + res.resp, res.err = s.dispatchBeginStart(req) + case "ServersClient.BeginStop": + res.resp, res.err = s.dispatchBeginStop(req) + case "ServersClient.BeginUpdate": + res.resp, res.err = s.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 (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 { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/servers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + 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[armpostgresql.ServerForCreate](req) + body, err := server.UnmarshalRequestAsJSON[armpostgresql.Server](req) if err != nil { return nil, err } @@ -137,25 +173,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}, resp.StatusCode) { + s.beginCreateOrUpdate.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } - if !server.PollerResponderMore(beginCreate) { - s.beginCreate.remove(req) + if !server.PollerResponderMore(beginCreateOrUpdate) { + s.beginCreateOrUpdate.remove(req) } return resp, nil @@ -167,10 +203,10 @@ func (s *ServersServerTransport) dispatchBeginDelete(req *http.Request) (*http.R } beginDelete := s.beginDelete.get(req) if beginDelete == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/servers/(?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~%@]+)` 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")]) @@ -209,10 +245,10 @@ func (s *ServersServerTransport) dispatchGet(req *http.Request) (*http.Response, 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/servers/(?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~%@]+)` 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")]) @@ -238,46 +274,16 @@ 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/servers` - 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) - } - 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")} } newListByResourceGroupPager := s.newListByResourceGroupPager.get(req) if newListByResourceGroupPager == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/servers` + 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")]) @@ -287,6 +293,9 @@ func (s *ServersServerTransport) dispatchNewListByResourceGroupPager(req *http.R resp := s.srv.NewListByResourceGroupPager(resourceGroupNameParam, nil) newListByResourceGroupPager = &resp s.newListByResourceGroupPager.add(req, newListByResourceGroupPager) + server.PagerResponderInjectNextLinks(newListByResourceGroupPager, req, func(page *armpostgresql.ServersClientListByResourceGroupResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) } resp, err := server.PagerResponderNext(newListByResourceGroupPager, req) if err != nil { @@ -302,18 +311,55 @@ 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 *armpostgresql.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")} } beginRestart := s.beginRestart.get(req) if beginRestart == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/servers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/restart` + 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[armpostgresql.RestartParameter](req) + if err != nil { + return nil, err + } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) if err != nil { return nil, err @@ -322,7 +368,13 @@ func (s *ServersServerTransport) dispatchBeginRestart(req *http.Request) (*http. if err != nil { return nil, err } - respr, errRespr := s.srv.BeginRestart(req.Context(), resourceGroupNameParam, serverNameParam, nil) + var options *armpostgresql.ServersClientBeginRestartOptions + if !reflect.ValueOf(body).IsZero() { + options = &armpostgresql.ServersClientBeginRestartOptions{ + Parameters: &body, + } + } + respr, errRespr := s.srv.BeginRestart(req.Context(), resourceGroupNameParam, serverNameParam, options) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } @@ -335,9 +387,9 @@ func (s *ServersServerTransport) dispatchBeginRestart(req *http.Request) (*http. return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { s.beginRestart.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(beginRestart) { s.beginRestart.remove(req) @@ -346,19 +398,107 @@ func (s *ServersServerTransport) dispatchBeginRestart(req *http.Request) (*http. return resp, nil } +func (s *ServersServerTransport) dispatchBeginStart(req *http.Request) (*http.Response, error) { + if s.srv.BeginStart == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginStart not implemented")} + } + beginStart := s.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~%@]+)/start` + 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 + } + respr, errRespr := s.srv.BeginStart(req.Context(), resourceGroupNameParam, serverNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginStart = &respr + s.beginStart.add(req, beginStart) + } + + resp, err := server.PollerResponderNext(beginStart, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + s.beginStart.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(beginStart) { + s.beginStart.remove(req) + } + + return resp, nil +} + +func (s *ServersServerTransport) dispatchBeginStop(req *http.Request) (*http.Response, error) { + if s.srv.BeginStop == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginStop not implemented")} + } + beginStop := s.beginStop.get(req) + if beginStop == nil { + 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 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 + } + respr, errRespr := s.srv.BeginStop(req.Context(), resourceGroupNameParam, serverNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginStop = &respr + s.beginStop.add(req, beginStop) + } + + resp, err := server.PollerResponderNext(beginStop, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + s.beginStop.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(beginStop) { + s.beginStop.remove(req) + } + + return resp, nil +} + func (s *ServersServerTransport) dispatchBeginUpdate(req *http.Request) (*http.Response, error) { if s.srv.BeginUpdate == nil { return nil, &nonRetriableError{errors.New("fake for method BeginUpdate not implemented")} } beginUpdate := s.beginUpdate.get(req) if beginUpdate == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/servers/(?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~%@]+)` 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[armpostgresql.ServerUpdateParameters](req) + body, err := server.UnmarshalRequestAsJSON[armpostgresql.ServerForPatch](req) if err != nil { return nil, err } @@ -393,3 +533,9 @@ func (s *ServersServerTransport) dispatchBeginUpdate(req *http.Request) (*http.R return resp, nil } + +// set this to conditionally intercept incoming requests to ServersServerTransport +var serversServerTransportInterceptor 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/armpostgresql/fake/serversecurityalertpolicies_server.go b/sdk/resourcemanager/postgresql/armpostgresql/fake/serversecurityalertpolicies_server.go deleted file mode 100644 index 67c71aa49ed5..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresql/fake/serversecurityalertpolicies_server.go +++ /dev/null @@ -1,225 +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/armpostgresql" - "net/http" - "net/url" - "regexp" -) - -// ServerSecurityAlertPoliciesServer is a fake server for instances of the armpostgresql.ServerSecurityAlertPoliciesClient type. -type ServerSecurityAlertPoliciesServer struct { - // BeginCreateOrUpdate is the fake for method ServerSecurityAlertPoliciesClient.BeginCreateOrUpdate - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted - BeginCreateOrUpdate func(ctx context.Context, resourceGroupName string, serverName string, securityAlertPolicyName armpostgresql.SecurityAlertPolicyName, parameters armpostgresql.ServerSecurityAlertPolicy, options *armpostgresql.ServerSecurityAlertPoliciesClientBeginCreateOrUpdateOptions) (resp azfake.PollerResponder[armpostgresql.ServerSecurityAlertPoliciesClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) - - // Get is the fake for method ServerSecurityAlertPoliciesClient.Get - // HTTP status codes to indicate success: http.StatusOK - Get func(ctx context.Context, resourceGroupName string, serverName string, securityAlertPolicyName armpostgresql.SecurityAlertPolicyName, options *armpostgresql.ServerSecurityAlertPoliciesClientGetOptions) (resp azfake.Responder[armpostgresql.ServerSecurityAlertPoliciesClientGetResponse], errResp azfake.ErrorResponder) - - // NewListByServerPager is the fake for method ServerSecurityAlertPoliciesClient.NewListByServerPager - // HTTP status codes to indicate success: http.StatusOK - NewListByServerPager func(resourceGroupName string, serverName string, options *armpostgresql.ServerSecurityAlertPoliciesClientListByServerOptions) (resp azfake.PagerResponder[armpostgresql.ServerSecurityAlertPoliciesClientListByServerResponse]) -} - -// NewServerSecurityAlertPoliciesServerTransport creates a new instance of ServerSecurityAlertPoliciesServerTransport with the provided implementation. -// The returned ServerSecurityAlertPoliciesServerTransport instance is connected to an instance of armpostgresql.ServerSecurityAlertPoliciesClient via the -// azcore.ClientOptions.Transporter field in the client's constructor parameters. -func NewServerSecurityAlertPoliciesServerTransport(srv *ServerSecurityAlertPoliciesServer) *ServerSecurityAlertPoliciesServerTransport { - return &ServerSecurityAlertPoliciesServerTransport{ - srv: srv, - beginCreateOrUpdate: newTracker[azfake.PollerResponder[armpostgresql.ServerSecurityAlertPoliciesClientCreateOrUpdateResponse]](), - newListByServerPager: newTracker[azfake.PagerResponder[armpostgresql.ServerSecurityAlertPoliciesClientListByServerResponse]](), - } -} - -// ServerSecurityAlertPoliciesServerTransport connects instances of armpostgresql.ServerSecurityAlertPoliciesClient to instances of ServerSecurityAlertPoliciesServer. -// Don't use this type directly, use NewServerSecurityAlertPoliciesServerTransport instead. -type ServerSecurityAlertPoliciesServerTransport struct { - srv *ServerSecurityAlertPoliciesServer - beginCreateOrUpdate *tracker[azfake.PollerResponder[armpostgresql.ServerSecurityAlertPoliciesClientCreateOrUpdateResponse]] - newListByServerPager *tracker[azfake.PagerResponder[armpostgresql.ServerSecurityAlertPoliciesClientListByServerResponse]] -} - -// Do implements the policy.Transporter interface for ServerSecurityAlertPoliciesServerTransport. -func (s *ServerSecurityAlertPoliciesServerTransport) 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")} - } - - var resp *http.Response - var err error - - switch method { - case "ServerSecurityAlertPoliciesClient.BeginCreateOrUpdate": - resp, err = s.dispatchBeginCreateOrUpdate(req) - case "ServerSecurityAlertPoliciesClient.Get": - resp, err = s.dispatchGet(req) - case "ServerSecurityAlertPoliciesClient.NewListByServerPager": - resp, err = s.dispatchNewListByServerPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } - - if err != nil { - return nil, err - } - - return resp, nil -} - -func (s *ServerSecurityAlertPoliciesServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { - if s.srv.BeginCreateOrUpdate == nil { - return nil, &nonRetriableError{errors.New("fake for method BeginCreateOrUpdate not implemented")} - } - 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/servers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/securityAlertPolicies/(?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[armpostgresql.ServerSecurityAlertPolicy](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 - } - securityAlertPolicyNameParam, err := parseWithCast(matches[regex.SubexpIndex("securityAlertPolicyName")], func(v string) (armpostgresql.SecurityAlertPolicyName, error) { - p, unescapeErr := url.PathUnescape(v) - if unescapeErr != nil { - return "", unescapeErr - } - return armpostgresql.SecurityAlertPolicyName(p), nil - }) - if err != nil { - return nil, err - } - respr, errRespr := s.srv.BeginCreateOrUpdate(req.Context(), resourceGroupNameParam, serverNameParam, securityAlertPolicyNameParam, body, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - beginCreateOrUpdate = &respr - s.beginCreateOrUpdate.add(req, beginCreateOrUpdate) - } - - resp, err := server.PollerResponderNext(beginCreateOrUpdate, req) - if err != nil { - return nil, err - } - - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { - s.beginCreateOrUpdate.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} - } - if !server.PollerResponderMore(beginCreateOrUpdate) { - s.beginCreateOrUpdate.remove(req) - } - - return resp, nil -} - -func (s *ServerSecurityAlertPoliciesServerTransport) 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/servers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/securityAlertPolicies/(?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 - } - securityAlertPolicyNameParam, err := parseWithCast(matches[regex.SubexpIndex("securityAlertPolicyName")], func(v string) (armpostgresql.SecurityAlertPolicyName, error) { - p, unescapeErr := url.PathUnescape(v) - if unescapeErr != nil { - return "", unescapeErr - } - return armpostgresql.SecurityAlertPolicyName(p), nil - }) - if err != nil { - return nil, err - } - respr, errRespr := s.srv.Get(req.Context(), resourceGroupNameParam, serverNameParam, securityAlertPolicyNameParam, 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).ServerSecurityAlertPolicy, req) - if err != nil { - return nil, err - } - return resp, nil -} - -func (s *ServerSecurityAlertPoliciesServerTransport) 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/servers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/securityAlertPolicies` - 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 *armpostgresql.ServerSecurityAlertPoliciesClientListByServerResponse, 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 -} diff --git a/sdk/resourcemanager/postgresql/armpostgresql/fake/serverthreatprotectionsettings_server.go b/sdk/resourcemanager/postgresql/armpostgresql/fake/serverthreatprotectionsettings_server.go new file mode 100644 index 000000000000..969d934e22fa --- /dev/null +++ b/sdk/resourcemanager/postgresql/armpostgresql/fake/serverthreatprotectionsettings_server.go @@ -0,0 +1,150 @@ +// 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) Go Code Generator. DO NOT EDIT. + +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/armpostgresql/v2" + "net/http" + "net/url" + "regexp" +) + +// ServerThreatProtectionSettingsServer is a fake server for instances of the armpostgresql.ServerThreatProtectionSettingsClient type. +type ServerThreatProtectionSettingsServer struct { + // BeginCreateOrUpdate is the fake for method ServerThreatProtectionSettingsClient.BeginCreateOrUpdate + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + BeginCreateOrUpdate func(ctx context.Context, resourceGroupName string, serverName string, threatProtectionName armpostgresql.ThreatProtectionName, parameters armpostgresql.AdvancedThreatProtectionSettingsModel, options *armpostgresql.ServerThreatProtectionSettingsClientBeginCreateOrUpdateOptions) (resp azfake.PollerResponder[armpostgresql.ServerThreatProtectionSettingsClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) +} + +// NewServerThreatProtectionSettingsServerTransport creates a new instance of ServerThreatProtectionSettingsServerTransport with the provided implementation. +// The returned ServerThreatProtectionSettingsServerTransport instance is connected to an instance of armpostgresql.ServerThreatProtectionSettingsClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewServerThreatProtectionSettingsServerTransport(srv *ServerThreatProtectionSettingsServer) *ServerThreatProtectionSettingsServerTransport { + return &ServerThreatProtectionSettingsServerTransport{ + srv: srv, + beginCreateOrUpdate: newTracker[azfake.PollerResponder[armpostgresql.ServerThreatProtectionSettingsClientCreateOrUpdateResponse]](), + } +} + +// ServerThreatProtectionSettingsServerTransport connects instances of armpostgresql.ServerThreatProtectionSettingsClient to instances of ServerThreatProtectionSettingsServer. +// Don't use this type directly, use NewServerThreatProtectionSettingsServerTransport instead. +type ServerThreatProtectionSettingsServerTransport struct { + srv *ServerThreatProtectionSettingsServer + beginCreateOrUpdate *tracker[azfake.PollerResponder[armpostgresql.ServerThreatProtectionSettingsClientCreateOrUpdateResponse]] +} + +// Do implements the policy.Transporter interface for ServerThreatProtectionSettingsServerTransport. +func (s *ServerThreatProtectionSettingsServerTransport) 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) +} + +func (s *ServerThreatProtectionSettingsServerTransport) 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 serverThreatProtectionSettingsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = serverThreatProtectionSettingsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "ServerThreatProtectionSettingsClient.BeginCreateOrUpdate": + res.resp, res.err = s.dispatchBeginCreateOrUpdate(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 (s *ServerThreatProtectionSettingsServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { + if s.srv.BeginCreateOrUpdate == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginCreateOrUpdate not implemented")} + } + 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~%@]+)/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) + } + body, err := server.UnmarshalRequestAsJSON[armpostgresql.AdvancedThreatProtectionSettingsModel](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 + } + threatProtectionNameParam, err := parseWithCast(matches[regex.SubexpIndex("threatProtectionName")], func(v string) (armpostgresql.ThreatProtectionName, error) { + p, unescapeErr := url.PathUnescape(v) + if unescapeErr != nil { + return "", unescapeErr + } + return armpostgresql.ThreatProtectionName(p), nil + }) + if err != nil { + return nil, err + } + respr, errRespr := s.srv.BeginCreateOrUpdate(req.Context(), resourceGroupNameParam, serverNameParam, threatProtectionNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginCreateOrUpdate = &respr + s.beginCreateOrUpdate.add(req, beginCreateOrUpdate) + } + + resp, err := server.PollerResponderNext(beginCreateOrUpdate, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + s.beginCreateOrUpdate.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + } + if !server.PollerResponderMore(beginCreateOrUpdate) { + s.beginCreateOrUpdate.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 + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/postgresql/armpostgresql/fake/time_rfc3339.go b/sdk/resourcemanager/postgresql/armpostgresql/fake/time_rfc3339.go deleted file mode 100644 index b98c0b0402be..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresql/fake/time_rfc3339.go +++ /dev/null @@ -1,83 +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 ( - "encoding/json" - "fmt" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "reflect" - "regexp" - "strings" - "time" -) - -// Azure reports time in UTC but it doesn't include the 'Z' time zone suffix in some cases. -var tzOffsetRegex = regexp.MustCompile(`(Z|z|\+|-)(\d+:\d+)*"*$`) - -const ( - utcDateTimeJSON = `"2006-01-02T15:04:05.999999999"` - utcDateTime = "2006-01-02T15:04:05.999999999" - dateTimeJSON = `"` + time.RFC3339Nano + `"` -) - -type dateTimeRFC3339 time.Time - -func (t dateTimeRFC3339) MarshalJSON() ([]byte, error) { - tt := time.Time(t) - return tt.MarshalJSON() -} - -func (t dateTimeRFC3339) MarshalText() ([]byte, error) { - tt := time.Time(t) - return tt.MarshalText() -} - -func (t *dateTimeRFC3339) UnmarshalJSON(data []byte) error { - layout := utcDateTimeJSON - if tzOffsetRegex.Match(data) { - layout = dateTimeJSON - } - return t.Parse(layout, string(data)) -} - -func (t *dateTimeRFC3339) UnmarshalText(data []byte) error { - layout := utcDateTime - if tzOffsetRegex.Match(data) { - layout = time.RFC3339Nano - } - return t.Parse(layout, string(data)) -} - -func (t *dateTimeRFC3339) Parse(layout, value string) error { - p, err := time.Parse(layout, strings.ToUpper(value)) - *t = dateTimeRFC3339(p) - return err -} - -func populateDateTimeRFC3339(m map[string]any, k string, t *time.Time) { - if t == nil { - return - } else if azcore.IsNullValue(t) { - m[k] = nil - return - } else if reflect.ValueOf(t).IsNil() { - return - } - m[k] = (*dateTimeRFC3339)(t) -} - -func unpopulateDateTimeRFC3339(data json.RawMessage, fn string, t **time.Time) error { - if data == nil || strings.EqualFold(string(data), "null") { - return nil - } - var aux dateTimeRFC3339 - if err := json.Unmarshal(data, &aux); err != nil { - return fmt.Errorf("struct field %s: %v", fn, err) - } - *t = (*time.Time)(&aux) - return nil -} diff --git a/sdk/resourcemanager/postgresql/armpostgresql/fake/tuningoptions_server.go b/sdk/resourcemanager/postgresql/armpostgresql/fake/tuningoptions_server.go new file mode 100644 index 000000000000..15ee88bffa02 --- /dev/null +++ b/sdk/resourcemanager/postgresql/armpostgresql/fake/tuningoptions_server.go @@ -0,0 +1,254 @@ +// 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) Go Code Generator. DO NOT EDIT. + +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/armpostgresql/v2" + "net/http" + "net/url" + "regexp" +) + +// TuningOptionsServer is a fake server for instances of the armpostgresql.TuningOptionsClient type. +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 armpostgresql.TuningOptionParameterEnum, options *armpostgresql.TuningOptionsClientGetOptions) (resp azfake.Responder[armpostgresql.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 *armpostgresql.TuningOptionsClientListByServerOptions) (resp azfake.PagerResponder[armpostgresql.TuningOptionsClientListByServerResponse]) + + // NewListRecommendationsPager is the fake for method TuningOptionsClient.NewListRecommendationsPager + // HTTP status codes to indicate success: http.StatusOK + NewListRecommendationsPager func(resourceGroupName string, serverName string, tuningOption armpostgresql.TuningOptionParameterEnum, options *armpostgresql.TuningOptionsClientListRecommendationsOptions) (resp azfake.PagerResponder[armpostgresql.TuningOptionsClientListRecommendationsResponse]) +} + +// NewTuningOptionsServerTransport creates a new instance of TuningOptionsServerTransport with the provided implementation. +// The returned TuningOptionsServerTransport instance is connected to an instance of armpostgresql.TuningOptionsClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewTuningOptionsServerTransport(srv *TuningOptionsServer) *TuningOptionsServerTransport { + return &TuningOptionsServerTransport{ + srv: srv, + newListByServerPager: newTracker[azfake.PagerResponder[armpostgresql.TuningOptionsClientListByServerResponse]](), + newListRecommendationsPager: newTracker[azfake.PagerResponder[armpostgresql.TuningOptionsClientListRecommendationsResponse]](), + } +} + +// TuningOptionsServerTransport connects instances of armpostgresql.TuningOptionsClient to instances of TuningOptionsServer. +// Don't use this type directly, use NewTuningOptionsServerTransport instead. +type TuningOptionsServerTransport struct { + srv *TuningOptionsServer + newListByServerPager *tracker[azfake.PagerResponder[armpostgresql.TuningOptionsClientListByServerResponse]] + newListRecommendationsPager *tracker[azfake.PagerResponder[armpostgresql.TuningOptionsClientListRecommendationsResponse]] +} + +// Do implements the policy.Transporter interface for TuningOptionsServerTransport. +func (t *TuningOptionsServerTransport) 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 *TuningOptionsServerTransport) 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 tuningOptionsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = tuningOptionsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "TuningOptionsClient.Get": + 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) + } + + } + 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 *TuningOptionsServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { + if t.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~%@]+)/tuningOptions/(?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 + } + tuningOptionParam, err := parseWithCast(matches[regex.SubexpIndex("tuningOption")], func(v string) (armpostgresql.TuningOptionParameterEnum, error) { + p, unescapeErr := url.PathUnescape(v) + if unescapeErr != nil { + return "", unescapeErr + } + return armpostgresql.TuningOptionParameterEnum(p), nil + }) + if err != nil { + return nil, err + } + respr, errRespr := t.srv.Get(req.Context(), resourceGroupNameParam, serverNameParam, tuningOptionParam, 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).TuningOptions, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (t *TuningOptionsServerTransport) dispatchNewListByServerPager(req *http.Request) (*http.Response, error) { + if t.srv.NewListByServerPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListByServerPager not implemented")} + } + newListByServerPager := t.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~%@]+)/tuningOptions` + 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 := t.srv.NewListByServerPager(resourceGroupNameParam, serverNameParam, nil) + newListByServerPager = &resp + t.newListByServerPager.add(req, newListByServerPager) + server.PagerResponderInjectNextLinks(newListByServerPager, req, func(page *armpostgresql.TuningOptionsClientListByServerResponse, 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) { + t.newListByServerPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListByServerPager) { + t.newListByServerPager.remove(req) + } + 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) (armpostgresql.TuningOptionParameterEnum, error) { + p, unescapeErr := url.PathUnescape(v) + if unescapeErr != nil { + return "", unescapeErr + } + return armpostgresql.TuningOptionParameterEnum(p), nil + }) + if err != nil { + return nil, err + } + recommendationTypeUnescaped, err := url.QueryUnescape(qp.Get("recommendationType")) + if err != nil { + return nil, err + } + recommendationTypeParam := getOptional(armpostgresql.RecommendationTypeParameterEnum(recommendationTypeUnescaped)) + var options *armpostgresql.TuningOptionsClientListRecommendationsOptions + if recommendationTypeParam != nil { + options = &armpostgresql.TuningOptionsClientListRecommendationsOptions{ + RecommendationType: recommendationTypeParam, + } + } + resp := t.srv.NewListRecommendationsPager(resourceGroupNameParam, serverNameParam, tuningOptionParam, options) + newListRecommendationsPager = &resp + t.newListRecommendationsPager.add(req, newListRecommendationsPager) + server.PagerResponderInjectNextLinks(newListRecommendationsPager, req, func(page *armpostgresql.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 + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/postgresql/armpostgresql/fake/virtualendpoints_server.go b/sdk/resourcemanager/postgresql/armpostgresql/fake/virtualendpoints_server.go new file mode 100644 index 000000000000..0177b2319f4d --- /dev/null +++ b/sdk/resourcemanager/postgresql/armpostgresql/fake/virtualendpoints_server.go @@ -0,0 +1,353 @@ +// 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) Go Code Generator. DO NOT EDIT. + +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/armpostgresql/v2" + "net/http" + "net/url" + "regexp" +) + +// VirtualEndpointsServer is a fake server for instances of the armpostgresql.VirtualEndpointsClient type. +type VirtualEndpointsServer struct { + // BeginCreate is the fake for method VirtualEndpointsClient.BeginCreate + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + BeginCreate func(ctx context.Context, resourceGroupName string, serverName string, virtualEndpointName string, parameters armpostgresql.VirtualEndpoint, options *armpostgresql.VirtualEndpointsClientBeginCreateOptions) (resp azfake.PollerResponder[armpostgresql.VirtualEndpointsClientCreateResponse], errResp azfake.ErrorResponder) + + // BeginDelete is the fake for method VirtualEndpointsClient.BeginDelete + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent + BeginDelete func(ctx context.Context, resourceGroupName string, serverName string, virtualEndpointName string, options *armpostgresql.VirtualEndpointsClientBeginDeleteOptions) (resp azfake.PollerResponder[armpostgresql.VirtualEndpointsClientDeleteResponse], errResp azfake.ErrorResponder) + + // Get is the fake for method VirtualEndpointsClient.Get + // HTTP status codes to indicate success: http.StatusOK + Get func(ctx context.Context, resourceGroupName string, serverName string, virtualEndpointName string, options *armpostgresql.VirtualEndpointsClientGetOptions) (resp azfake.Responder[armpostgresql.VirtualEndpointsClientGetResponse], errResp azfake.ErrorResponder) + + // NewListByServerPager is the fake for method VirtualEndpointsClient.NewListByServerPager + // HTTP status codes to indicate success: http.StatusOK + NewListByServerPager func(resourceGroupName string, serverName string, options *armpostgresql.VirtualEndpointsClientListByServerOptions) (resp azfake.PagerResponder[armpostgresql.VirtualEndpointsClientListByServerResponse]) + + // BeginUpdate is the fake for method VirtualEndpointsClient.BeginUpdate + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + BeginUpdate func(ctx context.Context, resourceGroupName string, serverName string, virtualEndpointName string, parameters armpostgresql.VirtualEndpointResourceForPatch, options *armpostgresql.VirtualEndpointsClientBeginUpdateOptions) (resp azfake.PollerResponder[armpostgresql.VirtualEndpointsClientUpdateResponse], errResp azfake.ErrorResponder) +} + +// NewVirtualEndpointsServerTransport creates a new instance of VirtualEndpointsServerTransport with the provided implementation. +// The returned VirtualEndpointsServerTransport instance is connected to an instance of armpostgresql.VirtualEndpointsClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewVirtualEndpointsServerTransport(srv *VirtualEndpointsServer) *VirtualEndpointsServerTransport { + return &VirtualEndpointsServerTransport{ + srv: srv, + beginCreate: newTracker[azfake.PollerResponder[armpostgresql.VirtualEndpointsClientCreateResponse]](), + beginDelete: newTracker[azfake.PollerResponder[armpostgresql.VirtualEndpointsClientDeleteResponse]](), + newListByServerPager: newTracker[azfake.PagerResponder[armpostgresql.VirtualEndpointsClientListByServerResponse]](), + beginUpdate: newTracker[azfake.PollerResponder[armpostgresql.VirtualEndpointsClientUpdateResponse]](), + } +} + +// VirtualEndpointsServerTransport connects instances of armpostgresql.VirtualEndpointsClient to instances of VirtualEndpointsServer. +// Don't use this type directly, use NewVirtualEndpointsServerTransport instead. +type VirtualEndpointsServerTransport struct { + srv *VirtualEndpointsServer + beginCreate *tracker[azfake.PollerResponder[armpostgresql.VirtualEndpointsClientCreateResponse]] + beginDelete *tracker[azfake.PollerResponder[armpostgresql.VirtualEndpointsClientDeleteResponse]] + newListByServerPager *tracker[azfake.PagerResponder[armpostgresql.VirtualEndpointsClientListByServerResponse]] + beginUpdate *tracker[azfake.PollerResponder[armpostgresql.VirtualEndpointsClientUpdateResponse]] +} + +// Do implements the policy.Transporter interface for VirtualEndpointsServerTransport. +func (v *VirtualEndpointsServerTransport) 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 v.dispatchToMethodFake(req, method) +} + +func (v *VirtualEndpointsServerTransport) 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 virtualEndpointsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = virtualEndpointsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "VirtualEndpointsClient.BeginCreate": + res.resp, res.err = v.dispatchBeginCreate(req) + case "VirtualEndpointsClient.BeginDelete": + res.resp, res.err = v.dispatchBeginDelete(req) + case "VirtualEndpointsClient.Get": + res.resp, res.err = v.dispatchGet(req) + case "VirtualEndpointsClient.NewListByServerPager": + res.resp, res.err = v.dispatchNewListByServerPager(req) + case "VirtualEndpointsClient.BeginUpdate": + res.resp, res.err = v.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 (v *VirtualEndpointsServerTransport) dispatchBeginCreate(req *http.Request) (*http.Response, error) { + if v.srv.BeginCreate == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginCreate not implemented")} + } + beginCreate := v.beginCreate.get(req) + if beginCreate == nil { + 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 len(matches) < 5 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armpostgresql.VirtualEndpoint](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 + } + virtualEndpointNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("virtualEndpointName")]) + if err != nil { + return nil, err + } + respr, errRespr := v.srv.BeginCreate(req.Context(), resourceGroupNameParam, serverNameParam, virtualEndpointNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginCreate = &respr + v.beginCreate.add(req, beginCreate) + } + + resp, err := server.PollerResponderNext(beginCreate, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + v.beginCreate.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + } + if !server.PollerResponderMore(beginCreate) { + v.beginCreate.remove(req) + } + + return resp, nil +} + +func (v *VirtualEndpointsServerTransport) dispatchBeginDelete(req *http.Request) (*http.Response, error) { + if v.srv.BeginDelete == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginDelete not implemented")} + } + beginDelete := v.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~%@]+)/virtualendpoints/(?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 + } + virtualEndpointNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("virtualEndpointName")]) + if err != nil { + return nil, err + } + respr, errRespr := v.srv.BeginDelete(req.Context(), resourceGroupNameParam, serverNameParam, virtualEndpointNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginDelete = &respr + v.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) { + v.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) { + v.beginDelete.remove(req) + } + + return resp, nil +} + +func (v *VirtualEndpointsServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { + if v.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~%@]+)/virtualendpoints/(?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 + } + virtualEndpointNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("virtualEndpointName")]) + if err != nil { + return nil, err + } + respr, errRespr := v.srv.Get(req.Context(), resourceGroupNameParam, serverNameParam, virtualEndpointNameParam, 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).VirtualEndpoint, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (v *VirtualEndpointsServerTransport) dispatchNewListByServerPager(req *http.Request) (*http.Response, error) { + if v.srv.NewListByServerPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListByServerPager not implemented")} + } + newListByServerPager := v.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~%@]+)/virtualendpoints` + 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 := v.srv.NewListByServerPager(resourceGroupNameParam, serverNameParam, nil) + newListByServerPager = &resp + v.newListByServerPager.add(req, newListByServerPager) + server.PagerResponderInjectNextLinks(newListByServerPager, req, func(page *armpostgresql.VirtualEndpointsClientListByServerResponse, 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) { + v.newListByServerPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListByServerPager) { + v.newListByServerPager.remove(req) + } + return resp, nil +} + +func (v *VirtualEndpointsServerTransport) dispatchBeginUpdate(req *http.Request) (*http.Response, error) { + if v.srv.BeginUpdate == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginUpdate not implemented")} + } + beginUpdate := v.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~%@]+)/virtualendpoints/(?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[armpostgresql.VirtualEndpointResourceForPatch](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 + } + virtualEndpointNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("virtualEndpointName")]) + if err != nil { + return nil, err + } + respr, errRespr := v.srv.BeginUpdate(req.Context(), resourceGroupNameParam, serverNameParam, virtualEndpointNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginUpdate = &respr + v.beginUpdate.add(req, beginUpdate) + } + + resp, err := server.PollerResponderNext(beginUpdate, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + v.beginUpdate.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + } + if !server.PollerResponderMore(beginUpdate) { + v.beginUpdate.remove(req) + } + + return resp, nil +} + +// set this to conditionally intercept incoming requests to VirtualEndpointsServerTransport +var virtualEndpointsServerTransportInterceptor 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/armpostgresql/fake/virtualnetworkrules_server.go b/sdk/resourcemanager/postgresql/armpostgresql/fake/virtualnetworkrules_server.go deleted file mode 100644 index 5f373b104860..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresql/fake/virtualnetworkrules_server.go +++ /dev/null @@ -1,269 +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/armpostgresql" - "net/http" - "net/url" - "regexp" -) - -// VirtualNetworkRulesServer is a fake server for instances of the armpostgresql.VirtualNetworkRulesClient type. -type VirtualNetworkRulesServer struct { - // BeginCreateOrUpdate is the fake for method VirtualNetworkRulesClient.BeginCreateOrUpdate - // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated, http.StatusAccepted - BeginCreateOrUpdate func(ctx context.Context, resourceGroupName string, serverName string, virtualNetworkRuleName string, parameters armpostgresql.VirtualNetworkRule, options *armpostgresql.VirtualNetworkRulesClientBeginCreateOrUpdateOptions) (resp azfake.PollerResponder[armpostgresql.VirtualNetworkRulesClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) - - // BeginDelete is the fake for method VirtualNetworkRulesClient.BeginDelete - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent - BeginDelete func(ctx context.Context, resourceGroupName string, serverName string, virtualNetworkRuleName string, options *armpostgresql.VirtualNetworkRulesClientBeginDeleteOptions) (resp azfake.PollerResponder[armpostgresql.VirtualNetworkRulesClientDeleteResponse], errResp azfake.ErrorResponder) - - // Get is the fake for method VirtualNetworkRulesClient.Get - // HTTP status codes to indicate success: http.StatusOK - Get func(ctx context.Context, resourceGroupName string, serverName string, virtualNetworkRuleName string, options *armpostgresql.VirtualNetworkRulesClientGetOptions) (resp azfake.Responder[armpostgresql.VirtualNetworkRulesClientGetResponse], errResp azfake.ErrorResponder) - - // NewListByServerPager is the fake for method VirtualNetworkRulesClient.NewListByServerPager - // HTTP status codes to indicate success: http.StatusOK - NewListByServerPager func(resourceGroupName string, serverName string, options *armpostgresql.VirtualNetworkRulesClientListByServerOptions) (resp azfake.PagerResponder[armpostgresql.VirtualNetworkRulesClientListByServerResponse]) -} - -// NewVirtualNetworkRulesServerTransport creates a new instance of VirtualNetworkRulesServerTransport with the provided implementation. -// The returned VirtualNetworkRulesServerTransport instance is connected to an instance of armpostgresql.VirtualNetworkRulesClient via the -// azcore.ClientOptions.Transporter field in the client's constructor parameters. -func NewVirtualNetworkRulesServerTransport(srv *VirtualNetworkRulesServer) *VirtualNetworkRulesServerTransport { - return &VirtualNetworkRulesServerTransport{ - srv: srv, - beginCreateOrUpdate: newTracker[azfake.PollerResponder[armpostgresql.VirtualNetworkRulesClientCreateOrUpdateResponse]](), - beginDelete: newTracker[azfake.PollerResponder[armpostgresql.VirtualNetworkRulesClientDeleteResponse]](), - newListByServerPager: newTracker[azfake.PagerResponder[armpostgresql.VirtualNetworkRulesClientListByServerResponse]](), - } -} - -// VirtualNetworkRulesServerTransport connects instances of armpostgresql.VirtualNetworkRulesClient to instances of VirtualNetworkRulesServer. -// Don't use this type directly, use NewVirtualNetworkRulesServerTransport instead. -type VirtualNetworkRulesServerTransport struct { - srv *VirtualNetworkRulesServer - beginCreateOrUpdate *tracker[azfake.PollerResponder[armpostgresql.VirtualNetworkRulesClientCreateOrUpdateResponse]] - beginDelete *tracker[azfake.PollerResponder[armpostgresql.VirtualNetworkRulesClientDeleteResponse]] - newListByServerPager *tracker[azfake.PagerResponder[armpostgresql.VirtualNetworkRulesClientListByServerResponse]] -} - -// Do implements the policy.Transporter interface for VirtualNetworkRulesServerTransport. -func (v *VirtualNetworkRulesServerTransport) 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")} - } - - var resp *http.Response - var err error - - switch method { - case "VirtualNetworkRulesClient.BeginCreateOrUpdate": - resp, err = v.dispatchBeginCreateOrUpdate(req) - case "VirtualNetworkRulesClient.BeginDelete": - resp, err = v.dispatchBeginDelete(req) - case "VirtualNetworkRulesClient.Get": - resp, err = v.dispatchGet(req) - case "VirtualNetworkRulesClient.NewListByServerPager": - resp, err = v.dispatchNewListByServerPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } - - if err != nil { - return nil, err - } - - return resp, nil -} - -func (v *VirtualNetworkRulesServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { - if v.srv.BeginCreateOrUpdate == nil { - return nil, &nonRetriableError{errors.New("fake for method BeginCreateOrUpdate not implemented")} - } - beginCreateOrUpdate := v.beginCreateOrUpdate.get(req) - if beginCreateOrUpdate == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/servers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/virtualNetworkRules/(?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[armpostgresql.VirtualNetworkRule](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 - } - virtualNetworkRuleNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("virtualNetworkRuleName")]) - if err != nil { - return nil, err - } - respr, errRespr := v.srv.BeginCreateOrUpdate(req.Context(), resourceGroupNameParam, serverNameParam, virtualNetworkRuleNameParam, body, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - beginCreateOrUpdate = &respr - v.beginCreateOrUpdate.add(req, beginCreateOrUpdate) - } - - resp, err := server.PollerResponderNext(beginCreateOrUpdate, req) - if err != nil { - return nil, err - } - - if !contains([]int{http.StatusOK, http.StatusCreated, http.StatusAccepted}, resp.StatusCode) { - v.beginCreateOrUpdate.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(beginCreateOrUpdate) { - v.beginCreateOrUpdate.remove(req) - } - - return resp, nil -} - -func (v *VirtualNetworkRulesServerTransport) dispatchBeginDelete(req *http.Request) (*http.Response, error) { - if v.srv.BeginDelete == nil { - return nil, &nonRetriableError{errors.New("fake for method BeginDelete not implemented")} - } - beginDelete := v.beginDelete.get(req) - if beginDelete == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/servers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/virtualNetworkRules/(?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 - } - virtualNetworkRuleNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("virtualNetworkRuleName")]) - if err != nil { - return nil, err - } - respr, errRespr := v.srv.BeginDelete(req.Context(), resourceGroupNameParam, serverNameParam, virtualNetworkRuleNameParam, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - beginDelete = &respr - v.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) { - v.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) { - v.beginDelete.remove(req) - } - - return resp, nil -} - -func (v *VirtualNetworkRulesServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { - if v.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/servers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/virtualNetworkRules/(?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 - } - virtualNetworkRuleNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("virtualNetworkRuleName")]) - if err != nil { - return nil, err - } - respr, errRespr := v.srv.Get(req.Context(), resourceGroupNameParam, serverNameParam, virtualNetworkRuleNameParam, 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).VirtualNetworkRule, req) - if err != nil { - return nil, err - } - return resp, nil -} - -func (v *VirtualNetworkRulesServerTransport) dispatchNewListByServerPager(req *http.Request) (*http.Response, error) { - if v.srv.NewListByServerPager == nil { - return nil, &nonRetriableError{errors.New("fake for method NewListByServerPager not implemented")} - } - newListByServerPager := v.newListByServerPager.get(req) - if newListByServerPager == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/servers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/virtualNetworkRules` - 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 := v.srv.NewListByServerPager(resourceGroupNameParam, serverNameParam, nil) - newListByServerPager = &resp - v.newListByServerPager.add(req, newListByServerPager) - server.PagerResponderInjectNextLinks(newListByServerPager, req, func(page *armpostgresql.VirtualNetworkRulesClientListByServerResponse, 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) { - v.newListByServerPager.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} - } - if !server.PagerResponderMore(newListByServerPager) { - v.newListByServerPager.remove(req) - } - return resp, nil -} diff --git a/sdk/resourcemanager/postgresql/armpostgresql/fake/virtualnetworksubnetusage_server.go b/sdk/resourcemanager/postgresql/armpostgresql/fake/virtualnetworksubnetusage_server.go new file mode 100644 index 000000000000..ca7643b0f2bf --- /dev/null +++ b/sdk/resourcemanager/postgresql/armpostgresql/fake/virtualnetworksubnetusage_server.go @@ -0,0 +1,121 @@ +// 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) Go Code Generator. DO NOT EDIT. + +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/armpostgresql/v2" + "net/http" + "net/url" + "regexp" +) + +// VirtualNetworkSubnetUsageServer is a fake server for instances of the armpostgresql.VirtualNetworkSubnetUsageClient type. +type VirtualNetworkSubnetUsageServer struct { + // List is the fake for method VirtualNetworkSubnetUsageClient.List + // HTTP status codes to indicate success: http.StatusOK + List func(ctx context.Context, locationName string, parameters armpostgresql.VirtualNetworkSubnetUsageParameter, options *armpostgresql.VirtualNetworkSubnetUsageClientListOptions) (resp azfake.Responder[armpostgresql.VirtualNetworkSubnetUsageClientListResponse], errResp azfake.ErrorResponder) +} + +// NewVirtualNetworkSubnetUsageServerTransport creates a new instance of VirtualNetworkSubnetUsageServerTransport with the provided implementation. +// The returned VirtualNetworkSubnetUsageServerTransport instance is connected to an instance of armpostgresql.VirtualNetworkSubnetUsageClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewVirtualNetworkSubnetUsageServerTransport(srv *VirtualNetworkSubnetUsageServer) *VirtualNetworkSubnetUsageServerTransport { + return &VirtualNetworkSubnetUsageServerTransport{srv: srv} +} + +// VirtualNetworkSubnetUsageServerTransport connects instances of armpostgresql.VirtualNetworkSubnetUsageClient to instances of VirtualNetworkSubnetUsageServer. +// Don't use this type directly, use NewVirtualNetworkSubnetUsageServerTransport instead. +type VirtualNetworkSubnetUsageServerTransport struct { + srv *VirtualNetworkSubnetUsageServer +} + +// Do implements the policy.Transporter interface for VirtualNetworkSubnetUsageServerTransport. +func (v *VirtualNetworkSubnetUsageServerTransport) 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 v.dispatchToMethodFake(req, method) +} + +func (v *VirtualNetworkSubnetUsageServerTransport) 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 virtualNetworkSubnetUsageServerTransportInterceptor != nil { + res.resp, res.err, intercepted = virtualNetworkSubnetUsageServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "VirtualNetworkSubnetUsageClient.List": + res.resp, res.err = v.dispatchList(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 (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 len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armpostgresql.VirtualNetworkSubnetUsageParameter](req) + if err != nil { + return nil, err + } + locationNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("locationName")]) + if err != nil { + return nil, err + } + respr, errRespr := v.srv.List(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).VirtualNetworkSubnetUsageModel, req) + if err != nil { + return nil, err + } + return resp, nil +} + +// set this to conditionally intercept incoming requests to VirtualNetworkSubnetUsageServerTransport +var virtualNetworkSubnetUsageServerTransportInterceptor 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/armpostgresql/firewallrules_client.go b/sdk/resourcemanager/postgresql/armpostgresql/firewallrules_client.go index 999fcb3cdeed..279afd705052 100644 --- a/sdk/resourcemanager/postgresql/armpostgresql/firewallrules_client.go +++ b/sdk/resourcemanager/postgresql/armpostgresql/firewallrules_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armpostgresql @@ -25,9 +24,9 @@ type FirewallRulesClient struct { } // NewFirewallRulesClient creates a new instance of FirewallRulesClient with the specified values. -// - subscriptionID - The ID of the target subscription. +// - 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 +42,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 2017-12-01 +// 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) { @@ -57,7 +56,8 @@ func (client *FirewallRulesClient) BeginCreateOrUpdate(ctx context.Context, reso return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[FirewallRulesClientCreateOrUpdateResponse]{ - Tracer: client.internal.Tracer(), + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -70,7 +70,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 2017-12-01 +// 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" @@ -85,7 +85,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 } @@ -93,8 +93,8 @@ func (client *FirewallRulesClient) createOrUpdate(ctx context.Context, resourceG } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *FirewallRulesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, serverName string, firewallRuleName string, parameters FirewallRule, options *FirewallRulesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/firewallRules/{firewallRuleName}" +func (client *FirewallRulesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, serverName string, firewallRuleName string, parameters FirewallRule, _ *FirewallRulesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/firewallRules/{firewallRuleName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -116,22 +116,22 @@ func (client *FirewallRulesClient) createOrUpdateCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2017-12-01") + reqQP.Set("api-version", "2025-08-01") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } return req, nil } -// BeginDelete - Deletes a server firewall rule. +// BeginDelete - Deletes an existing firewall rule. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2017-12-01 +// 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) { @@ -151,10 +151,10 @@ func (client *FirewallRulesClient) BeginDelete(ctx context.Context, resourceGrou } } -// Delete - Deletes a server firewall rule. +// Delete - Deletes an existing firewall rule. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2017-12-01 +// 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" @@ -169,7 +169,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 } @@ -177,8 +177,8 @@ func (client *FirewallRulesClient) deleteOperation(ctx context.Context, resource } // deleteCreateRequest creates the Delete request. -func (client *FirewallRulesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, serverName string, firewallRuleName string, options *FirewallRulesClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/firewallRules/{firewallRuleName}" +func (client *FirewallRulesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, serverName string, firewallRuleName string, _ *FirewallRulesClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/firewallRules/{firewallRuleName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -200,19 +200,18 @@ func (client *FirewallRulesClient) deleteCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2017-12-01") + 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 firewall rule. +// Get - Gets information about a firewall rule in a server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2017-12-01 +// 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 @@ -237,8 +236,8 @@ func (client *FirewallRulesClient) Get(ctx context.Context, resourceGroupName st } // getCreateRequest creates the Get request. -func (client *FirewallRulesClient) getCreateRequest(ctx context.Context, resourceGroupName string, serverName string, firewallRuleName string, options *FirewallRulesClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/firewallRules/{firewallRuleName}" +func (client *FirewallRulesClient) getCreateRequest(ctx context.Context, resourceGroupName string, serverName string, firewallRuleName string, _ *FirewallRulesClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/firewallRules/{firewallRuleName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -260,7 +259,7 @@ func (client *FirewallRulesClient) getCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2017-12-01") + 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 +274,9 @@ func (client *FirewallRulesClient) getHandleResponse(resp *http.Response) (Firew return result, nil } -// NewListByServerPager - List all the firewall rules in a given server. +// NewListByServerPager - Lists information about all firewall rules in a server. // -// Generated from API version 2017-12-01 +// 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 @@ -285,21 +284,20 @@ func (client *FirewallRulesClient) getHandleResponse(resp *http.Response) (Firew func (client *FirewallRulesClient) NewListByServerPager(resourceGroupName string, serverName string, options *FirewallRulesClientListByServerOptions) *runtime.Pager[FirewallRulesClientListByServerResponse] { return runtime.NewPager(runtime.PagingHandler[FirewallRulesClientListByServerResponse]{ More: func(page FirewallRulesClientListByServerResponse) bool { - return false + return page.NextLink != nil && len(*page.NextLink) > 0 }, Fetcher: func(ctx context.Context, page *FirewallRulesClientListByServerResponse) (FirewallRulesClientListByServerResponse, error) { ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "FirewallRulesClient.NewListByServerPager") - req, err := client.listByServerCreateRequest(ctx, resourceGroupName, serverName, options) - if err != nil { - return FirewallRulesClientListByServerResponse{}, err + nextLink := "" + if page != nil { + nextLink = *page.NextLink } - resp, err := client.internal.Pipeline().Do(req) + 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 FirewallRulesClientListByServerResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return FirewallRulesClientListByServerResponse{}, runtime.NewResponseError(resp) - } return client.listByServerHandleResponse(resp) }, Tracer: client.internal.Tracer(), @@ -307,8 +305,8 @@ func (client *FirewallRulesClient) NewListByServerPager(resourceGroupName string } // listByServerCreateRequest creates the ListByServer request. -func (client *FirewallRulesClient) listByServerCreateRequest(ctx context.Context, resourceGroupName string, serverName string, options *FirewallRulesClientListByServerOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/firewallRules" +func (client *FirewallRulesClient) listByServerCreateRequest(ctx context.Context, resourceGroupName string, serverName string, _ *FirewallRulesClientListByServerOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/firewallRules" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -326,7 +324,7 @@ func (client *FirewallRulesClient) listByServerCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2017-12-01") + reqQP.Set("api-version", "2025-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -335,7 +333,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/armpostgresql/firewallrules_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresql/firewallrules_client_example_test.go index b90ae739a193..59abaab978ef 100644 --- a/sdk/resourcemanager/postgresql/armpostgresql/firewallrules_client_example_test.go +++ b/sdk/resourcemanager/postgresql/armpostgresql/firewallrules_client_example_test.go @@ -1,70 +1,55 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armpostgresql_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/armpostgresql" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresql/v2" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/FirewallRuleCreate.json +// Generated from example definition: 2025-08-01/FirewallRulesCreateOrUpdate.json func ExampleFirewallRulesClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armpostgresql.NewClientFactory("", cred, nil) + clientFactory, err := armpostgresql.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewFirewallRulesClient().BeginCreateOrUpdate(ctx, "TestGroup", "testserver", "rule1", armpostgresql.FirewallRule{ + poller, err := clientFactory.NewFirewallRulesClient().BeginCreateOrUpdate(ctx, "exampleresourcegroup", "exampleserver", "examplefirewallrule", armpostgresql.FirewallRule{ Properties: &armpostgresql.FirewallRuleProperties{ - EndIPAddress: to.Ptr("255.255.255.255"), - StartIPAddress: to.Ptr("0.0.0.0"), + EndIPAddress: to.Ptr("255.255.255.255"), + StartIPAddress: to.Ptr("0.0.0.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.FirewallRule = armpostgresql.FirewallRule{ - // Name: to.Ptr("rule1"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/firewallRules"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/firewallRules/rule1"), - // Properties: &armpostgresql.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/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/FirewallRuleDelete.json +// Generated from example definition: 2025-08-01/FirewallRulesDelete.json func ExampleFirewallRulesClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armpostgresql.NewClientFactory("", cred, nil) + clientFactory, err := armpostgresql.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewFirewallRulesClient().BeginDelete(ctx, "TestGroup", "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) } @@ -74,47 +59,49 @@ func ExampleFirewallRulesClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/FirewallRuleGet.json +// Generated from example definition: 2025-08-01/FirewallRulesGet.json func ExampleFirewallRulesClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armpostgresql.NewClientFactory("", cred, nil) + clientFactory, err := armpostgresql.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewFirewallRulesClient().Get(ctx, "TestGroup", "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) } // 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 = armpostgresql.FirewallRule{ - // Name: to.Ptr("rule1"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/firewallRules"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/firewallRules/rule1"), - // Properties: &armpostgresql.FirewallRuleProperties{ - // EndIPAddress: to.Ptr("255.255.255.255"), - // StartIPAddress: to.Ptr("0.0.0.0"), + // res = armpostgresql.FirewallRulesClientGetResponse{ + // FirewallRule: &armpostgresql.FirewallRule{ + // Name: to.Ptr("examplefirewallrule"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/firewallRules"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/servers/exampleserver/firewallRules/examplefirewallrule"), + // Properties: &armpostgresql.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/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/FirewallRuleListByServer.json +// Generated from example definition: 2025-08-01/FirewallRulesListByServer.json func ExampleFirewallRulesClient_NewListByServerPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armpostgresql.NewClientFactory("", cred, nil) + clientFactory, err := armpostgresql.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewFirewallRulesClient().NewListByServerPager("TestGroup", "testserver", nil) + pager := clientFactory.NewFirewallRulesClient().NewListByServerPager("exampleresourcegroup", "exampleserver", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -125,26 +112,30 @@ 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 = armpostgresql.FirewallRuleListResult{ - // Value: []*armpostgresql.FirewallRule{ - // { - // Name: to.Ptr("rule1"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/firewallRules"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/firewallRules/rule1"), - // Properties: &armpostgresql.FirewallRuleProperties{ - // EndIPAddress: to.Ptr("255.255.255.255"), - // StartIPAddress: to.Ptr("0.0.0.0"), + // page = armpostgresql.FirewallRulesClientListByServerResponse{ + // FirewallRuleList: armpostgresql.FirewallRuleList{ + // NextLink: to.Ptr("https://management.azure.com/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff//resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/firewallRules?api-version=2025-06-01-preview&$skiptoken=skiptoken"), + // Value: []*armpostgresql.FirewallRule{ + // { + // Name: to.Ptr("examplefirewallrule1"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/firewallRules"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/firewallRules/examplefirewallrule1"), + // Properties: &armpostgresql.FirewallRuleProperties{ + // EndIPAddress: to.Ptr("255.255.255.255"), + // StartIPAddress: to.Ptr("0.0.0.0"), + // }, // }, - // }, - // { - // Name: to.Ptr("rule2"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/firewallRules"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/firewallRules/rule2"), - // Properties: &armpostgresql.FirewallRuleProperties{ - // EndIPAddress: to.Ptr("255.0.0.0"), - // StartIPAddress: to.Ptr("1.0.0.0"), + // { + // Name: to.Ptr("examplefirewallrule2"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/firewallRules"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/firewallRules/examplefirewallrule2"), + // Properties: &armpostgresql.FirewallRuleProperties{ + // EndIPAddress: to.Ptr("255.0.0.0"), + // StartIPAddress: to.Ptr("1.0.0.0"), + // }, // }, - // }}, + // }, + // }, // } } } diff --git a/sdk/resourcemanager/postgresql/armpostgresql/go.mod b/sdk/resourcemanager/postgresql/armpostgresql/go.mod index 850578bd0645..028dc9ae60c2 100644 --- a/sdk/resourcemanager/postgresql/armpostgresql/go.mod +++ b/sdk/resourcemanager/postgresql/armpostgresql/go.mod @@ -1,4 +1,4 @@ -module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresql +module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresql/v2 go 1.24.0 diff --git a/sdk/resourcemanager/postgresql/armpostgresql/interfaces.go b/sdk/resourcemanager/postgresql/armpostgresql/interfaces.go deleted file mode 100644 index e60234588c9c..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresql/interfaces.go +++ /dev/null @@ -1,16 +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 armpostgresql - -// ServerPropertiesForCreateClassification provides polymorphic access to related types. -// Call the interface's GetServerPropertiesForCreate() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *ServerPropertiesForCreate, *ServerPropertiesForDefaultCreate, *ServerPropertiesForGeoRestore, *ServerPropertiesForReplica, -// - *ServerPropertiesForRestore -type ServerPropertiesForCreateClassification interface { - // GetServerPropertiesForCreate returns the ServerPropertiesForCreate content of the underlying type. - GetServerPropertiesForCreate() *ServerPropertiesForCreate -} diff --git a/sdk/resourcemanager/postgresql/armpostgresql/locationbasedperformancetier_client.go b/sdk/resourcemanager/postgresql/armpostgresql/locationbasedperformancetier_client.go deleted file mode 100644 index cbc585976633..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresql/locationbasedperformancetier_client.go +++ /dev/null @@ -1,102 +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 armpostgresql - -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" -) - -// LocationBasedPerformanceTierClient contains the methods for the LocationBasedPerformanceTier group. -// Don't use this type directly, use NewLocationBasedPerformanceTierClient() instead. -type LocationBasedPerformanceTierClient struct { - internal *arm.Client - subscriptionID string -} - -// NewLocationBasedPerformanceTierClient creates a new instance of LocationBasedPerformanceTierClient with the specified values. -// - subscriptionID - The ID of the target subscription. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewLocationBasedPerformanceTierClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*LocationBasedPerformanceTierClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &LocationBasedPerformanceTierClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// NewListPager - List all the performance tiers at specified location in a given subscription. -// -// Generated from API version 2017-12-01 -// - locationName - The name of the location. -// - options - LocationBasedPerformanceTierClientListOptions contains the optional parameters for the LocationBasedPerformanceTierClient.NewListPager -// method. -func (client *LocationBasedPerformanceTierClient) NewListPager(locationName string, options *LocationBasedPerformanceTierClientListOptions) *runtime.Pager[LocationBasedPerformanceTierClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[LocationBasedPerformanceTierClientListResponse]{ - More: func(page LocationBasedPerformanceTierClientListResponse) bool { - return false - }, - Fetcher: func(ctx context.Context, page *LocationBasedPerformanceTierClientListResponse) (LocationBasedPerformanceTierClientListResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "LocationBasedPerformanceTierClient.NewListPager") - req, err := client.listCreateRequest(ctx, locationName, options) - if err != nil { - return LocationBasedPerformanceTierClientListResponse{}, err - } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return LocationBasedPerformanceTierClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return LocationBasedPerformanceTierClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listCreateRequest creates the List request. -func (client *LocationBasedPerformanceTierClient) listCreateRequest(ctx context.Context, locationName string, options *LocationBasedPerformanceTierClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.DBforPostgreSQL/locations/{locationName}/performanceTiers" - 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", "2017-12-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *LocationBasedPerformanceTierClient) listHandleResponse(resp *http.Response) (LocationBasedPerformanceTierClientListResponse, error) { - result := LocationBasedPerformanceTierClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.PerformanceTierListResult); err != nil { - return LocationBasedPerformanceTierClientListResponse{}, err - } - return result, nil -} diff --git a/sdk/resourcemanager/postgresql/armpostgresql/locationbasedperformancetier_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresql/locationbasedperformancetier_client_example_test.go index d61e88f89416..33c5b8c9c12e 100644 --- a/sdk/resourcemanager/postgresql/armpostgresql/locationbasedperformancetier_client_example_test.go +++ b/sdk/resourcemanager/postgresql/armpostgresql/locationbasedperformancetier_client_example_test.go @@ -11,7 +11,7 @@ import ( "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresql" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresql/v2" ) // Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/PerformanceTiersListByLocation.json diff --git a/sdk/resourcemanager/postgresql/armpostgresql/logfiles_client.go b/sdk/resourcemanager/postgresql/armpostgresql/logfiles_client.go deleted file mode 100644 index ebadea18566c..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresql/logfiles_client.go +++ /dev/null @@ -1,107 +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 armpostgresql - -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" -) - -// LogFilesClient contains the methods for the LogFiles group. -// Don't use this type directly, use NewLogFilesClient() instead. -type LogFilesClient struct { - internal *arm.Client - subscriptionID string -} - -// NewLogFilesClient creates a new instance of LogFilesClient with the specified values. -// - subscriptionID - The ID of the target subscription. -// - 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) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &LogFilesClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// NewListByServerPager - List all the log files in a given server. -// -// Generated from API version 2017-12-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 -// 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 { - return false - }, - Fetcher: func(ctx context.Context, page *LogFilesClientListByServerResponse) (LogFilesClientListByServerResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "LogFilesClient.NewListByServerPager") - req, err := client.listByServerCreateRequest(ctx, resourceGroupName, serverName, options) - if err != nil { - return LogFilesClientListByServerResponse{}, err - } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return LogFilesClientListByServerResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return LogFilesClientListByServerResponse{}, runtime.NewResponseError(resp) - } - return client.listByServerHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listByServerCreateRequest creates the ListByServer request. -func (client *LogFilesClient) listByServerCreateRequest(ctx context.Context, resourceGroupName string, serverName string, options *LogFilesClientListByServerOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/logFiles" - 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", "2017-12-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 - } - return result, nil -} diff --git a/sdk/resourcemanager/postgresql/armpostgresql/logfiles_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresql/logfiles_client_example_test.go index 1c64366fba2b..736eaffaa382 100644 --- a/sdk/resourcemanager/postgresql/armpostgresql/logfiles_client_example_test.go +++ b/sdk/resourcemanager/postgresql/armpostgresql/logfiles_client_example_test.go @@ -11,7 +11,7 @@ import ( "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresql" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresql/v2" ) // Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/LogFileListByServer.json diff --git a/sdk/resourcemanager/postgresql/armpostgresql/migrations_client.go b/sdk/resourcemanager/postgresql/armpostgresql/migrations_client.go new file mode 100644 index 000000000000..1760e07896df --- /dev/null +++ b/sdk/resourcemanager/postgresql/armpostgresql/migrations_client.go @@ -0,0 +1,467 @@ +// 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) Go Code Generator. DO NOT EDIT. + +package armpostgresql + +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" +) + +// MigrationsClient contains the methods for the Migrations group. +// Don't use this type directly, use NewMigrationsClient() instead. +type MigrationsClient struct { + 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 - 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{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// Cancel - Cancels an active migration. +// 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. +// - 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.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.cancelCreateRequest(ctx, resourceGroupName, serverName, migrationName, options) + if err != nil { + return MigrationsClientCancelResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return MigrationsClientCancelResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return MigrationsClientCancelResponse{}, err + } + resp, err := client.cancelHandleResponse(httpResp) + return resp, err +} + +// 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(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 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)) + 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 +} + +// 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 - Check the validity and availability of the given name, to assign it to a new migration. +// +// 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"} + req.Raw().Header["Content-Type"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} + +// 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 +} + +// Create - Creates a new migration. +// 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. +// - 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.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.createCreateRequest(ctx, resourceGroupName, serverName, migrationName, parameters, options) + if err != nil { + return MigrationsClientCreateResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return MigrationsClientCreateResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return MigrationsClientCreateResponse{}, err + } + resp, err := client.createHandleResponse(httpResp) + return resp, err +} + +// 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(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 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)) + 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"} + req.Raw().Header["Content-Type"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + 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.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-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, 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, resourceGroupName, serverName, migrationName, options) + if err != nil { + return MigrationsClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return MigrationsClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return MigrationsClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +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(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 migrationName == "" { + return nil, errors.New("parameter migrationName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{migrationName}", url.PathEscape(migrationName)) + 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 *MigrationsClient) getHandleResponse(resp *http.Response) (MigrationsClientGetResponse, error) { + result := MigrationsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.Migration); err != nil { + return MigrationsClientGetResponse{}, err + } + return result, nil +} + +// NewListByTargetServerPager - Lists all migrations of a target flexible 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(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 + }, + Fetcher: func(ctx context.Context, page *MigrationsClientListByTargetServerResponse) (MigrationsClientListByTargetServerResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "MigrationsClient.NewListByTargetServerPager") + 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.listByTargetServerCreateRequest(ctx, resourceGroupName, serverName, options) + }, nil) + if err != nil { + return MigrationsClientListByTargetServerResponse{}, err + } + return client.listByTargetServerHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listByTargetServerCreateRequest creates the ListByTargetServer request. +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(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") + if options != nil && options.MigrationListFilter != nil { + reqQP.Set("migrationListFilter", string(*options.MigrationListFilter)) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByTargetServerHandleResponse handles the ListByTargetServer response. +func (client *MigrationsClient) listByTargetServerHandleResponse(resp *http.Response) (MigrationsClientListByTargetServerResponse, error) { + result := MigrationsClientListByTargetServerResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.MigrationList); err != nil { + return MigrationsClientListByTargetServerResponse{}, err + } + return result, nil +} + +// Update - Updates an existing migration. The request body can contain one to many of the mutable properties present in the +// migration definition. Certain property updates initiate migration state transitions. +// 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. +// - 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, 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, resourceGroupName, serverName, migrationName, parameters, options) + if err != nil { + return MigrationsClientUpdateResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return MigrationsClientUpdateResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return MigrationsClientUpdateResponse{}, err + } + resp, err := client.updateHandleResponse(httpResp) + return resp, err +} + +// updateCreateRequest creates the Update request. +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(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 migrationName == "" { + return nil, errors.New("parameter migrationName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{migrationName}", url.PathEscape(migrationName)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, 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"} + req.Raw().Header["Content-Type"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} + +// updateHandleResponse handles the Update response. +func (client *MigrationsClient) updateHandleResponse(resp *http.Response) (MigrationsClientUpdateResponse, error) { + result := MigrationsClientUpdateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.Migration); err != nil { + return MigrationsClientUpdateResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/postgresql/armpostgresql/migrations_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresql/migrations_client_example_test.go new file mode 100644 index 000000000000..7361bd357a87 --- /dev/null +++ b/sdk/resourcemanager/postgresql/armpostgresql/migrations_client_example_test.go @@ -0,0 +1,1382 @@ +// 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) Go Code Generator. DO NOT EDIT. + +package armpostgresql_test + +import ( + "context" + "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/armpostgresql/v2" + "log" +) + +// Generated from example definition: 2025-08-01/MigrationsCancel.json +func ExampleMigrationsClient_Cancel() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armpostgresql.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + 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 = armpostgresql.MigrationsClientCancelResponse{ + // Migration: &armpostgresql.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: &armpostgresql.MigrationProperties{ + // CurrentStatus: &armpostgresql.MigrationStatus{ + // CurrentSubStateDetails: &armpostgresql.MigrationSubstateDetails{ + // CurrentSubState: to.Ptr(armpostgresql.MigrationSubstatePerformingPreRequisiteSteps), + // DbDetails: map[string]*armpostgresql.DatabaseMigrationState{ + // }, + // }, + // State: to.Ptr(armpostgresql.MigrationStateInProgress), + // }, + // DbsToMigrate: []*string{ + // to.Ptr("exampledatabase1"), + // to.Ptr("exampledatabase2"), + // to.Ptr("exampledatabase3"), + // to.Ptr("exampledatabase4"), + // }, + // MigrateRoles: to.Ptr(armpostgresql.MigrateRolesAndPermissionsFalse), + // MigrationID: to.Ptr("bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb"), + // MigrationMode: to.Ptr(armpostgresql.MigrationModeOffline), + // MigrationOption: to.Ptr(armpostgresql.MigrationOptionValidateAndMigrate), + // MigrationWindowStartTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T18:30:22.12345Z"); return t}()), + // OverwriteDbsInTarget: to.Ptr(armpostgresql.OverwriteDatabasesOnTargetServerTrue), + // SetupLogicalReplicationOnSourceDbIfNeeded: to.Ptr(armpostgresql.LogicalReplicationOnSourceServerTrue), + // SourceDbServerResourceID: to.Ptr("examplesource:5432@exampleadministratorlogin"), + // SourceType: to.Ptr(armpostgresql.SourceTypeOnPremises), + // SSLMode: to.Ptr(armpostgresql.SSLModePrefer), + // TargetDbServerMetadata: &armpostgresql.DbServerMetadata{ + // Location: to.Ptr("East US"), + // SKU: &armpostgresql.ServerSKU{ + // Name: to.Ptr("Standard_D4ds_v4"), + // Tier: to.Ptr(armpostgresql.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(armpostgresql.TriggerCutoverTrue), + // }, + // }, + // } +} + +// Generated from example definition: 2025-08-01/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 := armpostgresql.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewMigrationsClient().CheckNameAvailability(ctx, "exampleresourcegroup", "exampleserver", armpostgresql.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 = armpostgresql.MigrationsClientCheckNameAvailabilityResponse{ + // MigrationNameAvailability: &armpostgresql.MigrationNameAvailability{ + // Name: to.Ptr("naexamplemigration"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/migrations"), + // NameAvailable: to.Ptr(true), + // }, + // } +} + +// Generated from example definition: 2025-08-01/MigrationsCreate.json +func ExampleMigrationsClient_Create_createAMigration() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armpostgresql.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewMigrationsClient().Create(ctx, "exampleresourcegroup", "exampleserver", "examplemigration", armpostgresql.Migration{ + Location: to.Ptr("eastus"), + Properties: &armpostgresql.MigrationProperties{ + DbsToMigrate: []*string{ + to.Ptr("exampledatabase1"), + to.Ptr("exampledatabase2"), + to.Ptr("exampledatabase3"), + to.Ptr("exampledatabase4"), + }, + MigrationMode: to.Ptr(armpostgresql.MigrationModeOffline), + OverwriteDbsInTarget: to.Ptr(armpostgresql.OverwriteDatabasesOnTargetServerTrue), + SecretParameters: &armpostgresql.MigrationSecretParameters{ + AdminCredentials: &armpostgresql.AdminCredentials{ + SourceServerPassword: to.Ptr("examplesourcepassword"), + TargetServerPassword: to.Ptr("exampletargetpassword"), + }, + }, + SourceDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBForPostgreSql/servers/examplesource"), + }, + }, 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 = armpostgresql.MigrationsClientCreateResponse{ + // Migration: &armpostgresql.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("eastus"), + // Properties: &armpostgresql.MigrationProperties{ + // CurrentStatus: &armpostgresql.MigrationStatus{ + // CurrentSubStateDetails: &armpostgresql.MigrationSubstateDetails{ + // CurrentSubState: to.Ptr(armpostgresql.MigrationSubstatePerformingPreRequisiteSteps), + // }, + // Error: to.Ptr(""), + // State: to.Ptr(armpostgresql.MigrationStateInProgress), + // }, + // DbsToMigrate: []*string{ + // to.Ptr("exampledatabase1"), + // to.Ptr("exampledatabase2"), + // to.Ptr("exampledatabase3"), + // to.Ptr("exampledatabase4"), + // }, + // MigrateRoles: to.Ptr(armpostgresql.MigrateRolesAndPermissionsFalse), + // MigrationID: to.Ptr("d3ceacbb-a5fd-43dc-a9db-6022b5154856"), + // MigrationWindowStartTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T18:30:22.123456Z"); return t}()), + // OverwriteDbsInTarget: to.Ptr(armpostgresql.OverwriteDatabasesOnTargetServerTrue), + // SetupLogicalReplicationOnSourceDbIfNeeded: to.Ptr(armpostgresql.LogicalReplicationOnSourceServerFalse), + // SourceDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBForPostgreSql/servers/examplesource"), + // StartDataMigration: to.Ptr(armpostgresql.StartDataMigrationFalse), + // TargetDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBForPostgreSql/flexibleServers/exampletarget"), + // TriggerCutover: to.Ptr(armpostgresql.TriggerCutoverFalse), + // }, + // Tags: map[string]*string{ + // "key1624": to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), + // }, + // }, + // } +} + +// Generated from example definition: 2025-08-01/MigrationsCreateOtherSourceTypesValidateMigrate.json +func ExampleMigrationsClient_Create_createAMigrationWithOtherSourceTypeForValidatingAndMigrating() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armpostgresql.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewMigrationsClient().Create(ctx, "exampleresourcegroup", "exampleserver", "examplemigration", armpostgresql.Migration{ + Location: to.Ptr("eastus"), + Properties: &armpostgresql.MigrationProperties{ + DbsToMigrate: []*string{ + to.Ptr("exampledatabase1"), + to.Ptr("exampledatabase2"), + to.Ptr("exampledatabase3"), + to.Ptr("exampledatabase4"), + }, + MigrationMode: to.Ptr(armpostgresql.MigrationModeOffline), + MigrationOption: to.Ptr(armpostgresql.MigrationOptionValidateAndMigrate), + OverwriteDbsInTarget: to.Ptr(armpostgresql.OverwriteDatabasesOnTargetServerTrue), + SecretParameters: &armpostgresql.MigrationSecretParameters{ + AdminCredentials: &armpostgresql.AdminCredentials{ + SourceServerPassword: to.Ptr("examplesourcepassword"), + TargetServerPassword: to.Ptr("exampletargetpassword"), + }, + }, + SourceDbServerResourceID: to.Ptr("examplesource:5432@exampleuser"), + SourceType: to.Ptr(armpostgresql.SourceTypeOnPremises), + SSLMode: to.Ptr(armpostgresql.SSLModePrefer), + }, + }, 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 = armpostgresql.MigrationsClientCreateResponse{ + // Migration: &armpostgresql.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("eastus"), + // Properties: &armpostgresql.MigrationProperties{ + // CurrentStatus: &armpostgresql.MigrationStatus{ + // CurrentSubStateDetails: &armpostgresql.MigrationSubstateDetails{ + // CurrentSubState: to.Ptr(armpostgresql.MigrationSubstateValidationInProgress), + // }, + // Error: to.Ptr(""), + // State: to.Ptr(armpostgresql.MigrationStateInProgress), + // }, + // DbsToMigrate: []*string{ + // to.Ptr("exampledatabase1"), + // to.Ptr("exampledatabase2"), + // to.Ptr("exampledatabase3"), + // to.Ptr("exampledatabase4"), + // }, + // MigrateRoles: to.Ptr(armpostgresql.MigrateRolesAndPermissionsFalse), + // MigrationID: to.Ptr("d3ceacbb-a5fd-43dc-a9db-6022b5154856"), + // MigrationOption: to.Ptr(armpostgresql.MigrationOptionValidateAndMigrate), + // MigrationWindowStartTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T18:30:22.123456Z"); return t}()), + // OverwriteDbsInTarget: to.Ptr(armpostgresql.OverwriteDatabasesOnTargetServerTrue), + // SetupLogicalReplicationOnSourceDbIfNeeded: to.Ptr(armpostgresql.LogicalReplicationOnSourceServerFalse), + // SourceDbServerResourceID: to.Ptr("examplesource:5432@exampleuser"), + // SourceType: to.Ptr(armpostgresql.SourceTypeOnPremises), + // SSLMode: to.Ptr(armpostgresql.SSLModePrefer), + // StartDataMigration: to.Ptr(armpostgresql.StartDataMigrationFalse), + // TargetDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBForPostgreSql/flexibleServers/exampletarget"), + // TriggerCutover: to.Ptr(armpostgresql.TriggerCutoverFalse), + // }, + // Tags: map[string]*string{ + // "key1624": to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), + // }, + // }, + // } +} + +// Generated from example definition: 2025-08-01/MigrationsCreateValidateOnly.json +func ExampleMigrationsClient_Create_createAMigrationForValidatingOnly() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armpostgresql.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewMigrationsClient().Create(ctx, "exampleresourcegroup", "exampleserver", "examplemigration", armpostgresql.Migration{ + Location: to.Ptr("eastus"), + Properties: &armpostgresql.MigrationProperties{ + DbsToMigrate: []*string{ + to.Ptr("exampledatabase1"), + to.Ptr("exampledatabase2"), + to.Ptr("exampledatabase3"), + to.Ptr("exampledatabase4"), + }, + MigrationMode: to.Ptr(armpostgresql.MigrationModeOffline), + MigrationOption: to.Ptr(armpostgresql.MigrationOptionValidate), + OverwriteDbsInTarget: to.Ptr(armpostgresql.OverwriteDatabasesOnTargetServerTrue), + SecretParameters: &armpostgresql.MigrationSecretParameters{ + AdminCredentials: &armpostgresql.AdminCredentials{ + SourceServerPassword: to.Ptr("examplesourcepassword"), + TargetServerPassword: to.Ptr("exampletargetpassword"), + }, + }, + SourceDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBForPostgreSql/servers/examplesource"), + }, + }, 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 = armpostgresql.MigrationsClientCreateResponse{ + // Migration: &armpostgresql.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("eastus"), + // Properties: &armpostgresql.MigrationProperties{ + // CurrentStatus: &armpostgresql.MigrationStatus{ + // CurrentSubStateDetails: &armpostgresql.MigrationSubstateDetails{ + // CurrentSubState: to.Ptr(armpostgresql.MigrationSubstateValidationInProgress), + // }, + // Error: to.Ptr(""), + // State: to.Ptr(armpostgresql.MigrationStateInProgress), + // }, + // DbsToMigrate: []*string{ + // to.Ptr("exampledatabase1"), + // to.Ptr("exampledatabase2"), + // to.Ptr("exampledatabase3"), + // to.Ptr("exampledatabase4"), + // }, + // MigrateRoles: to.Ptr(armpostgresql.MigrateRolesAndPermissionsFalse), + // MigrationID: to.Ptr("d3ceacbb-a5fd-43dc-a9db-6022b5154856"), + // MigrationOption: to.Ptr(armpostgresql.MigrationOptionValidate), + // MigrationWindowStartTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T18:30:22.123456Z"); return t}()), + // OverwriteDbsInTarget: to.Ptr(armpostgresql.OverwriteDatabasesOnTargetServerTrue), + // SetupLogicalReplicationOnSourceDbIfNeeded: to.Ptr(armpostgresql.LogicalReplicationOnSourceServerFalse), + // SourceDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBForPostgreSql/servers/examplesource"), + // StartDataMigration: to.Ptr(armpostgresql.StartDataMigrationFalse), + // TargetDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBForPostgreSql/flexibleServers/exampletarget"), + // TriggerCutover: to.Ptr(armpostgresql.TriggerCutoverFalse), + // }, + // Tags: map[string]*string{ + // "key1624": to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), + // }, + // }, + // } +} + +// Generated from example definition: 2025-08-01/MigrationsCreateWithFullyQualifiedDomainName.json +func ExampleMigrationsClient_Create_createAMigrationWithFullyQualifiedDomainNamesForSourceAndTargetServers() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armpostgresql.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewMigrationsClient().Create(ctx, "exampleresourcegroup", "exampleserver", "examplemigration", armpostgresql.Migration{ + Location: to.Ptr("eastus"), + Properties: &armpostgresql.MigrationProperties{ + DbsToMigrate: []*string{ + to.Ptr("exampledatabase1"), + to.Ptr("exampledatabase2"), + to.Ptr("exampledatabase3"), + to.Ptr("exampledatabase4"), + }, + MigrationMode: to.Ptr(armpostgresql.MigrationModeOffline), + OverwriteDbsInTarget: to.Ptr(armpostgresql.OverwriteDatabasesOnTargetServerTrue), + SecretParameters: &armpostgresql.MigrationSecretParameters{ + AdminCredentials: &armpostgresql.AdminCredentials{ + SourceServerPassword: to.Ptr("xxxxxxxx"), + TargetServerPassword: to.Ptr("xxxxxxxx"), + }, + }, + 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 { + 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 = armpostgresql.MigrationsClientCreateResponse{ + // Migration: &armpostgresql.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("eastus"), + // Properties: &armpostgresql.MigrationProperties{ + // CurrentStatus: &armpostgresql.MigrationStatus{ + // CurrentSubStateDetails: &armpostgresql.MigrationSubstateDetails{ + // CurrentSubState: to.Ptr(armpostgresql.MigrationSubstatePerformingPreRequisiteSteps), + // }, + // Error: to.Ptr(""), + // State: to.Ptr(armpostgresql.MigrationStateInProgress), + // }, + // DbsToMigrate: []*string{ + // to.Ptr("exampledatabase1"), + // to.Ptr("exampledatabase2"), + // to.Ptr("exampledatabase3"), + // to.Ptr("exampledatabase4"), + // }, + // MigrateRoles: to.Ptr(armpostgresql.MigrateRolesAndPermissionsFalse), + // MigrationID: to.Ptr("d3ceacbb-a5fd-43dc-a9db-6022b5154856"), + // MigrationWindowStartTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T18:30:22.123456Z"); return t}()), + // OverwriteDbsInTarget: to.Ptr(armpostgresql.OverwriteDatabasesOnTargetServerTrue), + // SetupLogicalReplicationOnSourceDbIfNeeded: to.Ptr(armpostgresql.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(armpostgresql.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(armpostgresql.TriggerCutoverFalse), + // }, + // Tags: map[string]*string{ + // "key1624": to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), + // }, + // }, + // } +} + +// Generated from example definition: 2025-08-01/MigrationsCreateWithOtherUsers.json +func ExampleMigrationsClient_Create_createAMigrationSpecifyingUserNames() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armpostgresql.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewMigrationsClient().Create(ctx, "exampleresourcegroup", "exampleserver", "examplemigration", armpostgresql.Migration{ + Location: to.Ptr("eastus"), + Properties: &armpostgresql.MigrationProperties{ + DbsToMigrate: []*string{ + to.Ptr("exampledatabase1"), + to.Ptr("exampledatabase2"), + to.Ptr("exampledatabase3"), + to.Ptr("exampledatabase4"), + }, + MigrationMode: to.Ptr(armpostgresql.MigrationModeOffline), + SecretParameters: &armpostgresql.MigrationSecretParameters{ + AdminCredentials: &armpostgresql.AdminCredentials{ + 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/exampleresourcegroup/providers/Microsoft.DBForPostgreSql/servers/examplesource"), + }, + }, 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 = armpostgresql.MigrationsClientCreateResponse{ + // Migration: &armpostgresql.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("eastus"), + // Properties: &armpostgresql.MigrationProperties{ + // CurrentStatus: &armpostgresql.MigrationStatus{ + // CurrentSubStateDetails: &armpostgresql.MigrationSubstateDetails{ + // CurrentSubState: to.Ptr(armpostgresql.MigrationSubstatePerformingPreRequisiteSteps), + // }, + // Error: to.Ptr(""), + // State: to.Ptr(armpostgresql.MigrationStateInProgress), + // }, + // DbsToMigrate: []*string{ + // to.Ptr("exampledatabase1"), + // to.Ptr("exampledatabase2"), + // to.Ptr("exampledatabase3"), + // to.Ptr("exampledatabase4"), + // }, + // MigrateRoles: to.Ptr(armpostgresql.MigrateRolesAndPermissionsFalse), + // MigrationID: to.Ptr("d3ceacbb-a5fd-43dc-a9db-6022b5154856"), + // MigrationMode: to.Ptr(armpostgresql.MigrationModeOffline), + // MigrationWindowStartTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T18:30:22.123456Z"); return t}()), + // OverwriteDbsInTarget: to.Ptr(armpostgresql.OverwriteDatabasesOnTargetServerFalse), + // SetupLogicalReplicationOnSourceDbIfNeeded: to.Ptr(armpostgresql.LogicalReplicationOnSourceServerFalse), + // SourceDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBForPostgreSql/servers/examplesource"), + // StartDataMigration: to.Ptr(armpostgresql.StartDataMigrationFalse), + // TargetDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBForPostgreSql/flexibleServers/exampletarget"), + // TriggerCutover: to.Ptr(armpostgresql.TriggerCutoverFalse), + // }, + // Tags: map[string]*string{ + // "key1624": to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), + // }, + // }, + // } +} + +// Generated from example definition: 2025-08-01/MigrationsCreateWithPrivateEndpointServers.json +func ExampleMigrationsClient_Create_createAMigrationWithPrivateEndpoint() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armpostgresql.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewMigrationsClient().Create(ctx, "exampleresourcegroup", "exampleserver", "examplemigration", armpostgresql.Migration{ + Location: to.Ptr("eastus"), + Properties: &armpostgresql.MigrationProperties{ + DbsToMigrate: []*string{ + 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(armpostgresql.MigrationModeOffline), + OverwriteDbsInTarget: to.Ptr(armpostgresql.OverwriteDatabasesOnTargetServerTrue), + SecretParameters: &armpostgresql.MigrationSecretParameters{ + AdminCredentials: &armpostgresql.AdminCredentials{ + SourceServerPassword: to.Ptr("examplesourcepassword"), + TargetServerPassword: to.Ptr("exampletargetpassword"), + }, + }, + SourceDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBForPostgreSql/servers/examplesource"), + }, + }, 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 = armpostgresql.MigrationsClientCreateResponse{ + // Migration: &armpostgresql.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("eastus"), + // Properties: &armpostgresql.MigrationProperties{ + // CurrentStatus: &armpostgresql.MigrationStatus{ + // CurrentSubStateDetails: &armpostgresql.MigrationSubstateDetails{ + // CurrentSubState: to.Ptr(armpostgresql.MigrationSubstatePerformingPreRequisiteSteps), + // }, + // Error: to.Ptr(""), + // State: to.Ptr(armpostgresql.MigrationStateInProgress), + // }, + // DbsToMigrate: []*string{ + // to.Ptr("exampledatabase1"), + // to.Ptr("exampledatabase2"), + // to.Ptr("exampledatabase3"), + // to.Ptr("exampledatabase4"), + // }, + // MigrateRoles: to.Ptr(armpostgresql.MigrateRolesAndPermissionsFalse), + // MigrationID: to.Ptr("d3ceacbb-a5fd-43dc-a9db-6022b5154856"), + // 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.123456Z"); return t}()), + // OverwriteDbsInTarget: to.Ptr(armpostgresql.OverwriteDatabasesOnTargetServerTrue), + // SetupLogicalReplicationOnSourceDbIfNeeded: to.Ptr(armpostgresql.LogicalReplicationOnSourceServerFalse), + // SourceDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBForPostgreSql/servers/examplesource"), + // StartDataMigration: to.Ptr(armpostgresql.StartDataMigrationFalse), + // TargetDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBForPostgreSql/flexibleServers/exampletarget"), + // TriggerCutover: to.Ptr(armpostgresql.TriggerCutoverFalse), + // }, + // Tags: map[string]*string{ + // "key1624": to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), + // }, + // }, + // } +} + +// Generated from example definition: 2025-08-01/MigrationsCreateWithRoles.json +func ExampleMigrationsClient_Create_createAMigrationWithRoles() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armpostgresql.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewMigrationsClient().Create(ctx, "exampleresourcegroup", "exampleserver", "examplemigration", armpostgresql.Migration{ + Location: to.Ptr("eastus"), + Properties: &armpostgresql.MigrationProperties{ + DbsToMigrate: []*string{ + to.Ptr("exampledatabase1"), + to.Ptr("exampledatabase2"), + to.Ptr("exampledatabase3"), + to.Ptr("exampledatabase4"), + }, + MigrateRoles: to.Ptr(armpostgresql.MigrateRolesAndPermissionsTrue), + MigrationMode: to.Ptr(armpostgresql.MigrationModeOffline), + OverwriteDbsInTarget: to.Ptr(armpostgresql.OverwriteDatabasesOnTargetServerTrue), + SecretParameters: &armpostgresql.MigrationSecretParameters{ + AdminCredentials: &armpostgresql.AdminCredentials{ + SourceServerPassword: to.Ptr("examplesourcepassword"), + TargetServerPassword: to.Ptr("exampletargetpassword"), + }, + }, + SourceDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBForPostgreSql/servers/examplesource"), + }, + }, 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 = armpostgresql.MigrationsClientCreateResponse{ + // Migration: &armpostgresql.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("eastus"), + // Properties: &armpostgresql.MigrationProperties{ + // CurrentStatus: &armpostgresql.MigrationStatus{ + // CurrentSubStateDetails: &armpostgresql.MigrationSubstateDetails{ + // CurrentSubState: to.Ptr(armpostgresql.MigrationSubstatePerformingPreRequisiteSteps), + // }, + // Error: to.Ptr(""), + // State: to.Ptr(armpostgresql.MigrationStateInProgress), + // }, + // DbsToMigrate: []*string{ + // to.Ptr("exampledatabase1"), + // to.Ptr("exampledatabase2"), + // to.Ptr("exampledatabase3"), + // to.Ptr("exampledatabase4"), + // }, + // MigrateRoles: to.Ptr(armpostgresql.MigrateRolesAndPermissionsTrue), + // MigrationID: to.Ptr("d3ceacbb-a5fd-43dc-a9db-6022b5154856"), + // MigrationWindowStartTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T18:30:22.123456Z"); return t}()), + // OverwriteDbsInTarget: to.Ptr(armpostgresql.OverwriteDatabasesOnTargetServerTrue), + // SetupLogicalReplicationOnSourceDbIfNeeded: to.Ptr(armpostgresql.LogicalReplicationOnSourceServerFalse), + // SourceDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBForPostgreSql/servers/examplesource"), + // StartDataMigration: to.Ptr(armpostgresql.StartDataMigrationFalse), + // TargetDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBForPostgreSql/flexibleServers/exampletarget"), + // TriggerCutover: to.Ptr(armpostgresql.TriggerCutoverFalse), + // }, + // Tags: map[string]*string{ + // "key1624": to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), + // }, + // }, + // } +} + +// Generated from example definition: 2025-08-01/MigrationsGet.json +func ExampleMigrationsClient_Get_getInformationAboutAMigration() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armpostgresql.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + 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 = armpostgresql.MigrationsClientGetResponse{ + // Migration: &armpostgresql.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("eastus"), + // Properties: &armpostgresql.MigrationProperties{ + // CurrentStatus: &armpostgresql.MigrationStatus{ + // CurrentSubStateDetails: &armpostgresql.MigrationSubstateDetails{ + // CurrentSubState: to.Ptr(armpostgresql.MigrationSubstatePerformingPreRequisiteSteps), + // }, + // Error: to.Ptr(""), + // State: to.Ptr(armpostgresql.MigrationStateInProgress), + // }, + // DbsToMigrate: []*string{ + // to.Ptr("exampledatabase1"), + // to.Ptr("exampledatabase2"), + // to.Ptr("exampledatabase3"), + // to.Ptr("exampledatabase4"), + // }, + // MigrateRoles: to.Ptr(armpostgresql.MigrateRolesAndPermissionsFalse), + // MigrationID: to.Ptr("d3ceacbb-a5fd-43dc-a9db-6022b5154856"), + // MigrationWindowStartTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T18:30:22.123456Z"); return t}()), + // OverwriteDbsInTarget: to.Ptr(armpostgresql.OverwriteDatabasesOnTargetServerFalse), + // SetupLogicalReplicationOnSourceDbIfNeeded: to.Ptr(armpostgresql.LogicalReplicationOnSourceServerFalse), + // SourceDbServerMetadata: &armpostgresql.DbServerMetadata{ + // Location: to.Ptr("eastus"), + // SKU: &armpostgresql.ServerSKU{ + // Name: to.Ptr("B_Gen5_2"), + // Tier: to.Ptr(armpostgresql.SKUTier("Basic")), + // }, + // StorageMb: to.Ptr[int32](1024), + // Version: to.Ptr("10"), + // }, + // SourceDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBForPostgreSql/servers/examplesource"), + // StartDataMigration: to.Ptr(armpostgresql.StartDataMigrationFalse), + // TargetDbServerMetadata: &armpostgresql.DbServerMetadata{ + // Location: to.Ptr("eastus"), + // SKU: &armpostgresql.ServerSKU{ + // Name: to.Ptr("Standard_D4ds_v5"), + // Tier: to.Ptr(armpostgresql.SKUTierGeneralPurpose), + // }, + // StorageMb: to.Ptr[int32](2048), + // Version: to.Ptr("17"), + // }, + // TargetDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBForPostgreSql/flexibleServers/exampletarget"), + // TriggerCutover: to.Ptr(armpostgresql.TriggerCutoverFalse), + // }, + // }, + // } +} + +// Generated from example definition: 2025-08-01/MigrationsGetMigrationWithSuccessfulValidationAndMigration.json +func ExampleMigrationsClient_Get_getInformationAboutAMigrationWithSuccessfulValidationAndSuccessfulMigration() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armpostgresql.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + 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 = armpostgresql.MigrationsClientGetResponse{ + // Migration: &armpostgresql.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("eastus"), + // Properties: &armpostgresql.MigrationProperties{ + // CurrentStatus: &armpostgresql.MigrationStatus{ + // CurrentSubStateDetails: &armpostgresql.MigrationSubstateDetails{ + // CurrentSubState: to.Ptr(armpostgresql.MigrationSubstateCompleted), + // DbDetails: map[string]*armpostgresql.DatabaseMigrationState{ + // "exampledatabase": &armpostgresql.DatabaseMigrationState{ + // AppliedChanges: to.Ptr[int32](0), + // CdcDeleteCounter: to.Ptr[int32](0), + // CdcInsertCounter: to.Ptr[int32](0), + // CdcUpdateCounter: to.Ptr[int32](0), + // DatabaseName: to.Ptr("exampledatabase"), + // EndedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T20:30:22.123456Z"); 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(armpostgresql.MigrationDatabaseStateSucceeded), + // StartedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T18:30:22.123456Z"); return t}()), + // }, + // }, + // ValidationDetails: &armpostgresql.ValidationDetails{ + // DbLevelValidationDetails: []*armpostgresql.DbLevelValidationStatus{ + // { + // DatabaseName: to.Ptr("exampledatabase"), + // EndedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T20:30:22.123456Z"); return t}()), + // StartedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T18:30:22.123456Z"); return t}()), + // Summary: []*armpostgresql.ValidationSummaryItem{ + // { + // Type: to.Ptr("SchemaValidation"), + // State: to.Ptr(armpostgresql.ValidationStateSucceeded), + // }, + // { + // Type: to.Ptr("ExtensionsValidation"), + // State: to.Ptr(armpostgresql.ValidationStateSucceeded), + // }, + // { + // Type: to.Ptr("CollationsValidation"), + // State: to.Ptr(armpostgresql.ValidationStateSucceeded), + // }, + // }, + // }, + // }, + // ServerLevelValidationDetails: []*armpostgresql.ValidationSummaryItem{ + // { + // Type: to.Ptr("AuthenticationAndConnectivityValidation"), + // State: to.Ptr(armpostgresql.ValidationStateSucceeded), + // }, + // { + // Type: to.Ptr("SourceVersionValidation"), + // State: to.Ptr(armpostgresql.ValidationStateSucceeded), + // }, + // { + // Type: to.Ptr("ServerParametersValidation"), + // State: to.Ptr(armpostgresql.ValidationStateSucceeded), + // }, + // }, + // Status: to.Ptr(armpostgresql.ValidationStateSucceeded), + // ValidationEndTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T20:30:22.123456Z"); return t}()), + // ValidationStartTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T18:30:22.123456Z"); return t}()), + // }, + // }, + // State: to.Ptr(armpostgresql.MigrationStateSucceeded), + // }, + // DbsToMigrate: []*string{ + // to.Ptr("exampledatabase"), + // }, + // MigrateRoles: to.Ptr(armpostgresql.MigrateRolesAndPermissionsFalse), + // MigrationID: to.Ptr("f2354e72-2828-4a19-ad20-b4cd9e2673c1"), + // MigrationMode: to.Ptr(armpostgresql.MigrationModeOffline), + // MigrationOption: to.Ptr(armpostgresql.MigrationOptionValidateAndMigrate), + // MigrationWindowEndTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T20:30:22.123456Z"); return t}()), + // MigrationWindowStartTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T18:30:22.123456Z"); return t}()), + // OverwriteDbsInTarget: to.Ptr(armpostgresql.OverwriteDatabasesOnTargetServerTrue), + // SetupLogicalReplicationOnSourceDbIfNeeded: to.Ptr(armpostgresql.LogicalReplicationOnSourceServerTrue), + // SourceDbServerResourceID: to.Ptr("20.228.214.65:5432@postgres"), + // TargetDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBForPostgreSql/flexibleServers/exampletarget"), + // TriggerCutover: to.Ptr(armpostgresql.TriggerCutoverTrue), + // }, + // }, + // } +} + +// Generated from example definition: 2025-08-01/MigrationsGetMigrationWithSuccessfulValidationButMigrationFailure.json +func ExampleMigrationsClient_Get_getInformationAboutAMigrationWithSuccessfulValidationButFailedMigration() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armpostgresql.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + 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 = armpostgresql.MigrationsClientGetResponse{ + // Migration: &armpostgresql.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("eastus"), + // Properties: &armpostgresql.MigrationProperties{ + // CurrentStatus: &armpostgresql.MigrationStatus{ + // CurrentSubStateDetails: &armpostgresql.MigrationSubstateDetails{ + // CurrentSubState: to.Ptr(armpostgresql.MigrationSubstateCompleted), + // DbDetails: map[string]*armpostgresql.DatabaseMigrationState{ + // "exampledatabase": &armpostgresql.DatabaseMigrationState{ + // AppliedChanges: to.Ptr[int32](0), + // CdcDeleteCounter: to.Ptr[int32](0), + // CdcInsertCounter: to.Ptr[int32](0), + // CdcUpdateCounter: to.Ptr[int32](0), + // DatabaseName: to.Ptr("exampledatabase"), + // EndedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T20:30:22.123456Z"); return t}()), + // FullLoadCompletedTables: to.Ptr[int32](0), + // 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), + // 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(armpostgresql.MigrationDatabaseStateFailed), + // StartedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T18:30:22.123456Z"); return t}()), + // }, + // }, + // ValidationDetails: &armpostgresql.ValidationDetails{ + // DbLevelValidationDetails: []*armpostgresql.DbLevelValidationStatus{ + // { + // DatabaseName: to.Ptr("address_standardizer"), + // EndedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T20:30:22.123456Z"); return t}()), + // StartedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T18:30:22.123456Z"); return t}()), + // Summary: []*armpostgresql.ValidationSummaryItem{ + // { + // Type: to.Ptr("ExtensionsValidation"), + // State: to.Ptr(armpostgresql.ValidationStateSucceeded), + // }, + // }, + // }, + // }, + // ServerLevelValidationDetails: []*armpostgresql.ValidationSummaryItem{ + // { + // Type: to.Ptr("AuthenticationAndConnectivityValidation"), + // State: to.Ptr(armpostgresql.ValidationStateSucceeded), + // }, + // }, + // Status: to.Ptr(armpostgresql.ValidationStateSucceeded), + // ValidationEndTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T20:30:22.123456Z"); return t}()), + // ValidationStartTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T18:30:22.123456Z"); return t}()), + // }, + // }, + // 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(armpostgresql.MigrationStateFailed), + // }, + // DbsToMigrate: []*string{ + // to.Ptr("exampledatabase"), + // }, + // MigrateRoles: to.Ptr(armpostgresql.MigrateRolesAndPermissionsFalse), + // MigrationID: to.Ptr("da52db29-cfeb-4670-a1ad-683edb14c621"), + // MigrationMode: to.Ptr(armpostgresql.MigrationModeOffline), + // MigrationOption: to.Ptr(armpostgresql.MigrationOptionValidateAndMigrate), + // MigrationWindowEndTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T20:30:22.123456Z"); return t}()), + // MigrationWindowStartTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T18:30:22.123456Z"); return t}()), + // OverwriteDbsInTarget: to.Ptr(armpostgresql.OverwriteDatabasesOnTargetServerTrue), + // SetupLogicalReplicationOnSourceDbIfNeeded: to.Ptr(armpostgresql.LogicalReplicationOnSourceServerTrue), + // SourceDbServerMetadata: &armpostgresql.DbServerMetadata{ + // Location: to.Ptr("eastus"), + // SKU: &armpostgresql.ServerSKU{ + // }, + // StorageMb: to.Ptr[int32](102400), + // }, + // SourceDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/servers/examplesource"), + // TargetDbServerMetadata: &armpostgresql.DbServerMetadata{ + // Location: to.Ptr("eastus"), + // SKU: &armpostgresql.ServerSKU{ + // Name: to.Ptr("Standard_D2ds_v4"), + // Tier: to.Ptr(armpostgresql.SKUTier("Standard_D2ds_v4")), + // }, + // StorageMb: to.Ptr[int32](131072), + // }, + // TargetDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampletarget"), + // }, + // }, + // } +} + +// Generated from example definition: 2025-08-01/MigrationsGetMigrationWithSuccessfulValidationOnly.json +func ExampleMigrationsClient_Get_getInformationAboutAMigrationWithSuccessfulValidationOnly() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armpostgresql.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + 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 = armpostgresql.MigrationsClientGetResponse{ + // Migration: &armpostgresql.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("eastus"), + // Properties: &armpostgresql.MigrationProperties{ + // CurrentStatus: &armpostgresql.MigrationStatus{ + // CurrentSubStateDetails: &armpostgresql.MigrationSubstateDetails{ + // CurrentSubState: to.Ptr(armpostgresql.MigrationSubstateCompleted), + // DbDetails: map[string]*armpostgresql.DatabaseMigrationState{ + // }, + // ValidationDetails: &armpostgresql.ValidationDetails{ + // DbLevelValidationDetails: []*armpostgresql.DbLevelValidationStatus{ + // { + // DatabaseName: to.Ptr("UnknownCollationTest"), + // EndedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T20:30:22.123456Z"); return t}()), + // StartedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T18:30:22.123456Z"); return t}()), + // Summary: []*armpostgresql.ValidationSummaryItem{ + // { + // Type: to.Ptr("SchemaValidation"), + // State: to.Ptr(armpostgresql.ValidationStateSucceeded), + // }, + // { + // Type: to.Ptr("ExtensionsValidation"), + // State: to.Ptr(armpostgresql.ValidationStateSucceeded), + // }, + // { + // Type: to.Ptr("CollationsValidation"), + // State: to.Ptr(armpostgresql.ValidationStateSucceeded), + // }, + // }, + // }, + // }, + // ServerLevelValidationDetails: []*armpostgresql.ValidationSummaryItem{ + // { + // Type: to.Ptr("AuthenticationAndConnectivityValidation"), + // State: to.Ptr(armpostgresql.ValidationStateSucceeded), + // }, + // { + // Type: to.Ptr("SourceVersionValidation"), + // State: to.Ptr(armpostgresql.ValidationStateSucceeded), + // }, + // { + // Type: to.Ptr("ServerParametersValidation"), + // State: to.Ptr(armpostgresql.ValidationStateSucceeded), + // }, + // }, + // Status: to.Ptr(armpostgresql.ValidationStateSucceeded), + // ValidationEndTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T20:30:22.123456Z"); return t}()), + // ValidationStartTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T18:30:22.123456Z"); return t}()), + // }, + // }, + // State: to.Ptr(armpostgresql.MigrationStateSucceeded), + // }, + // DbsToMigrate: []*string{ + // to.Ptr("UnknownCollationTest"), + // }, + // MigrateRoles: to.Ptr(armpostgresql.MigrateRolesAndPermissionsFalse), + // MigrationID: to.Ptr("77840327-7be8-44b8-adc0-af0ccccfeb36"), + // MigrationMode: to.Ptr(armpostgresql.MigrationModeOffline), + // MigrationOption: to.Ptr(armpostgresql.MigrationOptionValidate), + // MigrationWindowEndTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T20:30:22.123456Z"); return t}()), + // MigrationWindowStartTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T18:30:22.123456Z"); return t}()), + // OverwriteDbsInTarget: to.Ptr(armpostgresql.OverwriteDatabasesOnTargetServerTrue), + // SetupLogicalReplicationOnSourceDbIfNeeded: to.Ptr(armpostgresql.LogicalReplicationOnSourceServerTrue), + // SourceDbServerResourceID: to.Ptr("20.228.214.65:5432@postgres"), + // TargetDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBForPostgreSql/flexibleServers/exampletarget"), + // TriggerCutover: to.Ptr(armpostgresql.TriggerCutoverTrue), + // }, + // }, + // } +} + +// Generated from example definition: 2025-08-01/MigrationsGetMigrationWithValidationFailures.json +func ExampleMigrationsClient_Get_getInformationAboutAMigrationWithValidationFailures() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armpostgresql.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + 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 = armpostgresql.MigrationsClientGetResponse{ + // Migration: &armpostgresql.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("eastus"), + // Properties: &armpostgresql.MigrationProperties{ + // CurrentStatus: &armpostgresql.MigrationStatus{ + // CurrentSubStateDetails: &armpostgresql.MigrationSubstateDetails{ + // CurrentSubState: to.Ptr(armpostgresql.MigrationSubstateCompleted), + // DbDetails: map[string]*armpostgresql.DatabaseMigrationState{ + // }, + // ValidationDetails: &armpostgresql.ValidationDetails{ + // DbLevelValidationDetails: []*armpostgresql.DbLevelValidationStatus{ + // { + // DatabaseName: to.Ptr("exampledatabase1"), + // EndedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T20:30:22.123456Z"); return t}()), + // StartedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T18:30:22.123456Z"); return t}()), + // Summary: []*armpostgresql.ValidationSummaryItem{ + // { + // Type: to.Ptr("SchemaValidation"), + // State: to.Ptr(armpostgresql.ValidationStateSucceeded), + // }, + // { + // Type: to.Ptr("ExtensionsValidation"), + // Messages: []*armpostgresql.ValidationMessage{ + // { + // Message: to.Ptr("Unsupported Extension. Single to Flex migration tool does not support migration of databases having postgres_fdw extension. Consider performing the migration through other migration tools such as pg_dump/pg_restore (https://aka.ms/migrate-using-pgdump-restore)"), + // State: to.Ptr(armpostgresql.ValidationStateFailed), + // }, + // }, + // State: to.Ptr(armpostgresql.ValidationStateFailed), + // }, + // { + // Type: to.Ptr("CollationsValidation"), + // State: to.Ptr(armpostgresql.ValidationStateSucceeded), + // }, + // }, + // }, + // { + // DatabaseName: to.Ptr("exampledatabase2"), + // EndedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T20:30:22.123456Z"); return t}()), + // StartedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T18:30:22.123456Z"); return t}()), + // Summary: []*armpostgresql.ValidationSummaryItem{ + // { + // Type: to.Ptr("SchemaValidation"), + // State: to.Ptr(armpostgresql.ValidationStateSucceeded), + // }, + // { + // Type: to.Ptr("ExtensionsValidation"), + // State: to.Ptr(armpostgresql.ValidationStateSucceeded), + // }, + // { + // Type: to.Ptr("CollationsValidation"), + // State: to.Ptr(armpostgresql.ValidationStateSucceeded), + // }, + // }, + // }, + // { + // DatabaseName: to.Ptr("exampledatabase3"), + // EndedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T20:30:22.123456Z"); return t}()), + // StartedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T18:30:22.123456Z"); return t}()), + // Summary: []*armpostgresql.ValidationSummaryItem{ + // { + // Type: to.Ptr("SchemaValidation"), + // State: to.Ptr(armpostgresql.ValidationStateSucceeded), + // }, + // { + // Type: to.Ptr("ExtensionsValidation"), + // State: to.Ptr(armpostgresql.ValidationStateSucceeded), + // }, + // { + // Type: to.Ptr("CollationsValidation"), + // State: to.Ptr(armpostgresql.ValidationStateSucceeded), + // }, + // }, + // }, + // { + // DatabaseName: to.Ptr("exampledatabase4"), + // EndedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T20:30:22.123456Z"); return t}()), + // StartedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T18:30:22.123456Z"); return t}()), + // Summary: []*armpostgresql.ValidationSummaryItem{ + // { + // Type: to.Ptr("SchemaValidation"), + // State: to.Ptr(armpostgresql.ValidationStateSucceeded), + // }, + // { + // Type: to.Ptr("ExtensionsValidation"), + // State: to.Ptr(armpostgresql.ValidationStateSucceeded), + // }, + // }, + // }, + // { + // DatabaseName: to.Ptr("exampledatabase5"), + // EndedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T20:30:22.123456Z"); return t}()), + // StartedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T18:30:22.123456Z"); return t}()), + // Summary: []*armpostgresql.ValidationSummaryItem{ + // { + // Type: to.Ptr("SchemaValidation"), + // State: to.Ptr(armpostgresql.ValidationStateSucceeded), + // }, + // { + // Type: to.Ptr("ExtensionsValidation"), + // State: to.Ptr(armpostgresql.ValidationStateSucceeded), + // }, + // }, + // }, + // { + // DatabaseName: to.Ptr("exampledatabase6"), + // EndedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T20:30:22.123456Z"); return t}()), + // StartedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T18:30:22.123456Z"); return t}()), + // Summary: []*armpostgresql.ValidationSummaryItem{ + // { + // Type: to.Ptr("SchemaValidation"), + // State: to.Ptr(armpostgresql.ValidationStateSucceeded), + // }, + // { + // Type: to.Ptr("ExtensionsValidation"), + // State: to.Ptr(armpostgresql.ValidationStateSucceeded), + // }, + // }, + // }, + // { + // DatabaseName: to.Ptr("exampledatabase7"), + // EndedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T20:30:22.123456Z"); return t}()), + // StartedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T18:30:22.123456Z"); return t}()), + // Summary: []*armpostgresql.ValidationSummaryItem{ + // { + // Type: to.Ptr("SchemaValidation"), + // State: to.Ptr(armpostgresql.ValidationStateSucceeded), + // }, + // { + // Type: to.Ptr("ExtensionsValidation"), + // Messages: []*armpostgresql.ValidationMessage{ + // { + // Message: to.Ptr("Unsupported Extension. Single to Flex migration tool does not support migration of databases having postgres_fdw extension. Consider performing the migration through other migration tools such as pg_dump/pg_restore (https://aka.ms/migrate-using-pgdump-restore)"), + // State: to.Ptr(armpostgresql.ValidationStateFailed), + // }, + // }, + // State: to.Ptr(armpostgresql.ValidationStateFailed), + // }, + // }, + // }, + // }, + // ServerLevelValidationDetails: []*armpostgresql.ValidationSummaryItem{ + // { + // Type: to.Ptr("AuthenticationAndConnectivityValidation"), + // State: to.Ptr(armpostgresql.ValidationStateSucceeded), + // }, + // { + // Type: to.Ptr("SourceVersionValidation"), + // State: to.Ptr(armpostgresql.ValidationStateSucceeded), + // }, + // { + // Type: to.Ptr("ServerParametersValidation"), + // State: to.Ptr(armpostgresql.ValidationStateSucceeded), + // }, + // }, + // Status: to.Ptr(armpostgresql.ValidationStateFailed), + // ValidationEndTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T20:30:22.123456Z"); return t}()), + // ValidationStartTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T18:30:22.123456Z"); return t}()), + // }, + // }, + // State: to.Ptr(armpostgresql.MigrationStateValidationFailed), + // }, + // DbsToMigrate: []*string{ + // to.Ptr("exampledatabase1"), + // to.Ptr("exampledatabase2"), + // to.Ptr("exampledatabase3"), + // to.Ptr("exampledatabase4"), + // to.Ptr("exampledatabase5"), + // to.Ptr("exampledatabase6"), + // to.Ptr("exampledatabase7"), + // }, + // MigrateRoles: to.Ptr(armpostgresql.MigrateRolesAndPermissionsFalse), + // MigrationID: to.Ptr("a3e2d3cc-b139-4201-9431-e4f3003140fd"), + // MigrationMode: to.Ptr(armpostgresql.MigrationModeOffline), + // MigrationOption: to.Ptr(armpostgresql.MigrationOptionValidate), + // MigrationWindowEndTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T20:30:22.123456Z"); return t}()), + // MigrationWindowStartTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T18:30:22.123456Z"); return t}()), + // OverwriteDbsInTarget: to.Ptr(armpostgresql.OverwriteDatabasesOnTargetServerTrue), + // SetupLogicalReplicationOnSourceDbIfNeeded: to.Ptr(armpostgresql.LogicalReplicationOnSourceServerTrue), + // SourceDbServerResourceID: to.Ptr("20.228.214.65:5432@postgres"), + // TargetDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampletarget"), + // TriggerCutover: to.Ptr(armpostgresql.TriggerCutoverTrue), + // }, + // }, + // } +} + +// Generated from example definition: 2025-08-01/MigrationsListByTargetServer.json +func ExampleMigrationsClient_NewListByTargetServerPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armpostgresql.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewMigrationsClient().NewListByTargetServerPager("exampleresourcegroup", "exampleserver", &armpostgresql.MigrationsClientListByTargetServerOptions{ + MigrationListFilter: to.Ptr(armpostgresql.MigrationListFilterAll)}) + 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 = armpostgresql.MigrationsClientListByTargetServerResponse{ + // MigrationList: armpostgresql.MigrationList{ + // Value: []*armpostgresql.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("eastus"), + // Properties: &armpostgresql.MigrationProperties{ + // CurrentStatus: &armpostgresql.MigrationStatus{ + // CurrentSubStateDetails: &armpostgresql.MigrationSubstateDetails{ + // CurrentSubState: to.Ptr(armpostgresql.MigrationSubstatePerformingPreRequisiteSteps), + // }, + // Error: to.Ptr(""), + // State: to.Ptr(armpostgresql.MigrationStateInProgress), + // }, + // DbsToMigrate: []*string{ + // to.Ptr("exampledatabase1"), + // to.Ptr("exampledatabase2"), + // to.Ptr("exampledatabase3"), + // to.Ptr("exampledatabase4"), + // }, + // MigrateRoles: to.Ptr(armpostgresql.MigrateRolesAndPermissionsFalse), + // MigrationID: to.Ptr("d3ceacbb-a5fd-43dc-a9db-6022b5154856"), + // MigrationWindowStartTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T20:30:22.123456Z"); return t}()), + // OverwriteDbsInTarget: to.Ptr(armpostgresql.OverwriteDatabasesOnTargetServerFalse), + // SetupLogicalReplicationOnSourceDbIfNeeded: to.Ptr(armpostgresql.LogicalReplicationOnSourceServerFalse), + // SourceDbServerMetadata: &armpostgresql.DbServerMetadata{ + // Location: to.Ptr("eastus"), + // SKU: &armpostgresql.ServerSKU{ + // Name: to.Ptr("B_Gen5_2"), + // Tier: to.Ptr(armpostgresql.SKUTier("Basic")), + // }, + // StorageMb: to.Ptr[int32](1024), + // Version: to.Ptr("10"), + // }, + // SourceDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBForPostgreSql/servers/examplesource"), + // StartDataMigration: to.Ptr(armpostgresql.StartDataMigrationFalse), + // TargetDbServerMetadata: &armpostgresql.DbServerMetadata{ + // Location: to.Ptr("eastus"), + // SKU: &armpostgresql.ServerSKU{ + // Name: to.Ptr("Standard_D4ds_v5"), + // Tier: to.Ptr(armpostgresql.SKUTierGeneralPurpose), + // }, + // StorageMb: to.Ptr[int32](2048), + // Version: to.Ptr("17"), + // }, + // TargetDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBForPostgreSql/flexibleServers/exampletarget"), + // TriggerCutover: to.Ptr(armpostgresql.TriggerCutoverFalse), + // }, + // }, + // }, + // }, + // } + } +} + +// Generated from example definition: 2025-08-01/MigrationsUpdate.json +func ExampleMigrationsClient_Update() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armpostgresql.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewMigrationsClient().Update(ctx, "exampleresourcegroup", "exampleserver", "examplemigration", armpostgresql.MigrationResourceForPatch{ + Properties: &armpostgresql.MigrationPropertiesForPatch{ + SetupLogicalReplicationOnSourceDbIfNeeded: to.Ptr(armpostgresql.LogicalReplicationOnSourceServerTrue), + }, + }, 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 = armpostgresql.MigrationsClientUpdateResponse{ + // Migration: &armpostgresql.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("eastus"), + // Properties: &armpostgresql.MigrationProperties{ + // CurrentStatus: &armpostgresql.MigrationStatus{ + // CurrentSubStateDetails: &armpostgresql.MigrationSubstateDetails{ + // CurrentSubState: to.Ptr(armpostgresql.MigrationSubstatePerformingPreRequisiteSteps), + // }, + // Error: to.Ptr(""), + // State: to.Ptr(armpostgresql.MigrationStateInProgress), + // }, + // DbsToMigrate: []*string{ + // to.Ptr("exampledatabase1"), + // to.Ptr("exampledatabase2"), + // to.Ptr("exampledatabase3"), + // to.Ptr("exampledatabase4"), + // }, + // MigrateRoles: to.Ptr(armpostgresql.MigrateRolesAndPermissionsFalse), + // MigrationID: to.Ptr("d3ceacbb-a5fd-43dc-a9db-6022b5154856"), + // MigrationWindowStartTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T20:30:22.123456Z"); return t}()), + // OverwriteDbsInTarget: to.Ptr(armpostgresql.OverwriteDatabasesOnTargetServerFalse), + // SetupLogicalReplicationOnSourceDbIfNeeded: to.Ptr(armpostgresql.LogicalReplicationOnSourceServerTrue), + // SourceDbServerMetadata: &armpostgresql.DbServerMetadata{ + // Location: to.Ptr("eastus"), + // SKU: &armpostgresql.ServerSKU{ + // Name: to.Ptr("B_Gen5_2"), + // Tier: to.Ptr(armpostgresql.SKUTier("Basic")), + // }, + // StorageMb: to.Ptr[int32](1024), + // Version: to.Ptr("10"), + // }, + // SourceDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBForPostgreSql/servers/examplesource"), + // StartDataMigration: to.Ptr(armpostgresql.StartDataMigrationFalse), + // TargetDbServerMetadata: &armpostgresql.DbServerMetadata{ + // Location: to.Ptr("eastus"), + // SKU: &armpostgresql.ServerSKU{ + // Name: to.Ptr("Standard_D4ds_v5"), + // Tier: to.Ptr(armpostgresql.SKUTierGeneralPurpose), + // }, + // StorageMb: to.Ptr[int32](2048), + // Version: to.Ptr("17"), + // }, + // TargetDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBForPostgreSql/flexibleServers/exampletarget"), + // TriggerCutover: to.Ptr(armpostgresql.TriggerCutoverFalse), + // }, + // }, + // } +} diff --git a/sdk/resourcemanager/postgresql/armpostgresql/models.go b/sdk/resourcemanager/postgresql/armpostgresql/models.go index 3209abb0c78c..ab95b80bf6dc 100644 --- a/sdk/resourcemanager/postgresql/armpostgresql/models.go +++ b/sdk/resourcemanager/postgresql/armpostgresql/models.go @@ -1,15 +1,400 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armpostgresql import "time" -// Configuration - Represents a Configuration. +// 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. Ex - /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 +} + +// 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 +} + +// AdministratorMicrosoftEntraList - List of server administrators associated to Microsoft Entra principals. +type AdministratorMicrosoftEntraList struct { + // REQUIRED; The AdministratorMicrosoftEntra items on this page + Value []*AdministratorMicrosoftEntra + + // The link to the next page of items + NextLink *string +} + +// AdministratorMicrosoftEntraProperties - Properties of a server administrator associated to a Microsoft Entra principal. +type AdministratorMicrosoftEntraProperties struct { + // Object identifier of the Microsoft Entra principal. + ObjectID *string + + // Name of the Microsoft Entra principal. + PrincipalName *string + + // Type of Microsoft Entra principal to which the server administrator is associated. + PrincipalType *PrincipalType + + // Identifier of the tenant in which the Microsoft Entra principal exists. + TenantID *string +} + +// AdministratorMicrosoftEntraPropertiesForAdd - Properties of a server administrator associated to a Microsoft Entra principal. +type AdministratorMicrosoftEntraPropertiesForAdd struct { + // Name of the Microsoft Entra principal. + PrincipalName *string + + // Type of Microsoft Entra principal to which the server administrator is associated. + PrincipalType *PrincipalType + + // Identifier of the tenant in which the Microsoft Entra principal exists. + TenantID *string +} + +// AdvancedThreatProtectionSettingsList - List of advanced threat protection settings for a server. +type AdvancedThreatProtectionSettingsList struct { + // READ-ONLY; The AdvancedThreatProtectionSettingsModel items on this page + Value []*AdvancedThreatProtectionSettingsModel + + // The link to the next page of items + NextLink *string +} + +// 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. Ex - /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 { + // 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 + + // Indicates if the server supports password based authentication. + PasswordAuth *PasswordBasedAuth + + // Identifier of the tenant of the delegated resource. + TenantID *string +} + +// Backup properties of a server. +type Backup 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 +} + +// BackupAutomaticAndOnDemand - Properties of a backup. +type BackupAutomaticAndOnDemand struct { + // Properties of a backup. + Properties *BackupAutomaticAndOnDemandProperties + + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /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 { + // REQUIRED; The BackupAutomaticAndOnDemand items on this page + Value []*BackupAutomaticAndOnDemand + + // The link to the next page of items + NextLink *string +} + +// 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 + + // READ-ONLY; Earliest restore point time (ISO8601 format) for a server. + EarliestRestoreDate *time.Time + + // READ-ONLY; Indicates if the server is configured to create geographically redundant backups. + GeoRedundantBackup *GeographicallyRedundantBackup +} + +// BackupSettings - The settings for the long term backup. +type BackupSettings struct { + // REQUIRED; Backup Name for the current backup + BackupName *string +} + +// BackupStoreDetails - Details about the target where the backup content will be stored. +type BackupStoreDetails struct { + // REQUIRED; List of SAS uri of storage containers where backup data is to be streamed/copied. + SasURIList []*string +} + +// 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. Ex - /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 { + // READ-ONLY; The Capability items on this page + Value []*Capability + + // The link to the next page of items + NextLink *string +} + +// CapturedLog - Log file. +type CapturedLog struct { + // Properties of a log file. + Properties *CapturedLogProperties + + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /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 { + // REQUIRED; The CapturedLog items on this page + Value []*CapturedLog + + // The link to the next page of items + NextLink *string +} + +// 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. +type CheckNameAvailabilityRequest struct { + // The name of the resource for which availability needs to be checked. + Name *string + + // The resource type. + Type *string +} + +// Cluster properties of a server. +type Cluster struct { + // Number of nodes assigned to the elastic cluster. + ClusterSize *int32 + + // Default database name for the elastic cluster. + DefaultDatabaseName *string +} + +// 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. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} @@ -18,40 +403,101 @@ type Configuration struct { // 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 } -// ConfigurationListResult - A list of server configurations. -type ConfigurationListResult struct { - // The list of server configurations. +// ConfigurationForUpdate - Configuration (also known as server parameter). +type ConfigurationForUpdate struct { + // Properties of a configuration (also known as server parameter). + Properties *ConfigurationProperties +} + +// ConfigurationList - List of configurations (also known as server parameters). +type ConfigurationList struct { + // REQUIRED; The Configuration items on this page Value []*Configuration + + // The link to the next page of items + NextLink *string } -// ConfigurationProperties - The properties of a configuration. +// ConfigurationProperties - Properties of a configuration (also known as server parameter). type ConfigurationProperties struct { - // Source of 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. + // 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. - DataType *string + // 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; Link pointing to the documentation of the configuration (also known as server parameter). + DocumentationLink *string + + // 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; 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; Indicates if it's a read-only (true) or modifiable (false) configuration (also known as server parameter). + IsReadOnly *bool + + // READ-ONLY; Units in which the configuration (also known as server parameter) value is expressed. + Unit *string } -// Database - Represents a Database. +// DataEncryption - Data encryption properties of a server. +type DataEncryption struct { + // 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 + + // 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 + + // URI of the key in Azure Key Vault used for data encryption of the primary storage associated to a server. + PrimaryKeyURI *string + + // 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 used by a server. + Type *DataEncryptionType + + // READ-ONLY; 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 + + // READ-ONLY; 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 +} + +// 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. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} @@ -60,57 +506,600 @@ type Database struct { // 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 } -// DatabaseListResult - A List of databases. -type DatabaseListResult struct { - // The list of databases housed in a server +// DatabaseList - List of all databases in a server. +type DatabaseList struct { + // REQUIRED; The Database items on this page Value []*Database + + // The link to the next page of items + NextLink *string +} + +// DatabaseMigrationState - Migration state of a database. +type DatabaseMigrationState struct { + // Change Data Capture applied changes counter. + AppliedChanges *int32 + + // Change Data Capture delete counter. + CdcDeleteCounter *int32 + + // Change Data Capture insert counter. + CdcInsertCounter *int32 + + // Change Data Capture update counter. + CdcUpdateCounter *int32 + + // Name of database. + DatabaseName *string + + // End time of a migration state. + EndedOn *time.Time + + // Number of tables loaded during the migration of a database. + FullLoadCompletedTables *int32 + + // Number of tables encountering errors during the migration of a database. + FullLoadErroredTables *int32 + + // Number of tables loading during the migration of a database. + FullLoadLoadingTables *int32 + + // Number of tables queued for the migration of a database. + FullLoadQueuedTables *int32 + + // Change Data Capture incoming changes counter. + IncomingChanges *int32 + + // Lag in seconds between source and target during online phase. + Latency *int32 + + // Error message, if any, for the migration state. + Message *string + + // Migration operation of a database. + MigrationOperation *string + + // Migration state of a database. + MigrationState *MigrationDatabaseState + + // Start time of a migration state. + StartedOn *time.Time } -// DatabaseProperties - The properties of a database. +// DatabaseProperties - Properties of a database. type DatabaseProperties struct { - // The charset of the database. + // Character set of the database. Charset *string - // The collation of the database. + // Collation of the database. Collation *string } -// ErrorAdditionalInfo - The resource management error additional info. -type ErrorAdditionalInfo struct { - // READ-ONLY; The additional info. - Info any +// 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 { + // 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. + StorageMb *int32 + + // Major version of PostgreSQL database engine. + Version *string + + // READ-ONLY; Location of database server. + Location *string +} + +// DelegatedSubnetUsage - Delegated subnet usage data. +type DelegatedSubnetUsage struct { + // READ-ONLY; Name of the delegated subnet for which IP addresses are in use + SubnetName *string + + // READ-ONLY; Number of IP addresses used by the delegated subnet + Usage *int64 +} + +// 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 this specification. + ServerCount *int32 + + // READ-ONLY; The status of the capability. + Status *CapabilityStatus + + // READ-ONLY; Compute name (SKU) supporting fast provisioning. + SupportedSKU *string + + // READ-ONLY; Major version of PostgreSQL database engine supporting fast provisioning. + SupportedServerVersions *string + + // READ-ONLY; Storage size (in GB) supporting fast provisioning. + SupportedStorageGb *int32 + + // READ-ONLY; Compute tier supporting fast provisioning. + SupportedTier *string +} + +// FirewallRule - Firewall rule. +type FirewallRule struct { + // REQUIRED; Properties of a firewall rule. + Properties *FirewallRuleProperties + + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /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 +} + +// FirewallRuleList - List of firewall rules. +type FirewallRuleList struct { + // REQUIRED; The FirewallRule items on this page + Value []*FirewallRule + + // The link to the next page of items + NextLink *string +} + +// FirewallRuleProperties - Properties of a firewall rule. +type FirewallRuleProperties struct { + // REQUIRED; IP address defining the end of the range of addresses of a firewall rule. Must be expressed in IPv4 format. + EndIPAddress *string + + // REQUIRED; IP address defining the start of the range of addresses of a firewall rule. Must be expressed in IPv4 format. + StartIPAddress *string +} + +// HighAvailability - High availability properties of a server. +type HighAvailability struct { + // High availability mode for a server. + Mode *FlexibleServerHighAvailabilityMode + + // Availability zone associated to the standby server created when high availability is set to SameZone or ZoneRedundant. + StandbyAvailabilityZone *string + + // READ-ONLY; Possible states of the standby server created when high availability is set to SameZone or ZoneRedundant. + State *HighAvailabilityState +} + +// HighAvailabilityForPatch - High availability properties of a server. +type HighAvailabilityForPatch struct { + // High availability mode for a server. + Mode *FlexibleServerHighAvailabilityMode + + // Availability zone associated to the standby server created when high availability is set to SameZone or ZoneRedundant. + StandbyAvailabilityZone *string + + // READ-ONLY; Possible states of the standby server created when high availability is set to SameZone or ZoneRedundant. + State *HighAvailabilityState +} + +// ImpactRecord - Impact on some metric if this recommended action is applied. +type ImpactRecord struct { + // Absolute value. + AbsoluteValue *float64 + + // Dimension name. + DimensionName *string + + // Optional property that can be used to store the identifier of the query, if the metric is for a specific query. + QueryID *int64 + + // Dimension unit. + Unit *string +} + +// LtrBackupOperationResponseProperties - Response for the backup request. +type LtrBackupOperationResponseProperties struct { + // REQUIRED; Start time of the operation. + StartTime *time.Time + + // REQUIRED; Service-set extensible enum indicating the status of operation + Status *ExecutionStatus + + // Metadata to be stored in RP. Store everything that will be required to perform a successful restore using this Recovery + // point. e.g. Versions, DataFormat etc + BackupMetadata *string + + // Name of Backup operation + BackupName *string + + // Data transferred in bytes + DataTransferredInBytes *int64 + + // Size of datasource in bytes + DatasourceSizeInBytes *int64 + + // End time of the operation. + EndTime *time.Time + + // PercentageCompleted + PercentComplete *float64 + + // READ-ONLY; The error code. + ErrorCode *string + + // READ-ONLY; The error message. + ErrorMessage *string +} + +// LtrPreBackupRequest - A request that is made for pre-backup. +type LtrPreBackupRequest struct { + // REQUIRED; Backup Settings + BackupSettings *BackupSettings +} + +// LtrPreBackupResponse - Response for the LTR pre-backup API call +type LtrPreBackupResponse struct { + // REQUIRED; Additional Properties for the pre backup response + Properties *BackupsLongTermRetentionResponseProperties +} + +// LtrServerBackupOperationList - A list of long term retention backup operations for server. +type LtrServerBackupOperationList struct { + // REQUIRED; The BackupsLongTermRetentionOperation items on this page + Value []*BackupsLongTermRetentionOperation + + // The link to the next page of items + NextLink *string +} + +// MaintenanceWindow - Maintenance window properties of a server. +type MaintenanceWindow struct { + // Indicates whether custom window is enabled or disabled. + CustomWindow *string + + // Day of the week to be used for maintenance window. + DayOfWeek *int32 + + // Start hour to be used for maintenance window. + StartHour *int32 + + // Start minute to be used for maintenance window. + StartMinute *int32 +} + +// MaintenanceWindowForPatch - Maintenance window properties of a server. +type MaintenanceWindowForPatch struct { + // Indicates whether custom window is enabled or disabled. + CustomWindow *string + + // Day of the week to be used for maintenance window. + DayOfWeek *int32 + + // Start hour to be used for maintenance window. + StartHour *int32 + + // Start minute to be used for maintenance window. + StartMinute *int32 +} + +// Migration - Properties of a migration. +type Migration struct { + // REQUIRED; The geo-location where the resource lives + Location *string + + // Migration properties. + Properties *MigrationProperties + + // Resource tags. + Tags map[string]*string + + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /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 +} + +// MigrationList - List of migrations. +type MigrationList struct { + // READ-ONLY; The Migration items on this page + Value []*Migration + + // The link to the next page of items + 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; Indicates if the migration name is available. + NameAvailable *bool + + // READ-ONLY; Migration name availability reason. + Reason *MigrationNameAvailabilityReason +} + +// 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 set 'triggerCutover' to 'True' and the names of the specific databases + // in this array. + DbsToCancelMigrationOn []*string + + // Names of databases to migrate. + DbsToMigrate []*string + + // 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 + + // Indicates if roles and permissions must be migrated. + MigrateRoles *MigrateRolesAndPermissions + + // Identifier of the private endpoint migration instance. + MigrationInstanceResourceID *string + + // Mode used to perform the migration: Online or Offline. + MigrationMode *MigrationMode + + // Supported option for a migration. + MigrationOption *MigrationOption + + // End time (UTC) for migration window. + MigrationWindowEndTimeInUTC *time.Time + + // Start time (UTC) for migration window. + MigrationWindowStartTimeInUTC *time.Time + + // 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 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. + SecretParameters *MigrationSecretParameters + + // Indicates whether to setup logical replication on source server, if needed. + SetupLogicalReplicationOnSourceDbIfNeeded *LogicalReplicationOnSourceServer + + // 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 + + // 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 + + // Source server type used for the migration: ApsaraDB_RDS, AWS, AWS_AURORA, AWS_EC2, AWS_RDS, AzureVM, Crunchy_PostgreSQL, + // Digital_Ocean_Droplets, Digital_Ocean_PostgreSQL, EDB, EDB_Oracle_Server, EDB_PostgreSQL, GCP, GCP_AlloyDB, GCP_CloudSQL, + // GCP_Compute, Heroku_PostgreSQL, Huawei_Compute, Huawei_RDS, OnPremises, PostgreSQLCosmosDB, PostgreSQLFlexibleServer, PostgreSQLSingleServer, + // or Supabase_PostgreSQL + SourceType *SourceType + + // Indicates if data migration must start right away. + StartDataMigration *StartDataMigration + + // 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 + + // Indicates if cutover must be triggered for the entire migration. + TriggerCutover *TriggerCutover + + // READ-ONLY; Current status of a migration. + CurrentStatus *MigrationStatus + + // READ-ONLY; Identifier of a migration. + MigrationID *string + + // READ-ONLY; Metadata of source database server. + SourceDbServerMetadata *DbServerMetadata + + // READ-ONLY; Metadata of target database server. + TargetDbServerMetadata *DbServerMetadata + + // READ-ONLY; Identifier of the target database server resource. + TargetDbServerResourceID *string +} + +// 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 set 'triggerCutover' to 'True' and the names of the specific databases + // in this array. + DbsToCancelMigrationOn []*string + + // Names of databases to migrate. + DbsToMigrate []*string + + // 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 + + // Indicates if roles and permissions must be migrated. + MigrateRoles *MigrateRolesAndPermissions + + // Mode used to perform the migration: Online or Offline. + MigrationMode *MigrationMode + + // Start time (UTC) for migration window. + MigrationWindowStartTimeInUTC *time.Time + + // 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 *MigrationSecretParametersForPatch + + // Indicates whether to setup logical replication on source server, if needed. + SetupLogicalReplicationOnSourceDbIfNeeded *LogicalReplicationOnSourceServer + + // 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 + + // 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 if data migration must start right away. + StartDataMigration *StartDataMigration + + // 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 + + // 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; Credentials of administrator users for source and target servers. + AdminCredentials *AdminCredentials + + // 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 name of the user for the target server. This user doesn't need to be an administrator. + TargetServerUsername *string +} + +// MigrationStatus - State of migration. +type MigrationStatus struct { + // READ-ONLY; Current migration sub state details. + CurrentSubStateDetails *MigrationSubstateDetails + + // READ-ONLY; Error message, if any, for the migration state. + Error *string + + // READ-ONLY; State of migration. + State *MigrationState +} + +// MigrationSubstateDetails - Details of migration substate. +type MigrationSubstateDetails struct { + DbDetails map[string]*DatabaseMigrationState + ValidationDetails *ValidationDetails + + // READ-ONLY; Substate of migration. + CurrentSubState *MigrationSubstate +} + +// NameAvailabilityModel - Availability of a name. +type NameAvailabilityModel struct { + // Detailed reason why the given name is not available. + Message *string + + // Indicates if the resource name is available. + NameAvailable *bool + + // The reason why the given name is not available. + Reason *CheckNameAvailabilityReason - // READ-ONLY; The additional info type. + // READ-ONLY; Name for which validity and availability was checked. + Name *string + + // READ-ONLY; Type of resource. It can be 'Microsoft.DBforPostgreSQL/flexibleServers' or 'Microsoft.DBforPostgreSQL/flexibleServers/virtualendpoints'. Type *string } -// ErrorResponse - Common error response for all Azure Resource Manager APIs to return error details for failed operations. -// (This also follows the OData error response format.) -type ErrorResponse struct { - // READ-ONLY; The error additional info. - AdditionalInfo []*ErrorAdditionalInfo +// NameProperty - Name property for quota usage +type NameProperty struct { + // Localized name + LocalizedValue *string - // READ-ONLY; The error code. - Code *string + // Name value + Value *string +} - // READ-ONLY; The error details. - Details []*ErrorResponse +// Network properties of a server. +type Network struct { + // 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 - // READ-ONLY; The error message. - Message *string + // 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 - // READ-ONLY; The error target. - Target *string + // 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 } -// FirewallRule - Represents a server firewall rule. -type FirewallRule struct { - // REQUIRED; The properties of a firewall rule. - Properties *FirewallRuleProperties +// ObjectRecommendation - Object recommendation properties. +type ObjectRecommendation struct { + // Always empty. + Kind *string // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string @@ -118,94 +1107,120 @@ type FirewallRule struct { // 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 } -// FirewallRuleListResult - A list of firewall rules. -type FirewallRuleListResult struct { - // The list of firewall rules in a server. - Value []*FirewallRule -} +// ObjectRecommendationDetails - Recommendation details for the recommended action. +type ObjectRecommendationDetails struct { + // Database name. + DatabaseName *string -// FirewallRuleProperties - The properties of a server firewall rule. -type FirewallRuleProperties struct { - // REQUIRED; The end IP address of the server firewall rule. Must be IPv4 format. - EndIPAddress *string + // Index included columns. + IncludedColumns []*string - // REQUIRED; The start IP address of the server firewall rule. Must be IPv4 format. - StartIPAddress *string -} + // Index columns. + IndexColumns []*string -// LogFile - Represents a log file. -type LogFile struct { - // The properties of the log file. - Properties *LogFileProperties + // Index name. + IndexName *string - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string + // Index type. + IndexType *string - // READ-ONLY; The name of the resource - Name *string + // Schema name. + Schema *string - // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string + // Table name. + Table *string } -// LogFileListResult - A list of log files. -type LogFileListResult struct { - // The list of log files. - Value []*LogFile +// ObjectRecommendationList - List of available object recommendations. +type ObjectRecommendationList struct { + // REQUIRED; The ObjectRecommendation items on this page + Value []*ObjectRecommendation + + // The link to the next page of items + NextLink *string } -// LogFileProperties - The properties of a log file. -type LogFileProperties struct { - // Size of the log file. - SizeInKB *int64 +// ObjectRecommendationProperties - Object recommendation properties. +type ObjectRecommendationProperties struct { + // Workload information for the recommended action. + AnalyzedWorkload *ObjectRecommendationPropertiesAnalyzedWorkload - // Type of the log file. - Type *string + // Current state. + CurrentState *string - // The url to download the log file from. - URL *string + // Implementation details for the recommended action. + ImplementationDetails *ObjectRecommendationPropertiesImplementationDetails - // READ-ONLY; Creation timestamp of the log file. - CreatedTime *time.Time + // 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 - // READ-ONLY; Last modified timestamp of the log file. - LastModifiedTime *time.Time + // 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 } -// NameAvailability - Represents a resource name availability. -type NameAvailability struct { - // Error Message. - Message *string +// ObjectRecommendationPropertiesAnalyzedWorkload - Workload information for the recommended action. +type ObjectRecommendationPropertiesAnalyzedWorkload struct { + // End time (UTC) of the workload analyzed. + EndTime *time.Time - // Indicates whether the resource name is available. - NameAvailable *bool + // Number of queries from the workload that were examined to produce this recommendation. For DROP INDEX recommendations it's + // 0 (zero). + QueryCount *int32 - // Reason for name being unavailable. - Reason *string + // Start time (UTC) of the workload analyzed. + StartTime *time.Time } -// NameAvailabilityRequest - Request from client to check resource name availability. -type NameAvailabilityRequest struct { - // REQUIRED; Resource name to verify. - Name *string +// ObjectRecommendationPropertiesImplementationDetails - Implementation details for the recommended action. +type ObjectRecommendationPropertiesImplementationDetails struct { + // Method of implementation for recommended action. + Method *string - // Resource type used for verification. - Type *string + // Implementation script for the recommended action. + Script *string } // Operation - REST API operation definition. type Operation struct { - // READ-ONLY; The localized display information for this particular operation or action. + // Indicates if the operation is a data action. + IsDataAction *bool + + // 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. @@ -214,86 +1229,35 @@ 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 { - // The list of resource provider operations. +// OperationList - Paged collection of Operation items +type OperationList struct { + // REQUIRED; The Operation items on this page Value []*Operation -} - -// PerformanceTierListResult - A list of performance tiers. -type PerformanceTierListResult struct { - // The list of performance tiers - Value []*PerformanceTierProperties -} - -// PerformanceTierProperties - Performance tier properties -type PerformanceTierProperties struct { - // ID of the performance tier. - ID *string - - // Maximum Backup retention in days for the performance tier edition - MaxBackupRetentionDays *int32 - // Max storage allowed for a server. - MaxLargeStorageMB *int32 - - // Max storage allowed for a server. - MaxStorageMB *int32 - - // Minimum Backup retention in days for the performance tier edition - MinBackupRetentionDays *int32 - - // Max storage allowed for a server. - MinLargeStorageMB *int32 - - // Max storage allowed for a server. - MinStorageMB *int32 - - // Service level objectives associated with the performance tier - ServiceLevelObjectives []*PerformanceTierServiceLevelObjectives + // The link to the next page of items + NextLink *string } -// PerformanceTierServiceLevelObjectives - Service level objectives for performance tier. -type PerformanceTierServiceLevelObjectives struct { - // Edition of the performance tier. - Edition *string - - // Hardware generation associated with the service level objective - HardwareGeneration *string - - // ID for the service level objective. +// PrivateEndpoint - The private endpoint resource. +type PrivateEndpoint struct { + // READ-ONLY; The resource identifier of the private endpoint ID *string - - // Maximum Backup retention in days for the performance tier edition - MaxBackupRetentionDays *int32 - - // Max storage allowed for a server. - MaxStorageMB *int32 - - // Minimum Backup retention in days for the performance tier edition - MinBackupRetentionDays *int32 - - // Max storage allowed for a server. - MinStorageMB *int32 - - // vCore associated with the service level objective - VCore *int32 } -// PrivateEndpointConnection - A private endpoint connection +// PrivateEndpointConnection - The private endpoint connection resource. type PrivateEndpointConnection struct { // Resource properties. Properties *PrivateEndpointConnectionProperties @@ -304,62 +1268,69 @@ type PrivateEndpointConnection struct { // 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 } -// PrivateEndpointConnectionListResult - A list of private endpoint connections. -type PrivateEndpointConnectionListResult struct { - // READ-ONLY; Link to retrieve next page of results. - NextLink *string - - // READ-ONLY; Array of results. +// PrivateEndpointConnectionList - List of private endpoint connections. +type PrivateEndpointConnectionList struct { + // READ-ONLY; The PrivateEndpointConnection items on this page Value []*PrivateEndpointConnection + + // The link to the next page of items + NextLink *string } -// PrivateEndpointConnectionProperties - Properties of a private endpoint connection. +// PrivateEndpointConnectionProperties - Properties of the private endpoint connection. type PrivateEndpointConnectionProperties struct { - // Private endpoint which the connection belongs to. - PrivateEndpoint *PrivateEndpointProperty + // REQUIRED; A collection of information about the state of the connection between service consumer and provider. + PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState - // Connection state of the private endpoint connection. - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionStateProperty + // The private endpoint resource. + PrivateEndpoint *PrivateEndpoint - // READ-ONLY; State of the private endpoint connection. - ProvisioningState *string -} + // READ-ONLY; The group ids for the private endpoint resource. + GroupIDs []*string -type PrivateEndpointProperty struct { - // Resource id of the private endpoint. - ID *string + // READ-ONLY; The provisioning state of the private endpoint connection resource. + ProvisioningState *PrivateEndpointConnectionProvisioningState } -// PrivateLinkResource - A private link resource +// PrivateLinkResource - A private link resource. type PrivateLinkResource struct { + // Resource properties. + Properties *PrivateLinkResourceProperties + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string // READ-ONLY; The name of the resource Name *string - // READ-ONLY; The private link resource group id. - Properties *PrivateLinkResourceProperties + // 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 } -// PrivateLinkResourceListResult - A list of private link resources -type PrivateLinkResourceListResult struct { - // READ-ONLY; Link to retrieve next page of results. - NextLink *string - - // READ-ONLY; Array of results. +// PrivateLinkResourceList - A list of private link resources +type PrivateLinkResourceList struct { + // READ-ONLY; The PrivateLinkResource items on this page Value []*PrivateLinkResource + + // The link to the next page of items + NextLink *string } // PrivateLinkResourceProperties - Properties of a private link resource. type PrivateLinkResourceProperties struct { + // The private link resource private link DNS zone name. + RequiredZoneNames []*string + // READ-ONLY; The private link resource group id. GroupID *string @@ -367,146 +1338,108 @@ type PrivateLinkResourceProperties struct { RequiredMembers []*string } -type PrivateLinkServiceConnectionStateProperty struct { - // REQUIRED; The private link service connection description. - Description *string - - // REQUIRED; The private link service connection status. - Status *string - - // READ-ONLY; The actions required for private link service connection. +// PrivateLinkServiceConnectionState - A collection of information about the state of the connection between service consumer +// and provider. +type PrivateLinkServiceConnectionState struct { + // A message indicating if changes on the service provider require any updates on the consumer. ActionsRequired *string -} - -// ProxyResource - The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a -// location -type ProxyResource struct { - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string - // READ-ONLY; The name of the resource - Name *string + // The reason for approval/rejection of the connection. + Description *string - // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string + // Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. + Status *PrivateEndpointServiceConnectionStatus } -// RecoverableServerProperties - The recoverable server's properties. -type RecoverableServerProperties struct { - // READ-ONLY; Edition of the performance tier. - Edition *string +// QuotaUsage - Quota usage for servers +type QuotaUsage struct { + // Current Quota usage value + CurrentValue *int64 - // READ-ONLY; Hardware generation associated with the service level objective - HardwareGeneration *string - - // READ-ONLY; The last available backup date time. - LastAvailableBackupDateTime *string + // Fully qualified ARM resource Id + ID *string - // READ-ONLY; The service level objective - ServiceLevelObjective *string + // Quota limit + Limit *int64 - // READ-ONLY; vCore associated with the service level objective - VCore *int32 + // Name of quota usage for servers + Name *NameProperty - // READ-ONLY; The PostgreSQL version - Version *string + // Quota unit + Unit *string } -// RecoverableServerResource - A recoverable server resource. -type RecoverableServerResource struct { - // Resource properties. - Properties *RecoverableServerProperties +// QuotaUsageList - Capability for the PostgreSQL server +type QuotaUsageList struct { + // READ-ONLY; The QuotaUsage items on this page + Value []*QuotaUsage - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string + // The link to the next page of items + NextLink *string +} - // READ-ONLY; The name of the resource - Name *string +// Replica properties of a server. +type Replica struct { + // 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 - // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string -} + // Data synchronization option to use when processing the operation specified in the promoteMode property. This property is + // write only. + PromoteOption *ReadReplicaPromoteOption -// Resource - Common fields that are returned in the response for all Azure Resource Manager resources -type Resource struct { - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string + // Role of the server in a replication set. + Role *ReplicationRole - // READ-ONLY; The name of the resource - Name *string + // READ-ONLY; Maximum number of read replicas allowed for a server. + Capacity *int32 - // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string + // 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 } -// ResourceIdentity - Azure Active Directory identity configuration for a resource. -type ResourceIdentity struct { - // The identity type. Set this to 'SystemAssigned' in order to automatically create and assign an Azure Active Directory principal - // for the resource. - Type *IdentityType - - // READ-ONLY; The Azure Active Directory principal id. - PrincipalID *string +// RestartParameter - PostgreSQL database engine restart parameters. +type RestartParameter struct { + // Failover mode. + FailoverMode *FailoverMode - // READ-ONLY; The Azure Active Directory tenant id. - TenantID *string + // 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 - Billing 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. BGen41, GPGen58. + // REQUIRED; Name by which is known a given compute size assigned to a server. Name *string - // The scale up/out capacity, representing server's compute units. - Capacity *int32 - - // The family of hardware. - Family *string - - // The size code, to be interpreted by resource as appropriate. - Size *string - - // The tier of the particular SKU, e.g. Basic. + // REQUIRED; Tier of the compute assigned to a server. Tier *SKUTier } -// SecurityAlertPolicyProperties - Properties of a security alert policy. -type SecurityAlertPolicyProperties struct { - // REQUIRED; Specifies the state of the policy, whether it is enabled or disabled. - State *ServerSecurityAlertPolicyState - - // Specifies an array of alerts that are disabled. Allowed values are: SqlInjection, SqlInjectionVulnerability, AccessAnomaly - DisabledAlerts []*string - - // Specifies that the alert is sent to the account administrators. - EmailAccountAdmins *bool - - // Specifies an array of e-mail addresses to which the alert is sent. - EmailAddresses []*string - - // Specifies the number of days to keep in the Threat Detection audit logs. - RetentionDays *int32 - - // Specifies the identifier key of the Threat Detection audit storage account. - StorageAccountAccessKey *string +// SKUForPatch - Compute information of a server. +type SKUForPatch struct { + // Name by which is known a given compute size assigned to a server. + Name *string - // Specifies the blob storage endpoint (e.g. https://MyAccount.blob.core.windows.net). This blob storage will hold all Threat - // Detection audit logs. - StorageEndpoint *string + // 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 - // The Azure Active Directory identity of the server. - Identity *ResourceIdentity + // 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. @@ -518,487 +1451,457 @@ type Server struct { // 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 } -// ServerAdministratorProperties - The properties of an server Administrator. -type ServerAdministratorProperties struct { - // CONSTANT; The type of administrator. - // Field has constant value "ActiveDirectory", any specified value is ignored. - AdministratorType *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; Name of compute tier. + Name *string - // REQUIRED; The server administrator login account name. - Login *string + // READ-ONLY; The reason for the capability not being available. + Reason *string - // REQUIRED; The server administrator Sid (Secure ID). - Sid *string + // READ-ONLY; The status of the capability. + Status *CapabilityStatus - // REQUIRED; The server Active Directory Administrator tenant id. - TenantID *string -} + // READ-ONLY; List of supported compute names (SKUs). + SupportedServerSKUs []*ServerSKUCapability -// ServerAdministratorResource - Represents a and external administrator to be created. -type ServerAdministratorResource struct { - // Properties of the server AAD administrator. - Properties *ServerAdministratorProperties + // READ-ONLY; List of storage editions supported by this compute tier and compute name. + SupportedStorageEditions []*StorageEditionCapability +} - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string +// ServerForPatch - Represents a server to be updated. +type ServerForPatch struct { + // Describes the identity of the application. + Identity *UserAssignedIdentity - // READ-ONLY; The name of the resource - Name *string + // Properties of the server. + Properties *ServerPropertiesForPatch - // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string -} + // Compute tier and size of a server. + SKU *SKUForPatch -// ServerAdministratorResourceListResult - The response to a list Active Directory Administrators request. -type ServerAdministratorResourceListResult struct { - // The list of server Active Directory Administrators for the server. - Value []*ServerAdministratorResource + // Application-specific metadata in the form of key-value pairs. + Tags map[string]*string } -// ServerForCreate - Represents a server to be created. -type ServerForCreate struct { - // REQUIRED; The location the resource resides in. - Location *string +// ServerList - A list of servers. +type ServerList struct { + // REQUIRED; The Server items on this page + Value []*Server - // REQUIRED; Properties of the server. - Properties ServerPropertiesForCreateClassification + // The link to the next page of items + NextLink *string +} - // The Azure Active Directory identity of the server. - Identity *ResourceIdentity +// ServerProperties - Properties of a server. +type ServerProperties 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 SKU (pricing tier) of the server. - SKU *SKU + // Password assigned to the administrator login. As long as password authentication is enabled, this password can be changed + // at any time. + AdministratorLoginPassword *string - // Application-specific metadata in the form of key-value pairs. - Tags map[string]*string -} + // Authentication configuration properties of a server. + AuthConfig *AuthConfig -// ServerKey - A PostgreSQL Server key. -type ServerKey struct { - // Properties of the ServerKey Resource. - Properties *ServerKeyProperties + // Availability zone of a server. + AvailabilityZone *string - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string + // Backup properties of a server. + Backup *Backup - // READ-ONLY; Kind of encryption protector used to protect the key. - Kind *string + // Cluster properties of a server. + Cluster *Cluster - // READ-ONLY; The name of the resource - Name *string + // Creation mode of a new server. + CreateMode *CreateMode - // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string -} + // Data encryption properties of a server. + DataEncryption *DataEncryption -// ServerKeyListResult - A list of PostgreSQL Server keys. -type ServerKeyListResult struct { - // READ-ONLY; Link to retrieve next page of results. - NextLink *string + // High availability properties of a server. + HighAvailability *HighAvailability - // READ-ONLY; A list of PostgreSQL Server keys. - Value []*ServerKey -} + // Maintenance window properties of a server. + MaintenanceWindow *MaintenanceWindow -// ServerKeyProperties - Properties for a key execution. -type ServerKeyProperties struct { - // REQUIRED; The key type like 'AzureKeyVault'. - ServerKeyType *ServerKeyType + // Network properties of a server. Only required if you want your server to be integrated into a virtual network provided + // by customer. + Network *Network - // The URI of the key. - URI *string + // 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 - // READ-ONLY; The key creation date. - CreationDate *time.Time -} + // Read replica properties of a server. Required only in case that you want to promote a server. + Replica *Replica -// ServerListResult - A list of servers. -type ServerListResult struct { - // The list of servers - Value []*Server -} + // Role of the server in a replication set. + ReplicationRole *ReplicationRole -// ServerPrivateEndpointConnection - A private endpoint connection under a server -type ServerPrivateEndpointConnection struct { - // READ-ONLY; Resource ID of the Private Endpoint Connection. - ID *string + // 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 - // READ-ONLY; Private endpoint connection properties - Properties *ServerPrivateEndpointConnectionProperties -} + // Storage properties of a server. + Storage *Storage -// ServerPrivateEndpointConnectionProperties - Properties of a private endpoint connection. -type ServerPrivateEndpointConnectionProperties struct { - // Private endpoint which the connection belongs to. - PrivateEndpoint *PrivateEndpointProperty + // Major version of PostgreSQL database engine. + Version *PostgresMajorVersion - // Connection state of the private endpoint connection. - PrivateLinkServiceConnectionState *ServerPrivateLinkServiceConnectionStateProperty + // READ-ONLY; Fully qualified domain name of a server. + FullyQualifiedDomainName *string - // READ-ONLY; State of the private endpoint connection. - ProvisioningState *PrivateEndpointProvisioningState -} + // READ-ONLY; Minor version of PostgreSQL database engine. + MinorVersion *string -type ServerPrivateLinkServiceConnectionStateProperty struct { - // REQUIRED; The private link service connection description. - Description *string + // READ-ONLY; List of private endpoint connections associated with the specified server. + PrivateEndpointConnections []*PrivateEndpointConnection - // REQUIRED; The private link service connection status. - Status *PrivateLinkServiceConnectionStateStatus + // READ-ONLY; Maximum number of read replicas allowed for a server. + ReplicaCapacity *int32 - // READ-ONLY; The actions required for private link service connection. - ActionsRequired *PrivateLinkServiceConnectionStateActionsRequire + // READ-ONLY; Possible states of a server. + State *ServerState } -// ServerProperties - The 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). - AdministratorLogin *string +// ServerPropertiesForPatch - Properties of a server. +type ServerPropertiesForPatch struct { + // Password assigned to the administrator login. As long as password authentication is enabled, this password can be changed + // at any time. + AdministratorLoginPassword *string - // Earliest restore point creation time (ISO8601 format) - EarliestRestoreDate *time.Time + // Authentication configuration properties of a server. + AuthConfig *AuthConfigForPatch - // The fully qualified domain name of a server. - FullyQualifiedDomainName *string + // Availability zone of a server. + AvailabilityZone *string - // Status showing whether the server enabled infrastructure encryption. - InfrastructureEncryption *InfrastructureEncryption + // Backup properties of a server. + Backup *BackupForPatch - // The master server id of a replica server. - MasterServerID *string + // Cluster properties of a server. + Cluster *Cluster - // Enforce a minimal Tls version for the server. - MinimalTLSVersion *MinimalTLSVersionEnum + // Update mode of an existing server. + CreateMode *CreateModeForPatch - // Whether or not public network access is allowed for this server. Value is optional but if passed in, must be 'Enabled' - // or 'Disabled' - PublicNetworkAccess *PublicNetworkAccessEnum + // Data encryption properties of a server. + DataEncryption *DataEncryption - // The maximum number of replicas that a master server can have. - ReplicaCapacity *int32 + // High availability properties of a server. + HighAvailability *HighAvailabilityForPatch - // The replication role of the server. - ReplicationRole *string + // Maintenance window properties of a server. + MaintenanceWindow *MaintenanceWindowForPatch - // Enable ssl enforcement or not when connect to server. - SSLEnforcement *SSLEnforcementEnum + // Network properties of a server. Only required if you want your server to be integrated into a virtual network provided + // by customer. + Network *Network - // Storage profile of a server. - StorageProfile *StorageProfile + // Read replica properties of a server. Required only in case that you want to promote a server. + Replica *Replica - // A state of a server that is visible to user. - UserVisibleState *ServerState + // Role of the server in a replication set. + ReplicationRole *ReplicationRole - // Server version. - Version *ServerVersion + // Storage properties of a server. + Storage *Storage - // READ-ONLY; Status showing whether the server data encryption is enabled with customer-managed keys. - ByokEnforcement *string + // Major version of PostgreSQL database engine. + Version *PostgresMajorVersion - // READ-ONLY; List of private endpoint connections on a server - PrivateEndpointConnections []*ServerPrivateEndpointConnection + // READ-ONLY; 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 } -// ServerPropertiesForCreate - The properties used to create a new server. -type ServerPropertiesForCreate struct { - // REQUIRED; The mode to create a new server. - CreateMode *CreateMode +// ServerSKU - Compute information of a server. +type ServerSKU struct { + // Compute tier and size of the database server. This object is empty for an Azure Database for PostgreSQL single server. + Name *string - // Status showing whether the server enabled infrastructure encryption. - InfrastructureEncryption *InfrastructureEncryption + // Tier of the compute assigned to a server. + Tier *SKUTier +} - // Enforce a minimal Tls version for the server. - MinimalTLSVersion *MinimalTLSVersionEnum +// ServerSKUCapability - Capabilities in terms of compute. +type ServerSKUCapability struct { + // READ-ONLY; Name of the compute (SKU). + Name *string - // Whether or not public network access is allowed for this server. Value is optional but if passed in, must be 'Enabled' - // or 'Disabled' - PublicNetworkAccess *PublicNetworkAccessEnum + // READ-ONLY; The reason for the capability not being available. + Reason *string - // Enable ssl enforcement or not when connect to server. - SSLEnforcement *SSLEnforcementEnum + // READ-ONLY; Security profile of the compute. Indicates if it's a Confidential Compute virtual machine. + SecurityProfile *string - // Storage profile of a server. - StorageProfile *StorageProfile + // READ-ONLY; The status of the capability. + Status *CapabilityStatus - // Server version. - Version *ServerVersion -} + // READ-ONLY; Features supported. + SupportedFeatures []*SupportedFeature -// GetServerPropertiesForCreate implements the ServerPropertiesForCreateClassification interface for type ServerPropertiesForCreate. -func (s *ServerPropertiesForCreate) GetServerPropertiesForCreate() *ServerPropertiesForCreate { - return s -} + // READ-ONLY; Modes of high availability supported for this compute. + SupportedHaMode []*HighAvailabilityMode -// ServerPropertiesForDefaultCreate - The properties used to create a new server. -type ServerPropertiesForDefaultCreate struct { - // REQUIRED; The administrator's login name of a server. Can only be specified when the server is being created (and is required - // for creation). - AdministratorLogin *string + // READ-ONLY; Maximum IOPS supported by this compute. + SupportedIops *int32 - // REQUIRED; The password of the administrator login. - AdministratorLoginPassword *string + // READ-ONLY; Supported memory (in MB) per virtual core assigned to this compute. + SupportedMemoryPerVcoreMb *int64 - // REQUIRED; The mode to create a new server. - CreateMode *CreateMode + // READ-ONLY; List of supported availability zones. E.g. '1', '2', '3' + SupportedZones []*string - // Status showing whether the server enabled infrastructure encryption. - InfrastructureEncryption *InfrastructureEncryption + // READ-ONLY; vCores available for this compute. + VCores *int32 +} - // Enforce a minimal Tls version for the server. - MinimalTLSVersion *MinimalTLSVersionEnum +// ServerVersionCapability - Capabilities in terms of major versions of PostgreSQL database engine. +type ServerVersionCapability struct { + // READ-ONLY; Major version of PostgreSQL database engine. + Name *string - // Whether or not public network access is allowed for this server. Value is optional but if passed in, must be 'Enabled' - // or 'Disabled' - PublicNetworkAccess *PublicNetworkAccessEnum + // READ-ONLY; The reason for the capability not being available. + Reason *string - // Enable ssl enforcement or not when connect to server. - SSLEnforcement *SSLEnforcementEnum + // READ-ONLY; The status of the capability. + Status *CapabilityStatus - // Storage profile of a server. - StorageProfile *StorageProfile + // READ-ONLY; Features supported. + SupportedFeatures []*SupportedFeature - // Server version. - Version *ServerVersion + // READ-ONLY; Major versions of PostgreSQL database engine to which this version can be automatically upgraded. + SupportedVersionsToUpgrade []*string } -// GetServerPropertiesForCreate implements the ServerPropertiesForCreateClassification interface for type ServerPropertiesForDefaultCreate. -func (s *ServerPropertiesForDefaultCreate) GetServerPropertiesForCreate() *ServerPropertiesForCreate { - return &ServerPropertiesForCreate{ - CreateMode: s.CreateMode, - InfrastructureEncryption: s.InfrastructureEncryption, - MinimalTLSVersion: s.MinimalTLSVersion, - PublicNetworkAccess: s.PublicNetworkAccess, - SSLEnforcement: s.SSLEnforcement, - StorageProfile: s.StorageProfile, - Version: s.Version, - } -} +// Storage properties of a server. +type Storage struct { + // 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 -// ServerPropertiesForGeoRestore - The properties used to create a new server by restoring to a different region from a geo -// replicated backup. -type ServerPropertiesForGeoRestore struct { - // REQUIRED; The mode to create a new server. - CreateMode *CreateMode + // Maximum IOPS supported for storage. Required when type of storage is PremiumV2_LRS or UltraSSD_LRS. + Iops *int32 - // REQUIRED; The source server id to restore from. - SourceServerID *string + // Size of storage assigned to a server. + StorageSizeGB *int32 - // Status showing whether the server enabled infrastructure encryption. - InfrastructureEncryption *InfrastructureEncryption + // Maximum throughput supported for storage. Required when type of storage is PremiumV2_LRS or UltraSSD_LRS. + Throughput *int32 - // Enforce a minimal Tls version for the server. - MinimalTLSVersion *MinimalTLSVersionEnum + // Storage tier of a server. + Tier *AzureManagedDiskPerformanceTier - // Whether or not public network access is allowed for this server. Value is optional but if passed in, must be 'Enabled' - // or 'Disabled' - PublicNetworkAccess *PublicNetworkAccessEnum + // Type of storage assigned to a server. Allowed values are Premium_LRS, PremiumV2_LRS, or UltraSSD_LRS. If not specified, + // it defaults to Premium_LRS. + Type *StorageType +} - // Enable ssl enforcement or not when connect to server. - SSLEnforcement *SSLEnforcementEnum +// StorageEditionCapability - Capabilities in terms of storage tier. +type StorageEditionCapability struct { + // READ-ONLY; Default storage size (in MB) for this storage tier. + DefaultStorageSizeMb *int64 - // Storage profile of a server. - StorageProfile *StorageProfile + // READ-ONLY; Name of storage tier. + Name *string - // Server version. - Version *ServerVersion -} + // READ-ONLY; The reason for the capability not being available. + Reason *string + + // READ-ONLY; The status of the capability. + Status *CapabilityStatus -// GetServerPropertiesForCreate implements the ServerPropertiesForCreateClassification interface for type ServerPropertiesForGeoRestore. -func (s *ServerPropertiesForGeoRestore) GetServerPropertiesForCreate() *ServerPropertiesForCreate { - return &ServerPropertiesForCreate{ - CreateMode: s.CreateMode, - InfrastructureEncryption: s.InfrastructureEncryption, - MinimalTLSVersion: s.MinimalTLSVersion, - PublicNetworkAccess: s.PublicNetworkAccess, - SSLEnforcement: s.SSLEnforcement, - StorageProfile: s.StorageProfile, - Version: s.Version, - } + // READ-ONLY; Configurations of storage supported for this storage tier. + SupportedStorageMb []*StorageMbCapability } -// ServerPropertiesForReplica - The properties to create a new replica. -type ServerPropertiesForReplica struct { - // REQUIRED; The mode to create a new server. - CreateMode *CreateMode +// StorageMbCapability - Storage size (in MB) capability. +type StorageMbCapability struct { + // READ-ONLY; Default IOPS for this tier and storage size. + DefaultIopsTier *string + + // READ-ONLY; Maximum supported size (in MB) of storage. + MaximumStorageSizeMb *int64 - // REQUIRED; The master server id to create replica from. - SourceServerID *string + // READ-ONLY; The reason for the capability not being available. + Reason *string - // Status showing whether the server enabled infrastructure encryption. - InfrastructureEncryption *InfrastructureEncryption + // READ-ONLY; The status of the capability. + Status *CapabilityStatus - // Enforce a minimal Tls version for the server. - MinimalTLSVersion *MinimalTLSVersionEnum + // READ-ONLY; Minimum supported size (in MB) of storage. + StorageSizeMb *int64 - // Whether or not public network access is allowed for this server. Value is optional but if passed in, must be 'Enabled' - // or 'Disabled' - PublicNetworkAccess *PublicNetworkAccessEnum + // READ-ONLY; Minimum IOPS supported by the storage size. + SupportedIops *int32 - // Enable ssl enforcement or not when connect to server. - SSLEnforcement *SSLEnforcementEnum + // READ-ONLY; List of all supported storage tiers for this tier and storage size. + SupportedIopsTiers []*StorageTierCapability - // Storage profile of a server. - StorageProfile *StorageProfile + // READ-ONLY; Maximum IOPS supported by the storage size. + SupportedMaximumIops *int32 - // Server version. - Version *ServerVersion -} + // READ-ONLY; Maximum supported throughput (in MB/s) of storage. + SupportedMaximumThroughput *int32 -// GetServerPropertiesForCreate implements the ServerPropertiesForCreateClassification interface for type ServerPropertiesForReplica. -func (s *ServerPropertiesForReplica) GetServerPropertiesForCreate() *ServerPropertiesForCreate { - return &ServerPropertiesForCreate{ - CreateMode: s.CreateMode, - InfrastructureEncryption: s.InfrastructureEncryption, - MinimalTLSVersion: s.MinimalTLSVersion, - PublicNetworkAccess: s.PublicNetworkAccess, - SSLEnforcement: s.SSLEnforcement, - StorageProfile: s.StorageProfile, - Version: s.Version, - } + // READ-ONLY; Minimum supported throughput (in MB/s) of storage. + SupportedThroughput *int32 } -// ServerPropertiesForRestore - The properties used to create a new server by restoring from a backup. -type ServerPropertiesForRestore struct { - // REQUIRED; The mode to create a new server. - CreateMode *CreateMode +// StorageTierCapability - Capability of a storage tier. +type StorageTierCapability struct { + // READ-ONLY; Supported IOPS for the storage tier. + Iops *int32 + + // READ-ONLY; Name of the storage tier. + Name *string - // REQUIRED; Restore point creation time (ISO8601 format), specifying the time to restore from. - RestorePointInTime *time.Time + // READ-ONLY; The reason for the capability not being available. + Reason *string - // REQUIRED; The source server id to restore from. - SourceServerID *string + // READ-ONLY; The status of the capability. + Status *CapabilityStatus +} - // Status showing whether the server enabled infrastructure encryption. - InfrastructureEncryption *InfrastructureEncryption +// SupportedFeature - Features supported. +type SupportedFeature struct { + // READ-ONLY; Name of the feature. + Name *string - // Enforce a minimal Tls version for the server. - MinimalTLSVersion *MinimalTLSVersionEnum + // READ-ONLY; Status of the feature. Indicates if the feature is enabled or not. + Status *FeatureStatus +} - // Whether or not public network access is allowed for this server. Value is optional but if passed in, must be 'Enabled' - // or 'Disabled' - PublicNetworkAccess *PublicNetworkAccessEnum +// SystemData - Metadata pertaining to creation and last modification of the resource. +type SystemData struct { + // The timestamp of resource creation (UTC). + CreatedAt *time.Time - // Enable ssl enforcement or not when connect to server. - SSLEnforcement *SSLEnforcementEnum + // The identity that created the resource. + CreatedBy *string - // Storage profile of a server. - StorageProfile *StorageProfile + // The type of identity that created the resource. + CreatedByType *CreatedByType - // Server version. - Version *ServerVersion -} + // The timestamp of resource last modification (UTC) + LastModifiedAt *time.Time -// GetServerPropertiesForCreate implements the ServerPropertiesForCreateClassification interface for type ServerPropertiesForRestore. -func (s *ServerPropertiesForRestore) GetServerPropertiesForCreate() *ServerPropertiesForCreate { - return &ServerPropertiesForCreate{ - CreateMode: s.CreateMode, - InfrastructureEncryption: s.InfrastructureEncryption, - MinimalTLSVersion: s.MinimalTLSVersion, - PublicNetworkAccess: s.PublicNetworkAccess, - SSLEnforcement: s.SSLEnforcement, - StorageProfile: s.StorageProfile, - Version: s.Version, - } -} + // The identity that last modified the resource. + LastModifiedBy *string -// ServerSecurityAlertPolicy - A server security alert policy. -type ServerSecurityAlertPolicy struct { - // Resource properties. - Properties *SecurityAlertPolicyProperties + // The type of identity that last modified the resource. + LastModifiedByType *CreatedByType +} +// TuningOptions - Impact on some metric if this recommended action is applied. +type TuningOptions struct { // READ-ONLY; Fully qualified resource ID for the resource. Ex - /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 } -// ServerSecurityAlertPolicyListResult - A list of the server's security alert policies. -type ServerSecurityAlertPolicyListResult struct { - // READ-ONLY; Link to retrieve next page of results. - NextLink *string +// TuningOptionsList - List of server tuning options. +type TuningOptionsList struct { + // REQUIRED; The TuningOptions items on this page + Value []*TuningOptions - // READ-ONLY; Array of results. - Value []*ServerSecurityAlertPolicy + // The link to the next page of items + NextLink *string } -// ServerUpdateParameters - Parameters allowed to update for a server. -type ServerUpdateParameters struct { - // The Azure Active Directory identity of the server. - Identity *ResourceIdentity +// UserAssignedIdentity - Identities associated with a server. +type UserAssignedIdentity struct { + // REQUIRED; Types of identities associated with a server. + Type *IdentityType - // The properties that can be updated for a server. - Properties *ServerUpdateParametersProperties + // Identifier of the object of the service principal associated to the user assigned managed identity. + PrincipalID *string - // The SKU (pricing tier) of the server. - SKU *SKU + // Map of user assigned managed identities. + UserAssignedIdentities map[string]*UserIdentity - // Application-specific metadata in the form of key-value pairs. - Tags map[string]*string + // READ-ONLY; Identifier of the tenant of a server. + TenantID *string } -// ServerUpdateParametersProperties - The properties that can be updated for a server. -type ServerUpdateParametersProperties struct { - // The password of the administrator login. - AdministratorLoginPassword *string +// UserIdentity - User assigned managed identity associated with a server. +type UserIdentity struct { + // Identifier of the client of the service principal associated to the user assigned managed identity. + ClientID *string - // Enforce a minimal Tls version for the server. - MinimalTLSVersion *MinimalTLSVersionEnum + // Identifier of the object of the service principal associated to the user assigned managed identity. + PrincipalID *string +} - // Whether or not public network access is allowed for this server. Value is optional but if passed in, must be 'Enabled' - // or 'Disabled' - PublicNetworkAccess *PublicNetworkAccessEnum +// ValidationDetails - Details for the validation for migration. +type ValidationDetails struct { + // Details of server level validations. + DbLevelValidationDetails []*DbLevelValidationStatus - // The replication role of the server. - ReplicationRole *string + // Details of server level validations. + ServerLevelValidationDetails []*ValidationSummaryItem - // Enable ssl enforcement or not when connect to server. - SSLEnforcement *SSLEnforcementEnum + // Validation status for migration. + Status *ValidationState - // Storage profile of a server. - StorageProfile *StorageProfile + // End time (UTC) for validation. + ValidationEndTimeInUTC *time.Time - // The version of a server. - Version *ServerVersion + // Start time (UTC) for validation. + ValidationStartTimeInUTC *time.Time } -// StorageProfile - Storage Profile properties of a server -type StorageProfile struct { - // Backup retention days for the server. - BackupRetentionDays *int32 +// ValidationMessage - Validation message object. +type ValidationMessage struct { + // Validation message string. + Message *string - // Enable Geo-redundant or not for server backup. - GeoRedundantBackup *GeoRedundantBackup + // Severity of validation message. + State *ValidationState +} - // Enable Storage Auto Grow. - StorageAutogrow *StorageAutogrow +// ValidationSummaryItem - Validation summary object. +type ValidationSummaryItem struct { + // Validation messages. + Messages []*ValidationMessage - // Max storage allowed for a server. - StorageMB *int32 -} + // Validation status for migration. + State *ValidationState -// TagsObject - Tags object for patch operations. -type TagsObject struct { - // Resource tags. - Tags map[string]*string + // Validation type. + Type *string } -// TrackedResource - The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' -// and a 'location' -type TrackedResource struct { - // REQUIRED; The geo-location where the resource lives - Location *string - - // Resource tags. - Tags map[string]*string +// 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. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string @@ -1006,42 +1909,54 @@ type TrackedResource struct { // 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 } -// VirtualNetworkRule - A virtual network rule. -type VirtualNetworkRule struct { - // Resource properties. - Properties *VirtualNetworkRuleProperties +// VirtualEndpointResourceForPatch - Pair of virtual endpoints for a server. +type VirtualEndpointResourceForPatch struct { + // Properties of the pair of virtual endpoints. + Properties *VirtualEndpointResourceProperties +} - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string +// VirtualEndpointResourceProperties - Properties of a pair of virtual endpoints. +type VirtualEndpointResourceProperties struct { + // Type of endpoint for the virtual endpoints. + EndpointType *VirtualEndpointType - // READ-ONLY; The name of the resource - Name *string + // List of servers that one of the virtual endpoints can refer to. + Members []*string - // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string + // READ-ONLY; List of virtual endpoints for a server. + VirtualEndpoints []*string } -// VirtualNetworkRuleListResult - A list of virtual network rules. -type VirtualNetworkRuleListResult struct { - // READ-ONLY; Link to retrieve next page of results. - NextLink *string +// VirtualEndpointsList - List of virtual endpoints. +type VirtualEndpointsList struct { + // REQUIRED; The VirtualEndpoint items on this page + Value []*VirtualEndpoint - // READ-ONLY; Array of results. - Value []*VirtualNetworkRule + // The link to the next page of items + NextLink *string } -// VirtualNetworkRuleProperties - Properties of a virtual network rule. -type VirtualNetworkRuleProperties struct { - // REQUIRED; The ARM resource id of the virtual network subnet. - VirtualNetworkSubnetID *string +// VirtualNetworkSubnetUsageModel - Virtual network subnet usage data. +type VirtualNetworkSubnetUsageModel struct { + // READ-ONLY + DelegatedSubnetsUsage []*DelegatedSubnetUsage + + // READ-ONLY; location of the delegated subnet usage + Location *string - // Create firewall rule before the virtual network has vnet service endpoint enabled. - IgnoreMissingVnetServiceEndpoint *bool + // READ-ONLY; subscriptionId of the delegated subnet usage + SubscriptionID *string +} - // READ-ONLY; Virtual Network Rule State - State *VirtualNetworkRuleState +// VirtualNetworkSubnetUsageParameter - Virtual network subnet usage parameter +type VirtualNetworkSubnetUsageParameter struct { + // Virtual network resource id. + VirtualNetworkArmResourceID *string } diff --git a/sdk/resourcemanager/postgresql/armpostgresql/models_serde.go b/sdk/resourcemanager/postgresql/armpostgresql/models_serde.go index dd739051095c..df5c70ad1a53 100644 --- a/sdk/resourcemanager/postgresql/armpostgresql/models_serde.go +++ b/sdk/resourcemanager/postgresql/armpostgresql/models_serde.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armpostgresql @@ -12,765 +11,3074 @@ import ( "reflect" ) -// MarshalJSON implements the json.Marshaller interface for type Configuration. -func (c Configuration) 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", c.ID) - populate(objectMap, "name", c.Name) - populate(objectMap, "properties", c.Properties) - populate(objectMap, "type", c.Type) + populate(objectMap, "sourceServerPassword", a.SourceServerPassword) + populate(objectMap, "targetServerPassword", a.TargetServerPassword) 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 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", c, err) + return fmt.Errorf("unmarshalling type %T: %v", a, 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 "sourceServerPassword": + err = unpopulate(val, "SourceServerPassword", &a.SourceServerPassword) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &c.Type) + case "targetServerPassword": + err = unpopulate(val, "TargetServerPassword", &a.TargetServerPassword) 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 ConfigurationListResult. -func (c ConfigurationListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AdminCredentialsForPatch. +func (a AdminCredentialsForPatch) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "value", c.Value) + populate(objectMap, "sourceServerPassword", a.SourceServerPassword) + populate(objectMap, "targetServerPassword", a.TargetServerPassword) 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 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", c, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } for key, val := range rawMsg { var err error switch key { - case "value": - err = unpopulate(val, "Value", &c.Value) + case "sourceServerPassword": + err = unpopulate(val, "SourceServerPassword", &a.SourceServerPassword) + delete(rawMsg, key) + case "targetServerPassword": + err = unpopulate(val, "TargetServerPassword", &a.TargetServerPassword) 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 ConfigurationProperties. -func (c ConfigurationProperties) 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, "allowedValues", c.AllowedValues) - populate(objectMap, "dataType", c.DataType) - populate(objectMap, "defaultValue", c.DefaultValue) - populate(objectMap, "description", c.Description) - populate(objectMap, "source", c.Source) - populate(objectMap, "value", c.Value) + 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 ConfigurationProperties. -func (c *ConfigurationProperties) 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", c, err) + return fmt.Errorf("unmarshalling type %T: %v", a, 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) + case "id": + err = unpopulate(val, "ID", &a.ID) delete(rawMsg, key) - case "defaultValue": - err = unpopulate(val, "DefaultValue", &c.DefaultValue) + case "name": + err = unpopulate(val, "Name", &a.Name) delete(rawMsg, key) - case "description": - err = unpopulate(val, "Description", &c.Description) + case "properties": + err = unpopulate(val, "Properties", &a.Properties) delete(rawMsg, key) - case "source": - err = unpopulate(val, "Source", &c.Source) + case "systemData": + err = unpopulate(val, "SystemData", &a.SystemData) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &c.Value) + case "type": + err = unpopulate(val, "Type", &a.Type) 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 Database. -func (d Database) 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, "id", d.ID) - populate(objectMap, "name", d.Name) - populate(objectMap, "properties", d.Properties) - populate(objectMap, "type", d.Type) + populate(objectMap, "properties", a.Properties) 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 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", d, err) + return fmt.Errorf("unmarshalling type %T: %v", a, 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 "type": - err = unpopulate(val, "Type", &d.Type) + err = unpopulate(val, "Properties", &a.Properties) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", a, 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 AdministratorMicrosoftEntraList. +func (a AdministratorMicrosoftEntraList) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "value", d.Value) + populate(objectMap, "nextLink", a.NextLink) + populate(objectMap, "value", a.Value) 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 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", d, 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", &a.NextLink) + delete(rawMsg, key) case "value": - err = unpopulate(val, "Value", &d.Value) + err = unpopulate(val, "Value", &a.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", a, 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 AdministratorMicrosoftEntraProperties. +func (a AdministratorMicrosoftEntraProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "charset", d.Charset) - populate(objectMap, "collation", d.Collation) + populate(objectMap, "objectId", a.ObjectID) + populate(objectMap, "principalName", a.PrincipalName) + populate(objectMap, "principalType", a.PrincipalType) + populate(objectMap, "tenantId", a.TenantID) 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 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", d, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } for key, val := range rawMsg { var err error switch key { - case "charset": - err = unpopulate(val, "Charset", &d.Charset) + case "objectId": + err = unpopulate(val, "ObjectID", &a.ObjectID) delete(rawMsg, key) - case "collation": - err = unpopulate(val, "Collation", &d.Collation) + case "principalName": + err = unpopulate(val, "PrincipalName", &a.PrincipalName) + delete(rawMsg, key) + case "principalType": + err = unpopulate(val, "PrincipalType", &a.PrincipalType) + delete(rawMsg, key) + case "tenantId": + err = unpopulate(val, "TenantID", &a.TenantID) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ErrorAdditionalInfo. -func (e ErrorAdditionalInfo) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AdministratorMicrosoftEntraPropertiesForAdd. +func (a AdministratorMicrosoftEntraPropertiesForAdd) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populateAny(objectMap, "info", e.Info) - populate(objectMap, "type", e.Type) + populate(objectMap, "principalName", a.PrincipalName) + populate(objectMap, "principalType", a.PrincipalType) + populate(objectMap, "tenantId", a.TenantID) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorAdditionalInfo. -func (e *ErrorAdditionalInfo) 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", e, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } for key, val := range rawMsg { var err error switch key { - case "info": - err = unpopulate(val, "Info", &e.Info) + case "principalName": + err = unpopulate(val, "PrincipalName", &a.PrincipalName) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &e.Type) + case "principalType": + err = unpopulate(val, "PrincipalType", &a.PrincipalType) + delete(rawMsg, key) + case "tenantId": + err = unpopulate(val, "TenantID", &a.TenantID) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ErrorResponse. -func (e ErrorResponse) 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, "additionalInfo", e.AdditionalInfo) - populate(objectMap, "code", e.Code) - populate(objectMap, "details", e.Details) - populate(objectMap, "message", e.Message) - populate(objectMap, "target", e.Target) + populate(objectMap, "nextLink", a.NextLink) + populate(objectMap, "value", a.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorResponse. -func (e *ErrorResponse) 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", e, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } for key, val := range rawMsg { var err error switch key { - case "additionalInfo": - err = unpopulate(val, "AdditionalInfo", &e.AdditionalInfo) - delete(rawMsg, key) - case "code": - err = unpopulate(val, "Code", &e.Code) - delete(rawMsg, key) - case "details": - err = unpopulate(val, "Details", &e.Details) - delete(rawMsg, key) - case "message": - err = unpopulate(val, "Message", &e.Message) + case "nextLink": + err = unpopulate(val, "NextLink", &a.NextLink) delete(rawMsg, key) - case "target": - err = unpopulate(val, "Target", &e.Target) + case "value": + err = unpopulate(val, "Value", &a.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", a, 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 AdvancedThreatProtectionSettingsModel. +func (a AdvancedThreatProtectionSettingsModel) 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, "type", f.Type) + 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 FirewallRule. -func (f *FirewallRule) 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", f, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } for key, val := range rawMsg { var err error switch key { case "id": - err = unpopulate(val, "ID", &f.ID) + err = unpopulate(val, "ID", &a.ID) delete(rawMsg, key) case "name": - err = unpopulate(val, "Name", &f.Name) + err = unpopulate(val, "Name", &a.Name) delete(rawMsg, key) case "properties": - err = unpopulate(val, "Properties", &f.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", &f.Type) + err = unpopulate(val, "Type", &a.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) + return fmt.Errorf("unmarshalling type %T: %v", a, 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 AdvancedThreatProtectionSettingsProperties. +func (a AdvancedThreatProtectionSettingsProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "value", f.Value) + populateDateTimeRFC3339(objectMap, "creationTime", a.CreationTime) + populate(objectMap, "state", a.State) 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 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", f, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } for key, val := range rawMsg { var err error switch key { - case "value": - err = unpopulate(val, "Value", &f.Value) + 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", f, err) + return fmt.Errorf("unmarshalling type %T: %v", a, 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 AuthConfig. +func (a AuthConfig) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "endIpAddress", f.EndIPAddress) - populate(objectMap, "startIpAddress", f.StartIPAddress) + 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 FirewallRuleProperties. -func (f *FirewallRuleProperties) 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", f, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } for key, val := range rawMsg { var err error switch key { - case "endIpAddress": - err = unpopulate(val, "EndIPAddress", &f.EndIPAddress) + case "activeDirectoryAuth": + err = unpopulate(val, "ActiveDirectoryAuth", &a.ActiveDirectoryAuth) delete(rawMsg, key) - case "startIpAddress": - err = unpopulate(val, "StartIPAddress", &f.StartIPAddress) + 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", f, err) + return fmt.Errorf("unmarshalling type %T: %v", a, 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 AuthConfigForPatch. +func (a AuthConfigForPatch) 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, "type", l.Type) + 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 LogFile. -func (l *LogFile) 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", l, err) + return fmt.Errorf("unmarshalling type %T: %v", a, 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 "activeDirectoryAuth": + err = unpopulate(val, "ActiveDirectoryAuth", &a.ActiveDirectoryAuth) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &l.Properties) + case "passwordAuth": + err = unpopulate(val, "PasswordAuth", &a.PasswordAuth) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &l.Type) + case "tenantId": + err = unpopulate(val, "TenantID", &a.TenantID) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) + return fmt.Errorf("unmarshalling type %T: %v", a, 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 Backup. +func (b Backup) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "value", l.Value) + 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 LogFileListResult. -func (l *LogFileListResult) 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", l, err) + return fmt.Errorf("unmarshalling type %T: %v", b, err) } for key, val := range rawMsg { var err error switch key { - case "value": - err = unpopulate(val, "Value", &l.Value) + 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", l, err) + return fmt.Errorf("unmarshalling type %T: %v", b, 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 BackupAutomaticAndOnDemand. +func (b BackupAutomaticAndOnDemand) 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, "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 LogFileProperties. -func (l *LogFileProperties) 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", l, err) + return fmt.Errorf("unmarshalling type %T: %v", b, err) } for key, val := range rawMsg { var err error switch key { - case "createdTime": - err = unpopulateDateTimeRFC3339(val, "CreatedTime", &l.CreatedTime) + case "id": + err = unpopulate(val, "ID", &b.ID) delete(rawMsg, key) - case "lastModifiedTime": - err = unpopulateDateTimeRFC3339(val, "LastModifiedTime", &l.LastModifiedTime) + case "name": + err = unpopulate(val, "Name", &b.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &b.Properties) delete(rawMsg, key) - case "sizeInKB": - err = unpopulate(val, "SizeInKB", &l.SizeInKB) + case "systemData": + err = unpopulate(val, "SystemData", &b.SystemData) delete(rawMsg, key) case "type": - err = unpopulate(val, "Type", &l.Type) - delete(rawMsg, key) - case "url": - err = unpopulate(val, "URL", &l.URL) + err = unpopulate(val, "Type", &b.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) + return fmt.Errorf("unmarshalling type %T: %v", b, err) } } 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 BackupAutomaticAndOnDemandList. +func (b BackupAutomaticAndOnDemandList) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "message", n.Message) - populate(objectMap, "nameAvailable", n.NameAvailable) - populate(objectMap, "reason", n.Reason) + populate(objectMap, "nextLink", b.NextLink) + populate(objectMap, "value", b.Value) 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 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", n, err) + return fmt.Errorf("unmarshalling type %T: %v", b, err) } for key, val := range rawMsg { var err error switch key { - case "message": - err = unpopulate(val, "Message", &n.Message) - delete(rawMsg, key) - case "nameAvailable": - err = unpopulate(val, "NameAvailable", &n.NameAvailable) + case "nextLink": + err = unpopulate(val, "NextLink", &b.NextLink) delete(rawMsg, key) - case "reason": - err = unpopulate(val, "Reason", &n.Reason) + case "value": + err = unpopulate(val, "Value", &b.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) + return fmt.Errorf("unmarshalling type %T: %v", b, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type NameAvailabilityRequest. -func (n NameAvailabilityRequest) 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, "name", n.Name) - populate(objectMap, "type", n.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 NameAvailabilityRequest. -func (n *NameAvailabilityRequest) 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", n, 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", &n.Name) + case "backupType": + err = unpopulate(val, "BackupType", &b.BackupType) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &n.Type) + case "completedTime": + err = unpopulateDateTimeRFC3339(val, "CompletedTime", &b.CompletedTime) + delete(rawMsg, key) + case "source": + err = unpopulate(val, "Source", &b.Source) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) + return fmt.Errorf("unmarshalling type %T: %v", b, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type Operation. -func (o Operation) 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, "display", o.Display) - populate(objectMap, "name", o.Name) - populate(objectMap, "origin", o.Origin) - populate(objectMap, "properties", o.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 Operation. -func (o *Operation) 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", o, err) + return fmt.Errorf("unmarshalling type %T: %v", b, err) } for key, val := range rawMsg { var err error switch key { - case "display": - err = unpopulate(val, "Display", &o.Display) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &o.Name) + case "backupRetentionDays": + err = unpopulate(val, "BackupRetentionDays", &b.BackupRetentionDays) delete(rawMsg, key) - case "origin": - err = unpopulate(val, "Origin", &o.Origin) + case "earliestRestoreDate": + err = unpopulateDateTimeRFC3339(val, "EarliestRestoreDate", &b.EarliestRestoreDate) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &o.Properties) + case "geoRedundantBackup": + err = unpopulate(val, "GeoRedundantBackup", &b.GeoRedundantBackup) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", b, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type OperationDisplay. -func (o OperationDisplay) 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, "description", o.Description) - populate(objectMap, "operation", o.Operation) - populate(objectMap, "provider", o.Provider) - populate(objectMap, "resource", o.Resource) + populate(objectMap, "backupName", b.BackupName) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type OperationDisplay. -func (o *OperationDisplay) 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", o, err) + return fmt.Errorf("unmarshalling type %T: %v", b, err) } for key, val := range rawMsg { var err error switch key { - case "description": - err = unpopulate(val, "Description", &o.Description) - delete(rawMsg, key) - case "operation": - err = unpopulate(val, "Operation", &o.Operation) - delete(rawMsg, key) - case "provider": - err = unpopulate(val, "Provider", &o.Provider) - delete(rawMsg, key) - case "resource": - err = unpopulate(val, "Resource", &o.Resource) + case "backupName": + err = unpopulate(val, "BackupName", &b.BackupName) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", b, err) } } 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 BackupStoreDetails. +func (b BackupStoreDetails) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "value", o.Value) + populate(objectMap, "sasUriList", b.SasURIList) 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 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", o, err) + return fmt.Errorf("unmarshalling type %T: %v", b, err) } for key, val := range rawMsg { var err error switch key { - case "value": - err = unpopulate(val, "Value", &o.Value) + case "sasUriList": + err = unpopulate(val, "SasURIList", &b.SasURIList) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", b, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type PerformanceTierListResult. -func (p PerformanceTierListResult) 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, "value", p.Value) + 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 PerformanceTierListResult. -func (p *PerformanceTierListResult) 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", p, err) + return fmt.Errorf("unmarshalling type %T: %v", b, err) } for key, val := range rawMsg { var err error switch key { - case "value": - err = unpopulate(val, "Value", &p.Value) + 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", p, err) + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type BackupsLongTermRetentionRequest. +func (b BackupsLongTermRetentionRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "backupSettings", b.BackupSettings) + populate(objectMap, "targetDetails", b.TargetDetails) + return json.Marshal(objectMap) +} + +// 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", b, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "backupSettings": + err = unpopulate(val, "BackupSettings", &b.BackupSettings) + delete(rawMsg, key) + case "targetDetails": + err = unpopulate(val, "TargetDetails", &b.TargetDetails) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type BackupsLongTermRetentionResponse. +func (b BackupsLongTermRetentionResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "properties", b.Properties) + return json.Marshal(objectMap) +} + +// 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", b, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "properties": + err = unpopulate(val, "Properties", &b.Properties) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type BackupsLongTermRetentionResponseProperties. +func (b BackupsLongTermRetentionResponseProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "numberOfContainers", b.NumberOfContainers) + return json.Marshal(objectMap) +} + +// 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", b, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "numberOfContainers": + err = unpopulate(val, "NumberOfContainers", &b.NumberOfContainers) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Capability. +func (c Capability) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + 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 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", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "fastProvisioningSupported": + err = unpopulate(val, "FastProvisioningSupported", &c.FastProvisioningSupported) + delete(rawMsg, key) + case "geoBackupSupported": + err = unpopulate(val, "GeoBackupSupported", &c.GeoBackupSupported) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &c.Name) + delete(rawMsg, key) + 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", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CapabilityList. +func (c CapabilityList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", c.NextLink) + populate(objectMap, "value", c.Value) + return json.Marshal(objectMap) +} + +// 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", c, 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) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CapturedLog. +func (c CapturedLog) 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) + return json.Marshal(objectMap) +} + +// 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", c, 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) + 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", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CapturedLogList. +func (c CapturedLogList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", c.NextLink) + populate(objectMap, "value", c.Value) + return json.Marshal(objectMap) +} + +// 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", c, 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) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CapturedLogProperties. +func (c CapturedLogProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + 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 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", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "createdTime": + err = unpopulateDateTimeRFC3339(val, "CreatedTime", &c.CreatedTime) + delete(rawMsg, key) + case "lastModifiedTime": + err = unpopulateDateTimeRFC3339(val, "LastModifiedTime", &c.LastModifiedTime) + delete(rawMsg, key) + case "sizeInKb": + err = unpopulate(val, "SizeInKb", &c.SizeInKb) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &c.Type) + delete(rawMsg, key) + case "url": + err = unpopulate(val, "URL", &c.URL) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CheckNameAvailabilityRequest. +func (c CheckNameAvailabilityRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "name", c.Name) + populate(objectMap, "type", c.Type) + return json.Marshal(objectMap) +} + +// 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", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "name": + err = unpopulate(val, "Name", &c.Name) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &c.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Cluster. +func (c Cluster) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "clusterSize", c.ClusterSize) + populate(objectMap, "defaultDatabaseName", c.DefaultDatabaseName) + return json.Marshal(objectMap) +} + +// 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", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "clusterSize": + err = unpopulate(val, "ClusterSize", &c.ClusterSize) + delete(rawMsg, key) + case "defaultDatabaseName": + err = unpopulate(val, "DefaultDatabaseName", &c.DefaultDatabaseName) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Configuration. +func (c Configuration) 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) + return json.Marshal(objectMap) +} + +// 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", c, 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) + 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", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ConfigurationForUpdate. +func (c ConfigurationForUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "properties", c.Properties) + return json.Marshal(objectMap) +} + +// 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", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "properties": + err = unpopulate(val, "Properties", &c.Properties) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ConfigurationList. +func (c ConfigurationList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", c.NextLink) + populate(objectMap, "value", c.Value) + return json.Marshal(objectMap) +} + +// 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", c, 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) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ConfigurationProperties. +func (c ConfigurationProperties) 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) + return json.Marshal(objectMap) +} + +// 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", c, 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) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DataEncryption. +func (d DataEncryption) 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) + return json.Marshal(objectMap) +} + +// 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", d, 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) + delete(rawMsg, key) + 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", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Database. +func (d Database) 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) + return json.Marshal(objectMap) +} + +// 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", d, 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) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &d.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DatabaseList. +func (d DatabaseList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", d.NextLink) + populate(objectMap, "value", d.Value) + return json.Marshal(objectMap) +} + +// 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", d, 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) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DatabaseMigrationState. +func (d DatabaseMigrationState) 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) + return json.Marshal(objectMap) +} + +// 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", d, 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) + delete(rawMsg, key) + case "startedOn": + err = unpopulateDateTimeRFC3339(val, "StartedOn", &d.StartedOn) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DatabaseProperties. +func (d DatabaseProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "charset", d.Charset) + populate(objectMap, "collation", d.Collation) + return json.Marshal(objectMap) +} + +// 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", d, 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) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DbLevelValidationStatus. +func (d DbLevelValidationStatus) 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) + return json.Marshal(objectMap) +} + +// 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", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "databaseName": + err = unpopulate(val, "DatabaseName", &d.DatabaseName) + delete(rawMsg, key) + 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", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DbServerMetadata. +func (d DbServerMetadata) 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) + return json.Marshal(objectMap) +} + +// 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", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "location": + err = unpopulate(val, "Location", &d.Location) + delete(rawMsg, key) + case "sku": + err = unpopulate(val, "SKU", &d.SKU) + delete(rawMsg, key) + case "storageMb": + err = unpopulate(val, "StorageMb", &d.StorageMb) + delete(rawMsg, key) + case "version": + err = unpopulate(val, "Version", &d.Version) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DelegatedSubnetUsage. +func (d DelegatedSubnetUsage) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "subnetName", d.SubnetName) + populate(objectMap, "usage", d.Usage) + return json.Marshal(objectMap) +} + +// 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", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "subnetName": + err = unpopulate(val, "SubnetName", &d.SubnetName) + delete(rawMsg, key) + case "usage": + err = unpopulate(val, "Usage", &d.Usage) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type FastProvisioningEditionCapability. +func (f FastProvisioningEditionCapability) 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) + return json.Marshal(objectMap) +} + +// 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", f, 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) + delete(rawMsg, key) + case "supportedSku": + err = unpopulate(val, "SupportedSKU", &f.SupportedSKU) + delete(rawMsg, key) + 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", f, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type FirewallRule. +func (f FirewallRule) 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) + return json.Marshal(objectMap) +} + +// 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", f, 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) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &f.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type FirewallRuleList. +func (f FirewallRuleList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", f.NextLink) + populate(objectMap, "value", f.Value) + return json.Marshal(objectMap) +} + +// 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", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &f.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &f.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type FirewallRuleProperties. +func (f FirewallRuleProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "endIpAddress", f.EndIPAddress) + populate(objectMap, "startIpAddress", f.StartIPAddress) + return json.Marshal(objectMap) +} + +// 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", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + 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", f, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type HighAvailability. +func (h HighAvailability) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + 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 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", 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 HighAvailabilityForPatch. +func (h HighAvailabilityForPatch) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + 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 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) + } + 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) + 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 { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type LtrPreBackupRequest. +func (l LtrPreBackupRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "backupSettings", l.BackupSettings) + return json.Marshal(objectMap) +} + +// 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) + } + for key, val := range rawMsg { + var err error + switch key { + case "backupSettings": + err = unpopulate(val, "BackupSettings", &l.BackupSettings) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type LtrPreBackupResponse. +func (l LtrPreBackupResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "properties", l.Properties) + return json.Marshal(objectMap) +} + +// 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) + } + for key, val := range rawMsg { + var err error + switch key { + case "properties": + err = unpopulate(val, "Properties", &l.Properties) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type LtrServerBackupOperationList. +func (l LtrServerBackupOperationList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", l.NextLink) + populate(objectMap, "value", l.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LtrServerBackupOperationList. +func (l *LtrServerBackupOperationList) 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) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &l.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &l.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MaintenanceWindow. +func (m MaintenanceWindow) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + 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 MaintenanceWindow. +func (m *MaintenanceWindow) 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 "customWindow": + err = unpopulate(val, "CustomWindow", &m.CustomWindow) + delete(rawMsg, key) + case "dayOfWeek": + err = unpopulate(val, "DayOfWeek", &m.DayOfWeek) + delete(rawMsg, key) + case "startHour": + err = unpopulate(val, "StartHour", &m.StartHour) + delete(rawMsg, key) + case "startMinute": + err = unpopulate(val, "StartMinute", &m.StartMinute) + 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 MaintenanceWindowForPatch. +func (m MaintenanceWindowForPatch) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + 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 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) + } + for key, val := range rawMsg { + var err error + switch key { + case "customWindow": + err = unpopulate(val, "CustomWindow", &m.CustomWindow) + delete(rawMsg, key) + case "dayOfWeek": + err = unpopulate(val, "DayOfWeek", &m.DayOfWeek) + delete(rawMsg, key) + case "startHour": + err = unpopulate(val, "StartHour", &m.StartHour) + delete(rawMsg, key) + case "startMinute": + err = unpopulate(val, "StartMinute", &m.StartMinute) + 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 Migration. +func (m Migration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", m.ID) + populate(objectMap, "location", m.Location) + populate(objectMap, "name", m.Name) + populate(objectMap, "properties", m.Properties) + populate(objectMap, "systemData", m.SystemData) + populate(objectMap, "tags", m.Tags) + populate(objectMap, "type", m.Type) + return json.Marshal(objectMap) +} + +// 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) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &m.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &m.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &m.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &m.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &m.SystemData) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &m.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &m.Type) + 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 MigrationList. +func (m MigrationList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", m.NextLink) + populate(objectMap, "value", m.Value) + return json.Marshal(objectMap) +} + +// 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) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &m.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &m.Value) + 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 MigrationNameAvailability. +func (m MigrationNameAvailability) 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) + return json.Marshal(objectMap) +} + +// 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) + } + 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) + 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 { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// 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) + populate(objectMap, "dbsToCancelMigrationOn", m.DbsToCancelMigrationOn) + populate(objectMap, "dbsToMigrate", m.DbsToMigrate) + populate(objectMap, "dbsToTriggerCutoverOn", m.DbsToTriggerCutoverOn) + populate(objectMap, "migrateRoles", m.MigrateRoles) + populate(objectMap, "migrationId", m.MigrationID) + populate(objectMap, "migrationInstanceResourceId", m.MigrationInstanceResourceID) + populate(objectMap, "migrationMode", m.MigrationMode) + populate(objectMap, "migrationOption", m.MigrationOption) + populateDateTimeRFC3339(objectMap, "migrationWindowEndTimeInUtc", m.MigrationWindowEndTimeInUTC) + populateDateTimeRFC3339(objectMap, "migrationWindowStartTimeInUtc", m.MigrationWindowStartTimeInUTC) + populate(objectMap, "overwriteDbsInTarget", m.OverwriteDbsInTarget) + populate(objectMap, "sslMode", m.SSLMode) + populate(objectMap, "secretParameters", m.SecretParameters) + populate(objectMap, "setupLogicalReplicationOnSourceDbIfNeeded", m.SetupLogicalReplicationOnSourceDbIfNeeded) + populate(objectMap, "sourceDbServerFullyQualifiedDomainName", m.SourceDbServerFullyQualifiedDomainName) + populate(objectMap, "sourceDbServerMetadata", m.SourceDbServerMetadata) + populate(objectMap, "sourceDbServerResourceId", m.SourceDbServerResourceID) + populate(objectMap, "sourceType", m.SourceType) + populate(objectMap, "startDataMigration", m.StartDataMigration) + populate(objectMap, "targetDbServerFullyQualifiedDomainName", m.TargetDbServerFullyQualifiedDomainName) + populate(objectMap, "targetDbServerMetadata", m.TargetDbServerMetadata) + populate(objectMap, "targetDbServerResourceId", m.TargetDbServerResourceID) + populate(objectMap, "triggerCutover", m.TriggerCutover) + return json.Marshal(objectMap) +} + +// 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) + } + for key, val := range rawMsg { + var err error + switch key { + case "cancel": + err = unpopulate(val, "Cancel", &m.Cancel) + delete(rawMsg, key) + case "currentStatus": + err = unpopulate(val, "CurrentStatus", &m.CurrentStatus) + delete(rawMsg, key) + case "dbsToCancelMigrationOn": + err = unpopulate(val, "DbsToCancelMigrationOn", &m.DbsToCancelMigrationOn) + delete(rawMsg, key) + case "dbsToMigrate": + err = unpopulate(val, "DbsToMigrate", &m.DbsToMigrate) + delete(rawMsg, key) + case "dbsToTriggerCutoverOn": + err = unpopulate(val, "DbsToTriggerCutoverOn", &m.DbsToTriggerCutoverOn) + delete(rawMsg, key) + case "migrateRoles": + err = unpopulate(val, "MigrateRoles", &m.MigrateRoles) + delete(rawMsg, key) + case "migrationId": + err = unpopulate(val, "MigrationID", &m.MigrationID) + delete(rawMsg, key) + case "migrationInstanceResourceId": + err = unpopulate(val, "MigrationInstanceResourceID", &m.MigrationInstanceResourceID) + delete(rawMsg, key) + case "migrationMode": + err = unpopulate(val, "MigrationMode", &m.MigrationMode) + delete(rawMsg, key) + case "migrationOption": + err = unpopulate(val, "MigrationOption", &m.MigrationOption) + delete(rawMsg, key) + case "migrationWindowEndTimeInUtc": + err = unpopulateDateTimeRFC3339(val, "MigrationWindowEndTimeInUTC", &m.MigrationWindowEndTimeInUTC) + delete(rawMsg, key) + case "migrationWindowStartTimeInUtc": + err = unpopulateDateTimeRFC3339(val, "MigrationWindowStartTimeInUTC", &m.MigrationWindowStartTimeInUTC) + delete(rawMsg, key) + case "overwriteDbsInTarget": + err = unpopulate(val, "OverwriteDbsInTarget", &m.OverwriteDbsInTarget) + delete(rawMsg, key) + case "sslMode": + err = unpopulate(val, "SSLMode", &m.SSLMode) + delete(rawMsg, key) + case "secretParameters": + err = unpopulate(val, "SecretParameters", &m.SecretParameters) + delete(rawMsg, key) + case "setupLogicalReplicationOnSourceDbIfNeeded": + err = unpopulate(val, "SetupLogicalReplicationOnSourceDbIfNeeded", &m.SetupLogicalReplicationOnSourceDbIfNeeded) + delete(rawMsg, key) + case "sourceDbServerFullyQualifiedDomainName": + err = unpopulate(val, "SourceDbServerFullyQualifiedDomainName", &m.SourceDbServerFullyQualifiedDomainName) + delete(rawMsg, key) + case "sourceDbServerMetadata": + err = unpopulate(val, "SourceDbServerMetadata", &m.SourceDbServerMetadata) + delete(rawMsg, key) + case "sourceDbServerResourceId": + err = unpopulate(val, "SourceDbServerResourceID", &m.SourceDbServerResourceID) + delete(rawMsg, key) + case "sourceType": + err = unpopulate(val, "SourceType", &m.SourceType) + delete(rawMsg, key) + case "startDataMigration": + err = unpopulate(val, "StartDataMigration", &m.StartDataMigration) + delete(rawMsg, key) + case "targetDbServerFullyQualifiedDomainName": + err = unpopulate(val, "TargetDbServerFullyQualifiedDomainName", &m.TargetDbServerFullyQualifiedDomainName) + delete(rawMsg, key) + case "targetDbServerMetadata": + err = unpopulate(val, "TargetDbServerMetadata", &m.TargetDbServerMetadata) + delete(rawMsg, key) + case "targetDbServerResourceId": + err = unpopulate(val, "TargetDbServerResourceID", &m.TargetDbServerResourceID) + delete(rawMsg, key) + case "triggerCutover": + err = unpopulate(val, "TriggerCutover", &m.TriggerCutover) + 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 MigrationPropertiesForPatch. +func (m MigrationPropertiesForPatch) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "cancel", m.Cancel) + populate(objectMap, "dbsToCancelMigrationOn", m.DbsToCancelMigrationOn) + populate(objectMap, "dbsToMigrate", m.DbsToMigrate) + populate(objectMap, "dbsToTriggerCutoverOn", m.DbsToTriggerCutoverOn) + populate(objectMap, "migrateRoles", m.MigrateRoles) + populate(objectMap, "migrationMode", m.MigrationMode) + populateDateTimeRFC3339(objectMap, "migrationWindowStartTimeInUtc", m.MigrationWindowStartTimeInUTC) + populate(objectMap, "overwriteDbsInTarget", m.OverwriteDbsInTarget) + populate(objectMap, "secretParameters", m.SecretParameters) + populate(objectMap, "setupLogicalReplicationOnSourceDbIfNeeded", m.SetupLogicalReplicationOnSourceDbIfNeeded) + populate(objectMap, "sourceDbServerFullyQualifiedDomainName", m.SourceDbServerFullyQualifiedDomainName) + populate(objectMap, "sourceDbServerResourceId", m.SourceDbServerResourceID) + populate(objectMap, "startDataMigration", m.StartDataMigration) + populate(objectMap, "targetDbServerFullyQualifiedDomainName", m.TargetDbServerFullyQualifiedDomainName) + populate(objectMap, "triggerCutover", m.TriggerCutover) + return json.Marshal(objectMap) +} + +// 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) + } + for key, val := range rawMsg { + var err error + switch key { + case "cancel": + err = unpopulate(val, "Cancel", &m.Cancel) + delete(rawMsg, key) + case "dbsToCancelMigrationOn": + err = unpopulate(val, "DbsToCancelMigrationOn", &m.DbsToCancelMigrationOn) + delete(rawMsg, key) + case "dbsToMigrate": + err = unpopulate(val, "DbsToMigrate", &m.DbsToMigrate) + delete(rawMsg, key) + case "dbsToTriggerCutoverOn": + err = unpopulate(val, "DbsToTriggerCutoverOn", &m.DbsToTriggerCutoverOn) + delete(rawMsg, key) + case "migrateRoles": + err = unpopulate(val, "MigrateRoles", &m.MigrateRoles) + delete(rawMsg, key) + case "migrationMode": + err = unpopulate(val, "MigrationMode", &m.MigrationMode) + delete(rawMsg, key) + case "migrationWindowStartTimeInUtc": + err = unpopulateDateTimeRFC3339(val, "MigrationWindowStartTimeInUTC", &m.MigrationWindowStartTimeInUTC) + delete(rawMsg, key) + case "overwriteDbsInTarget": + err = unpopulate(val, "OverwriteDbsInTarget", &m.OverwriteDbsInTarget) + delete(rawMsg, key) + case "secretParameters": + err = unpopulate(val, "SecretParameters", &m.SecretParameters) + delete(rawMsg, key) + case "setupLogicalReplicationOnSourceDbIfNeeded": + err = unpopulate(val, "SetupLogicalReplicationOnSourceDbIfNeeded", &m.SetupLogicalReplicationOnSourceDbIfNeeded) + delete(rawMsg, key) + case "sourceDbServerFullyQualifiedDomainName": + err = unpopulate(val, "SourceDbServerFullyQualifiedDomainName", &m.SourceDbServerFullyQualifiedDomainName) + delete(rawMsg, key) + case "sourceDbServerResourceId": + err = unpopulate(val, "SourceDbServerResourceID", &m.SourceDbServerResourceID) + delete(rawMsg, key) + case "startDataMigration": + err = unpopulate(val, "StartDataMigration", &m.StartDataMigration) + delete(rawMsg, key) + case "targetDbServerFullyQualifiedDomainName": + err = unpopulate(val, "TargetDbServerFullyQualifiedDomainName", &m.TargetDbServerFullyQualifiedDomainName) + delete(rawMsg, key) + case "triggerCutover": + err = unpopulate(val, "TriggerCutover", &m.TriggerCutover) + 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 MigrationResourceForPatch. +func (m MigrationResourceForPatch) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + 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) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MigrationSecretParameters. +func (m *MigrationSecretParameters) 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 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) + populate(objectMap, "currentSubStateDetails", m.CurrentSubStateDetails) + populate(objectMap, "error", m.Error) + populate(objectMap, "state", m.State) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MigrationStatus. +func (m *MigrationStatus) 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 "currentSubStateDetails": + err = unpopulate(val, "CurrentSubStateDetails", &m.CurrentSubStateDetails) + delete(rawMsg, key) + case "error": + err = unpopulate(val, "Error", &m.Error) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &m.State) + 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 MigrationSubstateDetails. +func (m MigrationSubstateDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "currentSubState", m.CurrentSubState) + populate(objectMap, "dbDetails", m.DbDetails) + populate(objectMap, "validationDetails", m.ValidationDetails) + return json.Marshal(objectMap) +} + +// 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) + } + for key, val := range rawMsg { + var err error + switch key { + case "currentSubState": + err = unpopulate(val, "CurrentSubState", &m.CurrentSubState) + delete(rawMsg, key) + case "dbDetails": + err = unpopulate(val, "DbDetails", &m.DbDetails) + delete(rawMsg, key) + case "validationDetails": + err = unpopulate(val, "ValidationDetails", &m.ValidationDetails) + 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 NameAvailabilityModel. +func (n NameAvailabilityModel) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "message", n.Message) + populate(objectMap, "name", n.Name) + populate(objectMap, "nameAvailable", n.NameAvailable) + populate(objectMap, "reason", n.Reason) + populate(objectMap, "type", n.Type) + return json.Marshal(objectMap) +} + +// 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) + } + for key, val := range rawMsg { + var err error + switch key { + case "message": + err = unpopulate(val, "Message", &n.Message) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &n.Name) + delete(rawMsg, key) + case "nameAvailable": + err = unpopulate(val, "NameAvailable", &n.NameAvailable) + delete(rawMsg, key) + case "reason": + err = unpopulate(val, "Reason", &n.Reason) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &n.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NameProperty. +func (n NameProperty) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "localizedValue", n.LocalizedValue) + populate(objectMap, "value", n.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NameProperty. +func (n *NameProperty) 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) + } + for key, val := range rawMsg { + var err error + switch key { + case "localizedValue": + err = unpopulate(val, "LocalizedValue", &n.LocalizedValue) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &n.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Network. +func (n Network) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "delegatedSubnetResourceId", n.DelegatedSubnetResourceID) + populate(objectMap, "privateDnsZoneArmResourceId", n.PrivateDNSZoneArmResourceID) + populate(objectMap, "publicNetworkAccess", n.PublicNetworkAccess) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Network. +func (n *Network) 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) + } + for key, val := range rawMsg { + var err error + switch key { + case "delegatedSubnetResourceId": + err = unpopulate(val, "DelegatedSubnetResourceID", &n.DelegatedSubnetResourceID) + delete(rawMsg, key) + case "privateDnsZoneArmResourceId": + err = unpopulate(val, "PrivateDNSZoneArmResourceID", &n.PrivateDNSZoneArmResourceID) + delete(rawMsg, key) + case "publicNetworkAccess": + err = unpopulate(val, "PublicNetworkAccess", &n.PublicNetworkAccess) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + 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) + populate(objectMap, "display", o.Display) + populate(objectMap, "isDataAction", o.IsDataAction) + populate(objectMap, "name", o.Name) + populate(objectMap, "origin", o.Origin) + populate(objectMap, "properties", o.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Operation. +func (o *Operation) 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 "display": + err = unpopulate(val, "Display", &o.Display) + delete(rawMsg, key) + case "isDataAction": + err = unpopulate(val, "IsDataAction", &o.IsDataAction) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &o.Name) + delete(rawMsg, key) + case "origin": + err = unpopulate(val, "Origin", &o.Origin) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &o.Properties) + 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 OperationDisplay. +func (o OperationDisplay) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "description", o.Description) + populate(objectMap, "operation", o.Operation) + populate(objectMap, "provider", o.Provider) + populate(objectMap, "resource", o.Resource) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationDisplay. +func (o *OperationDisplay) 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 "description": + err = unpopulate(val, "Description", &o.Description) + delete(rawMsg, key) + case "operation": + err = unpopulate(val, "Operation", &o.Operation) + delete(rawMsg, key) + case "provider": + err = unpopulate(val, "Provider", &o.Provider) + delete(rawMsg, key) + case "resource": + err = unpopulate(val, "Resource", &o.Resource) + 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 PerformanceTierProperties. -func (p PerformanceTierProperties) 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, "id", p.ID) - populate(objectMap, "maxBackupRetentionDays", p.MaxBackupRetentionDays) - populate(objectMap, "maxLargeStorageMB", p.MaxLargeStorageMB) - populate(objectMap, "maxStorageMB", p.MaxStorageMB) - populate(objectMap, "minBackupRetentionDays", p.MinBackupRetentionDays) - populate(objectMap, "minLargeStorageMB", p.MinLargeStorageMB) - populate(objectMap, "minStorageMB", p.MinStorageMB) - populate(objectMap, "serviceLevelObjectives", p.ServiceLevelObjectives) + populate(objectMap, "nextLink", o.NextLink) + populate(objectMap, "value", o.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PerformanceTierProperties. -func (p *PerformanceTierProperties) 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", p, err) + 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", &p.ID) - delete(rawMsg, key) - case "maxBackupRetentionDays": - err = unpopulate(val, "MaxBackupRetentionDays", &p.MaxBackupRetentionDays) - delete(rawMsg, key) - case "maxLargeStorageMB": - err = unpopulate(val, "MaxLargeStorageMB", &p.MaxLargeStorageMB) - delete(rawMsg, key) - case "maxStorageMB": - err = unpopulate(val, "MaxStorageMB", &p.MaxStorageMB) - delete(rawMsg, key) - case "minBackupRetentionDays": - err = unpopulate(val, "MinBackupRetentionDays", &p.MinBackupRetentionDays) - delete(rawMsg, key) - case "minLargeStorageMB": - err = unpopulate(val, "MinLargeStorageMB", &p.MinLargeStorageMB) - delete(rawMsg, key) - case "minStorageMB": - err = unpopulate(val, "MinStorageMB", &p.MinStorageMB) + case "nextLink": + err = unpopulate(val, "NextLink", &o.NextLink) delete(rawMsg, key) - case "serviceLevelObjectives": - err = unpopulate(val, "ServiceLevelObjectives", &p.ServiceLevelObjectives) + case "value": + err = unpopulate(val, "Value", &o.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type PerformanceTierServiceLevelObjectives. -func (p PerformanceTierServiceLevelObjectives) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PrivateEndpoint. +func (p PrivateEndpoint) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "edition", p.Edition) - populate(objectMap, "hardwareGeneration", p.HardwareGeneration) populate(objectMap, "id", p.ID) - populate(objectMap, "maxBackupRetentionDays", p.MaxBackupRetentionDays) - populate(objectMap, "maxStorageMB", p.MaxStorageMB) - populate(objectMap, "minBackupRetentionDays", p.MinBackupRetentionDays) - populate(objectMap, "minStorageMB", p.MinStorageMB) - populate(objectMap, "vCore", p.VCore) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PerformanceTierServiceLevelObjectives. -func (p *PerformanceTierServiceLevelObjectives) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpoint. +func (p *PrivateEndpoint) 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) @@ -778,30 +3086,9 @@ func (p *PerformanceTierServiceLevelObjectives) UnmarshalJSON(data []byte) error for key, val := range rawMsg { var err error switch key { - case "edition": - err = unpopulate(val, "Edition", &p.Edition) - delete(rawMsg, key) - case "hardwareGeneration": - err = unpopulate(val, "HardwareGeneration", &p.HardwareGeneration) - delete(rawMsg, key) case "id": err = unpopulate(val, "ID", &p.ID) delete(rawMsg, key) - case "maxBackupRetentionDays": - err = unpopulate(val, "MaxBackupRetentionDays", &p.MaxBackupRetentionDays) - delete(rawMsg, key) - case "maxStorageMB": - err = unpopulate(val, "MaxStorageMB", &p.MaxStorageMB) - delete(rawMsg, key) - case "minBackupRetentionDays": - err = unpopulate(val, "MinBackupRetentionDays", &p.MinBackupRetentionDays) - delete(rawMsg, key) - case "minStorageMB": - err = unpopulate(val, "MinStorageMB", &p.MinStorageMB) - delete(rawMsg, key) - case "vCore": - err = unpopulate(val, "VCore", &p.VCore) - delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", p, err) @@ -816,6 +3103,7 @@ func (p PrivateEndpointConnection) MarshalJSON() ([]byte, error) { populate(objectMap, "id", p.ID) populate(objectMap, "name", p.Name) populate(objectMap, "properties", p.Properties) + populate(objectMap, "systemData", p.SystemData) populate(objectMap, "type", p.Type) return json.Marshal(objectMap) } @@ -838,6 +3126,9 @@ func (p *PrivateEndpointConnection) UnmarshalJSON(data []byte) error { case "properties": err = unpopulate(val, "Properties", &p.Properties) delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &p.SystemData) + delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &p.Type) delete(rawMsg, key) @@ -849,16 +3140,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) @@ -883,6 +3174,7 @@ func (p *PrivateEndpointConnectionListResult) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnectionProperties. func (p PrivateEndpointConnectionProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "groupIds", p.GroupIDs) populate(objectMap, "privateEndpoint", p.PrivateEndpoint) populate(objectMap, "privateLinkServiceConnectionState", p.PrivateLinkServiceConnectionState) populate(objectMap, "provisioningState", p.ProvisioningState) @@ -898,6 +3190,9 @@ func (p *PrivateEndpointConnectionProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "groupIds": + err = unpopulate(val, "GroupIDs", &p.GroupIDs) + delete(rawMsg, key) case "privateEndpoint": err = unpopulate(val, "PrivateEndpoint", &p.PrivateEndpoint) delete(rawMsg, key) @@ -915,39 +3210,13 @@ func (p *PrivateEndpointConnectionProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointProperty. -func (p PrivateEndpointProperty) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", p.ID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointProperty. -func (p *PrivateEndpointProperty) 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) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &p.ID) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - // MarshalJSON implements the json.Marshaller interface for type PrivateLinkResource. func (p PrivateLinkResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", p.ID) populate(objectMap, "name", p.Name) populate(objectMap, "properties", p.Properties) + populate(objectMap, "systemData", p.SystemData) populate(objectMap, "type", p.Type) return json.Marshal(objectMap) } @@ -970,6 +3239,9 @@ func (p *PrivateLinkResource) UnmarshalJSON(data []byte) error { case "properties": err = unpopulate(val, "Properties", &p.Properties) delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &p.SystemData) + delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &p.Type) delete(rawMsg, key) @@ -981,16 +3253,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) @@ -1017,6 +3289,7 @@ func (p PrivateLinkResourceProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "groupId", p.GroupID) populate(objectMap, "requiredMembers", p.RequiredMembers) + populate(objectMap, "requiredZoneNames", p.RequiredZoneNames) return json.Marshal(objectMap) } @@ -1035,6 +3308,9 @@ func (p *PrivateLinkResourceProperties) UnmarshalJSON(data []byte) error { case "requiredMembers": err = unpopulate(val, "RequiredMembers", &p.RequiredMembers) delete(rawMsg, key) + case "requiredZoneNames": + err = unpopulate(val, "RequiredZoneNames", &p.RequiredZoneNames) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", p, err) @@ -1043,8 +3319,8 @@ func (p *PrivateLinkResourceProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type PrivateLinkServiceConnectionStateProperty. -func (p PrivateLinkServiceConnectionStateProperty) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PrivateLinkServiceConnectionState. +func (p PrivateLinkServiceConnectionState) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "actionsRequired", p.ActionsRequired) populate(objectMap, "description", p.Description) @@ -1052,8 +3328,8 @@ func (p PrivateLinkServiceConnectionStateProperty) MarshalJSON() ([]byte, error) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkServiceConnectionStateProperty. -func (p *PrivateLinkServiceConnectionStateProperty) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkServiceConnectionState. +func (p *PrivateLinkServiceConnectionState) 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) @@ -1078,397 +3354,164 @@ func (p *PrivateLinkServiceConnectionStateProperty) UnmarshalJSON(data []byte) e return nil } -// MarshalJSON implements the json.Marshaller interface for type ProxyResource. -func (p ProxyResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", p.ID) - populate(objectMap, "name", p.Name) - populate(objectMap, "type", p.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ProxyResource. -func (p *ProxyResource) 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) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &p.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &p.Name) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &p.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type RecoverableServerProperties. -func (r RecoverableServerProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type QuotaUsage. +func (q QuotaUsage) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "edition", r.Edition) - populate(objectMap, "hardwareGeneration", r.HardwareGeneration) - populate(objectMap, "lastAvailableBackupDateTime", r.LastAvailableBackupDateTime) - populate(objectMap, "serviceLevelObjective", r.ServiceLevelObjective) - populate(objectMap, "vCore", r.VCore) - populate(objectMap, "version", r.Version) + populate(objectMap, "currentValue", q.CurrentValue) + populate(objectMap, "id", q.ID) + populate(objectMap, "limit", q.Limit) + populate(objectMap, "name", q.Name) + populate(objectMap, "unit", q.Unit) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type RecoverableServerProperties. -func (r *RecoverableServerProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type QuotaUsage. +func (q *QuotaUsage) 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", r, err) + return fmt.Errorf("unmarshalling type %T: %v", q, err) } for key, val := range rawMsg { var err error switch key { - case "edition": - err = unpopulate(val, "Edition", &r.Edition) - delete(rawMsg, key) - case "hardwareGeneration": - err = unpopulate(val, "HardwareGeneration", &r.HardwareGeneration) - delete(rawMsg, key) - case "lastAvailableBackupDateTime": - err = unpopulate(val, "LastAvailableBackupDateTime", &r.LastAvailableBackupDateTime) - delete(rawMsg, key) - case "serviceLevelObjective": - err = unpopulate(val, "ServiceLevelObjective", &r.ServiceLevelObjective) + case "currentValue": + err = unpopulate(val, "CurrentValue", &q.CurrentValue) delete(rawMsg, key) - case "vCore": - err = unpopulate(val, "VCore", &r.VCore) - delete(rawMsg, key) - case "version": - err = unpopulate(val, "Version", &r.Version) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type RecoverableServerResource. -func (r RecoverableServerResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", r.ID) - populate(objectMap, "name", r.Name) - populate(objectMap, "properties", r.Properties) - populate(objectMap, "type", r.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RecoverableServerResource. -func (r *RecoverableServerResource) 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", r, err) - } - for key, val := range rawMsg { - var err error - switch key { case "id": - err = unpopulate(val, "ID", &r.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &r.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &r.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &r.Type) + err = unpopulate(val, "ID", &q.ID) delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type Resource. -func (r Resource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", r.ID) - populate(objectMap, "name", r.Name) - populate(objectMap, "type", r.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type Resource. -func (r *Resource) 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", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &r.ID) + case "limit": + err = unpopulate(val, "Limit", &q.Limit) delete(rawMsg, key) case "name": - err = unpopulate(val, "Name", &r.Name) + err = unpopulate(val, "Name", &q.Name) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &r.Type) + case "unit": + err = unpopulate(val, "Unit", &q.Unit) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", q, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ResourceIdentity. -func (r ResourceIdentity) 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, "principalId", r.PrincipalID) - populate(objectMap, "tenantId", r.TenantID) - populate(objectMap, "type", r.Type) + populate(objectMap, "nextLink", q.NextLink) + populate(objectMap, "value", q.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceIdentity. -func (r *ResourceIdentity) 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", r, err) + return fmt.Errorf("unmarshalling type %T: %v", q, err) } for key, val := range rawMsg { var err error switch key { - case "principalId": - err = unpopulate(val, "PrincipalID", &r.PrincipalID) - delete(rawMsg, key) - case "tenantId": - err = unpopulate(val, "TenantID", &r.TenantID) + case "nextLink": + err = unpopulate(val, "NextLink", &q.NextLink) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &r.Type) + case "value": + err = unpopulate(val, "Value", &q.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", q, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type SKU. -func (s SKU) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type Replica. +func (r Replica) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "capacity", s.Capacity) - populate(objectMap, "family", s.Family) - populate(objectMap, "name", s.Name) - populate(objectMap, "size", s.Size) - populate(objectMap, "tier", s.Tier) + populate(objectMap, "capacity", r.Capacity) + populate(objectMap, "promoteMode", r.PromoteMode) + populate(objectMap, "promoteOption", r.PromoteOption) + populate(objectMap, "replicationState", r.ReplicationState) + populate(objectMap, "role", r.Role) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type SKU. -func (s *SKU) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type Replica. +func (r *Replica) 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) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } for key, val := range rawMsg { var err error switch key { case "capacity": - err = unpopulate(val, "Capacity", &s.Capacity) - delete(rawMsg, key) - case "family": - err = unpopulate(val, "Family", &s.Family) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &s.Name) - delete(rawMsg, key) - case "size": - err = unpopulate(val, "Size", &s.Size) - 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 SecurityAlertPolicyProperties. -func (s SecurityAlertPolicyProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "disabledAlerts", s.DisabledAlerts) - populate(objectMap, "emailAccountAdmins", s.EmailAccountAdmins) - populate(objectMap, "emailAddresses", s.EmailAddresses) - populate(objectMap, "retentionDays", s.RetentionDays) - populate(objectMap, "state", s.State) - populate(objectMap, "storageAccountAccessKey", s.StorageAccountAccessKey) - populate(objectMap, "storageEndpoint", s.StorageEndpoint) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SecurityAlertPolicyProperties. -func (s *SecurityAlertPolicyProperties) 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 "disabledAlerts": - err = unpopulate(val, "DisabledAlerts", &s.DisabledAlerts) - delete(rawMsg, key) - case "emailAccountAdmins": - err = unpopulate(val, "EmailAccountAdmins", &s.EmailAccountAdmins) - delete(rawMsg, key) - case "emailAddresses": - err = unpopulate(val, "EmailAddresses", &s.EmailAddresses) - delete(rawMsg, key) - case "retentionDays": - err = unpopulate(val, "RetentionDays", &s.RetentionDays) - delete(rawMsg, key) - case "state": - err = unpopulate(val, "State", &s.State) - delete(rawMsg, key) - case "storageAccountAccessKey": - err = unpopulate(val, "StorageAccountAccessKey", &s.StorageAccountAccessKey) - delete(rawMsg, key) - case "storageEndpoint": - err = unpopulate(val, "StorageEndpoint", &s.StorageEndpoint) - 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 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, "tags", s.Tags) - populate(objectMap, "type", s.Type) - return json.Marshal(objectMap) -} - -// 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) - } - 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) + err = unpopulate(val, "Capacity", &r.Capacity) 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) + case "promoteMode": + err = unpopulate(val, "PromoteMode", &r.PromoteMode) delete(rawMsg, key) - case "sku": - err = unpopulate(val, "SKU", &s.SKU) + case "promoteOption": + err = unpopulate(val, "PromoteOption", &r.PromoteOption) delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &s.Tags) + case "replicationState": + err = unpopulate(val, "ReplicationState", &r.ReplicationState) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &s.Type) + case "role": + err = unpopulate(val, "Role", &r.Role) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ServerAdministratorProperties. -func (s ServerAdministratorProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type RestartParameter. +func (r RestartParameter) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - objectMap["administratorType"] = "ActiveDirectory" - populate(objectMap, "login", s.Login) - populate(objectMap, "sid", s.Sid) - populate(objectMap, "tenantId", s.TenantID) + populate(objectMap, "failoverMode", r.FailoverMode) + populate(objectMap, "restartWithFailover", r.RestartWithFailover) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ServerAdministratorProperties. -func (s *ServerAdministratorProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type RestartParameter. +func (r *RestartParameter) 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) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } for key, val := range rawMsg { var err error switch key { - case "administratorType": - err = unpopulate(val, "AdministratorType", &s.AdministratorType) - delete(rawMsg, key) - case "login": - err = unpopulate(val, "Login", &s.Login) - delete(rawMsg, key) - case "sid": - err = unpopulate(val, "Sid", &s.Sid) + case "failoverMode": + err = unpopulate(val, "FailoverMode", &r.FailoverMode) delete(rawMsg, key) - case "tenantId": - err = unpopulate(val, "TenantID", &s.TenantID) + case "restartWithFailover": + err = unpopulate(val, "RestartWithFailover", &r.RestartWithFailover) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ServerAdministratorResource. -func (s ServerAdministratorResource) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type SKU. +func (s SKU) 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, "type", s.Type) + populate(objectMap, "tier", s.Tier) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ServerAdministratorResource. -func (s *ServerAdministratorResource) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type SKU. +func (s *SKU) 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) @@ -1476,17 +3519,11 @@ func (s *ServerAdministratorResource) 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 "name": err = unpopulate(val, "Name", &s.Name) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &s.Properties) - 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 { @@ -1496,15 +3533,16 @@ func (s *ServerAdministratorResource) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ServerAdministratorResourceListResult. -func (s ServerAdministratorResourceListResult) 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, "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 ServerAdministratorResourceListResult. -func (s *ServerAdministratorResourceListResult) 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) @@ -1512,8 +3550,11 @@ func (s *ServerAdministratorResourceListResult) UnmarshalJSON(data []byte) error for key, val := range rawMsg { var err error switch key { - case "value": - err = unpopulate(val, "Value", &s.Value) + 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 { @@ -1523,19 +3564,23 @@ func (s *ServerAdministratorResourceListResult) UnmarshalJSON(data []byte) error return nil } -// MarshalJSON implements the json.Marshaller interface for type ServerForCreate. -func (s ServerForCreate) 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 ServerForCreate. -func (s *ServerForCreate) 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) @@ -1543,21 +3588,33 @@ func (s *ServerForCreate) 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": - s.Properties, err = unmarshalServerPropertiesForCreateClassification(val) + 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) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) @@ -1566,19 +3623,20 @@ func (s *ServerForCreate) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ServerKey. -func (s ServerKey) 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, "id", s.ID) - populate(objectMap, "kind", s.Kind) + populate(objectMap, "defaultSkuName", s.DefaultSKUName) populate(objectMap, "name", s.Name) - populate(objectMap, "properties", s.Properties) - populate(objectMap, "type", s.Type) + 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 ServerKey. -func (s *ServerKey) 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) @@ -1586,20 +3644,62 @@ func (s *ServerKey) 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 "kind": - err = unpopulate(val, "Kind", &s.Kind) + case "defaultSkuName": + err = unpopulate(val, "DefaultSKUName", &s.DefaultSKUName) delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &s.Name) delete(rawMsg, key) + case "reason": + err = unpopulate(val, "Reason", &s.Reason) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &s.Status) + delete(rawMsg, key) + 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 { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// 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) + populate(objectMap, "sku", s.SKU) + populate(objectMap, "tags", s.Tags) + return json.Marshal(objectMap) +} + +// 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) + } + for key, val := range rawMsg { + var err error + switch key { + case "identity": + err = unpopulate(val, "Identity", &s.Identity) + delete(rawMsg, key) case "properties": err = unpopulate(val, "Properties", &s.Properties) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &s.Type) + case "sku": + err = unpopulate(val, "SKU", &s.SKU) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &s.Tags) delete(rawMsg, key) } if err != nil { @@ -1609,16 +3709,16 @@ func (s *ServerKey) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ServerKeyListResult. -func (s ServerKeyListResult) 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 ServerKeyListResult. -func (s *ServerKeyListResult) 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) @@ -1640,17 +3740,36 @@ func (s *ServerKeyListResult) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ServerKeyProperties. -func (s ServerKeyProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ServerProperties. +func (s ServerProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populateDateTimeRFC3339(objectMap, "creationDate", s.CreationDate) - populate(objectMap, "serverKeyType", s.ServerKeyType) - populate(objectMap, "uri", s.URI) + 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, "fullyQualifiedDomainName", s.FullyQualifiedDomainName) + populate(objectMap, "highAvailability", s.HighAvailability) + populate(objectMap, "maintenanceWindow", s.MaintenanceWindow) + populate(objectMap, "minorVersion", s.MinorVersion) + populate(objectMap, "network", s.Network) + populateDateTimeRFC3339(objectMap, "pointInTimeUTC", s.PointInTimeUTC) + populate(objectMap, "privateEndpointConnections", s.PrivateEndpointConnections) + populate(objectMap, "replica", s.Replica) + populate(objectMap, "replicaCapacity", s.ReplicaCapacity) + populate(objectMap, "replicationRole", s.ReplicationRole) + populate(objectMap, "sourceServerResourceId", s.SourceServerResourceID) + populate(objectMap, "state", s.State) + populate(objectMap, "storage", s.Storage) + populate(objectMap, "version", s.Version) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ServerKeyProperties. -func (s *ServerKeyProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerProperties. +func (s *ServerProperties) 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) @@ -1658,14 +3777,71 @@ func (s *ServerKeyProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "creationDate": - err = unpopulateDateTimeRFC3339(val, "CreationDate", &s.CreationDate) + 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 "availabilityZone": + err = unpopulate(val, "AvailabilityZone", &s.AvailabilityZone) + 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 "fullyQualifiedDomainName": + err = unpopulate(val, "FullyQualifiedDomainName", &s.FullyQualifiedDomainName) + 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 "minorVersion": + err = unpopulate(val, "MinorVersion", &s.MinorVersion) + delete(rawMsg, key) + case "network": + err = unpopulate(val, "Network", &s.Network) + delete(rawMsg, key) + case "pointInTimeUTC": + err = unpopulateDateTimeRFC3339(val, "PointInTimeUTC", &s.PointInTimeUTC) + delete(rawMsg, key) + case "privateEndpointConnections": + err = unpopulate(val, "PrivateEndpointConnections", &s.PrivateEndpointConnections) + delete(rawMsg, key) + case "replica": + err = unpopulate(val, "Replica", &s.Replica) + delete(rawMsg, key) + case "replicaCapacity": + err = unpopulate(val, "ReplicaCapacity", &s.ReplicaCapacity) + delete(rawMsg, key) + case "replicationRole": + err = unpopulate(val, "ReplicationRole", &s.ReplicationRole) delete(rawMsg, key) - case "serverKeyType": - err = unpopulate(val, "ServerKeyType", &s.ServerKeyType) + case "sourceServerResourceId": + err = unpopulate(val, "SourceServerResourceID", &s.SourceServerResourceID) delete(rawMsg, key) - case "uri": - err = unpopulate(val, "URI", &s.URI) + 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 { @@ -1675,15 +3851,29 @@ func (s *ServerKeyProperties) 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 ServerPropertiesForPatch. +func (s ServerPropertiesForPatch) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "value", s.Value) + 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 ServerListResult. -func (s *ServerListResult) 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) @@ -1691,8 +3881,50 @@ func (s *ServerListResult) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "value": - err = unpopulate(val, "Value", &s.Value) + 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 "availabilityZone": + err = unpopulate(val, "AvailabilityZone", &s.AvailabilityZone) + 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 { @@ -1702,16 +3934,16 @@ func (s *ServerListResult) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ServerPrivateEndpointConnection. -func (s ServerPrivateEndpointConnection) 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, "id", s.ID) - populate(objectMap, "properties", s.Properties) + populate(objectMap, "name", s.Name) + populate(objectMap, "tier", s.Tier) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ServerPrivateEndpointConnection. -func (s *ServerPrivateEndpointConnection) 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) @@ -1719,11 +3951,11 @@ func (s *ServerPrivateEndpointConnection) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &s.ID) + case "name": + err = unpopulate(val, "Name", &s.Name) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &s.Properties) + case "tier": + err = unpopulate(val, "Tier", &s.Tier) delete(rawMsg, key) } if err != nil { @@ -1733,17 +3965,24 @@ func (s *ServerPrivateEndpointConnection) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ServerPrivateEndpointConnectionProperties. -func (s ServerPrivateEndpointConnectionProperties) 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, "privateEndpoint", s.PrivateEndpoint) - populate(objectMap, "privateLinkServiceConnectionState", s.PrivateLinkServiceConnectionState) - populate(objectMap, "provisioningState", s.ProvisioningState) + 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 ServerPrivateEndpointConnectionProperties. -func (s *ServerPrivateEndpointConnectionProperties) 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) @@ -1751,14 +3990,35 @@ func (s *ServerPrivateEndpointConnectionProperties) UnmarshalJSON(data []byte) e for key, val := range rawMsg { var err error switch key { - case "privateEndpoint": - err = unpopulate(val, "PrivateEndpoint", &s.PrivateEndpoint) + case "name": + err = unpopulate(val, "Name", &s.Name) delete(rawMsg, key) - case "privateLinkServiceConnectionState": - err = unpopulate(val, "PrivateLinkServiceConnectionState", &s.PrivateLinkServiceConnectionState) + case "reason": + err = unpopulate(val, "Reason", &s.Reason) delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &s.ProvisioningState) + 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 { @@ -1768,17 +4028,19 @@ func (s *ServerPrivateEndpointConnectionProperties) UnmarshalJSON(data []byte) e return nil } -// MarshalJSON implements the json.Marshaller interface for type ServerPrivateLinkServiceConnectionStateProperty. -func (s ServerPrivateLinkServiceConnectionStateProperty) 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, "actionsRequired", s.ActionsRequired) - populate(objectMap, "description", s.Description) + 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 ServerPrivateLinkServiceConnectionStateProperty. -func (s *ServerPrivateLinkServiceConnectionStateProperty) 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) @@ -1786,15 +4048,21 @@ func (s *ServerPrivateLinkServiceConnectionStateProperty) UnmarshalJSON(data []b for key, val := range rawMsg { var err error switch key { - case "actionsRequired": - err = unpopulate(val, "ActionsRequired", &s.ActionsRequired) + case "name": + err = unpopulate(val, "Name", &s.Name) delete(rawMsg, key) - case "description": - err = unpopulate(val, "Description", &s.Description) + case "reason": + err = unpopulate(val, "Reason", &s.Reason) 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 "supportedVersionsToUpgrade": + err = unpopulate(val, "SupportedVersionsToUpgrade", &s.SupportedVersionsToUpgrade) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) @@ -1803,29 +4071,20 @@ func (s *ServerPrivateLinkServiceConnectionStateProperty) UnmarshalJSON(data []b return nil } -// MarshalJSON implements the json.Marshaller interface for type ServerProperties. -func (s ServerProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type Storage. +func (s Storage) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "administratorLogin", s.AdministratorLogin) - populate(objectMap, "byokEnforcement", s.ByokEnforcement) - populateDateTimeRFC3339(objectMap, "earliestRestoreDate", s.EarliestRestoreDate) - populate(objectMap, "fullyQualifiedDomainName", s.FullyQualifiedDomainName) - populate(objectMap, "infrastructureEncryption", s.InfrastructureEncryption) - populate(objectMap, "masterServerId", s.MasterServerID) - populate(objectMap, "minimalTlsVersion", s.MinimalTLSVersion) - populate(objectMap, "privateEndpointConnections", s.PrivateEndpointConnections) - populate(objectMap, "publicNetworkAccess", s.PublicNetworkAccess) - populate(objectMap, "replicaCapacity", s.ReplicaCapacity) - populate(objectMap, "replicationRole", s.ReplicationRole) - populate(objectMap, "sslEnforcement", s.SSLEnforcement) - populate(objectMap, "storageProfile", s.StorageProfile) - populate(objectMap, "userVisibleState", s.UserVisibleState) - populate(objectMap, "version", s.Version) + populate(objectMap, "autoGrow", s.AutoGrow) + populate(objectMap, "iops", s.Iops) + populate(objectMap, "storageSizeGB", s.StorageSizeGB) + populate(objectMap, "throughput", s.Throughput) + populate(objectMap, "tier", s.Tier) + populate(objectMap, "type", s.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ServerProperties. -func (s *ServerProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type Storage. +func (s *Storage) 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) @@ -1833,50 +4092,23 @@ func (s *ServerProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "administratorLogin": - err = unpopulate(val, "AdministratorLogin", &s.AdministratorLogin) - delete(rawMsg, key) - case "byokEnforcement": - err = unpopulate(val, "ByokEnforcement", &s.ByokEnforcement) - delete(rawMsg, key) - case "earliestRestoreDate": - err = unpopulateDateTimeRFC3339(val, "EarliestRestoreDate", &s.EarliestRestoreDate) - delete(rawMsg, key) - case "fullyQualifiedDomainName": - err = unpopulate(val, "FullyQualifiedDomainName", &s.FullyQualifiedDomainName) - delete(rawMsg, key) - case "infrastructureEncryption": - err = unpopulate(val, "InfrastructureEncryption", &s.InfrastructureEncryption) - delete(rawMsg, key) - case "masterServerId": - err = unpopulate(val, "MasterServerID", &s.MasterServerID) + case "autoGrow": + err = unpopulate(val, "AutoGrow", &s.AutoGrow) delete(rawMsg, key) - case "minimalTlsVersion": - err = unpopulate(val, "MinimalTLSVersion", &s.MinimalTLSVersion) + case "iops": + err = unpopulate(val, "Iops", &s.Iops) delete(rawMsg, key) - case "privateEndpointConnections": - err = unpopulate(val, "PrivateEndpointConnections", &s.PrivateEndpointConnections) - delete(rawMsg, key) - case "publicNetworkAccess": - err = unpopulate(val, "PublicNetworkAccess", &s.PublicNetworkAccess) - delete(rawMsg, key) - case "replicaCapacity": - err = unpopulate(val, "ReplicaCapacity", &s.ReplicaCapacity) - delete(rawMsg, key) - case "replicationRole": - err = unpopulate(val, "ReplicationRole", &s.ReplicationRole) - delete(rawMsg, key) - case "sslEnforcement": - err = unpopulate(val, "SSLEnforcement", &s.SSLEnforcement) - delete(rawMsg, key) - case "storageProfile": - err = unpopulate(val, "StorageProfile", &s.StorageProfile) + case "storageSizeGB": + err = unpopulate(val, "StorageSizeGB", &s.StorageSizeGB) delete(rawMsg, key) - case "userVisibleState": - err = unpopulate(val, "UserVisibleState", &s.UserVisibleState) + case "throughput": + err = unpopulate(val, "Throughput", &s.Throughput) delete(rawMsg, key) - case "version": - err = unpopulate(val, "Version", &s.Version) + case "tier": + err = unpopulate(val, "Tier", &s.Tier) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &s.Type) delete(rawMsg, key) } if err != nil { @@ -1886,21 +4118,19 @@ func (s *ServerProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ServerPropertiesForCreate. -func (s ServerPropertiesForCreate) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type StorageEditionCapability. +func (s StorageEditionCapability) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - objectMap["createMode"] = s.CreateMode - populate(objectMap, "infrastructureEncryption", s.InfrastructureEncryption) - populate(objectMap, "minimalTlsVersion", s.MinimalTLSVersion) - populate(objectMap, "publicNetworkAccess", s.PublicNetworkAccess) - populate(objectMap, "sslEnforcement", s.SSLEnforcement) - populate(objectMap, "storageProfile", s.StorageProfile) - populate(objectMap, "version", s.Version) + populate(objectMap, "defaultStorageSizeMb", s.DefaultStorageSizeMb) + populate(objectMap, "name", s.Name) + populate(objectMap, "reason", s.Reason) + populate(objectMap, "status", s.Status) + populate(objectMap, "supportedStorageMb", s.SupportedStorageMb) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ServerPropertiesForCreate. -func (s *ServerPropertiesForCreate) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type StorageEditionCapability. +func (s *StorageEditionCapability) 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) @@ -1908,26 +4138,20 @@ func (s *ServerPropertiesForCreate) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "createMode": - err = unpopulate(val, "CreateMode", &s.CreateMode) + case "defaultStorageSizeMb": + err = unpopulate(val, "DefaultStorageSizeMb", &s.DefaultStorageSizeMb) delete(rawMsg, key) - case "infrastructureEncryption": - err = unpopulate(val, "InfrastructureEncryption", &s.InfrastructureEncryption) - delete(rawMsg, key) - case "minimalTlsVersion": - err = unpopulate(val, "MinimalTLSVersion", &s.MinimalTLSVersion) - delete(rawMsg, key) - case "publicNetworkAccess": - err = unpopulate(val, "PublicNetworkAccess", &s.PublicNetworkAccess) + case "name": + err = unpopulate(val, "Name", &s.Name) delete(rawMsg, key) - case "sslEnforcement": - err = unpopulate(val, "SSLEnforcement", &s.SSLEnforcement) + case "reason": + err = unpopulate(val, "Reason", &s.Reason) delete(rawMsg, key) - case "storageProfile": - err = unpopulate(val, "StorageProfile", &s.StorageProfile) + case "status": + err = unpopulate(val, "Status", &s.Status) delete(rawMsg, key) - case "version": - err = unpopulate(val, "Version", &s.Version) + case "supportedStorageMb": + err = unpopulate(val, "SupportedStorageMb", &s.SupportedStorageMb) delete(rawMsg, key) } if err != nil { @@ -1937,23 +4161,24 @@ func (s *ServerPropertiesForCreate) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ServerPropertiesForDefaultCreate. -func (s ServerPropertiesForDefaultCreate) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type StorageMbCapability. +func (s StorageMbCapability) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "administratorLogin", s.AdministratorLogin) - populate(objectMap, "administratorLoginPassword", s.AdministratorLoginPassword) - objectMap["createMode"] = CreateModeDefault - populate(objectMap, "infrastructureEncryption", s.InfrastructureEncryption) - populate(objectMap, "minimalTlsVersion", s.MinimalTLSVersion) - populate(objectMap, "publicNetworkAccess", s.PublicNetworkAccess) - populate(objectMap, "sslEnforcement", s.SSLEnforcement) - populate(objectMap, "storageProfile", s.StorageProfile) - populate(objectMap, "version", s.Version) + populate(objectMap, "defaultIopsTier", s.DefaultIopsTier) + populate(objectMap, "maximumStorageSizeMb", s.MaximumStorageSizeMb) + populate(objectMap, "reason", s.Reason) + populate(objectMap, "status", s.Status) + populate(objectMap, "storageSizeMb", s.StorageSizeMb) + populate(objectMap, "supportedIops", s.SupportedIops) + populate(objectMap, "supportedIopsTiers", s.SupportedIopsTiers) + populate(objectMap, "supportedMaximumIops", s.SupportedMaximumIops) + populate(objectMap, "supportedMaximumThroughput", s.SupportedMaximumThroughput) + populate(objectMap, "supportedThroughput", s.SupportedThroughput) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ServerPropertiesForDefaultCreate. -func (s *ServerPropertiesForDefaultCreate) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type StorageMbCapability. +func (s *StorageMbCapability) 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) @@ -1961,32 +4186,35 @@ func (s *ServerPropertiesForDefaultCreate) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "administratorLogin": - err = unpopulate(val, "AdministratorLogin", &s.AdministratorLogin) + case "defaultIopsTier": + err = unpopulate(val, "DefaultIopsTier", &s.DefaultIopsTier) delete(rawMsg, key) - case "administratorLoginPassword": - err = unpopulate(val, "AdministratorLoginPassword", &s.AdministratorLoginPassword) + case "maximumStorageSizeMb": + err = unpopulate(val, "MaximumStorageSizeMb", &s.MaximumStorageSizeMb) delete(rawMsg, key) - case "createMode": - err = unpopulate(val, "CreateMode", &s.CreateMode) + case "reason": + err = unpopulate(val, "Reason", &s.Reason) delete(rawMsg, key) - case "infrastructureEncryption": - err = unpopulate(val, "InfrastructureEncryption", &s.InfrastructureEncryption) + case "status": + err = unpopulate(val, "Status", &s.Status) delete(rawMsg, key) - case "minimalTlsVersion": - err = unpopulate(val, "MinimalTLSVersion", &s.MinimalTLSVersion) + case "storageSizeMb": + err = unpopulate(val, "StorageSizeMb", &s.StorageSizeMb) delete(rawMsg, key) - case "publicNetworkAccess": - err = unpopulate(val, "PublicNetworkAccess", &s.PublicNetworkAccess) + case "supportedIops": + err = unpopulate(val, "SupportedIops", &s.SupportedIops) delete(rawMsg, key) - case "sslEnforcement": - err = unpopulate(val, "SSLEnforcement", &s.SSLEnforcement) + case "supportedIopsTiers": + err = unpopulate(val, "SupportedIopsTiers", &s.SupportedIopsTiers) delete(rawMsg, key) - case "storageProfile": - err = unpopulate(val, "StorageProfile", &s.StorageProfile) + case "supportedMaximumIops": + err = unpopulate(val, "SupportedMaximumIops", &s.SupportedMaximumIops) delete(rawMsg, key) - case "version": - err = unpopulate(val, "Version", &s.Version) + case "supportedMaximumThroughput": + err = unpopulate(val, "SupportedMaximumThroughput", &s.SupportedMaximumThroughput) + delete(rawMsg, key) + case "supportedThroughput": + err = unpopulate(val, "SupportedThroughput", &s.SupportedThroughput) delete(rawMsg, key) } if err != nil { @@ -1996,22 +4224,18 @@ func (s *ServerPropertiesForDefaultCreate) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ServerPropertiesForGeoRestore. -func (s ServerPropertiesForGeoRestore) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type StorageTierCapability. +func (s StorageTierCapability) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - objectMap["createMode"] = CreateModeGeoRestore - populate(objectMap, "infrastructureEncryption", s.InfrastructureEncryption) - populate(objectMap, "minimalTlsVersion", s.MinimalTLSVersion) - populate(objectMap, "publicNetworkAccess", s.PublicNetworkAccess) - populate(objectMap, "sslEnforcement", s.SSLEnforcement) - populate(objectMap, "sourceServerId", s.SourceServerID) - populate(objectMap, "storageProfile", s.StorageProfile) - populate(objectMap, "version", s.Version) + populate(objectMap, "iops", s.Iops) + populate(objectMap, "name", s.Name) + populate(objectMap, "reason", s.Reason) + populate(objectMap, "status", s.Status) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ServerPropertiesForGeoRestore. -func (s *ServerPropertiesForGeoRestore) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type StorageTierCapability. +func (s *StorageTierCapability) 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) @@ -2019,29 +4243,17 @@ func (s *ServerPropertiesForGeoRestore) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "createMode": - err = unpopulate(val, "CreateMode", &s.CreateMode) + case "iops": + err = unpopulate(val, "Iops", &s.Iops) delete(rawMsg, key) - case "infrastructureEncryption": - err = unpopulate(val, "InfrastructureEncryption", &s.InfrastructureEncryption) - delete(rawMsg, key) - case "minimalTlsVersion": - err = unpopulate(val, "MinimalTLSVersion", &s.MinimalTLSVersion) - delete(rawMsg, key) - case "publicNetworkAccess": - err = unpopulate(val, "PublicNetworkAccess", &s.PublicNetworkAccess) - delete(rawMsg, key) - case "sslEnforcement": - err = unpopulate(val, "SSLEnforcement", &s.SSLEnforcement) - delete(rawMsg, key) - case "sourceServerId": - err = unpopulate(val, "SourceServerID", &s.SourceServerID) + case "name": + err = unpopulate(val, "Name", &s.Name) delete(rawMsg, key) - case "storageProfile": - err = unpopulate(val, "StorageProfile", &s.StorageProfile) + case "reason": + err = unpopulate(val, "Reason", &s.Reason) delete(rawMsg, key) - case "version": - err = unpopulate(val, "Version", &s.Version) + case "status": + err = unpopulate(val, "Status", &s.Status) delete(rawMsg, key) } if err != nil { @@ -2051,22 +4263,16 @@ func (s *ServerPropertiesForGeoRestore) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ServerPropertiesForReplica. -func (s ServerPropertiesForReplica) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type SupportedFeature. +func (s SupportedFeature) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - objectMap["createMode"] = CreateModeReplica - populate(objectMap, "infrastructureEncryption", s.InfrastructureEncryption) - populate(objectMap, "minimalTlsVersion", s.MinimalTLSVersion) - populate(objectMap, "publicNetworkAccess", s.PublicNetworkAccess) - populate(objectMap, "sslEnforcement", s.SSLEnforcement) - populate(objectMap, "sourceServerId", s.SourceServerID) - populate(objectMap, "storageProfile", s.StorageProfile) - populate(objectMap, "version", s.Version) + populate(objectMap, "name", s.Name) + populate(objectMap, "status", s.Status) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ServerPropertiesForReplica. -func (s *ServerPropertiesForReplica) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type SupportedFeature. +func (s *SupportedFeature) 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) @@ -2074,29 +4280,11 @@ func (s *ServerPropertiesForReplica) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "createMode": - err = unpopulate(val, "CreateMode", &s.CreateMode) - delete(rawMsg, key) - case "infrastructureEncryption": - err = unpopulate(val, "InfrastructureEncryption", &s.InfrastructureEncryption) - delete(rawMsg, key) - case "minimalTlsVersion": - err = unpopulate(val, "MinimalTLSVersion", &s.MinimalTLSVersion) - delete(rawMsg, key) - case "publicNetworkAccess": - err = unpopulate(val, "PublicNetworkAccess", &s.PublicNetworkAccess) - delete(rawMsg, key) - case "sslEnforcement": - err = unpopulate(val, "SSLEnforcement", &s.SSLEnforcement) - delete(rawMsg, key) - case "sourceServerId": - err = unpopulate(val, "SourceServerID", &s.SourceServerID) - delete(rawMsg, key) - case "storageProfile": - err = unpopulate(val, "StorageProfile", &s.StorageProfile) + case "name": + err = unpopulate(val, "Name", &s.Name) delete(rawMsg, key) - case "version": - err = unpopulate(val, "Version", &s.Version) + case "status": + err = unpopulate(val, "Status", &s.Status) delete(rawMsg, key) } if err != nil { @@ -2106,23 +4294,20 @@ func (s *ServerPropertiesForReplica) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ServerPropertiesForRestore. -func (s ServerPropertiesForRestore) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type SystemData. +func (s SystemData) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - objectMap["createMode"] = CreateModePointInTimeRestore - populate(objectMap, "infrastructureEncryption", s.InfrastructureEncryption) - populate(objectMap, "minimalTlsVersion", s.MinimalTLSVersion) - populate(objectMap, "publicNetworkAccess", s.PublicNetworkAccess) - populateDateTimeRFC3339(objectMap, "restorePointInTime", s.RestorePointInTime) - populate(objectMap, "sslEnforcement", s.SSLEnforcement) - populate(objectMap, "sourceServerId", s.SourceServerID) - populate(objectMap, "storageProfile", s.StorageProfile) - populate(objectMap, "version", s.Version) + populateDateTimeRFC3339(objectMap, "createdAt", s.CreatedAt) + populate(objectMap, "createdBy", s.CreatedBy) + populate(objectMap, "createdByType", s.CreatedByType) + populateDateTimeRFC3339(objectMap, "lastModifiedAt", s.LastModifiedAt) + populate(objectMap, "lastModifiedBy", s.LastModifiedBy) + populate(objectMap, "lastModifiedByType", s.LastModifiedByType) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ServerPropertiesForRestore. -func (s *ServerPropertiesForRestore) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type SystemData. +func (s *SystemData) 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) @@ -2130,32 +4315,23 @@ func (s *ServerPropertiesForRestore) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "createMode": - err = unpopulate(val, "CreateMode", &s.CreateMode) - delete(rawMsg, key) - case "infrastructureEncryption": - err = unpopulate(val, "InfrastructureEncryption", &s.InfrastructureEncryption) - delete(rawMsg, key) - case "minimalTlsVersion": - err = unpopulate(val, "MinimalTLSVersion", &s.MinimalTLSVersion) - delete(rawMsg, key) - case "publicNetworkAccess": - err = unpopulate(val, "PublicNetworkAccess", &s.PublicNetworkAccess) + case "createdAt": + err = unpopulateDateTimeRFC3339(val, "CreatedAt", &s.CreatedAt) delete(rawMsg, key) - case "restorePointInTime": - err = unpopulateDateTimeRFC3339(val, "RestorePointInTime", &s.RestorePointInTime) + case "createdBy": + err = unpopulate(val, "CreatedBy", &s.CreatedBy) delete(rawMsg, key) - case "sslEnforcement": - err = unpopulate(val, "SSLEnforcement", &s.SSLEnforcement) + case "createdByType": + err = unpopulate(val, "CreatedByType", &s.CreatedByType) delete(rawMsg, key) - case "sourceServerId": - err = unpopulate(val, "SourceServerID", &s.SourceServerID) + case "lastModifiedAt": + err = unpopulateDateTimeRFC3339(val, "LastModifiedAt", &s.LastModifiedAt) delete(rawMsg, key) - case "storageProfile": - err = unpopulate(val, "StorageProfile", &s.StorageProfile) + case "lastModifiedBy": + err = unpopulate(val, "LastModifiedBy", &s.LastModifiedBy) delete(rawMsg, key) - case "version": - err = unpopulate(val, "Version", &s.Version) + case "lastModifiedByType": + err = unpopulate(val, "LastModifiedByType", &s.LastModifiedByType) delete(rawMsg, key) } if err != nil { @@ -2165,287 +4341,268 @@ func (s *ServerPropertiesForRestore) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ServerSecurityAlertPolicy. -func (s ServerSecurityAlertPolicy) 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, "id", s.ID) - populate(objectMap, "name", s.Name) - populate(objectMap, "properties", s.Properties) - populate(objectMap, "type", s.Type) + 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 ServerSecurityAlertPolicy. -func (s *ServerSecurityAlertPolicy) 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", s, err) + return fmt.Errorf("unmarshalling type %T: %v", t, err) } for key, val := range rawMsg { var err error switch key { case "id": - err = unpopulate(val, "ID", &s.ID) + err = unpopulate(val, "ID", &t.ID) delete(rawMsg, key) case "name": - err = unpopulate(val, "Name", &s.Name) + err = unpopulate(val, "Name", &t.Name) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &s.Properties) + case "systemData": + err = unpopulate(val, "SystemData", &t.SystemData) delete(rawMsg, key) case "type": - err = unpopulate(val, "Type", &s.Type) + err = unpopulate(val, "Type", &t.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) + return fmt.Errorf("unmarshalling type %T: %v", t, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ServerSecurityAlertPolicyListResult. -func (s ServerSecurityAlertPolicyListResult) 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, "nextLink", s.NextLink) - populate(objectMap, "value", s.Value) + populate(objectMap, "nextLink", t.NextLink) + populate(objectMap, "value", t.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ServerSecurityAlertPolicyListResult. -func (s *ServerSecurityAlertPolicyListResult) 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", s, err) + return fmt.Errorf("unmarshalling type %T: %v", t, err) } for key, val := range rawMsg { var err error switch key { case "nextLink": - err = unpopulate(val, "NextLink", &s.NextLink) + err = unpopulate(val, "NextLink", &t.NextLink) delete(rawMsg, key) case "value": - err = unpopulate(val, "Value", &s.Value) + err = unpopulate(val, "Value", &t.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) + return fmt.Errorf("unmarshalling type %T: %v", t, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ServerUpdateParameters. -func (s ServerUpdateParameters) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type UserAssignedIdentity. +func (u UserAssignedIdentity) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "identity", s.Identity) - populate(objectMap, "properties", s.Properties) - populate(objectMap, "sku", s.SKU) - populate(objectMap, "tags", s.Tags) + populate(objectMap, "principalId", u.PrincipalID) + populate(objectMap, "tenantId", u.TenantID) + populate(objectMap, "type", u.Type) + populate(objectMap, "userAssignedIdentities", u.UserAssignedIdentities) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ServerUpdateParameters. -func (s *ServerUpdateParameters) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type UserAssignedIdentity. +func (u *UserAssignedIdentity) 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) + return fmt.Errorf("unmarshalling type %T: %v", u, err) } for key, val := range rawMsg { var err error switch key { - case "identity": - err = unpopulate(val, "Identity", &s.Identity) + case "principalId": + err = unpopulate(val, "PrincipalID", &u.PrincipalID) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &s.Properties) + case "tenantId": + err = unpopulate(val, "TenantID", &u.TenantID) delete(rawMsg, key) - case "sku": - err = unpopulate(val, "SKU", &s.SKU) + case "type": + err = unpopulate(val, "Type", &u.Type) delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &s.Tags) + case "userAssignedIdentities": + err = unpopulate(val, "UserAssignedIdentities", &u.UserAssignedIdentities) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) + return fmt.Errorf("unmarshalling type %T: %v", u, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ServerUpdateParametersProperties. -func (s ServerUpdateParametersProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type UserIdentity. +func (u UserIdentity) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "administratorLoginPassword", s.AdministratorLoginPassword) - populate(objectMap, "minimalTlsVersion", s.MinimalTLSVersion) - populate(objectMap, "publicNetworkAccess", s.PublicNetworkAccess) - populate(objectMap, "replicationRole", s.ReplicationRole) - populate(objectMap, "sslEnforcement", s.SSLEnforcement) - populate(objectMap, "storageProfile", s.StorageProfile) - populate(objectMap, "version", s.Version) + populate(objectMap, "clientId", u.ClientID) + populate(objectMap, "principalId", u.PrincipalID) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ServerUpdateParametersProperties. -func (s *ServerUpdateParametersProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type UserIdentity. +func (u *UserIdentity) 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) + return fmt.Errorf("unmarshalling type %T: %v", u, err) } for key, val := range rawMsg { var err error switch key { - case "administratorLoginPassword": - err = unpopulate(val, "AdministratorLoginPassword", &s.AdministratorLoginPassword) - delete(rawMsg, key) - case "minimalTlsVersion": - err = unpopulate(val, "MinimalTLSVersion", &s.MinimalTLSVersion) - delete(rawMsg, key) - case "publicNetworkAccess": - err = unpopulate(val, "PublicNetworkAccess", &s.PublicNetworkAccess) - delete(rawMsg, key) - case "replicationRole": - err = unpopulate(val, "ReplicationRole", &s.ReplicationRole) - delete(rawMsg, key) - case "sslEnforcement": - err = unpopulate(val, "SSLEnforcement", &s.SSLEnforcement) + case "clientId": + err = unpopulate(val, "ClientID", &u.ClientID) delete(rawMsg, key) - case "storageProfile": - err = unpopulate(val, "StorageProfile", &s.StorageProfile) - delete(rawMsg, key) - case "version": - err = unpopulate(val, "Version", &s.Version) + case "principalId": + err = unpopulate(val, "PrincipalID", &u.PrincipalID) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) + return fmt.Errorf("unmarshalling type %T: %v", u, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type StorageProfile. -func (s StorageProfile) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ValidationDetails. +func (v ValidationDetails) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "backupRetentionDays", s.BackupRetentionDays) - populate(objectMap, "geoRedundantBackup", s.GeoRedundantBackup) - populate(objectMap, "storageAutogrow", s.StorageAutogrow) - populate(objectMap, "storageMB", s.StorageMB) + populate(objectMap, "dbLevelValidationDetails", v.DbLevelValidationDetails) + populate(objectMap, "serverLevelValidationDetails", v.ServerLevelValidationDetails) + populate(objectMap, "status", v.Status) + populateDateTimeRFC3339(objectMap, "validationEndTimeInUtc", v.ValidationEndTimeInUTC) + populateDateTimeRFC3339(objectMap, "validationStartTimeInUtc", v.ValidationStartTimeInUTC) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type StorageProfile. -func (s *StorageProfile) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ValidationDetails. +func (v *ValidationDetails) 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) + return fmt.Errorf("unmarshalling type %T: %v", v, err) } for key, val := range rawMsg { var err error switch key { - case "backupRetentionDays": - err = unpopulate(val, "BackupRetentionDays", &s.BackupRetentionDays) + case "dbLevelValidationDetails": + err = unpopulate(val, "DbLevelValidationDetails", &v.DbLevelValidationDetails) delete(rawMsg, key) - case "geoRedundantBackup": - err = unpopulate(val, "GeoRedundantBackup", &s.GeoRedundantBackup) + case "serverLevelValidationDetails": + err = unpopulate(val, "ServerLevelValidationDetails", &v.ServerLevelValidationDetails) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &v.Status) delete(rawMsg, key) - case "storageAutogrow": - err = unpopulate(val, "StorageAutogrow", &s.StorageAutogrow) + case "validationEndTimeInUtc": + err = unpopulateDateTimeRFC3339(val, "ValidationEndTimeInUTC", &v.ValidationEndTimeInUTC) delete(rawMsg, key) - case "storageMB": - err = unpopulate(val, "StorageMB", &s.StorageMB) + case "validationStartTimeInUtc": + err = unpopulateDateTimeRFC3339(val, "ValidationStartTimeInUTC", &v.ValidationStartTimeInUTC) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) + return fmt.Errorf("unmarshalling type %T: %v", v, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type TagsObject. -func (t TagsObject) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ValidationMessage. +func (v ValidationMessage) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "tags", t.Tags) + populate(objectMap, "message", v.Message) + populate(objectMap, "state", v.State) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type TagsObject. -func (t *TagsObject) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ValidationMessage. +func (v *ValidationMessage) 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) + return fmt.Errorf("unmarshalling type %T: %v", v, err) } for key, val := range rawMsg { var err error switch key { - case "tags": - err = unpopulate(val, "Tags", &t.Tags) + case "message": + err = unpopulate(val, "Message", &v.Message) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &v.State) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", t, err) + return fmt.Errorf("unmarshalling type %T: %v", v, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type TrackedResource. -func (t TrackedResource) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ValidationSummaryItem. +func (v ValidationSummaryItem) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", t.ID) - populate(objectMap, "location", t.Location) - populate(objectMap, "name", t.Name) - populate(objectMap, "tags", t.Tags) - populate(objectMap, "type", t.Type) + populate(objectMap, "messages", v.Messages) + populate(objectMap, "state", v.State) + populate(objectMap, "type", v.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type TrackedResource. -func (t *TrackedResource) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ValidationSummaryItem. +func (v *ValidationSummaryItem) 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) + return fmt.Errorf("unmarshalling type %T: %v", v, err) } for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &t.ID) + case "messages": + err = unpopulate(val, "Messages", &v.Messages) delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &t.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &t.Name) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &t.Tags) + case "state": + err = unpopulate(val, "State", &v.State) delete(rawMsg, key) case "type": - err = unpopulate(val, "Type", &t.Type) + err = unpopulate(val, "Type", &v.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", t, err) + return fmt.Errorf("unmarshalling type %T: %v", v, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type VirtualNetworkRule. -func (v VirtualNetworkRule) 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) populate(objectMap, "properties", v.Properties) + populate(objectMap, "systemData", v.SystemData) populate(objectMap, "type", v.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkRule. -func (v *VirtualNetworkRule) 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) @@ -2462,6 +4619,9 @@ func (v *VirtualNetworkRule) UnmarshalJSON(data []byte) error { case "properties": err = unpopulate(val, "Properties", &v.Properties) delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &v.SystemData) + delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &v.Type) delete(rawMsg, key) @@ -2473,16 +4633,78 @@ func (v *VirtualNetworkRule) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type VirtualNetworkRuleListResult. -func (v VirtualNetworkRuleListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type VirtualEndpointResourceForPatch. +func (v VirtualEndpointResourceForPatch) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "properties", v.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualEndpointResourceForPatch. +func (v *VirtualEndpointResourceForPatch) 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) + } + for key, val := range rawMsg { + var err error + switch key { + case "properties": + err = unpopulate(val, "Properties", &v.Properties) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VirtualEndpointResourceProperties. +func (v VirtualEndpointResourceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "endpointType", v.EndpointType) + populate(objectMap, "members", v.Members) + populate(objectMap, "virtualEndpoints", v.VirtualEndpoints) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualEndpointResourceProperties. +func (v *VirtualEndpointResourceProperties) 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) + } + for key, val := range rawMsg { + var err error + switch key { + case "endpointType": + err = unpopulate(val, "EndpointType", &v.EndpointType) + delete(rawMsg, key) + case "members": + err = unpopulate(val, "Members", &v.Members) + delete(rawMsg, key) + case "virtualEndpoints": + err = unpopulate(val, "VirtualEndpoints", &v.VirtualEndpoints) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// 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 VirtualNetworkRuleListResult. -func (v *VirtualNetworkRuleListResult) 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) @@ -2504,17 +4726,17 @@ func (v *VirtualNetworkRuleListResult) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type VirtualNetworkRuleProperties. -func (v VirtualNetworkRuleProperties) 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, "ignoreMissingVnetServiceEndpoint", v.IgnoreMissingVnetServiceEndpoint) - populate(objectMap, "state", v.State) - populate(objectMap, "virtualNetworkSubnetId", v.VirtualNetworkSubnetID) + 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 VirtualNetworkRuleProperties. -func (v *VirtualNetworkRuleProperties) 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) @@ -2522,14 +4744,14 @@ func (v *VirtualNetworkRuleProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "ignoreMissingVnetServiceEndpoint": - err = unpopulate(val, "IgnoreMissingVnetServiceEndpoint", &v.IgnoreMissingVnetServiceEndpoint) + case "delegatedSubnetsUsage": + err = unpopulate(val, "DelegatedSubnetsUsage", &v.DelegatedSubnetsUsage) delete(rawMsg, key) - case "state": - err = unpopulate(val, "State", &v.State) + case "location": + err = unpopulate(val, "Location", &v.Location) delete(rawMsg, key) - case "virtualNetworkSubnetId": - err = unpopulate(val, "VirtualNetworkSubnetID", &v.VirtualNetworkSubnetID) + case "subscriptionId": + err = unpopulate(val, "SubscriptionID", &v.SubscriptionID) delete(rawMsg, key) } if err != nil { @@ -2539,28 +4761,45 @@ func (v *VirtualNetworkRuleProperties) UnmarshalJSON(data []byte) error { return nil } -func populate(m map[string]any, k string, v any) { - if v == nil { - return - } else if azcore.IsNullValue(v) { - m[k] = nil - } else if !reflect.ValueOf(v).IsNil() { - m[k] = v +// MarshalJSON implements the json.Marshaller interface for type VirtualNetworkSubnetUsageParameter. +func (v VirtualNetworkSubnetUsageParameter) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "virtualNetworkArmResourceId", v.VirtualNetworkArmResourceID) + return json.Marshal(objectMap) +} + +// 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) + } + for key, val := range rawMsg { + var err error + switch key { + case "virtualNetworkArmResourceId": + err = unpopulate(val, "VirtualNetworkArmResourceID", &v.VirtualNetworkArmResourceID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } } + return nil } -func populateAny(m map[string]any, k string, v any) { +func populate(m map[string]any, k string, v any) { if v == nil { return } else if azcore.IsNullValue(v) { m[k] = nil - } else { + } else if !reflect.ValueOf(v).IsNil() { m[k] = v } } func unpopulate(data json.RawMessage, fn string, v any) error { - if data == nil { + if data == nil || string(data) == "null" { return nil } if err := json.Unmarshal(data, v); err != nil { diff --git a/sdk/resourcemanager/postgresql/armpostgresql/nameavailability_client.go b/sdk/resourcemanager/postgresql/armpostgresql/nameavailability_client.go new file mode 100644 index 000000000000..716070eca68b --- /dev/null +++ b/sdk/resourcemanager/postgresql/armpostgresql/nameavailability_client.go @@ -0,0 +1,166 @@ +// 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) Go Code Generator. DO NOT EDIT. + +package armpostgresql + +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 - The request body +// - 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"} + req.Raw().Header["Content-Type"] = []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 - The request body +// - 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"} + req.Raw().Header["Content-Type"] = []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/armpostgresql/nameavailability_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresql/nameavailability_client_example_test.go new file mode 100644 index 000000000000..5f7f5d87760f --- /dev/null +++ b/sdk/resourcemanager/postgresql/armpostgresql/nameavailability_client_example_test.go @@ -0,0 +1,75 @@ +// 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) Go Code Generator. DO NOT EDIT. + +package armpostgresql_test + +import ( + "context" + "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/armpostgresql/v2" + "log" +) + +// Generated from example definition: 2025-08-01/NameAvailabilityCheckGlobally.json +func ExampleNameAvailabilityClient_CheckGlobally() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armpostgresql.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewNameAvailabilityClient().CheckGlobally(ctx, armpostgresql.CheckNameAvailabilityRequest{ + Name: to.Ptr("exampleserver"), + 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 = armpostgresql.NameAvailabilityClientCheckGloballyResponse{ + // NameAvailabilityModel: &armpostgresql.NameAvailabilityModel{ + // Name: to.Ptr("exampleserver"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers"), + // Message: to.Ptr(""), + // NameAvailable: to.Ptr(true), + // }, + // } +} + +// Generated from example definition: 2025-08-01/NameAvailabilityCheckWithLocation.json +func ExampleNameAvailabilityClient_CheckWithLocation() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armpostgresql.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewNameAvailabilityClient().CheckWithLocation(ctx, "eastus", armpostgresql.CheckNameAvailabilityRequest{ + Name: to.Ptr("exampleserver"), + 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 = armpostgresql.NameAvailabilityClientCheckWithLocationResponse{ + // NameAvailabilityModel: &armpostgresql.NameAvailabilityModel{ + // Name: to.Ptr("exampleserver"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers"), + // Message: to.Ptr(""), + // NameAvailable: to.Ptr(true), + // }, + // } +} diff --git a/sdk/resourcemanager/postgresql/armpostgresql/operations_client.go b/sdk/resourcemanager/postgresql/armpostgresql/operations_client.go index fa4970c52e0e..802040270aff 100644 --- a/sdk/resourcemanager/postgresql/armpostgresql/operations_client.go +++ b/sdk/resourcemanager/postgresql/armpostgresql/operations_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armpostgresql @@ -14,7 +13,10 @@ import ( "net/http" ) -// OperationsClient contains the methods for the Operations group. +// OperationsClient - This is the interface that implements the standard Azure Resource Manager operation that returns +// all supported RP operations. You should have exactly one declaration for each +// Azure Resource Manager service. It implements +// GET "/providers/Microsoft.ContosoProviderHub/operations" // Don't use this type directly, use NewOperationsClient() instead. type OperationsClient struct { internal *arm.Client @@ -22,7 +24,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,42 +36,42 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO return client, nil } -// List - Lists all of the available REST API operations. -// If the operation fails it returns an *azcore.ResponseError type. +// NewListPager - Lists all available REST API operations. // -// Generated from API version 2017-12-01 -// - options - OperationsClientListOptions contains the optional parameters for the OperationsClient.List method. -func (client *OperationsClient) List(ctx context.Context, options *OperationsClientListOptions) (OperationsClientListResponse, error) { - var err error - const operationName = "OperationsClient.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.listCreateRequest(ctx, options) - if err != nil { - return OperationsClientListResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return OperationsClientListResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return OperationsClientListResponse{}, err - } - resp, err := client.listHandleResponse(httpResp) - return resp, err +// 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]{ + More: func(page OperationsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *OperationsClientListResponse) (OperationsClientListResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "OperationsClient.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, options) + }, nil) + if err != nil { + return OperationsClientListResponse{}, err + } + return client.listHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) } // listCreateRequest creates the List request. -func (client *OperationsClient) listCreateRequest(ctx context.Context, options *OperationsClientListOptions) (*policy.Request, error) { +func (client *OperationsClient) listCreateRequest(ctx context.Context, _ *OperationsClientListOptions) (*policy.Request, error) { urlPath := "/providers/Microsoft.DBforPostgreSQL/operations" 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", "2017-12-01") + 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 +80,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * // 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/armpostgresql/operations_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresql/operations_client_example_test.go index 42e668011ecb..9d054f0b1bc0 100644 --- a/sdk/resourcemanager/postgresql/armpostgresql/operations_client_example_test.go +++ b/sdk/resourcemanager/postgresql/armpostgresql/operations_client_example_test.go @@ -1,204 +1,2222 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armpostgresql_test import ( "context" - "log" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresql" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresql/v2" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/OperationList.json -func ExampleOperationsClient_List() { +// Generated from example definition: 2025-08-01/OperationsList.json +func ExampleOperationsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armpostgresql.NewClientFactory("", cred, nil) + clientFactory, err := armpostgresql.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewOperationsClient().List(ctx, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) + pager := clientFactory.NewOperationsClient().NewListPager(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 = armpostgresql.OperationsClientListResponse{ + // OperationList: armpostgresql.OperationList{ + // Value: []*armpostgresql.Operation{ + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/queryTexts/read"), + // Display: &armpostgresql.OperationDisplay{ + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/queryTexts/read"), + // Display: &armpostgresql.OperationDisplay{ + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/tuningOptions/recommendations/read"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Returns the list of recommended indexes for the Azure Database for PostgreSQL Flexible Server"), + // Operation: to.Ptr("List Azure Database for PostgreSQL Flexible Server recommended indexes for tuning."), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("Recommended Indexes"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/tuningOptions/read"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Returns the list of Tuning Options available for the Azure Database for PostgreSQL Flexible Server"), + // Operation: to.Ptr("List Azure Database for PostgreSQL Flexible Server Tuning Options."), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("Server Tuning Option"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/tuningOptions/read"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Returns a tuning option"), + // Operation: to.Ptr("Get a single tuning option"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("Server Tuning Option"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/migrations/write"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Creates a migration with the specified parameters."), + // Operation: to.Ptr("Create a database migration workflow."), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("Database Migration Workflow"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/migrations/read"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Gets the properties for the specified migration workflow."), + // Operation: to.Ptr("Get Migration Workflow details."), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("Database Migration Workflow"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/migrations/read"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("List of migration workflows for the specified database server."), + // Operation: to.Ptr("List Migration Workflow details."), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("Database Migration Workflow"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/migrations/write"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Update the properties for the specified migration."), + // Operation: to.Ptr("Update a database migration workflow."), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("Database Migration Workflow"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/migrations/delete"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Deletes an existing migration workflow."), + // Operation: to.Ptr("Delete Migration Workflow."), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("Database Migration Workflow"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/locations/getAutoMigrationFreeSlots/action"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Returns the list of free / available slots for auto migration of PostgreSQL server"), + // Operation: to.Ptr("Get auto migration free / available slots for PostgreSQL"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("Auto migration workflow to get free / available slots for auto migration"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/locations/getLatestAutoMigrationSchedule/action"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Returns the instance of the latest auto migration schedule for PostgreSQL server"), + // Operation: to.Ptr("Get latest auto migration schedule for PostgreSQL server"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("Auto migration workflow to get latest auto migration schedule"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/locations/updateAutoMigrationSchedule/action"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Update auto migration schedule for the PostgreSQL server"), + // Operation: to.Ptr("Update auto migration schedule for the PostgreSQL server"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("Auto migration workflow to update auto migration schedule"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/tuningOptions/startSession/action"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Starts a server configuration tuning session on a server"), + // Operation: to.Ptr("Start tuning configuration session"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("Server Configuration Tuning"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/tuningOptions/stopSession/action"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Stops the server configuration tuning session on a server"), + // Operation: to.Ptr("Stop tuning configuration session"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("Server Configuration Tuning"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/tuningOptions/sessions/read"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Gets the list of server configuration tuning sessions on a server"), + // Operation: to.Ptr("Server configuration tuning sessions"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("Server Configuration Tuning"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/tuningOptions/enable/action"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Enables server configuration tuning feature on the server"), + // Operation: to.Ptr("Enable server configuration tuning feature"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("Server Configuration Tuning"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/tuningOptions/startSession/action"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Starts a server configuration tuning session on a server"), + // Operation: to.Ptr("Start tuning configuration session"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("Server Configuration Tuning"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/tuningOptions/stopSession/action"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Stops the server configuration tuning session on a server"), + // Operation: to.Ptr("Stop tuning configuration session"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("Server Configuration Tuning"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/tuningOptions/sessions/read"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Gets the list of server configuration tuning sessions on a server"), + // Operation: to.Ptr("Server configuration tuning sessions"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("Server Configuration Tuning"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/tuningOptions/sessionDetails/read"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Gets the list of iterations for a specified server configuration tuning session on a server"), + // Operation: to.Ptr("Server configuration session details"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("Server Configuration Tuning"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/tuningOptions/disable/action"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Disables server configuration tuning feature on the server"), + // Operation: to.Ptr("Disable server configuration tuning feature"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("Server Configuration Tuning"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/restart/action"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Restarts an existing server"), + // Operation: to.Ptr("Restart PostgreSQL server"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("PostgreSQL Server"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/start/action"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Starts an existing server"), + // Operation: to.Ptr("Start PostgreSQL server"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("PostgreSQL Server"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/stop/action"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Stops an existing server"), + // Operation: to.Ptr("Stops an existing server"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("PostgreSQL Server"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/replicas/read"), + // Display: &armpostgresql.OperationDisplay{ + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("PostgreSQL Server"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/read"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Return the list of servers or gets the properties for the specified server."), + // Operation: to.Ptr("List/Get PostgreSQL server"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("PostgreSQL Server"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/write"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Creates a server with the specified parameters or update the properties or tags for the specified server."), + // Operation: to.Ptr("Create/Update PostgreSQL server"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("PostgreSQL Server"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/write"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Creates a server with the specified parameters or update the properties or tags for the specified server."), + // Operation: to.Ptr("Create/Update PostgreSQL server"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("PostgreSQL Server"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/delete"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Deletes an existing server."), + // Operation: to.Ptr("Delete PostgreSQL server"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("PostgreSQL Server"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/locations/capabilities/read"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Gets the capabilities for this subscription in a given location"), + // Operation: to.Ptr("Gets the capabilities for this subscription"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("Location Capability"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/capabilities/read"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Gets the capabilities for this subscription in a given location"), + // Operation: to.Ptr("Gets the capabilities for this subscription"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("Location Capability"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/locations/capabilities/{serverName}/read"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Gets the capabilities for this subscription in a given location"), + // Operation: to.Ptr("Gets the capabilities for this subscription"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("Location Capability"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/backups/read"), + // Display: &armpostgresql.OperationDisplay{ + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("Flexible server database backups"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/backups/write"), + // Display: &armpostgresql.OperationDisplay{ + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("Flexible server database backups"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/backups/delete"), + // Display: &armpostgresql.OperationDisplay{ + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("Flexible server database backups"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/advisors/read"), + // Display: &armpostgresql.OperationDisplay{ + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/waitStatistics/action"), + // Display: &armpostgresql.OperationDisplay{ + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/queryStatistics/read"), + // Display: &armpostgresql.OperationDisplay{ + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/topQueryStatistics/read"), + // Display: &armpostgresql.OperationDisplay{ + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/resetQueryPerformanceInsightData/action"), + // Display: &armpostgresql.OperationDisplay{ + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/advisors/recommendedActions/read"), + // Display: &armpostgresql.OperationDisplay{ + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/checkMigrationNameAvailability/action"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Checks the availability of the given migration name."), + // Operation: to.Ptr("Check the availability of the given migration name."), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("Database Migration Name Availability Resource"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/assessForMigration/action"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Performs a migration assessment with the specified parameters"), + // Operation: to.Ptr("Get Migration Assessment"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("Migration Assessments"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/administrators/read"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Return the list of server administrators or gets the properties for the specified server administrator."), + // Operation: to.Ptr("List/Get PostgreSQL server administrator"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("PostgreSQL Server Administrator"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/administrators/read"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Return the list of server administrators or gets the properties for the specified server administrator."), + // Operation: to.Ptr("List/Get PostgreSQL server administrator"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("PostgreSQL Server Administrator"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/administrators/delete"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Deletes an existing PostgreSQL server administrator."), + // Operation: to.Ptr("Delete PostgreSQL server administrator"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("PostgreSQL Server Administrator"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/administrators/write"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Creates a server administrator with the specified parameters or update the properties or tags for the specified server administrator."), + // Operation: to.Ptr("Create/Update PostgreSQL server administrator"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("PostgreSQL Server Administrator"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/administrators/action"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Creates a server administrator with the specified parameters or update the properties or tags for the specified server administrator."), + // Operation: to.Ptr("Create/Update PostgreSQL server administrator"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("PostgreSQL Server Administrator"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/firewallRules/write"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Creates a firewall rule with the specified parameters or update an existing rule."), + // Operation: to.Ptr("Create/Update Firewall Rule"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("Firewall Rules"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/firewallRules/read"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Return the list of firewall rules for a server or gets the properties for the specified firewall rule."), + // Operation: to.Ptr("List/Get Firewall Rules"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("Firewall Rules"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/firewallRules/delete"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Deletes an existing firewall rule."), + // Operation: to.Ptr("Delete Firewall Rule"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("Firewall Rules"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/databases/read"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Returns the list of PostgreSQL server databases or gets the database for the specified server."), + // Operation: to.Ptr("List/Get PostgreSQL server configuration"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("PostgreSQL Server Database"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/databases/write"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Creates or Updates the database of a PostgreSQL server."), + // Operation: to.Ptr("Creates/Updates PostgreSQL server database"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("PostgreSQL Server Database"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/databases/delete"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Delete the database of a PostgreSQL server"), + // Operation: to.Ptr("Delete PostgreSQL server database"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("PostgreSQL Server Database"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations/read"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Returns the list of PostgreSQL server configurations or gets the configurations for the specified server."), + // Operation: to.Ptr("List/Get PostgreSQL server configuration"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("PostgreSQL Server Configuration"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations/write"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Updates the configuration of a PostgreSQL server."), + // Operation: to.Ptr("Update PostgreSQL server configuration"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("PostgreSQL Server Configuration"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/getSourceDatabaseList/action"), + // Display: &armpostgresql.OperationDisplay{ + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("Fetch Databases Pre Migration Workflow"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/virtualendpoints/write"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Creates or Updates VirtualEndpoint"), + // Operation: to.Ptr("VirtualEndpoint Create or Update operation"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("Azure Database for PostgreSQL - Flexible Server Virtual Endpoint"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/virtualendpoints/write"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Patches the VirtualEndpoint. Currently patch does a full replace"), + // Operation: to.Ptr("VirtualEndpoint Patch operation"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("Azure Database for PostgreSQL - Flexible Server Virtual Endpoint"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/virtualendpoints/delete"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Deletes the VirtualEndpoint"), + // Operation: to.Ptr("VirtualEndpoint Delete operation"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("Azure Database for PostgreSQL - Flexible Server Virtual Endpoint"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/virtualendpoints/read"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Gets the VirtualEndpoint details"), + // Operation: to.Ptr("VirtualEndpoint Get operation"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("Azure Database for PostgreSQL - Flexible Server Virtual Endpoint"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/virtualendpoints/read"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Lists the VirtualEndpoints"), + // Operation: to.Ptr("VirtualEndpoint List operation"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("Azure Database for PostgreSQL - Flexible Server Virtual Endpoint"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/testConnectivity/action"), + // Display: &armpostgresql.OperationDisplay{ + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("Pre-migration Workflow for checking the server connectivity"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/logFiles/read"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Return a list of server log Files for a PostgreSQL Flexible server with File download links"), + // Operation: to.Ptr("List/Get PostgreSQL Flexible Server Log Files"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("PostgreSQL Flexible Server Log Files"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/startLtrBackup/action"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Start long term backup for a server"), + // Operation: to.Ptr("Start long term backup for a server"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("PostgreSQL Server Long term backup operation."), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/ltrPreBackup/action"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Checks if a server is ready for a long term backup"), + // Operation: to.Ptr("Checks if a server is ready for a long term backup"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("PostgreSQL Server Long term backup operation."), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/ltrBackupOperations/read"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Returns the PostgreSQL server long term backup operation tracking by backup name."), + // Operation: to.Ptr("Get PostgreSQL server long term backup operation by backup name"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("PostgreSQL Server Long term backup operation."), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/ltrBackupOperations/read"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Returns the list of PostgreSQL server long term backup operation tracking."), + // Operation: to.Ptr("List/Get PostgreSQL server long term backup operation"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("PostgreSQL Server Long term backup operation."), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/advancedThreatProtectionSettings/read"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Returns the list of Advanced Threat Protection or gets the properties for the specified Advanced Threat Protection."), + // Operation: to.Ptr("List/Get Azure Database for PostgreSQL Flexible Server Advanced Threat Protection states."), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("Azure Database for PostgreSQL Server Advanced Threat Protection"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/advancedThreatProtectionSettings/read"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Returns the list of Advanced Threat Protection or gets the properties for the specified Advanced Threat Protection."), + // Operation: to.Ptr("List/Get Azure Database for PostgreSQL Flexible Server Advanced Threat Protection states."), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("Azure Database for PostgreSQL Server Advanced Threat Protection"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/advancedThreatProtectionSettings/write"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Enables/Disables Azure Database for PostgreSQL Flexible Server Advanced Threat Protection"), + // Operation: to.Ptr("Update Azure Database for PostgreSQL Server Advanced Threat Protection state"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("Azure Database for PostgreSQL Server Advanced Threat Protection"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/locations/resourceType/usages/read"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Gets the quota usages of a subscription"), + // Operation: to.Ptr("Gets quota usage"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/privateEndpointConnectionProxies/read"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Returns the list of private endpoint connection proxies or gets the properties for the specified private endpoint connection proxy."), + // Operation: to.Ptr("List/Get Azure Database for PostgreSQL Flexible Server Private Endpoint Connection Proxy"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("Azure Database for PostgreSQL - Flexible Server Private Endpoint Connection Proxy"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/privateEndpointConnectionProxies/delete"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Deletes an existing private endpoint connection proxy resource."), + // Operation: to.Ptr("Delete Azure Database for PostgreSQL - Flexible Server Private Endpoint Connection Proxy"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("Azure Database for PostgreSQL - Flexible Server Private Endpoint Connection Proxy"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/privateEndpointConnectionProxies/write"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Creates a private endpoint connection proxy with the specified parameters or updates the properties or tags for the specified private endpoint connection proxy"), + // Operation: to.Ptr("Create/Update Azure Database for PostgreSQL - Flexible Server Private Endpoint Connection Proxy"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("Azure Database for PostgreSQL - Flexible Server Private Endpoint Connection Proxy"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/privateEndpointConnectionProxies/validate/action"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Validates a private endpoint connection create call from NRP side"), + // Operation: to.Ptr("Validate Azure Database for PostgreSQL - Flexible Server Private Endpoint Connection Creation by NRP"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("Azure Database for PostgreSQL - Flexible Server Private Endpoint Connection Proxy"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/privateEndpointConnections/read"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Returns the list of private endpoint connections or gets the properties for the specified private endpoint connection."), + // Operation: to.Ptr("List/Get Azure Database for PostgreSQL - Flexible Server Private Endpoint Connection"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("Azure Database for PostgreSQL - Flexible Server Private Endpoint Connection"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/privateEndpointConnections/delete"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Deletes an existing private endpoint connection"), + // Operation: to.Ptr("Delete Azure Database for PostgreSQL - Flexible Server Private Endpoint Connection"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("Azure Database for PostgreSQL - Flexible Server Private Endpoint Connection"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/privateEndpointConnections/write"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Approves or rejects an existing private endpoint connection"), + // Operation: to.Ptr("Approve or Reject Azure Database for PostgreSQL - Flexible Server Private Endpoint Connection"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("Azure Database for PostgreSQL - Flexible Server Private Endpoint Connection"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/privateLinkResources/read"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Return a list containing private link resource or gets the specified private link resource."), + // Operation: to.Ptr("List/Get PostgreSQL private link resource"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("Azure Database for PostgreSQL private link resource"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/serverGroupsv2/privateEndpointConnectionProxies/read"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Returns the list of private endpoint connections or gets the properties for the specified private endpoint connection via proxy"), + // Operation: to.Ptr("List/Get Azure Database for PostgreSQL SGv2 Private Endpoint Connection Via Proxy"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("Azure Database for PostgreSQL SGv2 Private Endpoint Connection Proxy"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/serverGroupsv2/privateEndpointConnectionProxies/write"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Creates a private endpoint connection with the specified parameters or updates the properties or tags for the specified private endpoint connection via proxy"), + // Operation: to.Ptr("Create/Update Azure Database for PostgreSQL SGv2 Private Endpoint Connection Via Proxy"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("Azure Database for PostgreSQL SGv2 Private Endpoint Connection Proxy"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/serverGroupsv2/privateEndpointConnectionProxies/delete"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Deletes an existing private endpoint connection via proxy"), + // Operation: to.Ptr("Delete Azure Database for PostgreSQL SGv2 Private Endpoint Connection Via Proxy"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("Azure Database for PostgreSQL SGv2 Private Endpoint Connection Proxy"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/serverGroupsv2/privateEndpointConnectionProxies/validate/action"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Validates a private endpoint connection creation by NRP"), + // Operation: to.Ptr("Validate Azure Database for PostgreSQL SGv2 Private Endpoint Connection Creation by NRP"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("Azure Database for PostgreSQL SGv2 Private Endpoint Connection Proxy"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/serverGroupsv2/privateEndpointConnections/read"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Returns the list of private endpoint connections or gets the properties for the specified private endpoint connection"), + // Operation: to.Ptr("List/Get Azure Database for PostgreSQL SGv2 Private Endpoint Connection"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("Azure Database for PostgreSQL SGv2 Private Endpoint Connection"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/serverGroupsv2/privateEndpointConnections/write"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Approves or rejects an existing private endpoint connection"), + // Operation: to.Ptr("Approve or Reject Azure Database for PostgreSQL SGv2 Private Endpoint Connection"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("Azure Database for PostgreSQL SGv2 Private Endpoint Connection"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/serverGroupsv2/privateEndpointConnections/delete"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Deletes an existing private endpoint connection"), + // Operation: to.Ptr("Delete Azure Database for PostgreSQL SGv2 Private Endpoint Connection"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("Azure Database for PostgreSQL SGv2 Private Endpoint Connection"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/serverGroupsv2/privateLinkResources/read"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Get the private link resources for the corresponding PostgreSQL SGv2"), + // Operation: to.Ptr("Get the private link resources for the corresponding PostgreSQL SGv2"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("Azure Database for PostgreSQL SGv2 Private Link Resource"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/serverGroupsv2/privateEndpointConnectionsApproval/action"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Determines if user is allowed to approve a private endpoint connection for PostgreSQL SGv2"), + // Operation: to.Ptr("Private Endpoint Connections Approval for PostgreSQL SGv2"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("Azure Database for PostgreSQL SGv2 Private Endpoint Connections Approval Resource"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/servers/securityAlertPolicies/read"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Retrieve details of the server threat detection policy configured on a given server"), + // Operation: to.Ptr("Get server threat detection policy"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("Server Threat Detection Policy"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/servers/securityAlertPolicies/write"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Change the server threat detection policy for a given server"), + // Operation: to.Ptr("Update server threat detection policy"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("Server Threat Detection Policy"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/locations/securityAlertPoliciesOperationResults/read"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Return the list of Server threat detection operation result."), + // Operation: to.Ptr("List/Get Server threat detection operation result."), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("Server threat detection operation result"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/servers/keys/read"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Return the list of server keys or gets the properties for the specified server key."), + // Operation: to.Ptr("List/Get Azure Database for PostgreSQL Server Key(s)"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("Azure Database for PostgreSQL Server Keys"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/servers/keys/write"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Creates a key with the specified parameters or update the properties or tags for the specified server key."), + // Operation: to.Ptr("Create/Update Azure Database for PostgreSQL Server Keys"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("Azure Database for PostgreSQL Server Keys"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/servers/keys/delete"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Deletes an existing server key."), + // Operation: to.Ptr("Delete Azure Database for PostgreSQL Server Key"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("Azure Database for PostgreSQL Server Keys"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/locations/serverKeyAzureAsyncOperation/read"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Gets in-progress operations on data encryption server keys"), + // Operation: to.Ptr("Data Encryption server keys operation"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("Data Encryption server key operation"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/locations/serverKeyOperationResults/read"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Gets in-progress operations on data encryption server keys"), + // Operation: to.Ptr("Data Encryption server keys operation"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("Data Encryption server key operation"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/servers/advisors/read"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Return the list of advisors"), + // Operation: to.Ptr("Return the list of advisors"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("Advisors"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/servers/advisors/recommendedActions/read"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Return the list of recommended actions"), + // Operation: to.Ptr("Return the list of recommended actions"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("Recommended Actions"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/servers/advisors/recommendedActionSessions/action"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Make recommendations"), + // Operation: to.Ptr("Make recommendations"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("Recommended Actions"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/servers/queryTexts/action"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Return the text of a query"), + // Operation: to.Ptr("List query text of a query"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("Query Texts"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/servers/queryTexts/read"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Return the texts for a list of queries"), + // Operation: to.Ptr("List query texts for a list of queries"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("Query Texts"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/servers/resetQueryPerformanceInsightData/action"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Reset Query Performance Insight data"), + // Operation: to.Ptr("Reset Query Performance Insight data"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("Reset Query Performance Insight data"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/servers/topQueryStatistics/read"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Return the list of Query Statistics for the top queries."), + // Operation: to.Ptr("List/Get Query Statistic(s) for top queries"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("Top Query Statistics"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/servers/waitStatistics/read"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Return wait statistics for an instance"), + // Operation: to.Ptr("List Wait Statistics for an instance"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("Wait Statistics"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/privateEndpointConnectionsApproval/action"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Determines if user is allowed to approve a private endpoint connection"), + // Operation: to.Ptr("Private Endpoint Connections Approval"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("Private Endpoint Connections Approval"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/servers/privateEndpointConnectionsApproval/action"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Determines if user is allowed to approve a private endpoint connection"), + // Operation: to.Ptr("Private Endpoint Connections Approval"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("Private Endpoint Connections Approval"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/servers/privateLinkResources/read"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Get the private link resources for the corresponding PostgreSQL Server"), + // Operation: to.Ptr("Get the private link resources for the corresponding PostgreSQL Server"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("Azure Database for PostgreSQL private link resource"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/servers/privateEndpointConnections/read"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Returns the list of private endpoint connections or gets the properties for the specified private endpoint connection."), + // Operation: to.Ptr("List/Get Azure Database for PostgreSQL private endpoint connection"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("Azure Database for PostgreSQL private endpoint connection"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/servers/privateEndpointConnections/delete"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Deletes an existing private endpoint connection"), + // Operation: to.Ptr("Delete Azure Database for PostgreSQL private endpoint connection"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("Azure Database for PostgreSQL private endpoint connection"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/servers/privateEndpointConnections/write"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Approves or rejects an existing private endpoint connection"), + // Operation: to.Ptr("Approve or Reject Azure Database for PostgreSQL private endpoint connection"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("Azure Database for PostgreSQL private endpoint connection"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/locations/privateEndpointConnectionOperationResults/read"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Gets the result for a private endpoint connection operation"), + // Operation: to.Ptr("Get private endpoint connection operation status"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("Azure Database for PostgreSQL private endpoint connection"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/locations/privateEndpointConnectionAzureAsyncOperation/read"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Gets the result for a private endpoint connection operation"), + // Operation: to.Ptr("Get private endpoint connection operation status"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("Azure Database for PostgreSQL private endpoint connection"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/locations/privateEndpointConnectionProxyOperationResults/read"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Gets the result for a private endpoint connection proxy operation"), + // Operation: to.Ptr("Get private endpoint connection proxy operation status"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("Azure Database for PostgreSQL Private Endpoint Connection Proxy"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/servers/privateEndpointConnectionProxies/validate/action"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Validates a private endpoint connection create call from NRP side"), + // Operation: to.Ptr("Validate Azure Database for PostgreSQL Private Endpoint Connection Creation by NRP"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("Azure Database for PostgreSQL Private Endpoint Connection Proxy"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/servers/privateEndpointConnectionProxies/read"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Returns the list of private endpoint connection proxies or gets the properties for the specified private endpoint connection proxy."), + // Operation: to.Ptr("List/Get Azure Database for PostgreSQL Private Endpoint Connection Proxy"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("Azure Database for PostgreSQL Private Endpoint Connection Proxy"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/servers/privateEndpointConnectionProxies/write"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Creates a private endpoint connection proxy with the specified parameters or updates the properties or tags for the specified private endpoint connection proxy."), + // Operation: to.Ptr("Create/Update Azure Database for PostgreSQL Private Endpoint Connection Proxy"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("Azure Database for PostgreSQL Private Endpoint Connection Proxy"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/servers/privateEndpointConnectionProxies/delete"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Deletes an existing private endpoint connection proxy"), + // Operation: to.Ptr("Delete Azure Database for PostgreSQL Private Endpoint Connection Proxy"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("Azure Database for PostgreSQL Private Endpoint Connection Proxy"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/locations/privateEndpointConnectionProxyAzureAsyncOperation/read"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Gets the result for a private endpoint connection proxy operation"), + // Operation: to.Ptr("Get private endpoint connection proxy operation status"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("Azure Database for PostgreSQL Private Endpoint Connection Proxy"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/locations/performanceTiers/read"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Returns the list of Performance Tiers available."), + // Operation: to.Ptr("List Performance Tiers"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("Performance Tiers"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/locations/operationResults/read"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Return ResourceGroup based PostgreSQL Server Operation Results"), + // Operation: to.Ptr("Get PostgreSQL ResourceGroup based Server Operation Results "), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("PostgreSQ ResourceGroup based Server Operation Results"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/servers/recoverableServers/read"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Return the recoverable PostgreSQL Server info"), + // Operation: to.Ptr("Get Recoverable PostgreSQL Server info"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("Recoverable PostgreSQL Server"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/servers/replicas/read"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Get read replicas of a PostgreSQL server"), + // Operation: to.Ptr("Get PostgreSQL read replicas"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("PostgreSQL Server"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/servers/read"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Return the list of servers or gets the properties for the specified server."), + // Operation: to.Ptr("List/Get PostgreSQL Servers"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("PostgreSQL Server"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/servers/write"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Creates a server with the specified parameters or update the properties or tags for the specified server."), + // Operation: to.Ptr("Create/Update PostgreSQL Server"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("PostgreSQL Server"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/servers/delete"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Deletes an existing server."), + // Operation: to.Ptr("Delete PostgreSQL Server"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("PostgreSQL Server"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/servers/performanceTiers/read"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Returns the list of Performance Tiers available."), + // Operation: to.Ptr("List Performance Tiers"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("Performance Tiers"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/locations/operationResults/read"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Return PostgreSQL Server Operation Results"), + // Operation: to.Ptr("Get PostgreSQL Server Operation Results"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("PostgreSQL Server Operation Results"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/servers/restart/action"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Restarts a specific server."), + // Operation: to.Ptr("Restart PostgreSQL Server"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("PostgreSQL Server"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/locations/securityAlertPoliciesAzureAsyncOperation/read"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Return the list of Server threat detection operation result."), + // Operation: to.Ptr("List/Get Server threat detection operation result."), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("Server threat detection operation result"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/servers/administrators/read"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Gets a list of PostgreSQL server administrators."), + // Operation: to.Ptr("Get Administrators of PostgreSQL server."), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("Administrator of PostgreSQL server."), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/servers/administrators/write"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Creates or updates PostgreSQL server administrator with the specified parameters."), + // Operation: to.Ptr("Create/Update Administrator of PostgreSQL server."), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("Administrator of PostgreSQL server."), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/servers/administrators/delete"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Deletes an existing administrator of PostgreSQL server."), + // Operation: to.Ptr("Delete Administrator of PostgreSQL server."), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("Administrator of PostgreSQL server."), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/locations/administratorAzureAsyncOperation/read"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Gets in-progress operations on PostgreSQL server administrators"), + // Operation: to.Ptr("PostgreSQL server administrator operation"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("Administrator opertiaons of PostgreSQL server."), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/locations/administratorOperationResults/read"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Return PostgreSQL Server administrator operation results"), + // Operation: to.Ptr("Get PostgreSQL server operation results"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("PostgreSQL server operation results"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/register/action"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Register PostgreSQL Resource Provider"), + // Operation: to.Ptr("Register PostgreSQL Resource Provider"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("Microsoft Database For PostgreSQL Resource Provider"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/servers/updateConfigurations/action"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Update configurations for the specified server"), + // Operation: to.Ptr("Batch Update Server Configurations"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("PostgreSQL Server"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/checkNameAvailability/action"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Verify whether given server name is available for provisioning worldwide for a given subscription."), + // Operation: to.Ptr("Check Server Name Availability"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("PostgreSQL Server"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations/read"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Return the list of configurations for a server or gets the properties for the specified configuration."), + // Operation: to.Ptr("List/Get Configurations"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("Configurations"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations/write"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Update the value for the specified configuration"), + // Operation: to.Ptr("Update Configuration"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("Configurations"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/servers/virtualNetworkRules/read"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Return the list of virtual network rules or gets the properties for the specified virtual network rule."), + // Operation: to.Ptr("List/Get Virtual Network Rule(s)"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("Virtual Network Rules"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/servers/virtualNetworkRules/write"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Creates a virtual network rule with the specified parameters or update the properties or tags for the specified virtual network rule."), + // Operation: to.Ptr("Create/Update Virtual Network Rule"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("Virtual Network Rules"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/servers/virtualNetworkRules/delete"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Deletes an existing Virtual Network Rule"), + // Operation: to.Ptr("Delete Virtual Network Rule"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("Virtual Network Rules"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/locations/azureAsyncOperation/read"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Return PostgreSQL Server Operation Results"), + // Operation: to.Ptr("Get PostgreSQL Server Operation Results"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("PostgreSQL Server Operation Results"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/servers/databases/read"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Return the list of PostgreSQL Databases or gets the properties for the specified Database."), + // Operation: to.Ptr("List/Get PostgreSQL Database"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("PostgreSQL Databases"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/servers/databases/write"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Creates a PostgreSQL Database with the specified parameters or update the properties for the specified Database."), + // Operation: to.Ptr("Create/Update PostgreSQL Database"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("PostgreSQL Databases"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/servers/databases/delete"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Deletes an existing PostgreSQL Database."), + // Operation: to.Ptr("Delete PostgreSQL Database"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("PostgreSQL Databases"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/servers/firewallRules/read"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Return the list of firewall rules for a server or gets the properties for the specified firewall rule."), + // Operation: to.Ptr("List/Get Firewall Rules"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("Firewall Rules"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/servers/firewallRules/write"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Creates a firewall rule with the specified parameters or update an existing rule."), + // Operation: to.Ptr("Create/Update Firewall Rule"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("Firewall Rules"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/servers/firewallRules/delete"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Deletes an existing firewall rule."), + // Operation: to.Ptr("Delete Firewall Rule"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("Firewall Rules"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/servers/logFiles/read"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Return the list of PostgreSQL LogFiles."), + // Operation: to.Ptr("List/Get PostgreSQL LogFiles"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("PostgreSQL LogFiles"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/performanceTiers/read"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Returns the list of Performance Tiers available."), + // Operation: to.Ptr("List Performance Tiers"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("Performance Tiers"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/operations/read"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Return the list of PostgreSQL Operations."), + // Operation: to.Ptr("List/Get PostgreSQL Operations"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("PostgreSQL Operations"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/servers/providers/Microsoft.Insights/metricDefinitions/read"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Return types of metrics that are available for databases"), + // Operation: to.Ptr("Get database metric definitions"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("Database Metric Definition"), + // }, + // Properties: map[string]any{ + // "serviceSpecification": map[string]any{ + // "metricSpecifications": []any{ + // map[string]any{ + // "name": "cpu_percent", + // "aggregationType": "Average", + // "category": "Saturation", + // "displayDescription": "CPU percent", + // "displayName": "CPU percent", + // "supportedAggregationTypes": []any{ + // "Average", + // "Maximum", + // "Minimum", + // }, + // "unit": "Percent", + // }, + // map[string]any{ + // "name": "memory_percent", + // "aggregationType": "Average", + // "category": "Saturation", + // "displayDescription": "Memory percent", + // "displayName": "Memory percent", + // "supportedAggregationTypes": []any{ + // "Average", + // "Maximum", + // "Minimum", + // }, + // "unit": "Percent", + // }, + // map[string]any{ + // "name": "io_consumption_percent", + // "aggregationType": "Average", + // "category": "Saturation", + // "displayDescription": "IO percent", + // "displayName": "IO percent", + // "supportedAggregationTypes": []any{ + // "Average", + // "Maximum", + // "Minimum", + // }, + // "unit": "Percent", + // }, + // map[string]any{ + // "name": "storage_percent", + // "aggregationType": "Average", + // "category": "Saturation", + // "displayDescription": "Storage percent", + // "displayName": "Storage percent", + // "supportedAggregationTypes": []any{ + // "Average", + // "Maximum", + // "Minimum", + // }, + // "unit": "Percent", + // }, + // map[string]any{ + // "name": "storage_used", + // "aggregationType": "Average", + // "category": "Saturation", + // "displayDescription": "Storage used", + // "displayName": "Storage used", + // "supportedAggregationTypes": []any{ + // "Average", + // "Maximum", + // "Minimum", + // }, + // "unit": "Bytes", + // }, + // map[string]any{ + // "name": "storage_limit", + // "aggregationType": "Maximum", + // "category": "Saturation", + // "displayDescription": "Storage limit", + // "displayName": "Storage limit", + // "supportedAggregationTypes": []any{ + // "Maximum", + // }, + // "unit": "Bytes", + // }, + // map[string]any{ + // "name": "serverlog_storage_percent", + // "aggregationType": "Average", + // "category": "Saturation", + // "displayDescription": "Server Log storage percent", + // "displayName": "Server Log storage percent", + // "supportedAggregationTypes": []any{ + // "Average", + // "Maximum", + // "Minimum", + // }, + // "unit": "Percent", + // }, + // map[string]any{ + // "name": "serverlog_storage_usage", + // "aggregationType": "Average", + // "category": "Saturation", + // "displayDescription": "Server Log storage used", + // "displayName": "Server Log storage used", + // "supportedAggregationTypes": []any{ + // "Average", + // "Maximum", + // "Minimum", + // }, + // "unit": "Bytes", + // }, + // map[string]any{ + // "name": "serverlog_storage_limit", + // "aggregationType": "Maximum", + // "category": "Saturation", + // "displayDescription": "Server Log storage limit", + // "displayName": "Server Log storage limit", + // "supportedAggregationTypes": []any{ + // "Maximum", + // }, + // "unit": "Bytes", + // }, + // map[string]any{ + // "name": "active_connections", + // "aggregationType": "Average", + // "category": "Traffic", + // "displayDescription": "Active Connections", + // "displayName": "Active Connections", + // "supportedAggregationTypes": []any{ + // "Average", + // "Maximum", + // "Minimum", + // }, + // "unit": "Count", + // }, + // map[string]any{ + // "name": "connections_failed", + // "aggregationType": "Total", + // "category": "Errors", + // "displayDescription": "Failed Connections", + // "displayName": "Failed Connections", + // "supportedAggregationTypes": []any{ + // "Total", + // }, + // "unit": "Count", + // }, + // map[string]any{ + // "name": "backup_storage_used", + // "aggregationType": "Average", + // "category": "Saturation", + // "displayDescription": "Backup Storage Used", + // "displayName": "Backup Storage Used", + // "supportedAggregationTypes": []any{ + // "Average", + // "Maximum", + // "Minimum", + // }, + // "supportedTimeGrainTypes": []any{ + // "PT15M", + // "PT30M", + // "PT1H", + // "PT6H", + // "PT12H", + // "P1D", + // }, + // "unit": "Bytes", + // }, + // map[string]any{ + // "name": "network_bytes_egress", + // "aggregationType": "Total", + // "category": "Traffic", + // "displayDescription": "Network Out across active connections", + // "displayName": "Network Out", + // "supportedAggregationTypes": []any{ + // "Total", + // }, + // "unit": "Bytes", + // }, + // map[string]any{ + // "name": "network_bytes_ingress", + // "aggregationType": "Total", + // "category": "Traffic", + // "displayDescription": "Network In across active connections", + // "displayName": "Network In", + // "supportedAggregationTypes": []any{ + // "Total", + // }, + // "unit": "Bytes", + // }, + // map[string]any{ + // "name": "pg_replica_log_delay_in_seconds", + // "aggregationType": "Maximum", + // "category": "Latency", + // "displayDescription": "Replica lag in seconds", + // "displayName": "Replica Lag", + // "supportedAggregationTypes": []any{ + // "Average", + // "Maximum", + // "Minimum", + // }, + // "unit": "Seconds", + // }, + // map[string]any{ + // "name": "pg_replica_log_delay_in_bytes", + // "aggregationType": "Maximum", + // "category": "Latency", + // "displayDescription": "Lag in bytes of the most lagging replica", + // "displayName": "Max Lag Across Replicas", + // "supportedAggregationTypes": []any{ + // "Average", + // "Maximum", + // "Minimum", + // }, + // "unit": "Bytes", + // }, + // }, + // }, + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/servers/providers/Microsoft.Insights/logDefinitions/read"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Gets the available logs for PostgreSQL servers"), + // Operation: to.Ptr("Read server log definitions"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("The log definition of servers"), + // }, + // Properties: map[string]any{ + // "serviceSpecification": map[string]any{ + // "logSpecifications": []any{ + // map[string]any{ + // "name": "PostgreSQLLogs", + // "blobDuration": "PT1H", + // "displayName": "PostgreSQL Server Logs", + // }, + // map[string]any{ + // "name": "QueryStoreRuntimeStatistics", + // "blobDuration": "PT1H", + // "displayName": "PostgreSQL Query Store Runtime Statistics", + // }, + // map[string]any{ + // "name": "QueryStoreWaitStatistics", + // "blobDuration": "PT1H", + // "displayName": "PostgreSQL Query Store Wait Statistics", + // }, + // }, + // }, + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/servers/providers/Microsoft.Insights/diagnosticSettings/read"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Gets the disagnostic setting for the resource"), + // Operation: to.Ptr("Read diagnostic setting"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("Database Metric Definition"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/servers/providers/Microsoft.Insights/diagnosticSettings/write"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Creates or updates the diagnostic setting for the resource"), + // Operation: to.Ptr("Write diagnostic setting"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("Database Metric Definition"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/serversv2/providers/Microsoft.Insights/metricDefinitions/read"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Return types of metrics that are available for databases"), + // Operation: to.Ptr("Get database metric definitions"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("Database Metric Definition"), + // }, + // Properties: map[string]any{ + // "serviceSpecification": map[string]any{ + // "metricSpecifications": []any{ + // map[string]any{ + // "name": "cpu_percent", + // "aggregationType": "Average", + // "category": "Saturation", + // "displayDescription": "CPU percent", + // "displayName": "CPU percent", + // "supportedAggregationTypes": []any{ + // "Average", + // "Maximum", + // "Minimum", + // }, + // "unit": "Percent", + // }, + // map[string]any{ + // "name": "memory_percent", + // "aggregationType": "Average", + // "category": "Saturation", + // "displayDescription": "Memory percent", + // "displayName": "Memory percent", + // "supportedAggregationTypes": []any{ + // "Average", + // "Maximum", + // "Minimum", + // }, + // "unit": "Percent", + // }, + // map[string]any{ + // "name": "iops", + // "aggregationType": "Average", + // "category": "Saturation", + // "displayDescription": "IO Operations per second", + // "displayName": "IOPS", + // "supportedAggregationTypes": []any{ + // "Average", + // "Maximum", + // "Minimum", + // }, + // "unit": "Count", + // }, + // map[string]any{ + // "name": "storage_percent", + // "aggregationType": "Average", + // "category": "Saturation", + // "displayDescription": "Storage percent", + // "displayName": "Storage percent", + // "supportedAggregationTypes": []any{ + // "Average", + // "Maximum", + // "Minimum", + // }, + // "unit": "Percent", + // }, + // map[string]any{ + // "name": "storage_used", + // "aggregationType": "Average", + // "category": "Saturation", + // "displayDescription": "Storage used", + // "displayName": "Storage used", + // "supportedAggregationTypes": []any{ + // "Average", + // "Maximum", + // "Minimum", + // }, + // "unit": "Bytes", + // }, + // map[string]any{ + // "name": "active_connections", + // "aggregationType": "Average", + // "category": "Traffic", + // "displayDescription": "Active Connections", + // "displayName": "Active Connections", + // "supportedAggregationTypes": []any{ + // "Average", + // "Maximum", + // "Minimum", + // }, + // "unit": "Count", + // }, + // map[string]any{ + // "name": "network_bytes_egress", + // "aggregationType": "Total", + // "category": "Traffic", + // "displayDescription": "Network Out across active connections", + // "displayName": "Network Out", + // "supportedAggregationTypes": []any{ + // "Total", + // }, + // "unit": "Bytes", + // }, + // map[string]any{ + // "name": "network_bytes_ingress", + // "aggregationType": "Total", + // "category": "Traffic", + // "displayDescription": "Network In across active connections", + // "displayName": "Network In", + // "supportedAggregationTypes": []any{ + // "Total", + // }, + // "unit": "Bytes", + // }, + // }, + // }, + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/serversv2/providers/Microsoft.Insights/logDefinitions/read"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Gets the available logs for PostgreSQL servers"), + // Operation: to.Ptr("Read server log definitions"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("The log definition of servers"), + // }, + // Properties: map[string]any{ + // "serviceSpecification": map[string]any{ + // "logSpecifications": []any{ + // map[string]any{ + // "name": "PostgreSQLLogs", + // "blobDuration": "PT1H", + // "displayName": "PostgreSQL Server Logs", + // }, + // }, + // }, + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/serversv2/providers/Microsoft.Insights/diagnosticSettings/read"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Gets the disagnostic setting for the resource"), + // Operation: to.Ptr("Read diagnostic setting"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("Database Metric Definition"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/serversv2/providers/Microsoft.Insights/diagnosticSettings/write"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Creates or updates the diagnostic setting for the resource"), + // Operation: to.Ptr("Write diagnostic setting"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("Database Metric Definition"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/serversv2/read"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Return the list of servers or gets the properties for the specified server."), + // Operation: to.Ptr("List/Get PostgreSQL Servers"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("PostgreSQL Server"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/serversv2/write"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Creates a server with the specified parameters or update the properties or tags for the specified server."), + // Operation: to.Ptr("Create/Update PostgreSQL Server"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("PostgreSQL Server"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/serversv2/delete"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Deletes an existing server."), + // Operation: to.Ptr("Delete PostgreSQL Server"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("PostgreSQL Server"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/serversv2/firewallRules/read"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Return the list of firewall rules for a server or gets the properties for the specified firewall rule."), + // Operation: to.Ptr("List/Get Firewall Rules"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("Firewall Rules"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/serversv2/firewallRules/write"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Creates a firewall rule with the specified parameters or update an existing rule."), + // Operation: to.Ptr("Create/Update Firewall Rule"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("Firewall Rules"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/serversv2/firewallRules/delete"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Deletes an existing firewall rule."), + // Operation: to.Ptr("Delete Firewall Rule"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("Firewall Rules"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/serversv2/configurations/read"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Return the list of configurations for a server or gets the properties for the specified configuration."), + // Operation: to.Ptr("List/Get Configurations"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("Configurations"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/serversv2/configurations/write"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Update the value for the specified configuration"), + // Operation: to.Ptr("Update Configuration"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("Configurations"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/serversv2/updateConfigurations/action"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Update configurations for the specified server"), + // Operation: to.Ptr("Batch Update Server Configurations"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("PostgreSQL Server"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/providers/Microsoft.Insights/metricDefinitions/read"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Return types of metrics that are available for databases"), + // Operation: to.Ptr("Get database metric definitions"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("Database Metric Definition"), + // }, + // Properties: map[string]any{ + // "serviceSpecification": map[string]any{ + // "metricSpecifications": []any{ + // map[string]any{ + // "name": "backup_storage_used", + // "aggregationType": "Average", + // "category": "Saturation", + // "displayDescription": "Backup Storage Used", + // "displayName": "Backup Storage Used", + // "supportedAggregationTypes": []any{ + // "Average", + // "Maximum", + // "Minimum", + // }, + // "unit": "Bytes", + // }, + // map[string]any{ + // "name": "cpu_credits_consumed", + // "aggregationType": "Average", + // "category": "Saturation", + // "displayDescription": "Total number of credits consumed by the database server", + // "displayName": "CPU Credits Consumed", + // "supportedAggregationTypes": []any{ + // "Average", + // "Maximum", + // "Minimum", + // }, + // "unit": "Count", + // }, + // map[string]any{ + // "name": "cpu_credits_remaining", + // "aggregationType": "Average", + // "category": "Saturation", + // "displayDescription": "Total number of credits available to burst", + // "displayName": "CPU Credits Remaining", + // "supportedAggregationTypes": []any{ + // "Average", + // "Maximum", + // "Minimum", + // }, + // "unit": "Count", + // }, + // map[string]any{ + // "name": "cpu_percent", + // "aggregationType": "Average", + // "category": "Saturation", + // "displayDescription": "CPU percent", + // "displayName": "CPU percent", + // "supportedAggregationTypes": []any{ + // "Average", + // "Maximum", + // "Minimum", + // }, + // "unit": "Percent", + // }, + // map[string]any{ + // "name": "memory_percent", + // "aggregationType": "Average", + // "category": "Saturation", + // "displayDescription": "Memory percent", + // "displayName": "Memory percent", + // "supportedAggregationTypes": []any{ + // "Average", + // "Maximum", + // "Minimum", + // }, + // "unit": "Percent", + // }, + // map[string]any{ + // "name": "iops", + // "aggregationType": "Average", + // "category": "Saturation", + // "displayDescription": "IO Operations per second", + // "displayName": "IOPS", + // "supportedAggregationTypes": []any{ + // "Average", + // "Maximum", + // "Minimum", + // }, + // "unit": "Count", + // }, + // map[string]any{ + // "name": "disk_queue_depth", + // "aggregationType": "Average", + // "category": "Saturation", + // "displayDescription": "Number of outstanding I/O operations to the data disk", + // "displayName": "Disk Queue Depth", + // "supportedAggregationTypes": []any{ + // "Average", + // "Maximum", + // "Minimum", + // }, + // "unit": "Count", + // }, + // map[string]any{ + // "name": "read_throughput", + // "aggregationType": "Average", + // "category": "Saturation", + // "displayDescription": "Bytes read per second from the data disk during monitoring period", + // "displayName": "Read Throughput Bytes/Sec", + // "supportedAggregationTypes": []any{ + // "Average", + // "Maximum", + // "Minimum", + // }, + // "unit": "Count", + // }, + // map[string]any{ + // "name": "write_throughput", + // "aggregationType": "Average", + // "category": "Saturation", + // "displayDescription": "Bytes written per second to the data disk during monitoring period", + // "displayName": "Write Throughput Bytes/Sec", + // "supportedAggregationTypes": []any{ + // "Average", + // "Maximum", + // "Minimum", + // }, + // "unit": "Count", + // }, + // map[string]any{ + // "name": "read_iops", + // "aggregationType": "Average", + // "category": "Saturation", + // "displayDescription": "Number of data disk I/O read operations per second", + // "displayName": "Read IOPS", + // "supportedAggregationTypes": []any{ + // "Average", + // "Maximum", + // "Minimum", + // }, + // "unit": "Count", + // }, + // map[string]any{ + // "name": "write_iops", + // "aggregationType": "Average", + // "category": "Saturation", + // "displayDescription": "Number of data disk I/O write operations per second", + // "displayName": "Write IOPS", + // "supportedAggregationTypes": []any{ + // "Average", + // "Maximum", + // "Minimum", + // }, + // "unit": "Count", + // }, + // map[string]any{ + // "name": "storage_percent", + // "aggregationType": "Average", + // "category": "Saturation", + // "displayDescription": "Storage percent", + // "displayName": "Storage percent", + // "supportedAggregationTypes": []any{ + // "Average", + // "Maximum", + // "Minimum", + // }, + // "unit": "Percent", + // }, + // map[string]any{ + // "name": "storage_used", + // "aggregationType": "Average", + // "category": "Saturation", + // "displayDescription": "Storage used", + // "displayName": "Storage used", + // "supportedAggregationTypes": []any{ + // "Average", + // "Maximum", + // "Minimum", + // }, + // "unit": "Bytes", + // }, + // map[string]any{ + // "name": "storage_free", + // "aggregationType": "Average", + // "category": "Saturation", + // "displayDescription": "Storage Free", + // "displayName": "Storage Free", + // "supportedAggregationTypes": []any{ + // "Average", + // "Maximum", + // "Minimum", + // }, + // "unit": "Bytes", + // }, + // map[string]any{ + // "name": "txlogs_storage_used", + // "aggregationType": "Average", + // "category": "Saturation", + // "displayDescription": "Transaction Log Storage Used", + // "displayName": "Transaction Log Storage Used", + // "supportedAggregationTypes": []any{ + // "Average", + // "Maximum", + // "Minimum", + // }, + // "unit": "Bytes", + // }, + // map[string]any{ + // "name": "active_connections", + // "aggregationType": "Average", + // "category": "Traffic", + // "displayDescription": "Active Connections", + // "displayName": "Active Connections", + // "supportedAggregationTypes": []any{ + // "Average", + // "Maximum", + // "Minimum", + // }, + // "unit": "Count", + // }, + // map[string]any{ + // "name": "network_bytes_egress", + // "aggregationType": "Total", + // "category": "Traffic", + // "displayDescription": "Network Out across active connections", + // "displayName": "Network Out", + // "supportedAggregationTypes": []any{ + // "Total", + // }, + // "unit": "Bytes", + // }, + // map[string]any{ + // "name": "network_bytes_ingress", + // "aggregationType": "Total", + // "category": "Traffic", + // "displayDescription": "Network In across active connections", + // "displayName": "Network In", + // "supportedAggregationTypes": []any{ + // "Total", + // }, + // "unit": "Bytes", + // }, + // map[string]any{ + // "name": "connections_failed", + // "aggregationType": "Total", + // "category": "Errors", + // "displayDescription": "Failed Connections", + // "displayName": "Failed Connections", + // "supportedAggregationTypes": []any{ + // "Total", + // }, + // "unit": "Count", + // }, + // map[string]any{ + // "name": "connections_succeeded", + // "aggregationType": "Total", + // "category": "Traffic", + // "displayDescription": "Succeeded Connections", + // "displayName": "Succeeded Connections", + // "supportedAggregationTypes": []any{ + // "Total", + // }, + // "unit": "Count", + // }, + // map[string]any{ + // "name": "maximum_used_transactionIDs", + // "aggregationType": "Average", + // "category": "Traffic", + // "displayDescription": "Maximum Used Transaction IDs", + // "displayName": "Maximum Used Transaction IDs", + // "supportedAggregationTypes": []any{ + // "Average", + // "Maximum", + // "Minimum", + // }, + // "unit": "Count", + // }, + // }, + // }, + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/providers/Microsoft.Insights/logDefinitions/read"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Gets the available logs for PostgreSQL servers"), + // Operation: to.Ptr("Read server log definitions"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("The log definition of servers"), + // }, + // Properties: map[string]any{ + // "serviceSpecification": map[string]any{ + // "logSpecifications": []any{ + // map[string]any{ + // "name": "PostgreSQLLogs", + // "blobDuration": "PT1H", + // "displayName": "PostgreSQL Server Logs", + // }, + // }, + // }, + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/providers/Microsoft.Insights/diagnosticSettings/read"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Gets the disagnostic setting for the resource"), + // Operation: to.Ptr("Read diagnostic setting"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("Database Metric Definition"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/providers/Microsoft.Insights/diagnosticSettings/write"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Creates or updates the diagnostic setting for the resource"), + // Operation: to.Ptr("Write diagnostic setting"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("Database Metric Definition"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/privateEndpointConnectionsApproval/action"), + // Display: &armpostgresql.OperationDisplay{ + // Description: to.Ptr("Determines if the user is allowed to approve a private endpoint connection"), + // Operation: to.Ptr("Private Endpoint Connections Approval"), + // Provider: to.Ptr("Microsoft DB for PostgreSQL"), + // Resource: to.Ptr("Private Endpoint Connections Approval"), + // }, + // }, + // }, + // }, + // } } - // 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.OperationListResult = armpostgresql.OperationListResult{ - // Value: []*armpostgresql.Operation{ - // { - // Name: to.Ptr("Microsoft.DBforPostgreSQL/locations/performanceTiers/read"), - // Display: &armpostgresql.OperationDisplay{ - // Description: to.Ptr("Returns the list of Performance Tiers available."), - // Operation: to.Ptr("List Performance Tiers"), - // Provider: to.Ptr("Microsoft DB for PostgreSQL"), - // Resource: to.Ptr("Performance Tiers"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.DBforPostgreSQL/servers/read"), - // Display: &armpostgresql.OperationDisplay{ - // Description: to.Ptr("Return the list of servers or gets the properties for the specified server."), - // Operation: to.Ptr("List/Get PostgreSQL Servers"), - // Provider: to.Ptr("Microsoft DB for PostgreSQL"), - // Resource: to.Ptr("PostgreSQL Server"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.DBforPostgreSQL/servers/write"), - // Display: &armpostgresql.OperationDisplay{ - // Description: to.Ptr("Creates a server with the specified parameters or update the properties or tags for the specified server."), - // Operation: to.Ptr("Create/Update PostgreSQL Server"), - // Provider: to.Ptr("Microsoft DB for PostgreSQL"), - // Resource: to.Ptr("PostgreSQL Server"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.DBforPostgreSQL/servers/delete"), - // Display: &armpostgresql.OperationDisplay{ - // Description: to.Ptr("Deletes an existing server."), - // Operation: to.Ptr("Delete PostgreSQL Server"), - // Provider: to.Ptr("Microsoft DB for PostgreSQL"), - // Resource: to.Ptr("PostgreSQL Server"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.DBforPostgreSQL/performanceTiers/read"), - // Display: &armpostgresql.OperationDisplay{ - // Description: to.Ptr("Returns the list of Performance Tiers available."), - // Operation: to.Ptr("List Performance Tiers"), - // Provider: to.Ptr("Microsoft DB for PostgreSQL"), - // Resource: to.Ptr("Performance Tiers"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.DBforPostgreSQL/servers/firewallRules/read"), - // Display: &armpostgresql.OperationDisplay{ - // Description: to.Ptr("Return the list of firewall rules for a server or gets the properties for the specified firewall rule."), - // Operation: to.Ptr("List/Get Firewall Rules"), - // Provider: to.Ptr("Microsoft DB for PostgreSQL"), - // Resource: to.Ptr("Firewall Rules"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.DBforPostgreSQL/servers/firewallRules/write"), - // Display: &armpostgresql.OperationDisplay{ - // Description: to.Ptr("Creates a firewall rule with the specified parameters or update an existing rule."), - // Operation: to.Ptr("Create/Update Firewall Rule"), - // Provider: to.Ptr("Microsoft DB for PostgreSQL"), - // Resource: to.Ptr("Firewall Rules"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.DBforPostgreSQL/servers/firewallRules/delete"), - // Display: &armpostgresql.OperationDisplay{ - // Description: to.Ptr("Deletes an existing firewall rule."), - // Operation: to.Ptr("Delete Firewall Rule"), - // Provider: to.Ptr("Microsoft DB for PostgreSQL"), - // Resource: to.Ptr("Firewall Rules"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.DBforPostgreSQL/servers/providers/Microsoft.Insights/metricDefinitions/read"), - // Display: &armpostgresql.OperationDisplay{ - // Description: to.Ptr("Return types of metrics that are available for databases"), - // Operation: to.Ptr("Get database metric definitions"), - // Provider: to.Ptr("Microsoft DB for PostgreSQL"), - // Resource: to.Ptr("Database Metric Definition"), - // }, - // Properties: map[string]any{ - // "serviceSpecification": map[string]any{ - // "metricSpecifications":[]any{ - // map[string]any{ - // "name": "cpu_percent", - // "aggregationType": "Average", - // "displayDescription": "CPU percent", - // "displayName": "CPU percent", - // "fillGapWithZero": true, - // "unit": "Percent", - // }, - // map[string]any{ - // "name": "memory_percent", - // "aggregationType": "Average", - // "displayDescription": "Memory percent", - // "displayName": "Memory percent", - // "fillGapWithZero": true, - // "unit": "Percent", - // }, - // map[string]any{ - // "name": "io_consumption_percent", - // "aggregationType": "Average", - // "displayDescription": "IO percent", - // "displayName": "IO percent", - // "fillGapWithZero": true, - // "unit": "Percent", - // }, - // map[string]any{ - // "name": "storage_percent", - // "aggregationType": "Average", - // "displayDescription": "Storage percentage", - // "displayName": "Storage percentage", - // "unit": "Percent", - // }, - // map[string]any{ - // "name": "storage_used", - // "aggregationType": "Average", - // "displayDescription": "Storage used", - // "displayName": "Storage used", - // "unit": "Bytes", - // }, - // map[string]any{ - // "name": "storage_limit", - // "aggregationType": "Average", - // "displayDescription": "Storage limit", - // "displayName": "Storage limit", - // "unit": "Bytes", - // }, - // map[string]any{ - // "name": "active_connections", - // "aggregationType": "Average", - // "displayDescription": "Total active connections", - // "displayName": "Total active connections", - // "fillGapWithZero": true, - // "unit": "Count", - // }, - // map[string]any{ - // "name": "connections_failed", - // "aggregationType": "Average", - // "displayDescription": "Total failed connections", - // "displayName": "Total failed connections", - // "fillGapWithZero": true, - // "unit": "Count", - // }, - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("Microsoft.DBforPostgreSQL/servers/providers/Microsoft.Insights/diagnosticSettings/read"), - // Display: &armpostgresql.OperationDisplay{ - // Description: to.Ptr("Gets the disagnostic setting for the resource"), - // Operation: to.Ptr("Read diagnostic setting"), - // Provider: to.Ptr("Microsoft DB for PostgreSQL"), - // Resource: to.Ptr("Database Metric Definition"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.DBforPostgreSQL/servers/providers/Microsoft.Insights/diagnosticSettings/write"), - // Display: &armpostgresql.OperationDisplay{ - // Description: to.Ptr("Creates or updates the diagnostic setting for the resource"), - // Operation: to.Ptr("Write diagnostic setting"), - // Provider: to.Ptr("Microsoft DB for PostgreSQL"), - // Resource: to.Ptr("Database Metric Definition"), - // }, - // }}, - // } } diff --git a/sdk/resourcemanager/postgresql/armpostgresql/options.go b/sdk/resourcemanager/postgresql/armpostgresql/options.go index 7ecabbc488d4..f564e8c7ee5c 100644 --- a/sdk/resourcemanager/postgresql/armpostgresql/options.go +++ b/sdk/resourcemanager/postgresql/armpostgresql/options.go @@ -1,20 +1,124 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armpostgresql -// CheckNameAvailabilityClientExecuteOptions contains the optional parameters for the CheckNameAvailabilityClient.Execute +// AdministratorsMicrosoftEntraClientBeginCreateOrUpdateOptions contains the optional parameters for the AdministratorsMicrosoftEntraClient.BeginCreateOrUpdate // method. -type CheckNameAvailabilityClientExecuteOptions struct { +type AdministratorsMicrosoftEntraClientBeginCreateOrUpdateOptions struct { + // Resumes the long-running operation from the provided token. + ResumeToken string +} + +// AdministratorsMicrosoftEntraClientBeginDeleteOptions contains the optional parameters for the AdministratorsMicrosoftEntraClient.BeginDelete +// method. +type AdministratorsMicrosoftEntraClientBeginDeleteOptions struct { + // Resumes the long-running operation from the provided token. + ResumeToken string +} + +// 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 +} + +// AdvancedThreatProtectionSettingsClientGetOptions contains the optional parameters for the AdvancedThreatProtectionSettingsClient.Get +// method. +type AdvancedThreatProtectionSettingsClientGetOptions struct { + // placeholder for future optional parameters +} + +// 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 +} + +// BackupsAutomaticAndOnDemandClientBeginDeleteOptions contains the optional parameters for the BackupsAutomaticAndOnDemandClient.BeginDelete +// method. +type BackupsAutomaticAndOnDemandClientBeginDeleteOptions struct { + // Resumes the long-running operation from the provided token. + ResumeToken string +} + +// BackupsAutomaticAndOnDemandClientGetOptions contains the optional parameters for the BackupsAutomaticAndOnDemandClient.Get +// method. +type BackupsAutomaticAndOnDemandClientGetOptions struct { + // placeholder for future optional parameters +} + +// BackupsAutomaticAndOnDemandClientListByServerOptions contains the optional parameters for the BackupsAutomaticAndOnDemandClient.NewListByServerPager +// method. +type BackupsAutomaticAndOnDemandClientListByServerOptions struct { // placeholder for future optional parameters } -// ConfigurationsClientBeginCreateOrUpdateOptions contains the optional parameters for the ConfigurationsClient.BeginCreateOrUpdate +// BackupsLongTermRetentionClientBeginStartOptions contains the optional parameters for the BackupsLongTermRetentionClient.BeginStart // method. -type ConfigurationsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. +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 +} + +// BackupsLongTermRetentionClientListByServerOptions contains the optional parameters for the BackupsLongTermRetentionClient.NewListByServerPager +// method. +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 +} + +// ConfigurationsClientBeginPutOptions contains the optional parameters for the ConfigurationsClient.BeginPut method. +type ConfigurationsClientBeginPutOptions struct { + // Resumes the long-running operation from the provided token. + ResumeToken string +} + +// ConfigurationsClientBeginUpdateOptions contains the optional parameters for the ConfigurationsClient.BeginUpdate method. +type ConfigurationsClientBeginUpdateOptions struct { + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -29,16 +133,15 @@ type ConfigurationsClientListByServerOptions struct { // placeholder for future optional parameters } -// DatabasesClientBeginCreateOrUpdateOptions contains the optional parameters for the DatabasesClient.BeginCreateOrUpdate -// method. -type DatabasesClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. +// DatabasesClientBeginCreateOptions contains the optional parameters for the DatabasesClient.BeginCreate method. +type DatabasesClientBeginCreateOptions struct { + // Resumes the long-running operation from the provided token. ResumeToken string } // DatabasesClientBeginDeleteOptions contains the optional parameters for the DatabasesClient.BeginDelete method. type DatabasesClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -55,13 +158,13 @@ type DatabasesClientListByServerOptions struct { // FirewallRulesClientBeginCreateOrUpdateOptions contains the optional parameters for the FirewallRulesClient.BeginCreateOrUpdate // method. type FirewallRulesClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // FirewallRulesClientBeginDeleteOptions contains the optional parameters for the FirewallRulesClient.BeginDelete method. type FirewallRulesClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -76,40 +179,72 @@ type FirewallRulesClientListByServerOptions struct { // placeholder for future optional parameters } -// LocationBasedPerformanceTierClientListOptions contains the optional parameters for the LocationBasedPerformanceTierClient.NewListPager +// MigrationsClientCancelOptions contains the optional parameters for the MigrationsClient.Cancel method. +type MigrationsClientCancelOptions struct { + // placeholder for future optional parameters +} + +// MigrationsClientCheckNameAvailabilityOptions contains the optional parameters for the MigrationsClient.CheckNameAvailability // method. -type LocationBasedPerformanceTierClientListOptions struct { +type MigrationsClientCheckNameAvailabilityOptions struct { // placeholder for future optional parameters } -// LogFilesClientListByServerOptions contains the optional parameters for the LogFilesClient.NewListByServerPager method. -type LogFilesClientListByServerOptions struct { +// MigrationsClientCreateOptions contains the optional parameters for the MigrationsClient.Create method. +type MigrationsClientCreateOptions struct { // placeholder for future optional parameters } -// OperationsClientListOptions contains the optional parameters for the OperationsClient.List method. -type OperationsClientListOptions struct { +// MigrationsClientGetOptions contains the optional parameters for the MigrationsClient.Get method. +type MigrationsClientGetOptions struct { // placeholder for future optional parameters } -// PrivateEndpointConnectionsClientBeginCreateOrUpdateOptions contains the optional parameters for the PrivateEndpointConnectionsClient.BeginCreateOrUpdate +// MigrationsClientListByTargetServerOptions contains the optional parameters for the MigrationsClient.NewListByTargetServerPager // method. -type PrivateEndpointConnectionsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string +type MigrationsClientListByTargetServerOptions struct { + // Migration list filter. Indicates if the request should retrieve only active migrations or all migrations. Defaults to Active. + MigrationListFilter *MigrationListFilter +} + +// MigrationsClientUpdateOptions contains the optional parameters for the MigrationsClient.Update method. +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 +} + +// PrivateDNSZoneSuffixClientGetOptions contains the optional parameters for the PrivateDNSZoneSuffixClient.Get method. +type PrivateDNSZoneSuffixClientGetOptions struct { + // placeholder for future optional parameters } // PrivateEndpointConnectionsClientBeginDeleteOptions contains the optional parameters for the PrivateEndpointConnectionsClient.BeginDelete // method. type PrivateEndpointConnectionsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } -// PrivateEndpointConnectionsClientBeginUpdateTagsOptions contains the optional parameters for the PrivateEndpointConnectionsClient.BeginUpdateTags +// PrivateEndpointConnectionsClientBeginUpdateOptions contains the optional parameters for the PrivateEndpointConnectionsClient.BeginUpdate // method. -type PrivateEndpointConnectionsClientBeginUpdateTagsOptions struct { - // Resumes the LRO from the provided token. +type PrivateEndpointConnectionsClientBeginUpdateOptions struct { + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -136,8 +271,8 @@ type PrivateLinkResourcesClientListByServerOptions struct { // placeholder for future optional parameters } -// RecoverableServersClientGetOptions contains the optional parameters for the RecoverableServersClient.Get method. -type RecoverableServersClientGetOptions struct { +// QuotaUsagesClientListOptions contains the optional parameters for the QuotaUsagesClient.NewListPager method. +type QuotaUsagesClientListOptions struct { // placeholder for future optional parameters } @@ -146,147 +281,118 @@ type ReplicasClientListByServerOptions struct { // placeholder for future optional parameters } -// ServerAdministratorsClientBeginCreateOrUpdateOptions contains the optional parameters for the ServerAdministratorsClient.BeginCreateOrUpdate +// ServerThreatProtectionSettingsClientBeginCreateOrUpdateOptions contains the optional parameters for the ServerThreatProtectionSettingsClient.BeginCreateOrUpdate // method. -type ServerAdministratorsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. +type ServerThreatProtectionSettingsClientBeginCreateOrUpdateOptions struct { + // Resumes the long-running operation from the provided token. ResumeToken string } -// ServerAdministratorsClientBeginDeleteOptions contains the optional parameters for the ServerAdministratorsClient.BeginDelete -// method. -type ServerAdministratorsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. +// ServersClientBeginCreateOrUpdateOptions contains the optional parameters for the ServersClient.BeginCreateOrUpdate method. +type ServersClientBeginCreateOrUpdateOptions struct { + // Resumes the long-running operation from the provided token. ResumeToken string } -// ServerAdministratorsClientGetOptions contains the optional parameters for the ServerAdministratorsClient.Get method. -type ServerAdministratorsClientGetOptions struct { - // placeholder for future optional parameters +// ServersClientBeginDeleteOptions contains the optional parameters for the ServersClient.BeginDelete method. +type ServersClientBeginDeleteOptions struct { + // Resumes the long-running operation from the provided token. + ResumeToken string } -// ServerAdministratorsClientListOptions contains the optional parameters for the ServerAdministratorsClient.NewListPager -// method. -type ServerAdministratorsClientListOptions struct { - // placeholder for future optional parameters -} +// ServersClientBeginRestartOptions contains the optional parameters for the ServersClient.BeginRestart method. +type ServersClientBeginRestartOptions struct { + // Parameters to restart a server. + Parameters *RestartParameter -// ServerBasedPerformanceTierClientListOptions contains the optional parameters for the ServerBasedPerformanceTierClient.NewListPager -// method. -type ServerBasedPerformanceTierClientListOptions struct { - // placeholder for future optional parameters + // Resumes the long-running operation from the provided token. + ResumeToken string } -// ServerKeysClientBeginCreateOrUpdateOptions contains the optional parameters for the ServerKeysClient.BeginCreateOrUpdate -// method. -type ServerKeysClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. +// ServersClientBeginStartOptions contains the optional parameters for the ServersClient.BeginStart method. +type ServersClientBeginStartOptions struct { + // Resumes the long-running operation from the provided token. ResumeToken string } -// ServerKeysClientBeginDeleteOptions contains the optional parameters for the ServerKeysClient.BeginDelete method. -type ServerKeysClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. +// ServersClientBeginStopOptions contains the optional parameters for the ServersClient.BeginStop method. +type ServersClientBeginStopOptions struct { + // Resumes the long-running operation from the provided token. ResumeToken string } -// ServerKeysClientGetOptions contains the optional parameters for the ServerKeysClient.Get method. -type ServerKeysClientGetOptions struct { - // placeholder for future optional parameters +// ServersClientBeginUpdateOptions contains the optional parameters for the ServersClient.BeginUpdate method. +type ServersClientBeginUpdateOptions struct { + // Resumes the long-running operation from the provided token. + ResumeToken string } -// ServerKeysClientListOptions contains the optional parameters for the ServerKeysClient.NewListPager method. -type ServerKeysClientListOptions struct { +// ServersClientGetOptions contains the optional parameters for the ServersClient.Get method. +type ServersClientGetOptions struct { // placeholder for future optional parameters } -// ServerParametersClientBeginListUpdateConfigurationsOptions contains the optional parameters for the ServerParametersClient.BeginListUpdateConfigurations +// ServersClientListByResourceGroupOptions contains the optional parameters for the ServersClient.NewListByResourceGroupPager // method. -type ServerParametersClientBeginListUpdateConfigurationsOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string +type ServersClientListByResourceGroupOptions struct { + // placeholder for future optional parameters } -// ServerSecurityAlertPoliciesClientBeginCreateOrUpdateOptions contains the optional parameters for the ServerSecurityAlertPoliciesClient.BeginCreateOrUpdate +// ServersClientListBySubscriptionOptions contains the optional parameters for the ServersClient.NewListBySubscriptionPager // method. -type ServerSecurityAlertPoliciesClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string +type ServersClientListBySubscriptionOptions struct { + // placeholder for future optional parameters } -// ServerSecurityAlertPoliciesClientGetOptions contains the optional parameters for the ServerSecurityAlertPoliciesClient.Get -// method. -type ServerSecurityAlertPoliciesClientGetOptions struct { +// TuningOptionsClientGetOptions contains the optional parameters for the TuningOptionsClient.Get method. +type TuningOptionsClientGetOptions struct { // placeholder for future optional parameters } -// ServerSecurityAlertPoliciesClientListByServerOptions contains the optional parameters for the ServerSecurityAlertPoliciesClient.NewListByServerPager +// TuningOptionsClientListByServerOptions contains the optional parameters for the TuningOptionsClient.NewListByServerPager // method. -type ServerSecurityAlertPoliciesClientListByServerOptions struct { +type TuningOptionsClientListByServerOptions struct { // placeholder for future optional parameters } -// ServersClientBeginCreateOptions contains the optional parameters for the ServersClient.BeginCreate method. -type ServersClientBeginCreateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string +// TuningOptionsClientListRecommendationsOptions contains the optional parameters for the TuningOptionsClient.NewListRecommendationsPager +// method. +type TuningOptionsClientListRecommendationsOptions struct { + // Recommendations list filter. Retrieves recommendations based on type. + RecommendationType *RecommendationTypeParameterEnum } -// ServersClientBeginDeleteOptions contains the optional parameters for the ServersClient.BeginDelete method. -type ServersClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. +// VirtualEndpointsClientBeginCreateOptions contains the optional parameters for the VirtualEndpointsClient.BeginCreate method. +type VirtualEndpointsClientBeginCreateOptions struct { + // Resumes the long-running operation from the provided token. ResumeToken string } -// ServersClientBeginRestartOptions contains the optional parameters for the ServersClient.BeginRestart method. -type ServersClientBeginRestartOptions struct { - // Resumes the LRO from the provided token. +// VirtualEndpointsClientBeginDeleteOptions contains the optional parameters for the VirtualEndpointsClient.BeginDelete method. +type VirtualEndpointsClientBeginDeleteOptions struct { + // Resumes the long-running operation from the provided token. ResumeToken string } -// ServersClientBeginUpdateOptions contains the optional parameters for the ServersClient.BeginUpdate method. -type ServersClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. +// VirtualEndpointsClientBeginUpdateOptions contains the optional parameters for the VirtualEndpointsClient.BeginUpdate method. +type VirtualEndpointsClientBeginUpdateOptions struct { + // Resumes the long-running operation from the provided token. ResumeToken string } -// ServersClientGetOptions contains the optional parameters for the ServersClient.Get method. -type ServersClientGetOptions struct { +// VirtualEndpointsClientGetOptions contains the optional parameters for the VirtualEndpointsClient.Get method. +type VirtualEndpointsClientGetOptions struct { // placeholder for future optional parameters } -// ServersClientListByResourceGroupOptions contains the optional parameters for the ServersClient.NewListByResourceGroupPager +// VirtualEndpointsClientListByServerOptions contains the optional parameters for the VirtualEndpointsClient.NewListByServerPager // method. -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 -} - -// VirtualNetworkRulesClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualNetworkRulesClient.BeginCreateOrUpdate -// method. -type VirtualNetworkRulesClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualNetworkRulesClientBeginDeleteOptions contains the optional parameters for the VirtualNetworkRulesClient.BeginDelete -// method. -type VirtualNetworkRulesClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualNetworkRulesClientGetOptions contains the optional parameters for the VirtualNetworkRulesClient.Get method. -type VirtualNetworkRulesClientGetOptions struct { +type VirtualEndpointsClientListByServerOptions struct { // placeholder for future optional parameters } -// VirtualNetworkRulesClientListByServerOptions contains the optional parameters for the VirtualNetworkRulesClient.NewListByServerPager +// VirtualNetworkSubnetUsageClientListOptions contains the optional parameters for the VirtualNetworkSubnetUsageClient.List // method. -type VirtualNetworkRulesClientListByServerOptions struct { +type VirtualNetworkSubnetUsageClientListOptions struct { // placeholder for future optional parameters } diff --git a/sdk/resourcemanager/postgresql/armpostgresql/polymorphic_helpers.go b/sdk/resourcemanager/postgresql/armpostgresql/polymorphic_helpers.go deleted file mode 100644 index 9e7984ed238a..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresql/polymorphic_helpers.go +++ /dev/null @@ -1,35 +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 armpostgresql - -import "encoding/json" - -func unmarshalServerPropertiesForCreateClassification(rawMsg json.RawMessage) (ServerPropertiesForCreateClassification, error) { - if rawMsg == nil { - return nil, nil - } - var m map[string]any - if err := json.Unmarshal(rawMsg, &m); err != nil { - return nil, err - } - var b ServerPropertiesForCreateClassification - switch m["createMode"] { - case string(CreateModeDefault): - b = &ServerPropertiesForDefaultCreate{} - case string(CreateModeGeoRestore): - b = &ServerPropertiesForGeoRestore{} - case string(CreateModePointInTimeRestore): - b = &ServerPropertiesForRestore{} - case string(CreateModeReplica): - b = &ServerPropertiesForReplica{} - default: - b = &ServerPropertiesForCreate{} - } - if err := json.Unmarshal(rawMsg, b); err != nil { - return nil, err - } - return b, nil -} diff --git a/sdk/resourcemanager/postgresql/armpostgresql/postgresql_live_test.go b/sdk/resourcemanager/postgresql/armpostgresql/postgresql_live_test.go index e5751e9c70cd..179e95c39ed1 100644 --- a/sdk/resourcemanager/postgresql/armpostgresql/postgresql_live_test.go +++ b/sdk/resourcemanager/postgresql/armpostgresql/postgresql_live_test.go @@ -13,7 +13,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/internal/recording" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3/testutil" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresql" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresql/v2" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources" "github.com/stretchr/testify/suite" ) @@ -21,14 +21,14 @@ import ( type PostgresqlTestSuite struct { suite.Suite - ctx context.Context - cred azcore.TokenCredential - options *arm.ClientOptions - serverName string - adminPassword string - location string - resourceGroupName string - subscriptionId string + ctx context.Context + cred azcore.TokenCredential + options *arm.ClientOptions + serverName string + adminPassword string + location string + resourceGroupName string + subscriptionId string } func (testsuite *PostgresqlTestSuite) SetupSuite() { @@ -65,23 +65,23 @@ func (testsuite *PostgresqlTestSuite) Prepare() { serversClient, err := armpostgresql.NewServersClient(testsuite.subscriptionId, testsuite.cred, testsuite.options) testsuite.Require().NoError(err) serversClientCreateResponsePoller, err := serversClient.BeginCreate(testsuite.ctx, testsuite.resourceGroupName, testsuite.serverName, armpostgresql.ServerForCreate{ - Location: to.Ptr(testsuite.location), + Location: to.Ptr(testsuite.location), Properties: &armpostgresql.ServerPropertiesForDefaultCreate{ - CreateMode: to.Ptr(armpostgresql.CreateModeDefault), - MinimalTLSVersion: to.Ptr(armpostgresql.MinimalTLSVersionEnumTLS12), - SSLEnforcement: to.Ptr(armpostgresql.SSLEnforcementEnumEnabled), + CreateMode: to.Ptr(armpostgresql.CreateModeDefault), + MinimalTLSVersion: to.Ptr(armpostgresql.MinimalTLSVersionEnumTLS12), + SSLEnforcement: to.Ptr(armpostgresql.SSLEnforcementEnumEnabled), StorageProfile: &armpostgresql.StorageProfile{ - BackupRetentionDays: to.Ptr[int32](7), - GeoRedundantBackup: to.Ptr(armpostgresql.GeoRedundantBackupDisabled), - StorageMB: to.Ptr[int32](128000), + BackupRetentionDays: to.Ptr[int32](7), + GeoRedundantBackup: to.Ptr(armpostgresql.GeoRedundantBackupDisabled), + StorageMB: to.Ptr[int32](128000), }, - AdministratorLogin: to.Ptr("cloudsa"), - AdministratorLoginPassword: to.Ptr(testsuite.adminPassword), + AdministratorLogin: to.Ptr("cloudsa"), + AdministratorLoginPassword: to.Ptr(testsuite.adminPassword), }, SKU: &armpostgresql.SKU{ - Name: to.Ptr("GP_Gen5_8"), - Family: to.Ptr("Gen5"), - Tier: to.Ptr(armpostgresql.SKUTierGeneralPurpose), + Name: to.Ptr("GP_Gen5_8"), + Family: to.Ptr("Gen5"), + Tier: to.Ptr(armpostgresql.SKUTierGeneralPurpose), }, Tags: map[string]*string{ "ElasticServer": to.Ptr("1"), @@ -124,9 +124,9 @@ func (testsuite *PostgresqlTestSuite) TestServers() { fmt.Println("Call operation: Servers_Update") serversClientUpdateResponsePoller, err := serversClient.BeginUpdate(testsuite.ctx, testsuite.resourceGroupName, testsuite.serverName, armpostgresql.ServerUpdateParameters{ Properties: &armpostgresql.ServerUpdateParametersProperties{ - AdministratorLoginPassword: to.Ptr(testsuite.adminPassword), - MinimalTLSVersion: to.Ptr(armpostgresql.MinimalTLSVersionEnumTLS12), - SSLEnforcement: to.Ptr(armpostgresql.SSLEnforcementEnumEnabled), + AdministratorLoginPassword: to.Ptr(testsuite.adminPassword), + MinimalTLSVersion: to.Ptr(armpostgresql.MinimalTLSVersionEnumTLS12), + SSLEnforcement: to.Ptr(armpostgresql.SSLEnforcementEnumEnabled), }, }, nil) testsuite.Require().NoError(err) @@ -150,8 +150,8 @@ func (testsuite *PostgresqlTestSuite) TestFirewallRules() { testsuite.Require().NoError(err) firewallRulesClientCreateOrUpdateResponsePoller, err := firewallRulesClient.BeginCreateOrUpdate(testsuite.ctx, testsuite.resourceGroupName, testsuite.serverName, "rule1", armpostgresql.FirewallRule{ Properties: &armpostgresql.FirewallRuleProperties{ - EndIPAddress: to.Ptr("255.255.255.255"), - StartIPAddress: to.Ptr("0.0.0.0"), + EndIPAddress: to.Ptr("255.255.255.255"), + StartIPAddress: to.Ptr("0.0.0.0"), }, }, nil) testsuite.Require().NoError(err) @@ -186,34 +186,34 @@ func (testsuite *PostgresqlTestSuite) TestVirtualNetworkRules() { var err error // From step VirtualNetwork_Create template := map[string]any{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", "outputs": map[string]any{ "subnetId": map[string]any{ - "type": "string", - "value": "[resourceId('Microsoft.Network/virtualNetworks/subnets', parameters('virtualNetworksName'), parameters('subnetName'))]", + "type": "string", + "value": "[resourceId('Microsoft.Network/virtualNetworks/subnets', parameters('virtualNetworksName'), parameters('subnetName'))]", }, }, "parameters": map[string]any{ "location": map[string]any{ - "type": "string", - "defaultValue": testsuite.location, + "type": "string", + "defaultValue": testsuite.location, }, "subnetName": map[string]any{ - "type": "string", - "defaultValue": "pgsubnet", + "type": "string", + "defaultValue": "pgsubnet", }, "virtualNetworksName": map[string]any{ - "type": "string", - "defaultValue": "pgvnet", + "type": "string", + "defaultValue": "pgvnet", }, }, "resources": []any{ map[string]any{ - "name": "[parameters('virtualNetworksName')]", - "type": "Microsoft.Network/virtualNetworks", - "apiVersion": "2021-05-01", - "location": "[parameters('location')]", + "name": "[parameters('virtualNetworksName')]", + "type": "Microsoft.Network/virtualNetworks", + "apiVersion": "2021-05-01", + "location": "[parameters('location')]", "properties": map[string]any{ "addressSpace": map[string]any{ "addressPrefixes": []any{ @@ -222,21 +222,21 @@ func (testsuite *PostgresqlTestSuite) TestVirtualNetworkRules() { }, "subnets": []any{ map[string]any{ - "name": "[parameters('subnetName')]", + "name": "[parameters('subnetName')]", "properties": map[string]any{ "addressPrefix": "10.0.0.0/24", }, }, }, }, - "tags": map[string]any{}, + "tags": map[string]any{}, }, }, } deployment := armresources.Deployment{ Properties: &armresources.DeploymentProperties{ - Template: template, - Mode: to.Ptr(armresources.DeploymentModeIncremental), + Template: template, + Mode: to.Ptr(armresources.DeploymentModeIncremental), }, } deploymentExtend, err := testutil.CreateDeployment(testsuite.ctx, testsuite.subscriptionId, testsuite.cred, testsuite.options, testsuite.resourceGroupName, "VirtualNetwork_Create", &deployment) @@ -249,8 +249,8 @@ func (testsuite *PostgresqlTestSuite) TestVirtualNetworkRules() { testsuite.Require().NoError(err) virtualNetworkRulesClientCreateOrUpdateResponsePoller, err := virtualNetworkRulesClient.BeginCreateOrUpdate(testsuite.ctx, testsuite.resourceGroupName, testsuite.serverName, "vnet-firewall-rule", armpostgresql.VirtualNetworkRule{ Properties: &armpostgresql.VirtualNetworkRuleProperties{ - IgnoreMissingVnetServiceEndpoint: to.Ptr(true), - VirtualNetworkSubnetID: to.Ptr(subnetId), + IgnoreMissingVnetServiceEndpoint: to.Ptr(true), + VirtualNetworkSubnetID: to.Ptr(subnetId), }, }, nil) testsuite.Require().NoError(err) @@ -288,8 +288,8 @@ func (testsuite *PostgresqlTestSuite) TestDatabases() { testsuite.Require().NoError(err) databasesClientCreateOrUpdateResponsePoller, err := databasesClient.BeginCreateOrUpdate(testsuite.ctx, testsuite.resourceGroupName, testsuite.serverName, "db1", armpostgresql.Database{ Properties: &armpostgresql.DatabaseProperties{ - Charset: to.Ptr("UTF8"), - Collation: to.Ptr("English_United States.1252"), + Charset: to.Ptr("UTF8"), + Collation: to.Ptr("English_United States.1252"), }, }, nil) testsuite.Require().NoError(err) @@ -327,8 +327,8 @@ func (testsuite *PostgresqlTestSuite) TestConfigurations() { testsuite.Require().NoError(err) configurationsClientCreateOrUpdateResponsePoller, err := configurationsClient.BeginCreateOrUpdate(testsuite.ctx, testsuite.resourceGroupName, testsuite.serverName, "array_nulls", armpostgresql.Configuration{ Properties: &armpostgresql.ConfigurationProperties{ - Source: to.Ptr("user-override"), - Value: to.Ptr("off"), + Source: to.Ptr("user-override"), + Value: to.Ptr("off"), }, }, nil) testsuite.Require().NoError(err) @@ -359,10 +359,10 @@ func (testsuite *PostgresqlTestSuite) TestServerAdministrators() { testsuite.Require().NoError(err) serverAdministratorsClientCreateOrUpdateResponsePoller, err := serverAdministratorsClient.BeginCreateOrUpdate(testsuite.ctx, testsuite.resourceGroupName, testsuite.serverName, armpostgresql.ServerAdministratorResource{ Properties: &armpostgresql.ServerAdministratorProperties{ - AdministratorType: to.Ptr("ActiveDirectory"), - Login: to.Ptr("bob@contoso.com"), - Sid: to.Ptr("c6b82b90-a647-49cb-8a62-0d2d3cb7ac7c"), - TenantID: to.Ptr("c6b82b90-a647-49cb-8a62-0d2d3cb7ac7c"), + AdministratorType: to.Ptr("ActiveDirectory"), + Login: to.Ptr("bob@contoso.com"), + Sid: to.Ptr("c6b82b90-a647-49cb-8a62-0d2d3cb7ac7c"), + TenantID: to.Ptr("c6b82b90-a647-49cb-8a62-0d2d3cb7ac7c"), }, }, nil) testsuite.Require().NoError(err) @@ -416,13 +416,13 @@ func (testsuite *PostgresqlTestSuite) TestServerParameters() { serverParametersClientListUpdateConfigurationsResponsePoller, err := serverParametersClient.BeginListUpdateConfigurations(testsuite.ctx, testsuite.resourceGroupName, testsuite.serverName, armpostgresql.ConfigurationListResult{ Value: []*armpostgresql.Configuration{ { - Name: to.Ptr("array_nulls"), + Name: to.Ptr("array_nulls"), Properties: &armpostgresql.ConfigurationProperties{ Value: to.Ptr("on"), }, }, { - Name: to.Ptr("backslash_quote"), + Name: to.Ptr("backslash_quote"), Properties: &armpostgresql.ConfigurationProperties{ Value: to.Ptr("on"), }, @@ -497,8 +497,8 @@ func (testsuite *PostgresqlTestSuite) TestCheckNameAvailability() { checkNameAvailabilityClient, err := armpostgresql.NewCheckNameAvailabilityClient(testsuite.subscriptionId, testsuite.cred, testsuite.options) testsuite.Require().NoError(err) _, err = checkNameAvailabilityClient.Execute(testsuite.ctx, armpostgresql.NameAvailabilityRequest{ - Name: to.Ptr("name1"), - Type: to.Ptr("Microsoft.DBforPostgreSQL"), + Name: to.Ptr("name1"), + Type: to.Ptr("Microsoft.DBforPostgreSQL"), }, nil) testsuite.Require().NoError(err) } diff --git a/sdk/resourcemanager/postgresql/armpostgresql/privatednszonesuffix_client.go b/sdk/resourcemanager/postgresql/armpostgresql/privatednszonesuffix_client.go new file mode 100644 index 000000000000..06d4602fa949 --- /dev/null +++ b/sdk/resourcemanager/postgresql/armpostgresql/privatednszonesuffix_client.go @@ -0,0 +1,85 @@ +// 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) Go Code Generator. DO NOT EDIT. + +package armpostgresql + +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/armpostgresql/privatednszonesuffix_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresql/privatednszonesuffix_client_example_test.go new file mode 100644 index 000000000000..d17db47d7199 --- /dev/null +++ b/sdk/resourcemanager/postgresql/armpostgresql/privatednszonesuffix_client_example_test.go @@ -0,0 +1,35 @@ +// 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) Go Code Generator. DO NOT EDIT. + +package armpostgresql_test + +import ( + "context" + "github.com/Azure/azure-sdk-for-go/sdk/azidentity" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresql/v2" + "log" +) + +// Generated from example definition: 2025-08-01/PrivateDnsZoneSuffixGet.json +func ExamplePrivateDNSZoneSuffixClient_Get() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armpostgresql.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewPrivateDNSZoneSuffixClient().Get(ctx, 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 = armpostgresql.PrivateDNSZoneSuffixClientGetResponse{ + // undefined: to.Ptr("postgres.database.azure.com"), + // } +} diff --git a/sdk/resourcemanager/postgresql/armpostgresql/privateendpointconnections_client.go b/sdk/resourcemanager/postgresql/armpostgresql/privateendpointconnections_client.go index 3b4ca1c46ddb..a70e061edbf2 100644 --- a/sdk/resourcemanager/postgresql/armpostgresql/privateendpointconnections_client.go +++ b/sdk/resourcemanager/postgresql/armpostgresql/privateendpointconnections_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armpostgresql @@ -25,9 +24,9 @@ type PrivateEndpointConnectionsClient struct { } // NewPrivateEndpointConnectionsClient creates a new instance of PrivateEndpointConnectionsClient with the specified values. -// - subscriptionID - The ID of the target subscription. +// - 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,95 +39,13 @@ func NewPrivateEndpointConnectionsClient(subscriptionID string, credential azcor return client, nil } -// BeginCreateOrUpdate - Approve or reject a private endpoint connection with a given name. +// BeginDelete - Deletes a private endpoint connection. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2018-06-01 -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - serverName - The name of the server. -// - options - PrivateEndpointConnectionsClientBeginCreateOrUpdateOptions contains the optional parameters for the PrivateEndpointConnectionsClient.BeginCreateOrUpdate -// method. -func (client *PrivateEndpointConnectionsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, privateEndpointConnectionName string, parameters PrivateEndpointConnection, options *PrivateEndpointConnectionsClientBeginCreateOrUpdateOptions) (*runtime.Poller[PrivateEndpointConnectionsClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, serverName, privateEndpointConnectionName, parameters, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[PrivateEndpointConnectionsClientCreateOrUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[PrivateEndpointConnectionsClientCreateOrUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// CreateOrUpdate - 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 2018-06-01 -func (client *PrivateEndpointConnectionsClient) createOrUpdate(ctx context.Context, resourceGroupName string, serverName string, privateEndpointConnectionName string, parameters PrivateEndpointConnection, options *PrivateEndpointConnectionsClientBeginCreateOrUpdateOptions) (*http.Response, error) { - var err error - const operationName = "PrivateEndpointConnectionsClient.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.createOrUpdateCreateRequest(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.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *PrivateEndpointConnectionsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, serverName string, privateEndpointConnectionName string, parameters PrivateEndpointConnection, options *PrivateEndpointConnectionsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/privateEndpointConnections/{privateEndpointConnectionName}" - 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)) - 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.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2018-06-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 -} - -// BeginDelete - Deletes a private endpoint connection with a given name. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2018-06-01 +// 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 associated with the Azure resource. // - 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) { @@ -138,7 +55,8 @@ func (client *PrivateEndpointConnectionsClient) BeginDelete(ctx context.Context, return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[PrivateEndpointConnectionsClientDeleteResponse]{ - Tracer: client.internal.Tracer(), + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -148,10 +66,10 @@ func (client *PrivateEndpointConnectionsClient) BeginDelete(ctx context.Context, } } -// Delete - Deletes a private endpoint connection with a given name. +// Delete - Deletes a private endpoint connection. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2018-06-01 +// 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" @@ -166,7 +84,7 @@ func (client *PrivateEndpointConnectionsClient) deleteOperation(ctx context.Cont 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 } @@ -174,8 +92,12 @@ func (client *PrivateEndpointConnectionsClient) deleteOperation(ctx context.Cont } // deleteCreateRequest creates the Delete request. -func (client *PrivateEndpointConnectionsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, serverName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/privateEndpointConnections/{privateEndpointConnectionName}" +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") } @@ -188,28 +110,23 @@ func (client *PrivateEndpointConnectionsClient) deleteCreateRequest(ctx context. return nil, errors.New("parameter privateEndpointConnectionName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{privateEndpointConnectionName}", url.PathEscape(privateEndpointConnectionName)) - 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.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2018-06-01") + 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 2018-06-01 +// 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. +// - privateEndpointConnectionName - The name of the private endpoint connection associated with the Azure resource. // - options - PrivateEndpointConnectionsClientGetOptions contains the optional parameters for the PrivateEndpointConnectionsClient.Get // method. func (client *PrivateEndpointConnectionsClient) Get(ctx context.Context, resourceGroupName string, serverName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientGetOptions) (PrivateEndpointConnectionsClientGetResponse, error) { @@ -235,8 +152,12 @@ func (client *PrivateEndpointConnectionsClient) Get(ctx context.Context, resourc } // getCreateRequest creates the Get request. -func (client *PrivateEndpointConnectionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, serverName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/privateEndpointConnections/{privateEndpointConnectionName}" +func (client *PrivateEndpointConnectionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, serverName string, privateEndpointConnectionName string, _ *PrivateEndpointConnectionsClientGetOptions) (*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") } @@ -249,16 +170,12 @@ func (client *PrivateEndpointConnectionsClient) getCreateRequest(ctx context.Con return nil, errors.New("parameter privateEndpointConnectionName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{privateEndpointConnectionName}", url.PathEscape(privateEndpointConnectionName)) - 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.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2018-06-01") + reqQP.Set("api-version", "2025-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -273,9 +190,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 2018-06-01 +// 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 @@ -304,8 +221,12 @@ func (client *PrivateEndpointConnectionsClient) NewListByServerPager(resourceGro } // listByServerCreateRequest creates the ListByServer request. -func (client *PrivateEndpointConnectionsClient) listByServerCreateRequest(ctx context.Context, resourceGroupName string, serverName string, options *PrivateEndpointConnectionsClientListByServerOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/privateEndpointConnections" +func (client *PrivateEndpointConnectionsClient) listByServerCreateRequest(ctx context.Context, resourceGroupName string, serverName string, _ *PrivateEndpointConnectionsClientListByServerOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/privateEndpointConnections" + 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") } @@ -314,16 +235,12 @@ func (client *PrivateEndpointConnectionsClient) listByServerCreateRequest(ctx co return nil, errors.New("parameter serverName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{serverName}", url.PathEscape(serverName)) - 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.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2018-06-01") + reqQP.Set("api-version", "2025-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -332,49 +249,51 @@ 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 } -// BeginUpdateTags - Updates private endpoint connection with the specified tags. +// BeginUpdate - Approves or rejects a private endpoint connection. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2018-06-01 +// 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 supplied to the Update private endpoint connection Tags operation. -// - options - PrivateEndpointConnectionsClientBeginUpdateTagsOptions contains the optional parameters for the PrivateEndpointConnectionsClient.BeginUpdateTags +// - privateEndpointConnectionName - The name of the private endpoint connection associated with the Azure resource. +// - parameters - Parameters required to update a private endpoint connection. +// - options - PrivateEndpointConnectionsClientBeginUpdateOptions contains the optional parameters for the PrivateEndpointConnectionsClient.BeginUpdate // method. -func (client *PrivateEndpointConnectionsClient) BeginUpdateTags(ctx context.Context, resourceGroupName string, serverName string, privateEndpointConnectionName string, parameters TagsObject, options *PrivateEndpointConnectionsClientBeginUpdateTagsOptions) (*runtime.Poller[PrivateEndpointConnectionsClientUpdateTagsResponse], error) { +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.updateTags(ctx, resourceGroupName, serverName, privateEndpointConnectionName, parameters, options) + 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[PrivateEndpointConnectionsClientUpdateTagsResponse]{ - Tracer: client.internal.Tracer(), + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[PrivateEndpointConnectionsClientUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + Tracer: client.internal.Tracer(), }) return poller, err } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[PrivateEndpointConnectionsClientUpdateTagsResponse]{ + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[PrivateEndpointConnectionsClientUpdateResponse]{ Tracer: client.internal.Tracer(), }) } } -// UpdateTags - Updates private endpoint connection with the specified tags. +// Update - Approves or rejects a private endpoint connection. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2018-06-01 -func (client *PrivateEndpointConnectionsClient) updateTags(ctx context.Context, resourceGroupName string, serverName string, privateEndpointConnectionName string, parameters TagsObject, options *PrivateEndpointConnectionsClientBeginUpdateTagsOptions) (*http.Response, error) { +// 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.BeginUpdateTags" + 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.updateTagsCreateRequest(ctx, resourceGroupName, serverName, privateEndpointConnectionName, parameters, options) + req, err := client.updateCreateRequest(ctx, resourceGroupName, serverName, privateEndpointConnectionName, parameters, options) if err != nil { return nil, err } @@ -382,16 +301,16 @@ func (client *PrivateEndpointConnectionsClient) updateTags(ctx context.Context, if err != nil { return nil, err } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { + if !runtime.HasStatusCode(httpResp, http.StatusAccepted) { err = runtime.NewResponseError(httpResp) return nil, err } return httpResp, nil } -// updateTagsCreateRequest creates the UpdateTags request. -func (client *PrivateEndpointConnectionsClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, serverName string, privateEndpointConnectionName string, parameters TagsObject, options *PrivateEndpointConnectionsClientBeginUpdateTagsOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/privateEndpointConnections/{privateEndpointConnectionName}" +// 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") } @@ -408,14 +327,14 @@ func (client *PrivateEndpointConnectionsClient) updateTagsCreateRequest(ctx cont return nil, errors.New("parameter privateEndpointConnectionName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{privateEndpointConnectionName}", url.PathEscape(privateEndpointConnectionName)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, 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", "2018-06-01") + reqQP.Set("api-version", "2025-08-01") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } diff --git a/sdk/resourcemanager/postgresql/armpostgresql/privateendpointconnections_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresql/privateendpointconnections_client_example_test.go index 44de1e846c89..e71c8ff6cc75 100644 --- a/sdk/resourcemanager/postgresql/armpostgresql/privateendpointconnections_client_example_test.go +++ b/sdk/resourcemanager/postgresql/armpostgresql/privateendpointconnections_client_example_test.go @@ -1,115 +1,29 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armpostgresql_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/armpostgresql" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresql/v2" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2018-06-01/examples/PrivateEndpointConnectionGet.json -func ExamplePrivateEndpointConnectionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPrivateEndpointConnectionsClient().Get(ctx, "Default", "test-svr", "private-endpoint-connection-name", 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.PrivateEndpointConnection = armpostgresql.PrivateEndpointConnection{ - // Name: to.Ptr("private-endpoint-connection-name"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.DBforPostgreSQL/servers/test-svr/privateEndpointConnections/private-endpoint-connection-name"), - // Properties: &armpostgresql.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armpostgresql.PrivateEndpointProperty{ - // ID: to.Ptr("/subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-Network/providers/Microsoft.Network/privateEndpoints/private-endpoint-name"), - // }, - // PrivateLinkServiceConnectionState: &armpostgresql.PrivateLinkServiceConnectionStateProperty{ - // Description: to.Ptr("Auto-approved"), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr("Approved"), - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2018-06-01/examples/PrivateEndpointConnectionUpdate.json -func ExamplePrivateEndpointConnectionsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewPrivateEndpointConnectionsClient().BeginCreateOrUpdate(ctx, "Default", "test-svr", "private-endpoint-connection-name", armpostgresql.PrivateEndpointConnection{ - Properties: &armpostgresql.PrivateEndpointConnectionProperties{ - PrivateLinkServiceConnectionState: &armpostgresql.PrivateLinkServiceConnectionStateProperty{ - Description: to.Ptr("Approved by johndoe@contoso.com"), - Status: to.Ptr("Approved"), - }, - }, - }, 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 = armpostgresql.PrivateEndpointConnection{ - // Name: to.Ptr("private-endpoint-connection-name"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.DBforPostgreSQL/servers/test-svr/privateEndpointConnections/private-endpoint-connection-name"), - // Properties: &armpostgresql.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armpostgresql.PrivateEndpointProperty{ - // ID: to.Ptr("/subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-Network/providers/Microsoft.Network/privateEndpoints/private-endpoint-name"), - // }, - // PrivateLinkServiceConnectionState: &armpostgresql.PrivateLinkServiceConnectionStateProperty{ - // Description: to.Ptr("Approved by johndoe@contoso.com"), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr("Approved"), - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2018-06-01/examples/PrivateEndpointConnectionDelete.json +// Generated from example definition: 2025-08-01/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 := armpostgresql.NewClientFactory("", cred, nil) + clientFactory, err := armpostgresql.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewPrivateEndpointConnectionsClient().BeginDelete(ctx, "Default", "test-svr", "private-endpoint-connection-name", nil) + 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) } @@ -119,64 +33,59 @@ func ExamplePrivateEndpointConnectionsClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2018-06-01/examples/PrivateEndpointConnectionUpdateTags.json -func ExamplePrivateEndpointConnectionsClient_BeginUpdateTags() { +// Generated from example definition: 2025-08-01/PrivateEndpointConnectionsGet.json +func ExamplePrivateEndpointConnectionsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armpostgresql.NewClientFactory("", cred, nil) + clientFactory, err := armpostgresql.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewPrivateEndpointConnectionsClient().BeginUpdateTags(ctx, "Default", "test-svr", "private-endpoint-connection-name", armpostgresql.TagsObject{ - Tags: map[string]*string{ - "key1": to.Ptr("val1"), - "key2": to.Ptr("val2"), - "key3": to.Ptr("val3"), - }, - }, 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) } - 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 = armpostgresql.PrivateEndpointConnection{ - // Name: to.Ptr("private-endpoint-connection-name"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.DBforPostgreSQL/servers/test-svr/privateEndpointConnections/private-endpoint-connection-name"), - // Properties: &armpostgresql.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armpostgresql.PrivateEndpointProperty{ - // ID: to.Ptr("/subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-Network/providers/Microsoft.Network/privateEndpoints/private-endpoint-name"), - // }, - // PrivateLinkServiceConnectionState: &armpostgresql.PrivateLinkServiceConnectionStateProperty{ - // Description: to.Ptr("Approved by johndoe@contoso.com"), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr("Approved"), + // res = armpostgresql.PrivateEndpointConnectionsClientGetResponse{ + // PrivateEndpointConnection: &armpostgresql.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/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/privateEndpointConnections/private-endpoint-connection-name.1fa229cd-bf3f-47f0-8c49-afb36723997e"), + // Properties: &armpostgresql.PrivateEndpointConnectionProperties{ + // GroupIDs: []*string{ + // to.Ptr("postgresqlServer"), + // }, + // PrivateEndpoint: &armpostgresql.PrivateEndpoint{ + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.Network/privateEndpoints/private-endpoint-name"), + // }, + // PrivateLinkServiceConnectionState: &armpostgresql.PrivateLinkServiceConnectionState{ + // Description: to.Ptr("Auto-approved"), + // ActionsRequired: to.Ptr("None"), + // Status: to.Ptr(armpostgresql.PrivateEndpointServiceConnectionStatusApproved), + // }, + // ProvisioningState: to.Ptr(armpostgresql.PrivateEndpointConnectionProvisioningState("Ready")), // }, - // ProvisioningState: to.Ptr("Succeeded"), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2018-06-01/examples/PrivateEndpointConnectionList.json +// Generated from example definition: 2025-08-01/PrivateEndpointConnectionsList.json func ExamplePrivateEndpointConnectionsClient_NewListByServerPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armpostgresql.NewClientFactory("", cred, nil) + clientFactory, err := armpostgresql.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) 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 { @@ -187,40 +96,77 @@ 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 = armpostgresql.PrivateEndpointConnectionListResult{ - // Value: []*armpostgresql.PrivateEndpointConnection{ - // { - // Name: to.Ptr("private-endpoint-connection-name"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.DBforPostgreSQL/servers/test-svr/privateEndpointConnections/private-endpoint-connection-name-2"), - // Properties: &armpostgresql.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armpostgresql.PrivateEndpointProperty{ - // ID: to.Ptr("/subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-Network/providers/Microsoft.Network/privateEndpoints/private-endpoint-name"), + // page = armpostgresql.PrivateEndpointConnectionsClientListByServerResponse{ + // PrivateEndpointConnectionList: armpostgresql.PrivateEndpointConnectionList{ + // Value: []*armpostgresql.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/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/privateEndpointConnections/private-endpoint-connection-name.1fa229cd-bf3f-47f0-8c49-afb36723997e"), + // Properties: &armpostgresql.PrivateEndpointConnectionProperties{ + // GroupIDs: []*string{ + // to.Ptr("postgresqlServer"), + // }, + // PrivateEndpoint: &armpostgresql.PrivateEndpoint{ + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.Network/privateEndpoints/private-endpoint-name"), + // }, + // PrivateLinkServiceConnectionState: &armpostgresql.PrivateLinkServiceConnectionState{ + // Description: to.Ptr("Auto-approved"), + // ActionsRequired: to.Ptr("None"), + // Status: to.Ptr(armpostgresql.PrivateEndpointServiceConnectionStatusApproved), + // }, + // ProvisioningState: to.Ptr(armpostgresql.PrivateEndpointConnectionProvisioningState("Ready")), // }, - // PrivateLinkServiceConnectionState: &armpostgresql.PrivateLinkServiceConnectionStateProperty{ - // Description: to.Ptr("Auto-approved"), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr("Approved"), - // }, - // ProvisioningState: to.Ptr("Succeeded"), // }, - // }, - // { - // Name: to.Ptr("private-endpoint-connection-name-2"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.DBforPostgreSQL/servers/test-svr/privateEndpointConnections/private-endpoint-connection-name-2"), - // Properties: &armpostgresql.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armpostgresql.PrivateEndpointProperty{ - // ID: to.Ptr("/subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-Network/providers/Microsoft.Network/privateEndpoints/private-endpoint-name-2"), - // }, - // PrivateLinkServiceConnectionState: &armpostgresql.PrivateLinkServiceConnectionStateProperty{ - // Description: to.Ptr("Auto-approved"), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr("Approved"), + // { + // Name: to.Ptr("private-endpoint-connection-name-2.1fa229cd-bf3f-47f0-8c49-afb36723997e"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/privateEndpointConnections"), + // 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: &armpostgresql.PrivateEndpointConnectionProperties{ + // GroupIDs: []*string{ + // to.Ptr("postgresqlServer"), + // }, + // PrivateEndpoint: &armpostgresql.PrivateEndpoint{ + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.Network/privateEndpoints/private-endpoint-name-2"), + // }, + // PrivateLinkServiceConnectionState: &armpostgresql.PrivateLinkServiceConnectionState{ + // Description: to.Ptr("Auto-approved"), + // ActionsRequired: to.Ptr("None"), + // Status: to.Ptr(armpostgresql.PrivateEndpointServiceConnectionStatusApproved), + // }, + // ProvisioningState: to.Ptr(armpostgresql.PrivateEndpointConnectionProvisioningState("Ready")), // }, - // ProvisioningState: to.Ptr("Succeeded"), // }, - // }}, + // }, + // }, // } } } + +// Generated from example definition: 2025-08-01/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 := armpostgresql.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", 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", armpostgresql.PrivateEndpointConnection{ + Properties: &armpostgresql.PrivateEndpointConnectionProperties{ + PrivateLinkServiceConnectionState: &armpostgresql.PrivateLinkServiceConnectionState{ + Description: to.Ptr("Approved by johndoe@contoso.com"), + Status: to.Ptr(armpostgresql.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) + } +} diff --git a/sdk/resourcemanager/postgresql/armpostgresql/privateendpointconnections_live_test.go b/sdk/resourcemanager/postgresql/armpostgresql/privateendpointconnections_live_test.go index f3c1e2a92b06..d8811d6d9da6 100644 --- a/sdk/resourcemanager/postgresql/armpostgresql/privateendpointconnections_live_test.go +++ b/sdk/resourcemanager/postgresql/armpostgresql/privateendpointconnections_live_test.go @@ -13,7 +13,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/internal/recording" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3/testutil" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresql" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresql/v2" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources" "github.com/stretchr/testify/suite" ) @@ -21,15 +21,15 @@ import ( type PrivateEndpointConnectionsTestSuite struct { suite.Suite - ctx context.Context - cred azcore.TokenCredential - options *arm.ClientOptions - postgresqlserverId string - serverName string - adminPassword string - location string - resourceGroupName string - subscriptionId string + ctx context.Context + cred azcore.TokenCredential + options *arm.ClientOptions + postgresqlserverId string + serverName string + adminPassword string + location string + resourceGroupName string + subscriptionId string } func (testsuite *PrivateEndpointConnectionsTestSuite) SetupSuite() { @@ -65,23 +65,23 @@ func (testsuite *PrivateEndpointConnectionsTestSuite) Prepare() { serversClient, err := armpostgresql.NewServersClient(testsuite.subscriptionId, testsuite.cred, testsuite.options) testsuite.Require().NoError(err) serversClientCreateResponsePoller, err := serversClient.BeginCreate(testsuite.ctx, testsuite.resourceGroupName, testsuite.serverName, armpostgresql.ServerForCreate{ - Location: to.Ptr(testsuite.location), + Location: to.Ptr(testsuite.location), Properties: &armpostgresql.ServerPropertiesForDefaultCreate{ - CreateMode: to.Ptr(armpostgresql.CreateModeDefault), - MinimalTLSVersion: to.Ptr(armpostgresql.MinimalTLSVersionEnumTLS12), - SSLEnforcement: to.Ptr(armpostgresql.SSLEnforcementEnumEnabled), + CreateMode: to.Ptr(armpostgresql.CreateModeDefault), + MinimalTLSVersion: to.Ptr(armpostgresql.MinimalTLSVersionEnumTLS12), + SSLEnforcement: to.Ptr(armpostgresql.SSLEnforcementEnumEnabled), StorageProfile: &armpostgresql.StorageProfile{ - BackupRetentionDays: to.Ptr[int32](7), - GeoRedundantBackup: to.Ptr(armpostgresql.GeoRedundantBackupDisabled), - StorageMB: to.Ptr[int32](128000), + BackupRetentionDays: to.Ptr[int32](7), + GeoRedundantBackup: to.Ptr(armpostgresql.GeoRedundantBackupDisabled), + StorageMB: to.Ptr[int32](128000), }, - AdministratorLogin: to.Ptr("cloudsa"), - AdministratorLoginPassword: to.Ptr(testsuite.adminPassword), + AdministratorLogin: to.Ptr("cloudsa"), + AdministratorLoginPassword: to.Ptr(testsuite.adminPassword), }, SKU: &armpostgresql.SKU{ - Name: to.Ptr("GP_Gen5_8"), - Family: to.Ptr("Gen5"), - Tier: to.Ptr(armpostgresql.SKUTierGeneralPurpose), + Name: to.Ptr("GP_Gen5_8"), + Family: to.Ptr("Gen5"), + Tier: to.Ptr(armpostgresql.SKUTierGeneralPurpose), }, Tags: map[string]*string{ "ElasticServer": to.Ptr("1"), @@ -99,78 +99,78 @@ func (testsuite *PrivateEndpointConnectionsTestSuite) TestPrivateEndpointConnect var err error // From step Create_PrivateEndpoint template := map[string]any{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", "parameters": map[string]any{ "location": map[string]any{ - "type": "string", - "defaultValue": testsuite.location, + "type": "string", + "defaultValue": testsuite.location, }, "networkInterfaceName": map[string]any{ - "type": "string", - "defaultValue": "pepostgresql-nic", + "type": "string", + "defaultValue": "pepostgresql-nic", }, "postgresqlserverId": map[string]any{ - "type": "string", - "defaultValue": testsuite.postgresqlserverId, + "type": "string", + "defaultValue": testsuite.postgresqlserverId, }, "privateEndpointName": map[string]any{ - "type": "string", - "defaultValue": "pepostgresql", + "type": "string", + "defaultValue": "pepostgresql", }, "virtualNetworksName": map[string]any{ - "type": "string", - "defaultValue": "pepostgresqlvnet", + "type": "string", + "defaultValue": "pepostgresqlvnet", }, }, "resources": []any{ map[string]any{ - "name": "[parameters('virtualNetworksName')]", - "type": "Microsoft.Network/virtualNetworks", - "apiVersion": "2020-11-01", - "location": "[parameters('location')]", + "name": "[parameters('virtualNetworksName')]", + "type": "Microsoft.Network/virtualNetworks", + "apiVersion": "2020-11-01", + "location": "[parameters('location')]", "properties": map[string]any{ "addressSpace": map[string]any{ "addressPrefixes": []any{ "10.0.0.0/16", }, }, - "enableDdosProtection": false, + "enableDdosProtection": false, "subnets": []any{ map[string]any{ - "name": "default", + "name": "default", "properties": map[string]any{ - "addressPrefix": "10.0.0.0/24", - "delegations": []any{}, - "privateEndpointNetworkPolicies": "Disabled", - "privateLinkServiceNetworkPolicies": "Enabled", + "addressPrefix": "10.0.0.0/24", + "delegations": []any{}, + "privateEndpointNetworkPolicies": "Disabled", + "privateLinkServiceNetworkPolicies": "Enabled", }, }, }, - "virtualNetworkPeerings": []any{}, + "virtualNetworkPeerings": []any{}, }, }, map[string]any{ - "name": "[parameters('networkInterfaceName')]", - "type": "Microsoft.Network/networkInterfaces", - "apiVersion": "2020-11-01", + "name": "[parameters('networkInterfaceName')]", + "type": "Microsoft.Network/networkInterfaces", + "apiVersion": "2020-11-01", "dependsOn": []any{ "[resourceId('Microsoft.Network/virtualNetworks', parameters('virtualNetworksName'))]", }, - "location": "[parameters('location')]", + "location": "[parameters('location')]", "properties": map[string]any{ "dnsSettings": map[string]any{ "dnsServers": []any{}, }, - "enableIPForwarding": false, + "enableIPForwarding": false, "ipConfigurations": []any{ map[string]any{ - "name": "privateEndpointIpConfig", + "name": "privateEndpointIpConfig", "properties": map[string]any{ - "primary": true, - "privateIPAddress": "10.0.0.4", - "privateIPAddressVersion": "IPv4", - "privateIPAllocationMethod": "Dynamic", + "primary": true, + "privateIPAddress": "10.0.0.4", + "privateIPAddressVersion": "IPv4", + "privateIPAllocationMethod": "Dynamic", "subnet": map[string]any{ "id": "[resourceId('Microsoft.Network/virtualNetworks/subnets', parameters('virtualNetworksName'), 'default')]", }, @@ -180,29 +180,29 @@ func (testsuite *PrivateEndpointConnectionsTestSuite) TestPrivateEndpointConnect }, }, map[string]any{ - "name": "[parameters('privateEndpointName')]", - "type": "Microsoft.Network/privateEndpoints", - "apiVersion": "2020-11-01", + "name": "[parameters('privateEndpointName')]", + "type": "Microsoft.Network/privateEndpoints", + "apiVersion": "2020-11-01", "dependsOn": []any{ "[resourceId('Microsoft.Network/virtualNetworks', parameters('virtualNetworksName'))]", }, - "location": "[parameters('location')]", + "location": "[parameters('location')]", "properties": map[string]any{ - "customDnsConfigs": []any{}, - "manualPrivateLinkServiceConnections": []any{}, + "customDnsConfigs": []any{}, + "manualPrivateLinkServiceConnections": []any{}, "privateLinkServiceConnections": []any{ map[string]any{ - "name": "[parameters('privateEndpointName')]", + "name": "[parameters('privateEndpointName')]", "properties": map[string]any{ "groupIds": []any{ "postgresqlServer", }, "privateLinkServiceConnectionState": map[string]any{ - "description": "Auto-Approved", - "actionsRequired": "None", - "status": "Approved", + "description": "Auto-Approved", + "actionsRequired": "None", + "status": "Approved", }, - "privateLinkServiceId": "[parameters('postgresqlserverId')]", + "privateLinkServiceId": "[parameters('postgresqlserverId')]", }, }, }, @@ -212,12 +212,12 @@ func (testsuite *PrivateEndpointConnectionsTestSuite) TestPrivateEndpointConnect }, }, }, - "variables": map[string]any{}, + "variables": map[string]any{}, } deployment := armresources.Deployment{ Properties: &armresources.DeploymentProperties{ - Template: template, - Mode: to.Ptr(armresources.DeploymentModeIncremental), + Template: template, + Mode: to.Ptr(armresources.DeploymentModeIncremental), }, } _, err = testutil.CreateDeployment(testsuite.ctx, testsuite.subscriptionId, testsuite.cred, testsuite.options, testsuite.resourceGroupName, "Create_PrivateEndpoint", &deployment) diff --git a/sdk/resourcemanager/postgresql/armpostgresql/privatelinkresources_client.go b/sdk/resourcemanager/postgresql/armpostgresql/privatelinkresources_client.go index 8830c9a76bee..cf8b8e6ca456 100644 --- a/sdk/resourcemanager/postgresql/armpostgresql/privatelinkresources_client.go +++ b/sdk/resourcemanager/postgresql/armpostgresql/privatelinkresources_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armpostgresql @@ -25,9 +24,9 @@ type PrivateLinkResourcesClient struct { } // NewPrivateLinkResourcesClient creates a new instance of PrivateLinkResourcesClient with the specified values. -// - subscriptionID - The ID of the target subscription. +// - 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 +42,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 2018-06-01 +// 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. @@ -72,8 +71,12 @@ func (client *PrivateLinkResourcesClient) Get(ctx context.Context, resourceGroup } // getCreateRequest creates the Get request. -func (client *PrivateLinkResourcesClient) getCreateRequest(ctx context.Context, resourceGroupName string, serverName string, groupName string, options *PrivateLinkResourcesClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/privateLinkResources/{groupName}" +func (client *PrivateLinkResourcesClient) getCreateRequest(ctx context.Context, resourceGroupName string, serverName string, groupName string, _ *PrivateLinkResourcesClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/privateLinkResources/{groupName}" + 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") } @@ -86,16 +89,12 @@ func (client *PrivateLinkResourcesClient) getCreateRequest(ctx context.Context, return nil, errors.New("parameter groupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{groupName}", url.PathEscape(groupName)) - 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.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2018-06-01") + 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 +111,7 @@ func (client *PrivateLinkResourcesClient) getHandleResponse(resp *http.Response) // NewListByServerPager - Gets the private link resources for PostgreSQL server. // -// Generated from API version 2018-06-01 +// 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 @@ -141,8 +140,12 @@ func (client *PrivateLinkResourcesClient) NewListByServerPager(resourceGroupName } // listByServerCreateRequest creates the ListByServer request. -func (client *PrivateLinkResourcesClient) listByServerCreateRequest(ctx context.Context, resourceGroupName string, serverName string, options *PrivateLinkResourcesClientListByServerOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/privateLinkResources" +func (client *PrivateLinkResourcesClient) listByServerCreateRequest(ctx context.Context, resourceGroupName string, serverName string, _ *PrivateLinkResourcesClientListByServerOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/privateLinkResources" + 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") } @@ -151,16 +154,12 @@ func (client *PrivateLinkResourcesClient) listByServerCreateRequest(ctx context. return nil, errors.New("parameter serverName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{serverName}", url.PathEscape(serverName)) - 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.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2018-06-01") + 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 +168,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/armpostgresql/privatelinkresources_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresql/privatelinkresources_client_example_test.go index 4784b7ba7698..5aa7332c9b95 100644 --- a/sdk/resourcemanager/postgresql/armpostgresql/privatelinkresources_client_example_test.go +++ b/sdk/resourcemanager/postgresql/armpostgresql/privatelinkresources_client_example_test.go @@ -1,31 +1,64 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armpostgresql_test import ( "context" - "log" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresql" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresql/v2" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2018-06-01/examples/PrivateLinkResourcesList.json +// Generated from example definition: 2025-08-01/PrivateLinkResourcesGet.json +func ExamplePrivateLinkResourcesClient_Get() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armpostgresql.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewPrivateLinkResourcesClient().Get(ctx, "exampleresourcegroup", "exampleserver", "exampleprivatelink", 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 = armpostgresql.PrivateLinkResourcesClientGetResponse{ + // PrivateLinkResource: &armpostgresql.PrivateLinkResource{ + // Name: to.Ptr("exampleprivatelink"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/privateLinkResources"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/privateLinkResources/exampleprivatelink"), + // Properties: &armpostgresql.PrivateLinkResourceProperties{ + // GroupID: to.Ptr("postgresqlServer"), + // RequiredMembers: []*string{ + // to.Ptr("postgresqlServer"), + // }, + // RequiredZoneNames: []*string{ + // to.Ptr("privatelink.postgres.database.azure.com"), + // }, + // }, + // }, + // } +} + +// Generated from example definition: 2025-08-01/PrivateLinkResourcesList.json func ExamplePrivateLinkResourcesClient_NewListByServerPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armpostgresql.NewClientFactory("", cred, nil) + clientFactory, err := armpostgresql.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) 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 { @@ -36,48 +69,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 = armpostgresql.PrivateLinkResourceListResult{ - // Value: []*armpostgresql.PrivateLinkResource{ - // { - // Name: to.Ptr("plr"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/privateLinkResources"), - // ID: to.Ptr("subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.DBforPostgreSQL/servers/test-svr/privateLinkResources/plr"), - // Properties: &armpostgresql.PrivateLinkResourceProperties{ - // GroupID: to.Ptr("postgresqlServer"), - // RequiredMembers: []*string{ - // to.Ptr("postgresqlServer")}, + // page = armpostgresql.PrivateLinkResourcesClientListByServerResponse{ + // PrivateLinkResourceList: armpostgresql.PrivateLinkResourceList{ + // Value: []*armpostgresql.PrivateLinkResource{ + // { + // Name: to.Ptr("exampleprivatelink"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/privateLinkResources"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/privateLinkResources/exampleprivatelink"), + // Properties: &armpostgresql.PrivateLinkResourceProperties{ + // GroupID: to.Ptr("postgresqlServer"), + // RequiredMembers: []*string{ + // to.Ptr("postgresqlServer"), + // }, + // RequiredZoneNames: []*string{ + // to.Ptr("privatelink.postgres.database.azure.com"), + // }, // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2018-06-01/examples/PrivateLinkResourcesGet.json -func ExamplePrivateLinkResourcesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) + // }, + // }, + // }, + // } } - ctx := context.Background() - clientFactory, err := armpostgresql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPrivateLinkResourcesClient().Get(ctx, "Default", "test-svr", "plr", 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.PrivateLinkResource = armpostgresql.PrivateLinkResource{ - // Name: to.Ptr("plr"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/privateLinkResources"), - // ID: to.Ptr("subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.DBforPostgreSQL/servers/test-svr/privateLinkResources/plr"), - // Properties: &armpostgresql.PrivateLinkResourceProperties{ - // GroupID: to.Ptr("postgresqlServer"), - // RequiredMembers: []*string{ - // to.Ptr("postgresqlServer")}, - // }, - // } } diff --git a/sdk/resourcemanager/postgresql/armpostgresql/quotausages_client.go b/sdk/resourcemanager/postgresql/armpostgresql/quotausages_client.go new file mode 100644 index 000000000000..5765100e16d2 --- /dev/null +++ b/sdk/resourcemanager/postgresql/armpostgresql/quotausages_client.go @@ -0,0 +1,99 @@ +// 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) Go Code Generator. DO NOT EDIT. + +package armpostgresql + +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" +) + +// QuotaUsagesClient contains the methods for the QuotaUsages group. +// Don't use this type directly, use NewQuotaUsagesClient() instead. +type QuotaUsagesClient struct { + internal *arm.Client + subscriptionID string +} + +// 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 - 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 { + return nil, err + } + client := &QuotaUsagesClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// NewListPager - Get quota usages at specified location in a given subscription. +// +// 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] { + return runtime.NewPager(runtime.PagingHandler[QuotaUsagesClientListResponse]{ + More: func(page QuotaUsagesClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *QuotaUsagesClientListResponse) (QuotaUsagesClientListResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "QuotaUsagesClient.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 QuotaUsagesClientListResponse{}, err + } + return client.listHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listCreateRequest creates the List request. +func (client *QuotaUsagesClient) listCreateRequest(ctx context.Context, locationName string, _ *QuotaUsagesClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.DBforPostgreSQL/locations/{locationName}/resourceType/flexibleServers/usages" + 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 *QuotaUsagesClient) listHandleResponse(resp *http.Response) (QuotaUsagesClientListResponse, error) { + result := QuotaUsagesClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.QuotaUsageList); err != nil { + return QuotaUsagesClientListResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/postgresql/armpostgresql/quotausages_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresql/quotausages_client_example_test.go new file mode 100644 index 000000000000..9dcd4f31747e --- /dev/null +++ b/sdk/resourcemanager/postgresql/armpostgresql/quotausages_client_example_test.go @@ -0,0 +1,63 @@ +// 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) Go Code Generator. DO NOT EDIT. + +package armpostgresql_test + +import ( + "context" + "github.com/Azure/azure-sdk-for-go/sdk/azidentity" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresql/v2" + "log" +) + +// Generated from example definition: 2025-08-01/QuotaUsagesForFlexibleServers.json +func ExampleQuotaUsagesClient_NewListPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armpostgresql.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewQuotaUsagesClient().NewListPager("eastus", 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 = armpostgresql.QuotaUsagesClientListResponse{ + // QuotaUsageList: armpostgresql.QuotaUsageList{ + // Value: []*armpostgresql.QuotaUsage{ + // { + // Name: &armpostgresql.NameProperty{ + // LocalizedValue: to.Ptr("standardBSFamily"), + // Value: to.Ptr("standardBSFamily"), + // }, + // CurrentValue: to.Ptr[int64](0), + // ID: to.Ptr(""), + // Limit: to.Ptr[int64](10000), + // Unit: to.Ptr("Count"), + // }, + // { + // Name: &armpostgresql.NameProperty{ + // LocalizedValue: to.Ptr("standardDDSv4Family"), + // Value: to.Ptr("standardDDSv4Family"), + // }, + // CurrentValue: to.Ptr[int64](0), + // ID: to.Ptr(""), + // Limit: to.Ptr[int64](100), + // Unit: to.Ptr("Count"), + // }, + // }, + // }, + // } + } +} diff --git a/sdk/resourcemanager/postgresql/armpostgresql/recoverableservers_client.go b/sdk/resourcemanager/postgresql/armpostgresql/recoverableservers_client.go deleted file mode 100644 index 0d02387200b9..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresql/recoverableservers_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 armpostgresql - -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" -) - -// RecoverableServersClient contains the methods for the RecoverableServers group. -// Don't use this type directly, use NewRecoverableServersClient() instead. -type RecoverableServersClient struct { - internal *arm.Client - subscriptionID string -} - -// NewRecoverableServersClient creates a new instance of RecoverableServersClient with the specified values. -// - subscriptionID - The ID of the target subscription. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewRecoverableServersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*RecoverableServersClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &RecoverableServersClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// Get - Gets a recoverable PostgreSQL Server. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2017-12-01 -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - serverName - The name of the server. -// - options - RecoverableServersClientGetOptions contains the optional parameters for the RecoverableServersClient.Get method. -func (client *RecoverableServersClient) Get(ctx context.Context, resourceGroupName string, serverName string, options *RecoverableServersClientGetOptions) (RecoverableServersClientGetResponse, error) { - var err error - const operationName = "RecoverableServersClient.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, options) - if err != nil { - return RecoverableServersClientGetResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return RecoverableServersClientGetResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return RecoverableServersClientGetResponse{}, err - } - resp, err := client.getHandleResponse(httpResp) - return resp, err -} - -// getCreateRequest creates the Get request. -func (client *RecoverableServersClient) getCreateRequest(ctx context.Context, resourceGroupName string, serverName string, options *RecoverableServersClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/recoverableServers" - 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", "2017-12-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *RecoverableServersClient) getHandleResponse(resp *http.Response) (RecoverableServersClientGetResponse, error) { - result := RecoverableServersClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.RecoverableServerResource); err != nil { - return RecoverableServersClientGetResponse{}, err - } - return result, nil -} diff --git a/sdk/resourcemanager/postgresql/armpostgresql/recoverableservers_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresql/recoverableservers_client_example_test.go index 9014933702ac..ab3fe246f387 100644 --- a/sdk/resourcemanager/postgresql/armpostgresql/recoverableservers_client_example_test.go +++ b/sdk/resourcemanager/postgresql/armpostgresql/recoverableservers_client_example_test.go @@ -11,7 +11,7 @@ import ( "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresql" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresql/v2" ) // Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/RecoverableServersGet.json diff --git a/sdk/resourcemanager/postgresql/armpostgresql/replicas_client.go b/sdk/resourcemanager/postgresql/armpostgresql/replicas_client.go index 176b4aa854f7..e94a24819463 100644 --- a/sdk/resourcemanager/postgresql/armpostgresql/replicas_client.go +++ b/sdk/resourcemanager/postgresql/armpostgresql/replicas_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armpostgresql @@ -25,9 +24,9 @@ type ReplicasClient struct { } // NewReplicasClient creates a new instance of ReplicasClient with the specified values. -// - subscriptionID - The ID of the target subscription. +// - 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 +39,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 2017-12-01 +// 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 @@ -50,21 +49,20 @@ func NewReplicasClient(subscriptionID string, credential azcore.TokenCredential, func (client *ReplicasClient) NewListByServerPager(resourceGroupName string, serverName string, options *ReplicasClientListByServerOptions) *runtime.Pager[ReplicasClientListByServerResponse] { return runtime.NewPager(runtime.PagingHandler[ReplicasClientListByServerResponse]{ More: func(page ReplicasClientListByServerResponse) bool { - return false + return page.NextLink != nil && len(*page.NextLink) > 0 }, Fetcher: func(ctx context.Context, page *ReplicasClientListByServerResponse) (ReplicasClientListByServerResponse, error) { ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "ReplicasClient.NewListByServerPager") - req, err := client.listByServerCreateRequest(ctx, resourceGroupName, serverName, options) - if err != nil { - return ReplicasClientListByServerResponse{}, err + nextLink := "" + if page != nil { + nextLink = *page.NextLink } - resp, err := client.internal.Pipeline().Do(req) + 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 ReplicasClientListByServerResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ReplicasClientListByServerResponse{}, runtime.NewResponseError(resp) - } return client.listByServerHandleResponse(resp) }, Tracer: client.internal.Tracer(), @@ -72,8 +70,8 @@ func (client *ReplicasClient) NewListByServerPager(resourceGroupName string, ser } // listByServerCreateRequest creates the ListByServer request. -func (client *ReplicasClient) listByServerCreateRequest(ctx context.Context, resourceGroupName string, serverName string, options *ReplicasClientListByServerOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/replicas" +func (client *ReplicasClient) listByServerCreateRequest(ctx context.Context, resourceGroupName string, serverName string, _ *ReplicasClientListByServerOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/replicas" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -91,7 +89,7 @@ func (client *ReplicasClient) listByServerCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2017-12-01") + 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 +98,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/armpostgresql/replicas_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresql/replicas_client_example_test.go index 770b631a82d6..0c37a65ca05b 100644 --- a/sdk/resourcemanager/postgresql/armpostgresql/replicas_client_example_test.go +++ b/sdk/resourcemanager/postgresql/armpostgresql/replicas_client_example_test.go @@ -1,31 +1,28 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armpostgresql_test import ( "context" - "log" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresql" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresql/v2" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/ReplicasListByServer.json +// Generated from example definition: 2025-08-01/ReplicasListByServer.json func ExampleReplicasClient_NewListByServerPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armpostgresql.NewClientFactory("", cred, nil) + clientFactory, err := armpostgresql.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewReplicasClient().NewListByServerPager("TestGroup_WestCentralUS", "testserver-master", nil) + pager := clientFactory.NewReplicasClient().NewListByServerPager("exampleresourcegroup", "exampleserver", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -36,148 +33,67 @@ 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 = armpostgresql.ServerListResult{ - // Value: []*armpostgresql.Server{ - // { - // Name: to.Ptr("testserver-replica1"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup_WestCentralUS/providers/Microsoft.DBforPostgreSQL/servers/testserver-replica1"), - // Location: to.Ptr("westcentralus"), - // Properties: &armpostgresql.ServerProperties{ - // AdministratorLogin: to.Ptr("postgres"), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-06-12T00:05:03.269Z"); return t}()), - // FullyQualifiedDomainName: to.Ptr("testserver-replica1.postgres.database.azure.com"), - // MasterServerID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup_WestCentralUS/providers/Microsoft.DBforPostgreSQL/servers/testserver-master"), - // ReplicaCapacity: to.Ptr[int32](0), - // ReplicationRole: to.Ptr("Replica"), - // SSLEnforcement: to.Ptr(armpostgresql.SSLEnforcementEnumDisabled), - // StorageProfile: &armpostgresql.StorageProfile{ - // BackupRetentionDays: to.Ptr[int32](7), - // GeoRedundantBackup: to.Ptr(armpostgresql.GeoRedundantBackupDisabled), - // StorageMB: to.Ptr[int32](2048000), - // }, - // UserVisibleState: to.Ptr(armpostgresql.ServerStateReady), - // Version: to.Ptr(armpostgresql.ServerVersionNine6), - // }, - // SKU: &armpostgresql.SKU{ - // Name: to.Ptr("GP_Gen4_16"), - // Capacity: to.Ptr[int32](16), - // Family: to.Ptr("Gen4"), - // Tier: to.Ptr(armpostgresql.SKUTierGeneralPurpose), - // }, - // }, - // { - // Name: to.Ptr("testserver-replica2"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup_WestCentralUS/providers/Microsoft.DBforPostgreSQL/servers/testserver-replica2"), - // Location: to.Ptr("westcentralus"), - // Properties: &armpostgresql.ServerProperties{ - // AdministratorLogin: to.Ptr("postgres"), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-06-12T00:05:03.269Z"); return t}()), - // FullyQualifiedDomainName: to.Ptr("testserver-replica2.postgres.database.azure.com"), - // MasterServerID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup_WestCentralUS/providers/Microsoft.DBforPostgreSQL/servers/testserver-master"), - // ReplicaCapacity: to.Ptr[int32](0), - // ReplicationRole: to.Ptr("Replica"), - // SSLEnforcement: to.Ptr(armpostgresql.SSLEnforcementEnumDisabled), - // StorageProfile: &armpostgresql.StorageProfile{ - // BackupRetentionDays: to.Ptr[int32](7), - // GeoRedundantBackup: to.Ptr(armpostgresql.GeoRedundantBackupDisabled), - // StorageMB: to.Ptr[int32](2048000), - // }, - // UserVisibleState: to.Ptr(armpostgresql.ServerStateReady), - // Version: to.Ptr(armpostgresql.ServerVersionNine6), - // }, - // SKU: &armpostgresql.SKU{ - // Name: to.Ptr("GP_Gen4_16"), - // Capacity: to.Ptr[int32](16), - // Family: to.Ptr("Gen4"), - // Tier: to.Ptr(armpostgresql.SKUTierGeneralPurpose), - // }, - // }, - // { - // Name: to.Ptr("testserver-replica3"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup_WestCentralUS/providers/Microsoft.DBforPostgreSQL/servers/testserver-replica3"), - // Location: to.Ptr("westcentralus"), - // Properties: &armpostgresql.ServerProperties{ - // AdministratorLogin: to.Ptr("postgres"), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-06-12T00:05:03.269Z"); return t}()), - // FullyQualifiedDomainName: to.Ptr("testserver-replica3.postgres.database.azure.com"), - // MasterServerID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup_WestCentralUS/providers/Microsoft.DBforPostgreSQL/servers/testserver-master"), - // ReplicaCapacity: to.Ptr[int32](0), - // ReplicationRole: to.Ptr("Replica"), - // SSLEnforcement: to.Ptr(armpostgresql.SSLEnforcementEnumDisabled), - // StorageProfile: &armpostgresql.StorageProfile{ - // BackupRetentionDays: to.Ptr[int32](7), - // GeoRedundantBackup: to.Ptr(armpostgresql.GeoRedundantBackupDisabled), - // StorageMB: to.Ptr[int32](2048000), + // page = armpostgresql.ReplicasClientListByServerResponse{ + // ServerList: armpostgresql.ServerList{ + // Value: []*armpostgresql.Server{ + // { + // Name: to.Ptr("exampleserver"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver"), + // Location: to.Ptr("eastus"), + // Properties: &armpostgresql.ServerProperties{ + // AdministratorLogin: to.Ptr("exampleadministratorlogin"), + // AuthConfig: &armpostgresql.AuthConfig{ + // ActiveDirectoryAuth: to.Ptr(armpostgresql.MicrosoftEntraAuthDisabled), + // PasswordAuth: to.Ptr(armpostgresql.PasswordBasedAuthEnabled), + // }, + // AvailabilityZone: to.Ptr("2"), + // Backup: &armpostgresql.Backup{ + // BackupRetentionDays: to.Ptr[int32](7), + // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T18:35:22.123456Z"); return t}()), + // GeoRedundantBackup: to.Ptr(armpostgresql.GeographicallyRedundantBackupDisabled), + // }, + // DataEncryption: &armpostgresql.DataEncryption{ + // Type: to.Ptr(armpostgresql.DataEncryptionTypeSystemManaged), + // }, + // FullyQualifiedDomainName: to.Ptr("exampleserver.postgres.database.azure.com"), + // HighAvailability: &armpostgresql.HighAvailability{ + // Mode: to.Ptr(armpostgresql.FlexibleServerHighAvailabilityModeDisabled), + // State: to.Ptr(armpostgresql.HighAvailabilityStateNotEnabled), + // }, + // MaintenanceWindow: &armpostgresql.MaintenanceWindow{ + // CustomWindow: to.Ptr("Disabled"), + // DayOfWeek: to.Ptr[int32](0), + // StartHour: to.Ptr[int32](0), + // StartMinute: to.Ptr[int32](0), + // }, + // MinorVersion: to.Ptr("5"), + // Network: &armpostgresql.Network{ + // PublicNetworkAccess: to.Ptr(armpostgresql.ServerPublicNetworkAccessStateEnabled), + // }, + // Replica: &armpostgresql.Replica{ + // Capacity: to.Ptr[int32](0), + // ReplicationState: to.Ptr(armpostgresql.ReplicationStateActive), + // Role: to.Ptr(armpostgresql.ReplicationRoleAsyncReplica), + // }, + // ReplicaCapacity: to.Ptr[int32](0), + // ReplicationRole: to.Ptr(armpostgresql.ReplicationRoleAsyncReplica), + // State: to.Ptr(armpostgresql.ServerStateReady), + // Storage: &armpostgresql.Storage{ + // AutoGrow: to.Ptr(armpostgresql.StorageAutoGrowDisabled), + // Iops: to.Ptr[int32](2300), + // StorageSizeGB: to.Ptr[int32](512), + // Tier: to.Ptr(armpostgresql.AzureManagedDiskPerformanceTierP20), + // }, + // Version: to.Ptr(armpostgresql.PostgresMajorVersion17), // }, - // UserVisibleState: to.Ptr(armpostgresql.ServerStateReady), - // Version: to.Ptr(armpostgresql.ServerVersionNine6), - // }, - // SKU: &armpostgresql.SKU{ - // Name: to.Ptr("GP_Gen4_16"), - // Capacity: to.Ptr[int32](16), - // Family: to.Ptr("Gen4"), - // Tier: to.Ptr(armpostgresql.SKUTierGeneralPurpose), - // }, - // }, - // { - // Name: to.Ptr("testserver-replica4"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup_WestCentralUS/providers/Microsoft.DBforPostgreSQL/servers/testserver-replica4"), - // Location: to.Ptr("westcentralus"), - // Properties: &armpostgresql.ServerProperties{ - // AdministratorLogin: to.Ptr("postgres"), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-06-12T00:05:03.269Z"); return t}()), - // FullyQualifiedDomainName: to.Ptr("testserver-replica4.postgres.database.azure.com"), - // MasterServerID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup_WestCentralUS/providers/Microsoft.DBforPostgreSQL/servers/testserver-master"), - // ReplicaCapacity: to.Ptr[int32](0), - // ReplicationRole: to.Ptr("Replica"), - // SSLEnforcement: to.Ptr(armpostgresql.SSLEnforcementEnumDisabled), - // StorageProfile: &armpostgresql.StorageProfile{ - // BackupRetentionDays: to.Ptr[int32](7), - // GeoRedundantBackup: to.Ptr(armpostgresql.GeoRedundantBackupDisabled), - // StorageMB: to.Ptr[int32](2048000), + // SKU: &armpostgresql.SKU{ + // Name: to.Ptr("Standard_D4ds_v5"), + // Tier: to.Ptr(armpostgresql.SKUTierGeneralPurpose), // }, - // UserVisibleState: to.Ptr(armpostgresql.ServerStateReady), - // Version: to.Ptr(armpostgresql.ServerVersionNine6), - // }, - // SKU: &armpostgresql.SKU{ - // Name: to.Ptr("GP_Gen4_16"), - // Capacity: to.Ptr[int32](16), - // Family: to.Ptr("Gen4"), - // Tier: to.Ptr(armpostgresql.SKUTierGeneralPurpose), // }, // }, - // { - // Name: to.Ptr("testserver-replica5"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup_WestCentralUS/providers/Microsoft.DBforPostgreSQL/servers/testserver-replica5"), - // Location: to.Ptr("westcentralus"), - // Properties: &armpostgresql.ServerProperties{ - // AdministratorLogin: to.Ptr("postgres"), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-06-12T00:05:03.269Z"); return t}()), - // FullyQualifiedDomainName: to.Ptr("testserver-replica5.postgres.database.azure.com"), - // MasterServerID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup_WestCentralUS/providers/Microsoft.DBforPostgreSQL/servers/testserver-master"), - // ReplicaCapacity: to.Ptr[int32](0), - // ReplicationRole: to.Ptr("Replica"), - // SSLEnforcement: to.Ptr(armpostgresql.SSLEnforcementEnumDisabled), - // StorageProfile: &armpostgresql.StorageProfile{ - // BackupRetentionDays: to.Ptr[int32](7), - // GeoRedundantBackup: to.Ptr(armpostgresql.GeoRedundantBackupDisabled), - // StorageMB: to.Ptr[int32](2048000), - // }, - // UserVisibleState: to.Ptr(armpostgresql.ServerStateReady), - // Version: to.Ptr(armpostgresql.ServerVersionNine6), - // }, - // SKU: &armpostgresql.SKU{ - // Name: to.Ptr("GP_Gen4_16"), - // Capacity: to.Ptr[int32](16), - // Family: to.Ptr("Gen4"), - // Tier: to.Ptr(armpostgresql.SKUTierGeneralPurpose), - // }, - // }}, + // }, // } } } diff --git a/sdk/resourcemanager/postgresql/armpostgresql/response_types.go b/sdk/resourcemanager/postgresql/armpostgresql/response_types.go deleted file mode 100644 index 778b612b6bf6..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresql/response_types.go +++ /dev/null @@ -1,286 +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 armpostgresql - -// CheckNameAvailabilityClientExecuteResponse contains the response from method CheckNameAvailabilityClient.Execute. -type CheckNameAvailabilityClientExecuteResponse struct { - // Represents a resource name availability. - NameAvailability -} - -// ConfigurationsClientCreateOrUpdateResponse contains the response from method ConfigurationsClient.BeginCreateOrUpdate. -type ConfigurationsClientCreateOrUpdateResponse struct { - // Represents a Configuration. - Configuration -} - -// ConfigurationsClientGetResponse contains the response from method ConfigurationsClient.Get. -type ConfigurationsClientGetResponse struct { - // Represents a Configuration. - Configuration -} - -// ConfigurationsClientListByServerResponse contains the response from method ConfigurationsClient.NewListByServerPager. -type ConfigurationsClientListByServerResponse struct { - // A list of server configurations. - ConfigurationListResult -} - -// DatabasesClientCreateOrUpdateResponse contains the response from method DatabasesClient.BeginCreateOrUpdate. -type DatabasesClientCreateOrUpdateResponse struct { - // Represents a Database. - Database -} - -// DatabasesClientDeleteResponse contains the response from method DatabasesClient.BeginDelete. -type DatabasesClientDeleteResponse struct { - // placeholder for future response values -} - -// DatabasesClientGetResponse contains the response from method DatabasesClient.Get. -type DatabasesClientGetResponse struct { - // Represents a Database. - Database -} - -// DatabasesClientListByServerResponse contains the response from method DatabasesClient.NewListByServerPager. -type DatabasesClientListByServerResponse struct { - // A List of databases. - DatabaseListResult -} - -// FirewallRulesClientCreateOrUpdateResponse contains the response from method FirewallRulesClient.BeginCreateOrUpdate. -type FirewallRulesClientCreateOrUpdateResponse struct { - // Represents a server firewall rule. - FirewallRule -} - -// FirewallRulesClientDeleteResponse contains the response from method FirewallRulesClient.BeginDelete. -type FirewallRulesClientDeleteResponse struct { - // placeholder for future response values -} - -// FirewallRulesClientGetResponse contains the response from method FirewallRulesClient.Get. -type FirewallRulesClientGetResponse struct { - // Represents a server firewall rule. - FirewallRule -} - -// FirewallRulesClientListByServerResponse contains the response from method FirewallRulesClient.NewListByServerPager. -type FirewallRulesClientListByServerResponse struct { - // A list of firewall rules. - FirewallRuleListResult -} - -// LocationBasedPerformanceTierClientListResponse contains the response from method LocationBasedPerformanceTierClient.NewListPager. -type LocationBasedPerformanceTierClientListResponse struct { - // A list of performance tiers. - PerformanceTierListResult -} - -// LogFilesClientListByServerResponse contains the response from method LogFilesClient.NewListByServerPager. -type LogFilesClientListByServerResponse struct { - // A list of log files. - LogFileListResult -} - -// OperationsClientListResponse contains the response from method OperationsClient.List. -type OperationsClientListResponse struct { - // A list of resource provider operations. - OperationListResult -} - -// PrivateEndpointConnectionsClientCreateOrUpdateResponse contains the response from method PrivateEndpointConnectionsClient.BeginCreateOrUpdate. -type PrivateEndpointConnectionsClientCreateOrUpdateResponse struct { - // A private endpoint connection - PrivateEndpointConnection -} - -// PrivateEndpointConnectionsClientDeleteResponse contains the response from method PrivateEndpointConnectionsClient.BeginDelete. -type PrivateEndpointConnectionsClientDeleteResponse struct { - // placeholder for future response values -} - -// PrivateEndpointConnectionsClientGetResponse contains the response from method PrivateEndpointConnectionsClient.Get. -type PrivateEndpointConnectionsClientGetResponse struct { - // A private endpoint connection - PrivateEndpointConnection -} - -// PrivateEndpointConnectionsClientListByServerResponse contains the response from method PrivateEndpointConnectionsClient.NewListByServerPager. -type PrivateEndpointConnectionsClientListByServerResponse struct { - // A list of private endpoint connections. - PrivateEndpointConnectionListResult -} - -// PrivateEndpointConnectionsClientUpdateTagsResponse contains the response from method PrivateEndpointConnectionsClient.BeginUpdateTags. -type PrivateEndpointConnectionsClientUpdateTagsResponse struct { - // A private endpoint connection - PrivateEndpointConnection -} - -// PrivateLinkResourcesClientGetResponse contains the response from method PrivateLinkResourcesClient.Get. -type PrivateLinkResourcesClientGetResponse struct { - // A private link resource - PrivateLinkResource -} - -// PrivateLinkResourcesClientListByServerResponse contains the response from method PrivateLinkResourcesClient.NewListByServerPager. -type PrivateLinkResourcesClientListByServerResponse struct { - // A list of private link resources - PrivateLinkResourceListResult -} - -// RecoverableServersClientGetResponse contains the response from method RecoverableServersClient.Get. -type RecoverableServersClientGetResponse struct { - // A recoverable server resource. - RecoverableServerResource -} - -// ReplicasClientListByServerResponse contains the response from method ReplicasClient.NewListByServerPager. -type ReplicasClientListByServerResponse struct { - // A list of servers. - ServerListResult -} - -// ServerAdministratorsClientCreateOrUpdateResponse contains the response from method ServerAdministratorsClient.BeginCreateOrUpdate. -type ServerAdministratorsClientCreateOrUpdateResponse struct { - // Represents a and external administrator to be created. - ServerAdministratorResource -} - -// ServerAdministratorsClientDeleteResponse contains the response from method ServerAdministratorsClient.BeginDelete. -type ServerAdministratorsClientDeleteResponse struct { - // placeholder for future response values -} - -// ServerAdministratorsClientGetResponse contains the response from method ServerAdministratorsClient.Get. -type ServerAdministratorsClientGetResponse struct { - // Represents a and external administrator to be created. - ServerAdministratorResource -} - -// ServerAdministratorsClientListResponse contains the response from method ServerAdministratorsClient.NewListPager. -type ServerAdministratorsClientListResponse struct { - // The response to a list Active Directory Administrators request. - ServerAdministratorResourceListResult -} - -// ServerBasedPerformanceTierClientListResponse contains the response from method ServerBasedPerformanceTierClient.NewListPager. -type ServerBasedPerformanceTierClientListResponse struct { - // A list of performance tiers. - PerformanceTierListResult -} - -// ServerKeysClientCreateOrUpdateResponse contains the response from method ServerKeysClient.BeginCreateOrUpdate. -type ServerKeysClientCreateOrUpdateResponse struct { - // A PostgreSQL Server key. - ServerKey -} - -// ServerKeysClientDeleteResponse contains the response from method ServerKeysClient.BeginDelete. -type ServerKeysClientDeleteResponse struct { - // placeholder for future response values -} - -// ServerKeysClientGetResponse contains the response from method ServerKeysClient.Get. -type ServerKeysClientGetResponse struct { - // A PostgreSQL Server key. - ServerKey -} - -// ServerKeysClientListResponse contains the response from method ServerKeysClient.NewListPager. -type ServerKeysClientListResponse struct { - // A list of PostgreSQL Server keys. - ServerKeyListResult -} - -// ServerParametersClientListUpdateConfigurationsResponse contains the response from method ServerParametersClient.BeginListUpdateConfigurations. -type ServerParametersClientListUpdateConfigurationsResponse struct { - // A list of server configurations. - ConfigurationListResult -} - -// ServerSecurityAlertPoliciesClientCreateOrUpdateResponse contains the response from method ServerSecurityAlertPoliciesClient.BeginCreateOrUpdate. -type ServerSecurityAlertPoliciesClientCreateOrUpdateResponse struct { - // A server security alert policy. - ServerSecurityAlertPolicy -} - -// ServerSecurityAlertPoliciesClientGetResponse contains the response from method ServerSecurityAlertPoliciesClient.Get. -type ServerSecurityAlertPoliciesClientGetResponse struct { - // A server security alert policy. - ServerSecurityAlertPolicy -} - -// ServerSecurityAlertPoliciesClientListByServerResponse contains the response from method ServerSecurityAlertPoliciesClient.NewListByServerPager. -type ServerSecurityAlertPoliciesClientListByServerResponse struct { - // A list of the server's security alert policies. - ServerSecurityAlertPolicyListResult -} - -// ServersClientCreateResponse contains the response from method ServersClient.BeginCreate. -type ServersClientCreateResponse struct { - // Represents a server. - Server -} - -// ServersClientDeleteResponse contains the response from method ServersClient.BeginDelete. -type ServersClientDeleteResponse struct { - // placeholder for future response values -} - -// ServersClientGetResponse contains the response from method ServersClient.Get. -type ServersClientGetResponse struct { - // Represents a server. - Server -} - -// ServersClientListByResourceGroupResponse contains the response from method ServersClient.NewListByResourceGroupPager. -type ServersClientListByResourceGroupResponse struct { - // A list of servers. - ServerListResult -} - -// ServersClientListResponse contains the response from method ServersClient.NewListPager. -type ServersClientListResponse struct { - // A list of servers. - ServerListResult -} - -// ServersClientRestartResponse contains the response from method ServersClient.BeginRestart. -type ServersClientRestartResponse struct { - // placeholder for future response values -} - -// ServersClientUpdateResponse contains the response from method ServersClient.BeginUpdate. -type ServersClientUpdateResponse struct { - // Represents a server. - Server -} - -// VirtualNetworkRulesClientCreateOrUpdateResponse contains the response from method VirtualNetworkRulesClient.BeginCreateOrUpdate. -type VirtualNetworkRulesClientCreateOrUpdateResponse struct { - // A virtual network rule. - VirtualNetworkRule -} - -// VirtualNetworkRulesClientDeleteResponse contains the response from method VirtualNetworkRulesClient.BeginDelete. -type VirtualNetworkRulesClientDeleteResponse struct { - // placeholder for future response values -} - -// VirtualNetworkRulesClientGetResponse contains the response from method VirtualNetworkRulesClient.Get. -type VirtualNetworkRulesClientGetResponse struct { - // A virtual network rule. - VirtualNetworkRule -} - -// VirtualNetworkRulesClientListByServerResponse contains the response from method VirtualNetworkRulesClient.NewListByServerPager. -type VirtualNetworkRulesClientListByServerResponse struct { - // A list of virtual network rules. - VirtualNetworkRuleListResult -} diff --git a/sdk/resourcemanager/postgresql/armpostgresql/responses.go b/sdk/resourcemanager/postgresql/armpostgresql/responses.go new file mode 100644 index 000000000000..af9ecb9432e2 --- /dev/null +++ b/sdk/resourcemanager/postgresql/armpostgresql/responses.go @@ -0,0 +1,398 @@ +// 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) Go Code Generator. DO NOT EDIT. + +package armpostgresql + +// AdministratorsMicrosoftEntraClientCreateOrUpdateResponse contains the response from method AdministratorsMicrosoftEntraClient.BeginCreateOrUpdate. +type AdministratorsMicrosoftEntraClientCreateOrUpdateResponse struct { + // Server administrator associated to a Microsoft Entra principal. + AdministratorMicrosoftEntra +} + +// AdministratorsMicrosoftEntraClientDeleteResponse contains the response from method AdministratorsMicrosoftEntraClient.BeginDelete. +type AdministratorsMicrosoftEntraClientDeleteResponse struct { + // placeholder for future response values +} + +// 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 +} + +// AdvancedThreatProtectionSettingsClientGetResponse contains the response from method AdvancedThreatProtectionSettingsClient.Get. +type AdvancedThreatProtectionSettingsClientGetResponse struct { + // Advanced threat protection settings of the server. + AdvancedThreatProtectionSettingsModel +} + +// AdvancedThreatProtectionSettingsClientListByServerResponse contains the response from method AdvancedThreatProtectionSettingsClient.NewListByServerPager. +type AdvancedThreatProtectionSettingsClientListByServerResponse struct { + // List of advanced threat protection settings for a server. + AdvancedThreatProtectionSettingsList +} + +// BackupsAutomaticAndOnDemandClientCreateResponse contains the response from method BackupsAutomaticAndOnDemandClient.BeginCreate. +type BackupsAutomaticAndOnDemandClientCreateResponse struct { + // Properties of a backup. + BackupAutomaticAndOnDemand +} + +// 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 + + // A unique ID for the current operation, service generated. All the resource providers must return this value in the response + // headers to facilitate debugging. + XMSRequestID *string +} + +// BackupsLongTermRetentionClientGetResponse contains the response from method BackupsLongTermRetentionClient.Get. +type BackupsLongTermRetentionClientGetResponse struct { + // Response for the LTR backup Operation API call + BackupsLongTermRetentionOperation +} + +// BackupsLongTermRetentionClientListByServerResponse contains the response from method BackupsLongTermRetentionClient.NewListByServerPager. +type BackupsLongTermRetentionClientListByServerResponse struct { + // A list of long term retention backup operations for server. + LtrServerBackupOperationList +} + +// BackupsLongTermRetentionClientStartResponse contains the response from method BackupsLongTermRetentionClient.BeginStart. +type BackupsLongTermRetentionClientStartResponse struct { + // Response for the LTR backup API call + BackupsLongTermRetentionResponse + + // A unique ID for the current operation, service generated. All the resource providers must return this value in the response + // headers to facilitate debugging. + XMSRequestID *string +} + +// CapabilitiesByLocationClientListResponse contains the response from method CapabilitiesByLocationClient.NewListPager. +type CapabilitiesByLocationClientListResponse struct { + // List of capabilities for the Azure Database for PostgreSQL flexible server. + CapabilityList +} + +// 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 { + // Configuration (also known as server parameter). + Configuration +} + +// ConfigurationsClientListByServerResponse contains the response from method ConfigurationsClient.NewListByServerPager. +type ConfigurationsClientListByServerResponse struct { + // List of configurations (also known as server parameters). + ConfigurationList +} + +// ConfigurationsClientPutResponse contains the response from method ConfigurationsClient.BeginPut. +type ConfigurationsClientPutResponse struct { + // Configuration (also known as server parameter). + Configuration +} + +// ConfigurationsClientUpdateResponse contains the response from method ConfigurationsClient.BeginUpdate. +type ConfigurationsClientUpdateResponse struct { + // Configuration (also known as server parameter). + Configuration +} + +// DatabasesClientCreateResponse contains the response from method DatabasesClient.BeginCreate. +type DatabasesClientCreateResponse struct { + // Represents a database. + Database +} + +// DatabasesClientDeleteResponse contains the response from method DatabasesClient.BeginDelete. +type DatabasesClientDeleteResponse struct { + // placeholder for future response values +} + +// DatabasesClientGetResponse contains the response from method DatabasesClient.Get. +type DatabasesClientGetResponse struct { + // Represents a database. + Database +} + +// DatabasesClientListByServerResponse contains the response from method DatabasesClient.NewListByServerPager. +type DatabasesClientListByServerResponse struct { + // List of all databases in a server. + DatabaseList +} + +// FirewallRulesClientCreateOrUpdateResponse contains the response from method FirewallRulesClient.BeginCreateOrUpdate. +type FirewallRulesClientCreateOrUpdateResponse struct { + // Firewall rule. + FirewallRule +} + +// FirewallRulesClientDeleteResponse contains the response from method FirewallRulesClient.BeginDelete. +type FirewallRulesClientDeleteResponse struct { + // placeholder for future response values +} + +// FirewallRulesClientGetResponse contains the response from method FirewallRulesClient.Get. +type FirewallRulesClientGetResponse struct { + // Firewall rule. + FirewallRule +} + +// FirewallRulesClientListByServerResponse contains the response from method FirewallRulesClient.NewListByServerPager. +type FirewallRulesClientListByServerResponse struct { + // List of firewall rules. + FirewallRuleList +} + +// MigrationsClientCancelResponse contains the response from method MigrationsClient.Cancel. +type MigrationsClientCancelResponse struct { + // Properties of a migration. + Migration +} + +// 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 { + // Properties of a migration. + Migration +} + +// MigrationsClientGetResponse contains the response from method MigrationsClient.Get. +type MigrationsClientGetResponse struct { + // Properties of a migration. + Migration +} + +// MigrationsClientListByTargetServerResponse contains the response from method MigrationsClient.NewListByTargetServerPager. +type MigrationsClientListByTargetServerResponse struct { + // List of migrations. + MigrationList +} + +// MigrationsClientUpdateResponse contains the response from method MigrationsClient.Update. +type MigrationsClientUpdateResponse struct { + // 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 { + // Paged collection of Operation items + OperationList +} + +// PrivateDNSZoneSuffixClientGetResponse contains the response from method PrivateDNSZoneSuffixClient.Get. +type PrivateDNSZoneSuffixClientGetResponse struct { + Value *string +} + +// PrivateEndpointConnectionsClientDeleteResponse contains the response from method PrivateEndpointConnectionsClient.BeginDelete. +type PrivateEndpointConnectionsClientDeleteResponse struct { + // placeholder for future response values +} + +// PrivateEndpointConnectionsClientGetResponse contains the response from method PrivateEndpointConnectionsClient.Get. +type PrivateEndpointConnectionsClientGetResponse struct { + // The private endpoint connection resource. + PrivateEndpointConnection +} + +// PrivateEndpointConnectionsClientListByServerResponse contains the response from method PrivateEndpointConnectionsClient.NewListByServerPager. +type PrivateEndpointConnectionsClientListByServerResponse struct { + // List of private endpoint connections. + PrivateEndpointConnectionList +} + +// PrivateEndpointConnectionsClientUpdateResponse contains the response from method PrivateEndpointConnectionsClient.BeginUpdate. +type PrivateEndpointConnectionsClientUpdateResponse struct { + // The private endpoint connection resource. + PrivateEndpointConnection +} + +// PrivateLinkResourcesClientGetResponse contains the response from method PrivateLinkResourcesClient.Get. +type PrivateLinkResourcesClientGetResponse struct { + // A private link resource. + PrivateLinkResource +} + +// PrivateLinkResourcesClientListByServerResponse contains the response from method PrivateLinkResourcesClient.NewListByServerPager. +type PrivateLinkResourcesClientListByServerResponse struct { + // A list of private link resources + PrivateLinkResourceList +} + +// QuotaUsagesClientListResponse contains the response from method QuotaUsagesClient.NewListPager. +type QuotaUsagesClientListResponse struct { + // Capability for the PostgreSQL server + QuotaUsageList +} + +// ReplicasClientListByServerResponse contains the response from method ReplicasClient.NewListByServerPager. +type ReplicasClientListByServerResponse struct { + // A list of servers. + ServerList +} + +// ServerThreatProtectionSettingsClientCreateOrUpdateResponse contains the response from method ServerThreatProtectionSettingsClient.BeginCreateOrUpdate. +type ServerThreatProtectionSettingsClientCreateOrUpdateResponse struct { + // Advanced threat protection settings of the server. + AdvancedThreatProtectionSettingsModel +} + +// ServersClientCreateOrUpdateResponse contains the response from method ServersClient.BeginCreateOrUpdate. +type ServersClientCreateOrUpdateResponse struct { + // Properties of a server. + Server +} + +// ServersClientDeleteResponse contains the response from method ServersClient.BeginDelete. +type ServersClientDeleteResponse struct { + // placeholder for future response values +} + +// ServersClientGetResponse contains the response from method ServersClient.Get. +type ServersClientGetResponse struct { + // Properties of a server. + Server +} + +// ServersClientListByResourceGroupResponse contains the response from method ServersClient.NewListByResourceGroupPager. +type ServersClientListByResourceGroupResponse struct { + // A list of servers. + ServerList +} + +// ServersClientListBySubscriptionResponse contains the response from method ServersClient.NewListBySubscriptionPager. +type ServersClientListBySubscriptionResponse struct { + // A list of servers. + ServerList +} + +// ServersClientRestartResponse contains the response from method ServersClient.BeginRestart. +type ServersClientRestartResponse struct { + // placeholder for future response values +} + +// ServersClientStartResponse contains the response from method ServersClient.BeginStart. +type ServersClientStartResponse struct { + // placeholder for future response values +} + +// ServersClientStopResponse contains the response from method ServersClient.BeginStop. +type ServersClientStopResponse struct { + // placeholder for future response values +} + +// ServersClientUpdateResponse contains the response from method ServersClient.BeginUpdate. +type ServersClientUpdateResponse struct { + // Properties of a server. + Server +} + +// TuningOptionsClientGetResponse contains the response from method TuningOptionsClient.Get. +type TuningOptionsClientGetResponse struct { + // Impact on some metric if this recommended action is applied. + TuningOptions +} + +// TuningOptionsClientListByServerResponse contains the response from method TuningOptionsClient.NewListByServerPager. +type TuningOptionsClientListByServerResponse struct { + // 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 { + // Pair of virtual endpoints for a server. + VirtualEndpoint +} + +// VirtualEndpointsClientDeleteResponse contains the response from method VirtualEndpointsClient.BeginDelete. +type VirtualEndpointsClientDeleteResponse struct { + // placeholder for future response values +} + +// VirtualEndpointsClientGetResponse contains the response from method VirtualEndpointsClient.Get. +type VirtualEndpointsClientGetResponse struct { + // Pair of virtual endpoints for a server. + VirtualEndpoint +} + +// VirtualEndpointsClientListByServerResponse contains the response from method VirtualEndpointsClient.NewListByServerPager. +type VirtualEndpointsClientListByServerResponse struct { + // List of virtual endpoints. + VirtualEndpointsList +} + +// VirtualEndpointsClientUpdateResponse contains the response from method VirtualEndpointsClient.BeginUpdate. +type VirtualEndpointsClientUpdateResponse struct { + // Pair of virtual endpoints for a server. + VirtualEndpoint +} + +// VirtualNetworkSubnetUsageClientListResponse contains the response from method VirtualNetworkSubnetUsageClient.List. +type VirtualNetworkSubnetUsageClientListResponse struct { + // Virtual network subnet usage data. + VirtualNetworkSubnetUsageModel +} diff --git a/sdk/resourcemanager/postgresql/armpostgresql/serveradministrators_client.go b/sdk/resourcemanager/postgresql/armpostgresql/serveradministrators_client.go deleted file mode 100644 index 5d3a2db54cfd..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresql/serveradministrators_client.go +++ /dev/null @@ -1,330 +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 armpostgresql - -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" -) - -// ServerAdministratorsClient contains the methods for the ServerAdministrators group. -// Don't use this type directly, use NewServerAdministratorsClient() instead. -type ServerAdministratorsClient struct { - internal *arm.Client - subscriptionID string -} - -// NewServerAdministratorsClient creates a new instance of ServerAdministratorsClient with the specified values. -// - subscriptionID - The ID of the target subscription. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewServerAdministratorsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ServerAdministratorsClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &ServerAdministratorsClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// BeginCreateOrUpdate - Creates or update active directory administrator on an existing server. The update action will overwrite -// the existing administrator. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2017-12-01 -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - serverName - The name of the server. -// - properties - The required parameters for creating or updating an AAD server administrator. -// - options - ServerAdministratorsClientBeginCreateOrUpdateOptions contains the optional parameters for the ServerAdministratorsClient.BeginCreateOrUpdate -// method. -func (client *ServerAdministratorsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, properties ServerAdministratorResource, options *ServerAdministratorsClientBeginCreateOrUpdateOptions) (*runtime.Poller[ServerAdministratorsClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, serverName, properties, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ServerAdministratorsClientCreateOrUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ServerAdministratorsClientCreateOrUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// CreateOrUpdate - Creates or update active directory administrator on an existing server. The update action will overwrite -// the existing administrator. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2017-12-01 -func (client *ServerAdministratorsClient) createOrUpdate(ctx context.Context, resourceGroupName string, serverName string, properties ServerAdministratorResource, options *ServerAdministratorsClientBeginCreateOrUpdateOptions) (*http.Response, error) { - var err error - const operationName = "ServerAdministratorsClient.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.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, properties, 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 -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *ServerAdministratorsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, serverName string, properties ServerAdministratorResource, options *ServerAdministratorsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/administrators/activeDirectory" - 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.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2017-12-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, properties); err != nil { - return nil, err - } - return req, nil -} - -// BeginDelete - Deletes server active directory administrator. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2017-12-01 -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - serverName - The name of the server. -// - options - ServerAdministratorsClientBeginDeleteOptions contains the optional parameters for the ServerAdministratorsClient.BeginDelete -// method. -func (client *ServerAdministratorsClient) BeginDelete(ctx context.Context, resourceGroupName string, serverName string, options *ServerAdministratorsClientBeginDeleteOptions) (*runtime.Poller[ServerAdministratorsClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, serverName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ServerAdministratorsClientDeleteResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ServerAdministratorsClientDeleteResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Delete - Deletes server active directory administrator. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2017-12-01 -func (client *ServerAdministratorsClient) deleteOperation(ctx context.Context, resourceGroupName string, serverName string, options *ServerAdministratorsClientBeginDeleteOptions) (*http.Response, error) { - var err error - const operationName = "ServerAdministratorsClient.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, 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, http.StatusNoContent) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *ServerAdministratorsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, serverName string, options *ServerAdministratorsClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/administrators/activeDirectory" - 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.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2017-12-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Gets information about a AAD server administrator. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2017-12-01 -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - serverName - The name of the server. -// - options - ServerAdministratorsClientGetOptions contains the optional parameters for the ServerAdministratorsClient.Get -// method. -func (client *ServerAdministratorsClient) Get(ctx context.Context, resourceGroupName string, serverName string, options *ServerAdministratorsClientGetOptions) (ServerAdministratorsClientGetResponse, error) { - var err error - const operationName = "ServerAdministratorsClient.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, options) - if err != nil { - return ServerAdministratorsClientGetResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return ServerAdministratorsClientGetResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return ServerAdministratorsClientGetResponse{}, err - } - resp, err := client.getHandleResponse(httpResp) - return resp, err -} - -// getCreateRequest creates the Get request. -func (client *ServerAdministratorsClient) getCreateRequest(ctx context.Context, resourceGroupName string, serverName string, options *ServerAdministratorsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/administrators/activeDirectory" - 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", "2017-12-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *ServerAdministratorsClient) getHandleResponse(resp *http.Response) (ServerAdministratorsClientGetResponse, error) { - result := ServerAdministratorsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ServerAdministratorResource); err != nil { - return ServerAdministratorsClientGetResponse{}, err - } - return result, nil -} - -// NewListPager - Returns a list of server Administrators. -// -// Generated from API version 2017-12-01 -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - serverName - The name of the server. -// - options - ServerAdministratorsClientListOptions contains the optional parameters for the ServerAdministratorsClient.NewListPager -// method. -func (client *ServerAdministratorsClient) NewListPager(resourceGroupName string, serverName string, options *ServerAdministratorsClientListOptions) *runtime.Pager[ServerAdministratorsClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[ServerAdministratorsClientListResponse]{ - More: func(page ServerAdministratorsClientListResponse) bool { - return false - }, - Fetcher: func(ctx context.Context, page *ServerAdministratorsClientListResponse) (ServerAdministratorsClientListResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "ServerAdministratorsClient.NewListPager") - req, err := client.listCreateRequest(ctx, resourceGroupName, serverName, options) - if err != nil { - return ServerAdministratorsClientListResponse{}, err - } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return ServerAdministratorsClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ServerAdministratorsClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listCreateRequest creates the List request. -func (client *ServerAdministratorsClient) listCreateRequest(ctx context.Context, resourceGroupName string, serverName string, options *ServerAdministratorsClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/administrators" - 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", "2017-12-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *ServerAdministratorsClient) listHandleResponse(resp *http.Response) (ServerAdministratorsClientListResponse, error) { - result := ServerAdministratorsClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ServerAdministratorResourceListResult); err != nil { - return ServerAdministratorsClientListResponse{}, err - } - return result, nil -} diff --git a/sdk/resourcemanager/postgresql/armpostgresql/serveradministrators_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresql/serveradministrators_client_example_test.go index 9cb73332bf62..35e50e14fa45 100644 --- a/sdk/resourcemanager/postgresql/armpostgresql/serveradministrators_client_example_test.go +++ b/sdk/resourcemanager/postgresql/armpostgresql/serveradministrators_client_example_test.go @@ -12,7 +12,7 @@ import ( "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/armpostgresql" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresql/v2" ) // Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/ServerAdminGet.json @@ -59,10 +59,10 @@ func ExampleServerAdministratorsClient_BeginCreateOrUpdate() { } poller, err := clientFactory.NewServerAdministratorsClient().BeginCreateOrUpdate(ctx, "testrg", "pgtestsvc4", armpostgresql.ServerAdministratorResource{ Properties: &armpostgresql.ServerAdministratorProperties{ - AdministratorType: to.Ptr("ActiveDirectory"), - Login: to.Ptr("bob@contoso.com"), - Sid: to.Ptr("c6b82b90-a647-49cb-8a62-0d2d3cb7ac7c"), - TenantID: to.Ptr("c6b82b90-a647-49cb-8a62-0d2d3cb7ac7c"), + AdministratorType: to.Ptr("ActiveDirectory"), + Login: to.Ptr("bob@contoso.com"), + Sid: to.Ptr("c6b82b90-a647-49cb-8a62-0d2d3cb7ac7c"), + TenantID: to.Ptr("c6b82b90-a647-49cb-8a62-0d2d3cb7ac7c"), }, }, nil) if err != nil { diff --git a/sdk/resourcemanager/postgresql/armpostgresql/serverbasedperformancetier_client.go b/sdk/resourcemanager/postgresql/armpostgresql/serverbasedperformancetier_client.go deleted file mode 100644 index 817340c3269e..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresql/serverbasedperformancetier_client.go +++ /dev/null @@ -1,107 +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 armpostgresql - -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" -) - -// ServerBasedPerformanceTierClient contains the methods for the ServerBasedPerformanceTier group. -// Don't use this type directly, use NewServerBasedPerformanceTierClient() instead. -type ServerBasedPerformanceTierClient struct { - internal *arm.Client - subscriptionID string -} - -// NewServerBasedPerformanceTierClient creates a new instance of ServerBasedPerformanceTierClient with the specified values. -// - subscriptionID - The ID of the target subscription. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewServerBasedPerformanceTierClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ServerBasedPerformanceTierClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &ServerBasedPerformanceTierClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// NewListPager - List all the performance tiers for a PostgreSQL server. -// -// Generated from API version 2017-12-01 -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - serverName - The name of the server. -// - options - ServerBasedPerformanceTierClientListOptions contains the optional parameters for the ServerBasedPerformanceTierClient.NewListPager -// method. -func (client *ServerBasedPerformanceTierClient) NewListPager(resourceGroupName string, serverName string, options *ServerBasedPerformanceTierClientListOptions) *runtime.Pager[ServerBasedPerformanceTierClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[ServerBasedPerformanceTierClientListResponse]{ - More: func(page ServerBasedPerformanceTierClientListResponse) bool { - return false - }, - Fetcher: func(ctx context.Context, page *ServerBasedPerformanceTierClientListResponse) (ServerBasedPerformanceTierClientListResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "ServerBasedPerformanceTierClient.NewListPager") - req, err := client.listCreateRequest(ctx, resourceGroupName, serverName, options) - if err != nil { - return ServerBasedPerformanceTierClientListResponse{}, err - } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return ServerBasedPerformanceTierClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ServerBasedPerformanceTierClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listCreateRequest creates the List request. -func (client *ServerBasedPerformanceTierClient) listCreateRequest(ctx context.Context, resourceGroupName string, serverName string, options *ServerBasedPerformanceTierClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/performanceTiers" - 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", "2017-12-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *ServerBasedPerformanceTierClient) listHandleResponse(resp *http.Response) (ServerBasedPerformanceTierClientListResponse, error) { - result := ServerBasedPerformanceTierClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.PerformanceTierListResult); err != nil { - return ServerBasedPerformanceTierClientListResponse{}, err - } - return result, nil -} diff --git a/sdk/resourcemanager/postgresql/armpostgresql/serverbasedperformancetier_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresql/serverbasedperformancetier_client_example_test.go index dca4a6315148..4bdd3e9975ae 100644 --- a/sdk/resourcemanager/postgresql/armpostgresql/serverbasedperformancetier_client_example_test.go +++ b/sdk/resourcemanager/postgresql/armpostgresql/serverbasedperformancetier_client_example_test.go @@ -11,7 +11,7 @@ import ( "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresql" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresql/v2" ) // Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/PerformanceTiersListByServer.json diff --git a/sdk/resourcemanager/postgresql/armpostgresql/serverkeys_client.go b/sdk/resourcemanager/postgresql/armpostgresql/serverkeys_client.go deleted file mode 100644 index d4fbbfa01a88..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresql/serverkeys_client.go +++ /dev/null @@ -1,339 +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 armpostgresql - -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" -) - -// ServerKeysClient contains the methods for the ServerKeys group. -// Don't use this type directly, use NewServerKeysClient() instead. -type ServerKeysClient struct { - internal *arm.Client - subscriptionID string -} - -// NewServerKeysClient creates a new instance of ServerKeysClient with the specified values. -// - subscriptionID - The ID of the target subscription. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewServerKeysClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ServerKeysClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &ServerKeysClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// BeginCreateOrUpdate - Creates or updates a PostgreSQL Server key. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2020-01-01 -// - serverName - The name of the server. -// - keyName - The name of the PostgreSQL Server key to be operated on (updated or created). -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - parameters - The requested PostgreSQL Server key resource state. -// - options - ServerKeysClientBeginCreateOrUpdateOptions contains the optional parameters for the ServerKeysClient.BeginCreateOrUpdate -// method. -func (client *ServerKeysClient) BeginCreateOrUpdate(ctx context.Context, serverName string, keyName string, resourceGroupName string, parameters ServerKey, options *ServerKeysClientBeginCreateOrUpdateOptions) (*runtime.Poller[ServerKeysClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, serverName, keyName, resourceGroupName, parameters, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ServerKeysClientCreateOrUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ServerKeysClientCreateOrUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// CreateOrUpdate - Creates or updates a PostgreSQL Server key. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2020-01-01 -func (client *ServerKeysClient) createOrUpdate(ctx context.Context, serverName string, keyName string, resourceGroupName string, parameters ServerKey, options *ServerKeysClientBeginCreateOrUpdateOptions) (*http.Response, error) { - var err error - const operationName = "ServerKeysClient.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.createOrUpdateCreateRequest(ctx, serverName, keyName, resourceGroupName, 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 -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *ServerKeysClient) createOrUpdateCreateRequest(ctx context.Context, serverName string, keyName string, resourceGroupName string, parameters ServerKey, options *ServerKeysClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/keys/{keyName}" - if serverName == "" { - return nil, errors.New("parameter serverName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{serverName}", url.PathEscape(serverName)) - if keyName == "" { - return nil, errors.New("parameter keyName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{keyName}", url.PathEscape(keyName)) - 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.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-01-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 -} - -// BeginDelete - Deletes the PostgreSQL Server key with the given name. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2020-01-01 -// - serverName - The name of the server. -// - keyName - The name of the PostgreSQL Server key to be deleted. -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - options - ServerKeysClientBeginDeleteOptions contains the optional parameters for the ServerKeysClient.BeginDelete method. -func (client *ServerKeysClient) BeginDelete(ctx context.Context, serverName string, keyName string, resourceGroupName string, options *ServerKeysClientBeginDeleteOptions) (*runtime.Poller[ServerKeysClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, serverName, keyName, resourceGroupName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ServerKeysClientDeleteResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ServerKeysClientDeleteResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Delete - Deletes the PostgreSQL Server key with the given name. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2020-01-01 -func (client *ServerKeysClient) deleteOperation(ctx context.Context, serverName string, keyName string, resourceGroupName string, options *ServerKeysClientBeginDeleteOptions) (*http.Response, error) { - var err error - const operationName = "ServerKeysClient.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, serverName, keyName, resourceGroupName, 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, http.StatusNoContent) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *ServerKeysClient) deleteCreateRequest(ctx context.Context, serverName string, keyName string, resourceGroupName string, options *ServerKeysClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/keys/{keyName}" - if serverName == "" { - return nil, errors.New("parameter serverName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{serverName}", url.PathEscape(serverName)) - if keyName == "" { - return nil, errors.New("parameter keyName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{keyName}", url.PathEscape(keyName)) - 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.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Gets a PostgreSQL Server key. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2020-01-01 -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - serverName - The name of the server. -// - keyName - The name of the PostgreSQL Server key to be retrieved. -// - options - ServerKeysClientGetOptions contains the optional parameters for the ServerKeysClient.Get method. -func (client *ServerKeysClient) Get(ctx context.Context, resourceGroupName string, serverName string, keyName string, options *ServerKeysClientGetOptions) (ServerKeysClientGetResponse, error) { - var err error - const operationName = "ServerKeysClient.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, keyName, options) - if err != nil { - return ServerKeysClientGetResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return ServerKeysClientGetResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return ServerKeysClientGetResponse{}, err - } - resp, err := client.getHandleResponse(httpResp) - return resp, err -} - -// getCreateRequest creates the Get request. -func (client *ServerKeysClient) getCreateRequest(ctx context.Context, resourceGroupName string, serverName string, keyName string, options *ServerKeysClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/keys/{keyName}" - 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 keyName == "" { - return nil, errors.New("parameter keyName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{keyName}", url.PathEscape(keyName)) - 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.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *ServerKeysClient) getHandleResponse(resp *http.Response) (ServerKeysClientGetResponse, error) { - result := ServerKeysClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ServerKey); err != nil { - return ServerKeysClientGetResponse{}, err - } - return result, nil -} - -// NewListPager - Gets a list of Server keys. -// -// Generated from API version 2020-01-01 -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - serverName - The name of the server. -// - options - ServerKeysClientListOptions contains the optional parameters for the ServerKeysClient.NewListPager method. -func (client *ServerKeysClient) NewListPager(resourceGroupName string, serverName string, options *ServerKeysClientListOptions) *runtime.Pager[ServerKeysClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[ServerKeysClientListResponse]{ - More: func(page ServerKeysClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *ServerKeysClientListResponse) (ServerKeysClientListResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "ServerKeysClient.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, resourceGroupName, serverName, options) - }, nil) - if err != nil { - return ServerKeysClientListResponse{}, err - } - return client.listHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listCreateRequest creates the List request. -func (client *ServerKeysClient) listCreateRequest(ctx context.Context, resourceGroupName string, serverName string, options *ServerKeysClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/keys" - 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", "2020-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *ServerKeysClient) listHandleResponse(resp *http.Response) (ServerKeysClientListResponse, error) { - result := ServerKeysClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ServerKeyListResult); err != nil { - return ServerKeysClientListResponse{}, err - } - return result, nil -} diff --git a/sdk/resourcemanager/postgresql/armpostgresql/serverkeys_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresql/serverkeys_client_example_test.go index 674ea146fcce..ca7a9956ad52 100644 --- a/sdk/resourcemanager/postgresql/armpostgresql/serverkeys_client_example_test.go +++ b/sdk/resourcemanager/postgresql/armpostgresql/serverkeys_client_example_test.go @@ -12,7 +12,7 @@ import ( "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/armpostgresql" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresql/v2" ) // Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2020-01-01/examples/ServerKeyList.json @@ -98,8 +98,8 @@ func ExampleServerKeysClient_BeginCreateOrUpdate() { } poller, err := clientFactory.NewServerKeysClient().BeginCreateOrUpdate(ctx, "testserver", "someVault_someKey_01234567890123456789012345678901", "testrg", armpostgresql.ServerKey{ Properties: &armpostgresql.ServerKeyProperties{ - ServerKeyType: to.Ptr(armpostgresql.ServerKeyTypeAzureKeyVault), - URI: to.Ptr("https://someVault.vault.azure.net/keys/someKey/01234567890123456789012345678901"), + ServerKeyType: to.Ptr(armpostgresql.ServerKeyTypeAzureKeyVault), + URI: to.Ptr("https://someVault.vault.azure.net/keys/someKey/01234567890123456789012345678901"), }, }, nil) if err != nil { diff --git a/sdk/resourcemanager/postgresql/armpostgresql/serverparameters_client.go b/sdk/resourcemanager/postgresql/armpostgresql/serverparameters_client.go deleted file mode 100644 index 3508309d7bb2..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresql/serverparameters_client.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 armpostgresql - -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" -) - -// ServerParametersClient contains the methods for the ServerParameters group. -// Don't use this type directly, use NewServerParametersClient() instead. -type ServerParametersClient struct { - internal *arm.Client - subscriptionID string -} - -// NewServerParametersClient creates a new instance of ServerParametersClient with the specified values. -// - subscriptionID - The ID of the target subscription. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewServerParametersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ServerParametersClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &ServerParametersClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// BeginListUpdateConfigurations - Update a list of configurations in a given server. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2017-12-01 -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - serverName - The name of the server. -// - value - The parameters for updating a list of server configuration. -// - options - ServerParametersClientBeginListUpdateConfigurationsOptions contains the optional parameters for the ServerParametersClient.BeginListUpdateConfigurations -// method. -func (client *ServerParametersClient) BeginListUpdateConfigurations(ctx context.Context, resourceGroupName string, serverName string, value ConfigurationListResult, options *ServerParametersClientBeginListUpdateConfigurationsOptions) (*runtime.Poller[ServerParametersClientListUpdateConfigurationsResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.listUpdateConfigurations(ctx, resourceGroupName, serverName, value, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ServerParametersClientListUpdateConfigurationsResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ServerParametersClientListUpdateConfigurationsResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// ListUpdateConfigurations - Update a list of configurations in a given server. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2017-12-01 -func (client *ServerParametersClient) listUpdateConfigurations(ctx context.Context, resourceGroupName string, serverName string, value ConfigurationListResult, options *ServerParametersClientBeginListUpdateConfigurationsOptions) (*http.Response, error) { - var err error - const operationName = "ServerParametersClient.BeginListUpdateConfigurations" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.listUpdateConfigurationsCreateRequest(ctx, resourceGroupName, serverName, value, 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 -} - -// listUpdateConfigurationsCreateRequest creates the ListUpdateConfigurations request. -func (client *ServerParametersClient) listUpdateConfigurationsCreateRequest(ctx context.Context, resourceGroupName string, serverName string, value ConfigurationListResult, options *ServerParametersClientBeginListUpdateConfigurationsOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/updateConfigurations" - 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", "2017-12-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, value); err != nil { - return nil, err - } - return req, nil -} diff --git a/sdk/resourcemanager/postgresql/armpostgresql/serverparameters_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresql/serverparameters_client_example_test.go index cb9aeedaf8ec..d8f2bfd60736 100644 --- a/sdk/resourcemanager/postgresql/armpostgresql/serverparameters_client_example_test.go +++ b/sdk/resourcemanager/postgresql/armpostgresql/serverparameters_client_example_test.go @@ -11,7 +11,7 @@ import ( "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresql" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresql/v2" ) // Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/ConfigurationsUpdateByServer.json diff --git a/sdk/resourcemanager/postgresql/armpostgresql/servers_client.go b/sdk/resourcemanager/postgresql/armpostgresql/servers_client.go index f8406a5d8d04..0e8378bf4e07 100644 --- a/sdk/resourcemanager/postgresql/armpostgresql/servers_client.go +++ b/sdk/resourcemanager/postgresql/armpostgresql/servers_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armpostgresql @@ -25,9 +24,9 @@ type ServersClient struct { } // NewServersClient creates a new instance of ServersClient with the specified values. -// - subscriptionID - The ID of the target subscription. +// - 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,42 +39,44 @@ func NewServersClient(subscriptionID string, credential azcore.TokenCredential, return client, nil } -// BeginCreate - Creates a new server, or will overwrite an existing server. +// BeginCreateOrUpdate - Creates a new server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2017-12-01 +// 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 ServerForCreate, 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]{ - Tracer: client.internal.Tracer(), + 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, or will overwrite an existing server. +// CreateOrUpdate - Creates a new server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2017-12-01 -func (client *ServersClient) create(ctx context.Context, resourceGroupName string, serverName string, parameters ServerForCreate, 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 } @@ -83,16 +84,16 @@ 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 ServerForCreate, options *ServersClientBeginCreateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}" +// 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") } @@ -110,19 +111,19 @@ func (client *ServersClient) createCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2017-12-01") + reqQP.Set("api-version", "2025-08-01") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } 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 2017-12-01 +// 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. @@ -143,10 +144,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 2017-12-01 +// 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" @@ -161,7 +162,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 } @@ -169,8 +170,8 @@ func (client *ServersClient) deleteOperation(ctx context.Context, resourceGroupN } // deleteCreateRequest creates the Delete request. -func (client *ServersClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, serverName string, options *ServersClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}" +func (client *ServersClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, serverName string, _ *ServersClientBeginDeleteOptions) (*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") } @@ -188,16 +189,15 @@ func (client *ServersClient) deleteCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2017-12-01") + 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 2017-12-01 +// 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. @@ -224,8 +224,8 @@ func (client *ServersClient) Get(ctx context.Context, resourceGroupName string, } // getCreateRequest creates the Get request. -func (client *ServersClient) getCreateRequest(ctx context.Context, resourceGroupName string, serverName string, options *ServersClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}" +func (client *ServersClient) getCreateRequest(ctx context.Context, resourceGroupName string, serverName string, _ *ServersClientGetOptions) (*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") } @@ -243,7 +243,7 @@ func (client *ServersClient) getCreateRequest(ctx context.Context, resourceGroup return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2017-12-01") + reqQP.Set("api-version", "2025-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -258,126 +258,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 2017-12-01 -// - 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 { - return false +// 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") - req, err := client.listCreateRequest(ctx, options) - if err != nil { - return ServersClientListResponse{}, err + 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 := client.internal.Pipeline().Do(req) + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) + }, nil) if err != nil { - return ServersClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ServersClientListResponse{}, runtime.NewResponseError(resp) + 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, options *ServersClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.DBforPostgreSQL/servers" +// 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", "2017-12-01") + 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 2017-12-01 -// - 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 { - return false +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") - req, err := client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) - if err != nil { - return ServersClientListByResourceGroupResponse{}, err + 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 := client.internal.Pipeline().Do(req) + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listBySubscriptionCreateRequest(ctx, options) + }, nil) if err != nil { - return ServersClientListByResourceGroupResponse{}, err + return ServersClientListBySubscriptionResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ServersClientListByResourceGroupResponse{}, runtime.NewResponseError(resp) - } - 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, options *ServersClientListByResourceGroupOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers" +// 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", "2017-12-01") + 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 2017-12-01 +// 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. @@ -398,10 +397,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 2017-12-01 +// 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" @@ -416,7 +415,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 } @@ -425,7 +424,7 @@ func (client *ServersClient) restart(ctx context.Context, resourceGroupName stri // restartCreateRequest creates the Restart request. func (client *ServersClient) restartCreateRequest(ctx context.Context, resourceGroupName string, serverName string, options *ServersClientBeginRestartOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/restart" + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/restart" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -443,29 +442,184 @@ func (client *ServersClient) restartCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2017-12-01") + 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 { + req.Raw().Header["Content-Type"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, *options.Parameters); err != nil { + return nil, err + } + return req, nil + } 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. +// BeginStart - Starts a stopped 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. +// - options - ServersClientBeginStartOptions contains the optional parameters for the ServersClient.BeginStart method. +func (client *ServersClient) BeginStart(ctx context.Context, resourceGroupName string, serverName string, options *ServersClientBeginStartOptions) (*runtime.Poller[ServersClientStartResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.start(ctx, resourceGroupName, serverName, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ServersClientStartResponse]{ + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ServersClientStartResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// Start - Starts a stopped server. +// If the operation fails it returns an *azcore.ResponseError type. +// +// 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" + 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, 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 +} + +// startCreateRequest creates the Start request. +func (client *ServersClient) startCreateRequest(ctx context.Context, resourceGroupName string, serverName string, _ *ServersClientBeginStartOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/start" + 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() + return req, nil +} + +// BeginStop - Stops 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. +// - options - ServersClientBeginStopOptions contains the optional parameters for the ServersClient.BeginStop method. +func (client *ServersClient) BeginStop(ctx context.Context, resourceGroupName string, serverName string, options *ServersClientBeginStopOptions) (*runtime.Poller[ServersClientStopResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.stop(ctx, resourceGroupName, serverName, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ServersClientStopResponse]{ + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ServersClientStopResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// Stop - Stops a server. +// If the operation fails it returns an *azcore.ResponseError type. +// +// 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" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.stopCreateRequest(ctx, resourceGroupName, serverName, 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 +} + +// stopCreateRequest creates the Stop request. +func (client *ServersClient) stopCreateRequest(ctx context.Context, resourceGroupName string, serverName string, _ *ServersClientBeginStopOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/stop" + 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() + return req, nil +} + +// 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 2017-12-01 +// 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 ServerUpdateParameters, 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 { return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ServersClientUpdateResponse]{ - Tracer: client.internal.Tracer(), + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -475,12 +629,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 2017-12-01 -func (client *ServersClient) update(ctx context.Context, resourceGroupName string, serverName string, parameters ServerUpdateParameters, 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) @@ -494,7 +648,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 } @@ -502,8 +656,8 @@ 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 ServerUpdateParameters, options *ServersClientBeginUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}" +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") } @@ -521,9 +675,9 @@ func (client *ServersClient) updateCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2017-12-01") + reqQP.Set("api-version", "2025-08-01") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } diff --git a/sdk/resourcemanager/postgresql/armpostgresql/servers_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresql/servers_client_example_test.go index e7d31e79806e..03baba5e5ef5 100644 --- a/sdk/resourcemanager/postgresql/armpostgresql/servers_client_example_test.go +++ b/sdk/resourcemanager/postgresql/armpostgresql/servers_client_example_test.go @@ -1,367 +1,554 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armpostgresql_test import ( "context" - "log" - - "time" - "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/armpostgresql" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresql/v2" + "log" + "time" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/ServerCreatePointInTimeRestore.json -func ExampleServersClient_BeginCreate_createADatabaseAsAPointInTimeRestore() { +// Generated from example definition: 2025-08-01/ServersClusterCreate.json +func ExampleServersClient_BeginCreateOrUpdate_createANewElasticCluster() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armpostgresql.NewClientFactory("", cred, nil) + clientFactory, err := armpostgresql.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewServersClient().BeginCreate(ctx, "TargetResourceGroup", "targetserver", armpostgresql.ServerForCreate{ - Location: to.Ptr("brazilsouth"), - Properties: &armpostgresql.ServerPropertiesForRestore{ - CreateMode: to.Ptr(armpostgresql.CreateModePointInTimeRestore), - RestorePointInTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-12-14T00:00:37.467Z"); return t }()), - SourceServerID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/SourceResourceGroup/providers/Microsoft.DBforPostgreSQL/servers/sourceserver"), + poller, err := clientFactory.NewServersClient().BeginCreateOrUpdate(ctx, "exampleresourcegroup", "exampleserver", armpostgresql.Server{ + Location: to.Ptr("eastus"), + Properties: &armpostgresql.ServerProperties{ + AdministratorLogin: to.Ptr("examplelogin"), + AdministratorLoginPassword: to.Ptr("examplepassword"), + Backup: &armpostgresql.Backup{ + BackupRetentionDays: to.Ptr[int32](7), + GeoRedundantBackup: to.Ptr(armpostgresql.GeographicallyRedundantBackupDisabled), + }, + Cluster: &armpostgresql.Cluster{ + ClusterSize: to.Ptr[int32](2), + DefaultDatabaseName: to.Ptr("clusterdb"), + }, + CreateMode: to.Ptr(armpostgresql.CreateModeCreate), + HighAvailability: &armpostgresql.HighAvailability{ + Mode: to.Ptr(armpostgresql.FlexibleServerHighAvailabilityModeDisabled), + }, + Network: &armpostgresql.Network{ + PublicNetworkAccess: to.Ptr(armpostgresql.ServerPublicNetworkAccessStateDisabled), + }, + Storage: &armpostgresql.Storage{ + AutoGrow: to.Ptr(armpostgresql.StorageAutoGrowDisabled), + StorageSizeGB: to.Ptr[int32](256), + Tier: to.Ptr(armpostgresql.AzureManagedDiskPerformanceTierP15), + }, + Version: to.Ptr(armpostgresql.PostgresMajorVersion16), }, SKU: &armpostgresql.SKU{ - Name: to.Ptr("B_Gen5_2"), - Capacity: to.Ptr[int32](2), - Family: to.Ptr("Gen5"), - Tier: to.Ptr(armpostgresql.SKUTierBasic), + Name: to.Ptr("Standard_D4ds_v5"), + Tier: to.Ptr(armpostgresql.SKUTierGeneralPurpose), }, - Tags: map[string]*string{ - "ElasticServer": to.Ptr("1"), + }, 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: 2025-08-01/ServersCreateGeoRestoreWithDataEncryptionEnabled.json +func ExampleServersClient_BeginCreateOrUpdate_createANewServerUsingARestoreOfAGeographicallyRedundantBackupOfAnExistingServerWithDataEncryptionBasedOnCustomerManagedKey() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armpostgresql.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewServersClient().BeginCreateOrUpdate(ctx, "exampleresourcegroup", "exampleserver", armpostgresql.Server{ + Identity: &armpostgresql.UserAssignedIdentity{ + Type: to.Ptr(armpostgresql.IdentityTypeUserAssigned), + UserAssignedIdentities: map[string]*armpostgresql.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": {}, + }, + }, + Location: to.Ptr("eastus"), + Properties: &armpostgresql.ServerProperties{ + CreateMode: to.Ptr(armpostgresql.CreateModeGeoRestore), + DataEncryption: &armpostgresql.DataEncryption{ + Type: to.Ptr(armpostgresql.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.123456Z"); 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: 2025-08-01/ServersCreateGeoRestoreWithDataEncryptionEnabledAutoUpdate.json +func ExampleServersClient_BeginCreateOrUpdate_createANewServerUsingARestoreOfAGeographicallyRedundantBackupOfAnExistingServerWithDataEncryptionBasedOnCustomerManagedKeyWithAutomaticKeyVersionUpdate() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armpostgresql.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewServersClient().BeginCreateOrUpdate(ctx, "exampleresourcegroup", "exampleserver", armpostgresql.Server{ + Identity: &armpostgresql.UserAssignedIdentity{ + Type: to.Ptr(armpostgresql.IdentityTypeUserAssigned), + UserAssignedIdentities: map[string]*armpostgresql.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": {}, + }, + }, + Location: to.Ptr("eastus"), + Properties: &armpostgresql.ServerProperties{ + CreateMode: to.Ptr(armpostgresql.CreateModeGeoRestore), + DataEncryption: &armpostgresql.DataEncryption{ + Type: to.Ptr(armpostgresql.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, "2025-06-01T18:35:22.123456Z"); 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 = armpostgresql.Server{ - // Name: to.Ptr("targetserver"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/servers/targetserver"), - // Location: to.Ptr("brazilsouth"), - // Tags: map[string]*string{ - // "ElasticServer": to.Ptr("1"), - // }, - // Properties: &armpostgresql.ServerProperties{ - // AdministratorLogin: to.Ptr("cloudsa"), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-12-14T21:08:24.637Z"); return t}()), - // FullyQualifiedDomainName: to.Ptr("targetserver.postgres.database.azure.com"), - // SSLEnforcement: to.Ptr(armpostgresql.SSLEnforcementEnumEnabled), - // StorageProfile: &armpostgresql.StorageProfile{ - // BackupRetentionDays: to.Ptr[int32](7), - // GeoRedundantBackup: to.Ptr(armpostgresql.GeoRedundantBackupDisabled), - // StorageMB: to.Ptr[int32](128000), - // }, - // UserVisibleState: to.Ptr(armpostgresql.ServerStateReady), - // Version: to.Ptr(armpostgresql.ServerVersionNine6), - // }, - // SKU: &armpostgresql.SKU{ - // Name: to.Ptr("B_Gen5_2"), - // Capacity: to.Ptr[int32](2), - // Family: to.Ptr("Gen5"), - // Tier: to.Ptr(armpostgresql.SKUTierBasic), - // }, - // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/ServerCreate.json -func ExampleServersClient_BeginCreate_createANewServer() { +// Generated from example definition: 2025-08-01/ServersCreateInMicrosoftOwnedVirtualNetworkWithZoneRedundantHighAvailability.json +func ExampleServersClient_BeginCreateOrUpdate_createANewServerInMicrosoftOwnedVirtualNetworkWithZoneRedundantHighAvailability() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armpostgresql.NewClientFactory("", cred, nil) + clientFactory, err := armpostgresql.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewServersClient().BeginCreate(ctx, "TestGroup", "pgtestsvc4", armpostgresql.ServerForCreate{ - Location: to.Ptr("westus"), - Properties: &armpostgresql.ServerPropertiesForDefaultCreate{ - CreateMode: to.Ptr(armpostgresql.CreateModeDefault), - MinimalTLSVersion: to.Ptr(armpostgresql.MinimalTLSVersionEnumTLS12), - SSLEnforcement: to.Ptr(armpostgresql.SSLEnforcementEnumEnabled), - StorageProfile: &armpostgresql.StorageProfile{ - BackupRetentionDays: to.Ptr[int32](7), - GeoRedundantBackup: to.Ptr(armpostgresql.GeoRedundantBackupDisabled), - StorageMB: to.Ptr[int32](128000), + poller, err := clientFactory.NewServersClient().BeginCreateOrUpdate(ctx, "exampleresourcegroup", "exampleserver", armpostgresql.Server{ + Location: to.Ptr("eastus"), + Properties: &armpostgresql.ServerProperties{ + AdministratorLogin: to.Ptr("exampleadministratorlogin"), + AdministratorLoginPassword: to.Ptr("examplepassword"), + AvailabilityZone: to.Ptr("1"), + Backup: &armpostgresql.Backup{ + BackupRetentionDays: to.Ptr[int32](7), + GeoRedundantBackup: to.Ptr(armpostgresql.GeographicallyRedundantBackupEnabled), }, - AdministratorLogin: to.Ptr("cloudsa"), - AdministratorLoginPassword: to.Ptr(""), + CreateMode: to.Ptr(armpostgresql.CreateModeCreate), + HighAvailability: &armpostgresql.HighAvailability{ + Mode: to.Ptr(armpostgresql.FlexibleServerHighAvailabilityModeZoneRedundant), + }, + Network: &armpostgresql.Network{ + PublicNetworkAccess: to.Ptr(armpostgresql.ServerPublicNetworkAccessStateEnabled), + }, + Storage: &armpostgresql.Storage{ + AutoGrow: to.Ptr(armpostgresql.StorageAutoGrowDisabled), + StorageSizeGB: to.Ptr[int32](512), + Tier: to.Ptr(armpostgresql.AzureManagedDiskPerformanceTierP20), + }, + Version: to.Ptr(armpostgresql.PostgresMajorVersion17), }, SKU: &armpostgresql.SKU{ - Name: to.Ptr("B_Gen5_2"), - Capacity: to.Ptr[int32](2), - Family: to.Ptr("Gen5"), - Tier: to.Ptr(armpostgresql.SKUTierBasic), + Name: to.Ptr("Standard_D4ds_v5"), + Tier: to.Ptr(armpostgresql.SKUTierGeneralPurpose), }, Tags: map[string]*string{ - "ElasticServer": to.Ptr("1"), + "InCustomerVnet": to.Ptr("false"), + "InMicrosoftVnet": to.Ptr("true"), }, }, 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 = armpostgresql.Server{ - // Name: to.Ptr("pgtestsvc4"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/servers/pgtestsvc4"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "ElasticServer": to.Ptr("1"), - // }, - // Properties: &armpostgresql.ServerProperties{ - // AdministratorLogin: to.Ptr("cloudsa"), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-03-14T21:08:24.637Z"); return t}()), - // FullyQualifiedDomainName: to.Ptr("pgtestsvc4.postgres.database.azure.com"), - // SSLEnforcement: to.Ptr(armpostgresql.SSLEnforcementEnumEnabled), - // StorageProfile: &armpostgresql.StorageProfile{ - // BackupRetentionDays: to.Ptr[int32](7), - // GeoRedundantBackup: to.Ptr(armpostgresql.GeoRedundantBackupDisabled), - // StorageMB: to.Ptr[int32](128000), - // }, - // UserVisibleState: to.Ptr(armpostgresql.ServerStateReady), - // Version: to.Ptr(armpostgresql.ServerVersionNine6), - // }, - // SKU: &armpostgresql.SKU{ - // Name: to.Ptr("B_Gen5_2"), - // Capacity: to.Ptr[int32](2), - // Family: to.Ptr("Gen5"), - // Tier: to.Ptr(armpostgresql.SKUTierBasic), - // }, - // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/ServerCreateReplicaMode.json -func ExampleServersClient_BeginCreate_createAReplicaServer() { +// Generated from example definition: 2025-08-01/ServersCreateInYourOwnVirtualNetworkWithSameZoneHighAvailability.json +func ExampleServersClient_BeginCreateOrUpdate_createANewServerInYourOwnVirtualNetworkWithSameZoneHighAvailability() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armpostgresql.NewClientFactory("", cred, nil) + clientFactory, err := armpostgresql.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewServersClient().BeginCreate(ctx, "TestGroup_WestCentralUS", "testserver-replica1", armpostgresql.ServerForCreate{ - Location: to.Ptr("westcentralus"), - Properties: &armpostgresql.ServerPropertiesForReplica{ - CreateMode: to.Ptr(armpostgresql.CreateModeReplica), - SourceServerID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup_WestCentralUS/providers/Microsoft.DBforPostgreSQL/servers/testserver-master"), + poller, err := clientFactory.NewServersClient().BeginCreateOrUpdate(ctx, "exampleresourcegroup", "exampleserver", armpostgresql.Server{ + Location: to.Ptr("eastus"), + Properties: &armpostgresql.ServerProperties{ + AdministratorLogin: to.Ptr("exampleadministratorlogin"), + AdministratorLoginPassword: to.Ptr("examplepassword"), + AvailabilityZone: to.Ptr("1"), + Backup: &armpostgresql.Backup{ + BackupRetentionDays: to.Ptr[int32](7), + GeoRedundantBackup: to.Ptr(armpostgresql.GeographicallyRedundantBackupEnabled), + }, + CreateMode: to.Ptr(armpostgresql.CreateModeCreate), + HighAvailability: &armpostgresql.HighAvailability{ + Mode: to.Ptr(armpostgresql.FlexibleServerHighAvailabilityModeSameZone), + }, + Network: &armpostgresql.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.private.postgres.database"), + }, + Storage: &armpostgresql.Storage{ + AutoGrow: to.Ptr(armpostgresql.StorageAutoGrowDisabled), + StorageSizeGB: to.Ptr[int32](512), + Tier: to.Ptr(armpostgresql.AzureManagedDiskPerformanceTierP20), + }, + Version: to.Ptr(armpostgresql.PostgresMajorVersion17), }, SKU: &armpostgresql.SKU{ - Name: to.Ptr("GP_Gen5_2"), - Capacity: to.Ptr[int32](2), - Family: to.Ptr("Gen5"), - Tier: to.Ptr(armpostgresql.SKUTierGeneralPurpose), + Name: to.Ptr("Standard_D4ds_v5"), + Tier: to.Ptr(armpostgresql.SKUTierGeneralPurpose), + }, + Tags: map[string]*string{ + "InCustomerVnet": to.Ptr("true"), + "InMicrosoftVnet": to.Ptr("false"), }, }, 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: 2025-08-01/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 := armpostgresql.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewServersClient().BeginCreateOrUpdate(ctx, "exampleresourcegroup", "exampleserver", armpostgresql.Server{ + Location: to.Ptr("eastus"), + Properties: &armpostgresql.ServerProperties{ + CreateMode: to.Ptr(armpostgresql.CreateModePointInTimeRestore), + PointInTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T18:35:22.123456Z"); 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) + } +} + +// Generated from example definition: 2025-08-01/ServersCreateReplica.json +func ExampleServersClient_BeginCreateOrUpdate_createAReadReplicaOfAnExistingServer() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armpostgresql.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewServersClient().BeginCreateOrUpdate(ctx, "exampleresourcegroup", "exampleserver", armpostgresql.Server{ + Identity: &armpostgresql.UserAssignedIdentity{ + Type: to.Ptr(armpostgresql.IdentityTypeUserAssigned), + UserAssignedIdentities: map[string]*armpostgresql.UserIdentity{ + "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/exampleprimaryidentity": {}, + }, + }, + Location: to.Ptr("eastus"), + Properties: &armpostgresql.ServerProperties{ + CreateMode: to.Ptr(armpostgresql.CreateModeReplica), + DataEncryption: &armpostgresql.DataEncryption{ + Type: to.Ptr(armpostgresql.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.123456Z"); 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) + } +} + +// Generated from example definition: 2025-08-01/ServersCreateReviveDropped.json +func ExampleServersClient_BeginCreateOrUpdate_createANewServerUsingABackupOfAServerThatWasDeletedOrDroppedRecently() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armpostgresql.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewServersClient().BeginCreateOrUpdate(ctx, "exampleresourcegroup", "exampleserver", armpostgresql.Server{ + Location: to.Ptr("eastus"), + Properties: &armpostgresql.ServerProperties{ + CreateMode: to.Ptr(armpostgresql.CreateModeReviveDropped), + PointInTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T18:30:22.123456Z"); 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) + } + _, 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 = armpostgresql.Server{ - // Name: to.Ptr("testserver-replica1"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup_WestCentralUS/providers/Microsoft.DBforPostgreSQL/servers/testserver-replica1"), - // Location: to.Ptr("westcentralus"), - // Properties: &armpostgresql.ServerProperties{ - // AdministratorLogin: to.Ptr("postgres"), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-06-20T00:17:56.677Z"); return t}()), - // FullyQualifiedDomainName: to.Ptr("testserver-replica1.postgres.database.azure.com"), - // MasterServerID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup_WestCentralUS/providers/Microsoft.DBforPostgreSQL/servers/testserver-master"), - // ReplicaCapacity: to.Ptr[int32](0), - // ReplicationRole: to.Ptr("Replica"), - // SSLEnforcement: to.Ptr(armpostgresql.SSLEnforcementEnumDisabled), - // StorageProfile: &armpostgresql.StorageProfile{ - // BackupRetentionDays: to.Ptr[int32](7), - // GeoRedundantBackup: to.Ptr(armpostgresql.GeoRedundantBackupDisabled), - // StorageMB: to.Ptr[int32](2048000), - // }, - // UserVisibleState: to.Ptr(armpostgresql.ServerStateReady), - // Version: to.Ptr(armpostgresql.ServerVersionNine6), - // }, - // SKU: &armpostgresql.SKU{ - // Name: to.Ptr("GP_Gen5_2"), - // Capacity: to.Ptr[int32](2), - // Family: to.Ptr("Gen4"), - // Tier: to.Ptr(armpostgresql.SKUTierGeneralPurpose), - // }, - // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/ServerCreateGeoRestoreMode.json -func ExampleServersClient_BeginCreate_createAServerAsAGeoRestore() { +// Generated from example definition: 2025-08-01/ServersCreateWithDataEncryptionEnabled.json +func ExampleServersClient_BeginCreateOrUpdate_createANewServerWithDataEncryptionBasedOnCustomerManagedKey() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armpostgresql.NewClientFactory("", cred, nil) + clientFactory, err := armpostgresql.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewServersClient().BeginCreate(ctx, "TargetResourceGroup", "targetserver", armpostgresql.ServerForCreate{ - Location: to.Ptr("westus"), - Properties: &armpostgresql.ServerPropertiesForGeoRestore{ - CreateMode: to.Ptr(armpostgresql.CreateModeGeoRestore), - SourceServerID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/SourceResourceGroup/providers/Microsoft.DBforPostgreSQL/servers/sourceserver"), + poller, err := clientFactory.NewServersClient().BeginCreateOrUpdate(ctx, "exampleresourcegroup", "exampleserver", armpostgresql.Server{ + Identity: &armpostgresql.UserAssignedIdentity{ + Type: to.Ptr(armpostgresql.IdentityTypeUserAssigned), + UserAssignedIdentities: map[string]*armpostgresql.UserIdentity{ + "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/exampleprimaryidentity": {}, + }, + }, + Location: to.Ptr("eastus"), + Properties: &armpostgresql.ServerProperties{ + AdministratorLogin: to.Ptr("exampleadministratorlogin"), + AdministratorLoginPassword: to.Ptr("examplepassword"), + AvailabilityZone: to.Ptr("1"), + Backup: &armpostgresql.Backup{ + BackupRetentionDays: to.Ptr[int32](7), + GeoRedundantBackup: to.Ptr(armpostgresql.GeographicallyRedundantBackupDisabled), + }, + CreateMode: to.Ptr(armpostgresql.CreateModeCreate), + DataEncryption: &armpostgresql.DataEncryption{ + Type: to.Ptr(armpostgresql.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: &armpostgresql.HighAvailability{ + Mode: to.Ptr(armpostgresql.FlexibleServerHighAvailabilityModeZoneRedundant), + }, + Network: &armpostgresql.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: &armpostgresql.Storage{ + AutoGrow: to.Ptr(armpostgresql.StorageAutoGrowDisabled), + StorageSizeGB: to.Ptr[int32](512), + Tier: to.Ptr(armpostgresql.AzureManagedDiskPerformanceTierP20), + }, + Version: to.Ptr(armpostgresql.PostgresMajorVersion17), }, SKU: &armpostgresql.SKU{ - Name: to.Ptr("GP_Gen5_2"), - Capacity: to.Ptr[int32](2), - Family: to.Ptr("Gen5"), - Tier: to.Ptr(armpostgresql.SKUTierGeneralPurpose), + Name: to.Ptr("Standard_D4ds_v5"), + Tier: to.Ptr(armpostgresql.SKUTierGeneralPurpose), }, - Tags: map[string]*string{ - "ElasticServer": to.Ptr("1"), + }, 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: 2025-08-01/ServersCreateWithDataEncryptionEnabledAutoUpdate.json +func ExampleServersClient_BeginCreateOrUpdate_createANewServerWithDataEncryptionBasedOnCustomerManagedKeyWithAutomaticKeyVersionUpdate() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armpostgresql.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewServersClient().BeginCreateOrUpdate(ctx, "exampleresourcegroup", "exampleserver", armpostgresql.Server{ + Identity: &armpostgresql.UserAssignedIdentity{ + Type: to.Ptr(armpostgresql.IdentityTypeUserAssigned), + UserAssignedIdentities: map[string]*armpostgresql.UserIdentity{ + "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/exampleprimaryidentity": {}, + }, + }, + Location: to.Ptr("eastus"), + Properties: &armpostgresql.ServerProperties{ + AdministratorLogin: to.Ptr("exampleadministratorlogin"), + AdministratorLoginPassword: to.Ptr("examplepassword"), + AvailabilityZone: to.Ptr("1"), + Backup: &armpostgresql.Backup{ + BackupRetentionDays: to.Ptr[int32](7), + GeoRedundantBackup: to.Ptr(armpostgresql.GeographicallyRedundantBackupDisabled), + }, + CreateMode: to.Ptr(armpostgresql.CreateModeCreate), + DataEncryption: &armpostgresql.DataEncryption{ + Type: to.Ptr(armpostgresql.DataEncryptionTypeAzureKeyVault), + GeoBackupKeyURI: to.Ptr(""), + GeoBackupUserAssignedIdentityID: to.Ptr(""), + 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: &armpostgresql.HighAvailability{ + Mode: to.Ptr(armpostgresql.FlexibleServerHighAvailabilityModeZoneRedundant), + }, + Network: &armpostgresql.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: &armpostgresql.Storage{ + AutoGrow: to.Ptr(armpostgresql.StorageAutoGrowDisabled), + StorageSizeGB: to.Ptr[int32](512), + Tier: to.Ptr(armpostgresql.AzureManagedDiskPerformanceTierP20), + }, + Version: to.Ptr(armpostgresql.PostgresMajorVersion17), + }, + SKU: &armpostgresql.SKU{ + Name: to.Ptr("Standard_D4ds_v5"), + Tier: to.Ptr(armpostgresql.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 = armpostgresql.Server{ - // Name: to.Ptr("targetserver"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/servers/targetserver"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "ElasticServer": to.Ptr("1"), - // }, - // Properties: &armpostgresql.ServerProperties{ - // AdministratorLogin: to.Ptr("cloudsa"), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-03-14T21:08:24.637Z"); return t}()), - // FullyQualifiedDomainName: to.Ptr("targetserver.postgres.database.azure.com"), - // SSLEnforcement: to.Ptr(armpostgresql.SSLEnforcementEnumEnabled), - // StorageProfile: &armpostgresql.StorageProfile{ - // BackupRetentionDays: to.Ptr[int32](7), - // GeoRedundantBackup: to.Ptr(armpostgresql.GeoRedundantBackupDisabled), - // StorageMB: to.Ptr[int32](128000), - // }, - // UserVisibleState: to.Ptr(armpostgresql.ServerStateReady), - // Version: to.Ptr(armpostgresql.ServerVersionNine6), - // }, - // SKU: &armpostgresql.SKU{ - // Name: to.Ptr("GP_Gen5_2"), - // Capacity: to.Ptr[int32](2), - // Family: to.Ptr("Gen5"), - // Tier: to.Ptr(armpostgresql.SKUTierGeneralPurpose), - // }, - // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/ServerUpdate.json -func ExampleServersClient_BeginUpdate() { +// Generated from example definition: 2025-08-01/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 := armpostgresql.NewClientFactory("", cred, nil) + clientFactory, err := armpostgresql.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewServersClient().BeginUpdate(ctx, "testrg", "pgtestsvc4", armpostgresql.ServerUpdateParameters{ - Properties: &armpostgresql.ServerUpdateParametersProperties{ - AdministratorLoginPassword: to.Ptr(""), - MinimalTLSVersion: to.Ptr(armpostgresql.MinimalTLSVersionEnumTLS12), - SSLEnforcement: to.Ptr(armpostgresql.SSLEnforcementEnumEnabled), + poller, err := clientFactory.NewServersClient().BeginCreateOrUpdate(ctx, "exampleresourcegroup", "exampleserver", armpostgresql.Server{ + Location: to.Ptr("eastus"), + Properties: &armpostgresql.ServerProperties{ + AdministratorLogin: to.Ptr("exampleadministratorlogin"), + AdministratorLoginPassword: to.Ptr("examplepassword"), + AuthConfig: &armpostgresql.AuthConfig{ + ActiveDirectoryAuth: to.Ptr(armpostgresql.MicrosoftEntraAuthEnabled), + PasswordAuth: to.Ptr(armpostgresql.PasswordBasedAuthEnabled), + TenantID: to.Ptr("tttttt-tttt-tttt-tttt-tttttttttttt"), + }, + AvailabilityZone: to.Ptr("1"), + Backup: &armpostgresql.Backup{ + BackupRetentionDays: to.Ptr[int32](7), + GeoRedundantBackup: to.Ptr(armpostgresql.GeographicallyRedundantBackupDisabled), + }, + CreateMode: to.Ptr(armpostgresql.CreateModeCreate), + DataEncryption: &armpostgresql.DataEncryption{ + Type: to.Ptr(armpostgresql.DataEncryptionTypeSystemManaged), + }, + HighAvailability: &armpostgresql.HighAvailability{ + Mode: to.Ptr(armpostgresql.FlexibleServerHighAvailabilityModeDisabled), + }, + Network: &armpostgresql.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: &armpostgresql.Storage{ + AutoGrow: to.Ptr(armpostgresql.StorageAutoGrowDisabled), + StorageSizeGB: to.Ptr[int32](512), + Tier: to.Ptr(armpostgresql.AzureManagedDiskPerformanceTierP20), + }, + Version: to.Ptr(armpostgresql.PostgresMajorVersion17), + }, + SKU: &armpostgresql.SKU{ + Name: to.Ptr("Standard_D4ds_v5"), + Tier: to.Ptr(armpostgresql.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 = armpostgresql.Server{ - // Name: to.Ptr("pgtestsvc4"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/servers/pgtestsvc4"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "ElasticServer": to.Ptr("1"), - // }, - // Properties: &armpostgresql.ServerProperties{ - // AdministratorLogin: to.Ptr("cloudsa"), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-03-14T21:08:24.637Z"); return t}()), - // FullyQualifiedDomainName: to.Ptr("pgtestsvc4.postgres.database.azure.com"), - // MinimalTLSVersion: to.Ptr(armpostgresql.MinimalTLSVersionEnumTLS12), - // SSLEnforcement: to.Ptr(armpostgresql.SSLEnforcementEnumEnabled), - // StorageProfile: &armpostgresql.StorageProfile{ - // BackupRetentionDays: to.Ptr[int32](7), - // GeoRedundantBackup: to.Ptr(armpostgresql.GeoRedundantBackupDisabled), - // StorageMB: to.Ptr[int32](128000), - // }, - // UserVisibleState: to.Ptr(armpostgresql.ServerStateReady), - // Version: to.Ptr(armpostgresql.ServerVersionNine6), - // }, - // SKU: &armpostgresql.SKU{ - // Name: to.Ptr("B_Gen4_2"), - // Capacity: to.Ptr[int32](2), - // Family: to.Ptr("Gen4"), - // Tier: to.Ptr(armpostgresql.SKUTierBasic), - // }, - // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/ServerDelete.json +// Generated from example definition: 2025-08-01/ServersDelete.json func ExampleServersClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armpostgresql.NewClientFactory("", cred, nil) + clientFactory, err := armpostgresql.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewServersClient().BeginDelete(ctx, "TestGroup", "testserver", nil) + poller, err := clientFactory.NewServersClient().BeginDelete(ctx, "exampleresourcegroup", "exampleserver", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -371,82 +558,277 @@ func ExampleServersClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/ServerGet.json -func ExampleServersClient_Get() { +// Generated from example definition: 2025-08-01/ServersGet.json +func ExampleServersClient_Get_getInformationAboutAnExistingServer() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armpostgresql.NewClientFactory("", cred, nil) + clientFactory, err := armpostgresql.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewServersClient().Get(ctx, "testrg", "pgtestsvc1", nil) + res, err := clientFactory.NewServersClient().Get(ctx, "exampleresourcegroup", "exampleserver", 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.Server = armpostgresql.Server{ - // Name: to.Ptr("pgtestsvc1"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/servers/pgtestsvc1"), - // Location: to.Ptr("westus"), - // Properties: &armpostgresql.ServerProperties{ - // AdministratorLogin: to.Ptr("testuser"), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-03-04T21:00:58.924Z"); return t}()), - // FullyQualifiedDomainName: to.Ptr("pgtestsvc1.postgres.database.azure.com"), - // MasterServerID: to.Ptr(""), - // MinimalTLSVersion: to.Ptr(armpostgresql.MinimalTLSVersionEnumTLS12), - // PrivateEndpointConnections: []*armpostgresql.ServerPrivateEndpointConnection{ - // { - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/servers/pgtestsvc1/privateEndpointConnections/private-endpoint-name-00000000-1111-2222-3333-444444444444"), - // Properties: &armpostgresql.ServerPrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armpostgresql.PrivateEndpointProperty{ - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/Default-Network/providers/Microsoft.Network/privateEndpoints/private-endpoint-name"), - // }, - // PrivateLinkServiceConnectionState: &armpostgresql.ServerPrivateLinkServiceConnectionStateProperty{ - // Description: to.Ptr("Auto-approved"), - // ActionsRequired: to.Ptr(armpostgresql.PrivateLinkServiceConnectionStateActionsRequireNone), - // Status: to.Ptr(armpostgresql.PrivateLinkServiceConnectionStateStatusApproved), + // res = armpostgresql.ServersClientGetResponse{ + // Server: &armpostgresql.Server{ + // Name: to.Ptr("exampleserver"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver"), + // Location: to.Ptr("eastus"), + // Properties: &armpostgresql.ServerProperties{ + // AdministratorLogin: to.Ptr("exampleadministratorlogin"), + // AuthConfig: &armpostgresql.AuthConfig{ + // ActiveDirectoryAuth: to.Ptr(armpostgresql.MicrosoftEntraAuthDisabled), + // PasswordAuth: to.Ptr(armpostgresql.PasswordBasedAuthEnabled), + // }, + // AvailabilityZone: to.Ptr("1"), + // Backup: &armpostgresql.Backup{ + // BackupRetentionDays: to.Ptr[int32](7), + // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T18:35:22.123456Z"); return t}()), + // GeoRedundantBackup: to.Ptr(armpostgresql.GeographicallyRedundantBackupEnabled), + // }, + // DataEncryption: &armpostgresql.DataEncryption{ + // Type: to.Ptr(armpostgresql.DataEncryptionTypeSystemManaged), + // }, + // FullyQualifiedDomainName: to.Ptr("exampleserver.postgres.database.azure.com"), + // HighAvailability: &armpostgresql.HighAvailability{ + // Mode: to.Ptr(armpostgresql.FlexibleServerHighAvailabilityModeDisabled), + // State: to.Ptr(armpostgresql.HighAvailabilityStateNotEnabled), + // }, + // MaintenanceWindow: &armpostgresql.MaintenanceWindow{ + // CustomWindow: to.Ptr("Disabled"), + // DayOfWeek: to.Ptr[int32](0), + // StartHour: to.Ptr[int32](0), + // StartMinute: to.Ptr[int32](0), + // }, + // MinorVersion: to.Ptr("5"), + // Network: &armpostgresql.Network{ + // PublicNetworkAccess: to.Ptr(armpostgresql.ServerPublicNetworkAccessStateEnabled), + // }, + // PrivateEndpointConnections: []*armpostgresql.PrivateEndpointConnection{ + // }, + // Replica: &armpostgresql.Replica{ + // Capacity: to.Ptr[int32](5), + // Role: to.Ptr(armpostgresql.ReplicationRolePrimary), + // }, + // ReplicaCapacity: to.Ptr[int32](5), + // ReplicationRole: to.Ptr(armpostgresql.ReplicationRolePrimary), + // State: to.Ptr(armpostgresql.ServerStateReady), + // Storage: &armpostgresql.Storage{ + // Type: to.Ptr(armpostgresql.StorageType("")), + // AutoGrow: to.Ptr(armpostgresql.StorageAutoGrowDisabled), + // Iops: to.Ptr[int32](500), + // StorageSizeGB: to.Ptr[int32](128), + // Tier: to.Ptr(armpostgresql.AzureManagedDiskPerformanceTierP10), + // }, + // Version: to.Ptr(armpostgresql.PostgresMajorVersion17), + // }, + // SKU: &armpostgresql.SKU{ + // Name: to.Ptr("Standard_D4ds_v5"), + // Tier: to.Ptr(armpostgresql.SKUTierGeneralPurpose), + // }, + // SystemData: &armpostgresql.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T18:30:22.123456Z"); return t}()), + // }, + // }, + // } +} + +// Generated from example definition: 2025-08-01/ServersGetWithPrivateEndpoints.json +func ExampleServersClient_Get_getInformationAboutAnExistingServerThatIsnTIntegratedIntoAVirtualNetworkProvidedByCustomerAndHasPrivateEndpointConnections() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armpostgresql.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewServersClient().Get(ctx, "exampleresourcegroup", "exampleserver", 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 = armpostgresql.ServersClientGetResponse{ + // Server: &armpostgresql.Server{ + // Name: to.Ptr("exampleserver"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver"), + // Location: to.Ptr("eastus"), + // Properties: &armpostgresql.ServerProperties{ + // AdministratorLogin: to.Ptr("exampleadministratorlogin"), + // AuthConfig: &armpostgresql.AuthConfig{ + // ActiveDirectoryAuth: to.Ptr(armpostgresql.MicrosoftEntraAuthDisabled), + // PasswordAuth: to.Ptr(armpostgresql.PasswordBasedAuthEnabled), + // }, + // AvailabilityZone: to.Ptr("1"), + // Backup: &armpostgresql.Backup{ + // BackupRetentionDays: to.Ptr[int32](7), + // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T18:35:22.123456Z"); return t}()), + // GeoRedundantBackup: to.Ptr(armpostgresql.GeographicallyRedundantBackupDisabled), + // }, + // FullyQualifiedDomainName: to.Ptr("exampleserver.postgres.database.azure.com"), + // HighAvailability: &armpostgresql.HighAvailability{ + // Mode: to.Ptr(armpostgresql.FlexibleServerHighAvailabilityModeDisabled), + // State: to.Ptr(armpostgresql.HighAvailabilityStateNotEnabled), + // }, + // MaintenanceWindow: &armpostgresql.MaintenanceWindow{ + // CustomWindow: to.Ptr("Disabled"), + // DayOfWeek: to.Ptr[int32](0), + // StartHour: to.Ptr[int32](0), + // StartMinute: to.Ptr[int32](0), + // }, + // MinorVersion: to.Ptr("5"), + // Network: &armpostgresql.Network{ + // PublicNetworkAccess: to.Ptr(armpostgresql.ServerPublicNetworkAccessStateEnabled), + // }, + // PrivateEndpointConnections: []*armpostgresql.PrivateEndpointConnection{ + // { + // 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/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/privateEndpointConnections/exampleprivateendpoint.40c899c7-5847-493e-9c9e-d0a0c90aaf92"), + // Properties: &armpostgresql.PrivateEndpointConnectionProperties{ + // GroupIDs: []*string{ + // to.Ptr("postgresqlServer"), + // }, + // PrivateEndpoint: &armpostgresql.PrivateEndpoint{ + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleprivateendpointresourcegroup/providers/Microsoft.Network/privateEndpoints/exampleprivateendpoint"), + // }, + // PrivateLinkServiceConnectionState: &armpostgresql.PrivateLinkServiceConnectionState{ + // Description: to.Ptr("Auto-Approved"), + // ActionsRequired: to.Ptr("None"), + // Status: to.Ptr(armpostgresql.PrivateEndpointServiceConnectionStatusApproved), + // }, + // ProvisioningState: to.Ptr(armpostgresql.PrivateEndpointConnectionProvisioningStateSucceeded), // }, - // ProvisioningState: to.Ptr(armpostgresql.PrivateEndpointProvisioningState("Succeeded")), // }, - // }}, - // PublicNetworkAccess: to.Ptr(armpostgresql.PublicNetworkAccessEnumEnabled), - // ReplicationRole: to.Ptr(""), - // SSLEnforcement: to.Ptr(armpostgresql.SSLEnforcementEnumEnabled), - // StorageProfile: &armpostgresql.StorageProfile{ - // BackupRetentionDays: to.Ptr[int32](10), - // GeoRedundantBackup: to.Ptr(armpostgresql.GeoRedundantBackupDisabled), - // StorageMB: to.Ptr[int32](5120), + // }, + // State: to.Ptr(armpostgresql.ServerStateReady), + // Storage: &armpostgresql.Storage{ + // AutoGrow: to.Ptr(armpostgresql.StorageAutoGrowDisabled), + // Iops: to.Ptr[int32](2300), + // StorageSizeGB: to.Ptr[int32](512), + // Tier: to.Ptr(armpostgresql.AzureManagedDiskPerformanceTierP20), + // }, + // Version: to.Ptr(armpostgresql.PostgresMajorVersion17), + // }, + // SKU: &armpostgresql.SKU{ + // Name: to.Ptr("Standard_D4ds_v5"), + // Tier: to.Ptr(armpostgresql.SKUTierGeneralPurpose), // }, - // UserVisibleState: to.Ptr(armpostgresql.ServerStateReady), - // Version: to.Ptr(armpostgresql.ServerVersionNine5), // }, - // SKU: &armpostgresql.SKU{ - // Name: to.Ptr("B_Gen4_1"), - // Capacity: to.Ptr[int32](1), - // Family: to.Ptr("Gen4"), - // Tier: to.Ptr(armpostgresql.SKUTierBasic), + // } +} + +// Generated from example definition: 2025-08-01/ServersGetWithVnet.json +func ExampleServersClient_Get_getInformationAboutAnExistingServerThatIsIntegratedIntoAVirtualNetworkProvidedByCustomer() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armpostgresql.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewServersClient().Get(ctx, "exampleresourcegroup", "exampleserver", 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 = armpostgresql.ServersClientGetResponse{ + // Server: &armpostgresql.Server{ + // Name: to.Ptr("exampleserver"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver"), + // Location: to.Ptr("eastus"), + // Properties: &armpostgresql.ServerProperties{ + // AdministratorLogin: to.Ptr("exampleadministratorlogin"), + // AuthConfig: &armpostgresql.AuthConfig{ + // ActiveDirectoryAuth: to.Ptr(armpostgresql.MicrosoftEntraAuthDisabled), + // PasswordAuth: to.Ptr(armpostgresql.PasswordBasedAuthEnabled), + // }, + // AvailabilityZone: to.Ptr("1"), + // Backup: &armpostgresql.Backup{ + // BackupRetentionDays: to.Ptr[int32](7), + // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T18:35:22.123456Z"); return t}()), + // GeoRedundantBackup: to.Ptr(armpostgresql.GeographicallyRedundantBackupEnabled), + // }, + // DataEncryption: &armpostgresql.DataEncryption{ + // Type: to.Ptr(armpostgresql.DataEncryptionTypeSystemManaged), + // }, + // FullyQualifiedDomainName: to.Ptr("exampleserver.postgres.database.azure.com"), + // HighAvailability: &armpostgresql.HighAvailability{ + // Mode: to.Ptr(armpostgresql.FlexibleServerHighAvailabilityModeZoneRedundant), + // StandbyAvailabilityZone: to.Ptr("2"), + // State: to.Ptr(armpostgresql.HighAvailabilityStateHealthy), + // }, + // MaintenanceWindow: &armpostgresql.MaintenanceWindow{ + // CustomWindow: to.Ptr("Disabled"), + // DayOfWeek: to.Ptr[int32](0), + // StartHour: to.Ptr[int32](0), + // StartMinute: to.Ptr[int32](0), + // }, + // MinorVersion: to.Ptr("5"), + // Network: &armpostgresql.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/exampleserver.private.postgres.database.azure.com"), + // PublicNetworkAccess: to.Ptr(armpostgresql.ServerPublicNetworkAccessStateDisabled), + // }, + // Replica: &armpostgresql.Replica{ + // Capacity: to.Ptr[int32](5), + // Role: to.Ptr(armpostgresql.ReplicationRolePrimary), + // }, + // ReplicaCapacity: to.Ptr[int32](5), + // ReplicationRole: to.Ptr(armpostgresql.ReplicationRolePrimary), + // State: to.Ptr(armpostgresql.ServerStateReady), + // Storage: &armpostgresql.Storage{ + // Type: to.Ptr(armpostgresql.StorageType("")), + // AutoGrow: to.Ptr(armpostgresql.StorageAutoGrowDisabled), + // Iops: to.Ptr[int32](2300), + // StorageSizeGB: to.Ptr[int32](512), + // Tier: to.Ptr(armpostgresql.AzureManagedDiskPerformanceTierP20), + // }, + // Version: to.Ptr(armpostgresql.PostgresMajorVersion17), + // }, + // SKU: &armpostgresql.SKU{ + // Name: to.Ptr("Standard_D4ds_v5"), + // Tier: to.Ptr(armpostgresql.SKUTierGeneralPurpose), + // }, + // SystemData: &armpostgresql.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T18:30:22.123456Z"); return t}()), + // }, + // Tags: map[string]*string{ + // "VnetServer": to.Ptr("1"), + // }, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/ServerListByResourceGroup.json +// Generated from example definition: 2025-08-01/ServersListByResourceGroup.json func ExampleServersClient_NewListByResourceGroupPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armpostgresql.NewClientFactory("", cred, nil) + clientFactory, err := armpostgresql.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewServersClient().NewListByResourceGroupPager("TestGroup", nil) + pager := clientFactory.NewServersClient().NewListByResourceGroupPager("exampleresourcegroup", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -457,124 +839,172 @@ 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 = armpostgresql.ServerListResult{ - // Value: []*armpostgresql.Server{ - // { - // Name: to.Ptr("pgtestsvc1"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/servers/pgtestsvc1"), - // Location: to.Ptr("westus"), - // Properties: &armpostgresql.ServerProperties{ - // AdministratorLogin: to.Ptr("testuser"), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-03-04T21:01:55.149Z"); return t}()), - // FullyQualifiedDomainName: to.Ptr("pgtestsvc1.postgres.database.azure.com"), - // PrivateEndpointConnections: []*armpostgresql.ServerPrivateEndpointConnection{ + // page = armpostgresql.ServersClientListByResourceGroupResponse{ + // ServerList: armpostgresql.ServerList{ + // NextLink: to.Ptr("https://management.azure.com/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers?api-version=2025-06-01-preview&$skiptoken=skiptoken"), + // Value: []*armpostgresql.Server{ + // { + // Name: to.Ptr("exampleserver1"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver1"), + // Location: to.Ptr("eastus"), + // Properties: &armpostgresql.ServerProperties{ + // AdministratorLogin: to.Ptr("exampleadministratorlogin"), + // AuthConfig: &armpostgresql.AuthConfig{ + // ActiveDirectoryAuth: to.Ptr(armpostgresql.MicrosoftEntraAuthEnabled), + // PasswordAuth: to.Ptr(armpostgresql.PasswordBasedAuthEnabled), + // TenantID: to.Ptr("tttttt-tttt-tttt-tttt-tttttttttttt"), + // }, + // AvailabilityZone: to.Ptr("1"), + // Backup: &armpostgresql.Backup{ + // BackupRetentionDays: to.Ptr[int32](7), + // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T18:35:22.123456Z"); return t}()), + // GeoRedundantBackup: to.Ptr(armpostgresql.GeographicallyRedundantBackupEnabled), + // }, + // DataEncryption: &armpostgresql.DataEncryption{ + // Type: to.Ptr(armpostgresql.DataEncryptionTypeSystemManaged), + // }, + // FullyQualifiedDomainName: to.Ptr("exampleserver1.postgres.database.azure.com"), + // HighAvailability: &armpostgresql.HighAvailability{ + // Mode: to.Ptr(armpostgresql.FlexibleServerHighAvailabilityModeZoneRedundant), + // StandbyAvailabilityZone: to.Ptr("2"), + // State: to.Ptr(armpostgresql.HighAvailabilityStateHealthy), + // }, + // MaintenanceWindow: &armpostgresql.MaintenanceWindow{ + // CustomWindow: to.Ptr("Disabled"), + // DayOfWeek: to.Ptr[int32](0), + // StartHour: to.Ptr[int32](0), + // StartMinute: to.Ptr[int32](0), + // }, + // MinorVersion: to.Ptr("5"), + // Network: &armpostgresql.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/exampleserver1.private.postgres.database.azure.com"), + // PublicNetworkAccess: to.Ptr(armpostgresql.ServerPublicNetworkAccessStateDisabled), + // }, + // Replica: &armpostgresql.Replica{ + // Capacity: to.Ptr[int32](5), + // Role: to.Ptr(armpostgresql.ReplicationRolePrimary), + // }, + // ReplicaCapacity: to.Ptr[int32](5), + // ReplicationRole: to.Ptr(armpostgresql.ReplicationRolePrimary), + // State: to.Ptr(armpostgresql.ServerStateReady), + // Storage: &armpostgresql.Storage{ + // Type: to.Ptr(armpostgresql.StorageType("")), + // AutoGrow: to.Ptr(armpostgresql.StorageAutoGrowDisabled), + // Iops: to.Ptr[int32](2300), + // StorageSizeGB: to.Ptr[int32](512), + // Tier: to.Ptr(armpostgresql.AzureManagedDiskPerformanceTierP20), + // }, + // Version: to.Ptr(armpostgresql.PostgresMajorVersion17), // }, - // PublicNetworkAccess: to.Ptr(armpostgresql.PublicNetworkAccessEnumEnabled), - // SSLEnforcement: to.Ptr(armpostgresql.SSLEnforcementEnumEnabled), - // StorageProfile: &armpostgresql.StorageProfile{ - // BackupRetentionDays: to.Ptr[int32](10), - // GeoRedundantBackup: to.Ptr(armpostgresql.GeoRedundantBackupDisabled), - // StorageMB: to.Ptr[int32](5120), + // SKU: &armpostgresql.SKU{ + // Name: to.Ptr("Standard_D4ds_v5"), + // Tier: to.Ptr(armpostgresql.SKUTierGeneralPurpose), + // }, + // SystemData: &armpostgresql.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T18:30:22.123456Z"); return t}()), + // }, + // Tags: map[string]*string{ + // "VnetServer": to.Ptr("1"), // }, - // UserVisibleState: to.Ptr(armpostgresql.ServerStateReady), - // Version: to.Ptr(armpostgresql.ServerVersionNine5), - // }, - // SKU: &armpostgresql.SKU{ - // Name: to.Ptr("B_Gen4_1"), - // Capacity: to.Ptr[int32](1), - // Family: to.Ptr("Gen4"), - // Tier: to.Ptr(armpostgresql.SKUTierBasic), // }, - // }, - // { - // Name: to.Ptr("pgtestsvc2"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/servers/pgtestsvc2"), - // Location: to.Ptr("westus"), - // Properties: &armpostgresql.ServerProperties{ - // AdministratorLogin: to.Ptr("testuser"), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-03-07T21:01:55.149Z"); return t}()), - // FullyQualifiedDomainName: to.Ptr("pgtestsvc2.postgres.database.azure.com"), - // PrivateEndpointConnections: []*armpostgresql.ServerPrivateEndpointConnection{ - // { - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/servers/pgtestsvc2/privateEndpointConnections/private-endpoint-name-00000000-1111-2222-3333-444444444444"), - // Properties: &armpostgresql.ServerPrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armpostgresql.PrivateEndpointProperty{ - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/Default-Network/providers/Microsoft.Network/privateEndpoints/private-endpoint-name"), - // }, - // PrivateLinkServiceConnectionState: &armpostgresql.ServerPrivateLinkServiceConnectionStateProperty{ - // Description: to.Ptr("Auto-approved"), - // ActionsRequired: to.Ptr(armpostgresql.PrivateLinkServiceConnectionStateActionsRequireNone), - // Status: to.Ptr(armpostgresql.PrivateLinkServiceConnectionStateStatusApproved), - // }, - // ProvisioningState: to.Ptr(armpostgresql.PrivateEndpointProvisioningState("Succeeded")), + // { + // Name: to.Ptr("exampleserver2"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver2"), + // Identity: &armpostgresql.UserAssignedIdentity{ + // Type: to.Ptr(armpostgresql.IdentityTypeSystemAssignedUserAssigned), + // PrincipalID: to.Ptr("rrrrrrrr-rrrr-rrrr-rrrr-rrrrrrrrrrrr"), + // TenantID: to.Ptr("tttttt-tttt-tttt-tttt-tttttttttttt"), + // UserAssignedIdentities: map[string]*armpostgresql.UserIdentity{ + // "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/exampleprimaryidentity": &armpostgresql.UserIdentity{ + // ClientID: to.Ptr("tttttt-tttt-tttt-tttt-tttttttttttt"), + // PrincipalID: to.Ptr("pppppppp-pppp-pppp-pppp-pppppppppppp"), // }, - // }}, - // PublicNetworkAccess: to.Ptr(armpostgresql.PublicNetworkAccessEnumEnabled), - // SSLEnforcement: to.Ptr(armpostgresql.SSLEnforcementEnumEnabled), - // StorageProfile: &armpostgresql.StorageProfile{ - // BackupRetentionDays: to.Ptr[int32](7), - // GeoRedundantBackup: to.Ptr(armpostgresql.GeoRedundantBackupDisabled), - // StorageMB: to.Ptr[int32](5120), + // }, // }, - // UserVisibleState: to.Ptr(armpostgresql.ServerStateReady), - // Version: to.Ptr(armpostgresql.ServerVersionNine6), - // }, - // SKU: &armpostgresql.SKU{ - // Name: to.Ptr("GP_Gen4_2"), - // Capacity: to.Ptr[int32](2), - // Family: to.Ptr("Gen4"), - // Tier: to.Ptr(armpostgresql.SKUTierGeneralPurpose), - // }, - // }, - // { - // Name: to.Ptr("pgtestsvc4"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/servers/pgtestsvc4"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "ElasticServer": to.Ptr("1"), - // }, - // Properties: &armpostgresql.ServerProperties{ - // AdministratorLogin: to.Ptr("cloudsa"), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-03-14T21:08:24.637Z"); return t}()), - // FullyQualifiedDomainName: to.Ptr("pgtestsvc4.postgres.database.azure.com"), - // PrivateEndpointConnections: []*armpostgresql.ServerPrivateEndpointConnection{ + // Location: to.Ptr("eastus"), + // Properties: &armpostgresql.ServerProperties{ + // AdministratorLogin: to.Ptr("exampleadministratorlogin"), + // AuthConfig: &armpostgresql.AuthConfig{ + // ActiveDirectoryAuth: to.Ptr(armpostgresql.MicrosoftEntraAuthEnabled), + // PasswordAuth: to.Ptr(armpostgresql.PasswordBasedAuthEnabled), + // TenantID: to.Ptr("tttttt-tttt-tttt-tttt-tttttttttttt"), + // }, + // AvailabilityZone: to.Ptr("1"), + // Backup: &armpostgresql.Backup{ + // BackupRetentionDays: to.Ptr[int32](7), + // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T19:35:22.123456Z"); return t}()), + // GeoRedundantBackup: to.Ptr(armpostgresql.GeographicallyRedundantBackupDisabled), + // }, + // DataEncryption: &armpostgresql.DataEncryption{ + // Type: to.Ptr(armpostgresql.DataEncryptionTypeAzureKeyVault), + // PrimaryEncryptionKeyStatus: to.Ptr(armpostgresql.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("exampleserver2.postgres.database.azure.com"), + // HighAvailability: &armpostgresql.HighAvailability{ + // Mode: to.Ptr(armpostgresql.FlexibleServerHighAvailabilityModeDisabled), + // State: to.Ptr(armpostgresql.HighAvailabilityStateNotEnabled), + // }, + // MaintenanceWindow: &armpostgresql.MaintenanceWindow{ + // CustomWindow: to.Ptr("Disabled"), + // DayOfWeek: to.Ptr[int32](0), + // StartHour: to.Ptr[int32](0), + // StartMinute: to.Ptr[int32](0), + // }, + // MinorVersion: to.Ptr("5"), + // Network: &armpostgresql.Network{ + // PublicNetworkAccess: to.Ptr(armpostgresql.ServerPublicNetworkAccessStateEnabled), + // }, + // PrivateEndpointConnections: []*armpostgresql.PrivateEndpointConnection{ + // }, + // Replica: &armpostgresql.Replica{ + // Capacity: to.Ptr[int32](5), + // Role: to.Ptr(armpostgresql.ReplicationRolePrimary), + // }, + // ReplicaCapacity: to.Ptr[int32](5), + // ReplicationRole: to.Ptr(armpostgresql.ReplicationRolePrimary), + // State: to.Ptr(armpostgresql.ServerStateReady), + // Storage: &armpostgresql.Storage{ + // Type: to.Ptr(armpostgresql.StorageType("")), + // AutoGrow: to.Ptr(armpostgresql.StorageAutoGrowDisabled), + // Iops: to.Ptr[int32](500), + // StorageSizeGB: to.Ptr[int32](128), + // Tier: to.Ptr(armpostgresql.AzureManagedDiskPerformanceTierP10), + // }, + // Version: to.Ptr(armpostgresql.PostgresMajorVersion17), // }, - // PublicNetworkAccess: to.Ptr(armpostgresql.PublicNetworkAccessEnumEnabled), - // SSLEnforcement: to.Ptr(armpostgresql.SSLEnforcementEnumEnabled), - // StorageProfile: &armpostgresql.StorageProfile{ - // BackupRetentionDays: to.Ptr[int32](7), - // GeoRedundantBackup: to.Ptr(armpostgresql.GeoRedundantBackupDisabled), - // StorageMB: to.Ptr[int32](128000), + // SKU: &armpostgresql.SKU{ + // Name: to.Ptr("Standard_D4ds_v5"), + // Tier: to.Ptr(armpostgresql.SKUTierGeneralPurpose), + // }, + // SystemData: &armpostgresql.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T19:30:22.123456Z"); return t}()), + // }, + // Tags: map[string]*string{ // }, - // UserVisibleState: to.Ptr(armpostgresql.ServerStateReady), - // Version: to.Ptr(armpostgresql.ServerVersionNine6), - // }, - // SKU: &armpostgresql.SKU{ - // Name: to.Ptr("B_Gen4_2"), - // Capacity: to.Ptr[int32](2), - // Family: to.Ptr("Gen4"), - // Tier: to.Ptr(armpostgresql.SKUTierBasic), // }, - // }}, + // }, + // }, // } } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/ServerList.json -func ExampleServersClient_NewListPager() { +// Generated from example definition: 2025-08-01/ServersListBySubscription.json +func ExampleServersClient_NewListBySubscriptionPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armpostgresql.NewClientFactory("", cred, nil) + clientFactory, err := armpostgresql.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) 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 { @@ -585,169 +1015,711 @@ 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 = armpostgresql.ServerListResult{ - // Value: []*armpostgresql.Server{ - // { - // Name: to.Ptr("pgtestsvc1"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/servers/pgtestsvc1"), - // Location: to.Ptr("westus"), - // Properties: &armpostgresql.ServerProperties{ - // AdministratorLogin: to.Ptr("testuser"), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-03-04T21:01:55.149Z"); return t}()), - // FullyQualifiedDomainName: to.Ptr("pgtestsvc1.postgres.database.azure.com"), - // MinimalTLSVersion: to.Ptr(armpostgresql.MinimalTLSVersionEnumTLS11), - // PrivateEndpointConnections: []*armpostgresql.ServerPrivateEndpointConnection{ + // page = armpostgresql.ServersClientListBySubscriptionResponse{ + // ServerList: armpostgresql.ServerList{ + // NextLink: to.Ptr("https://management.azure.com/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/providers/Microsoft.DBforPostgreSQL/flexibleServers?api-version=2025-06-01-preview&$skiptoken=skiptoken"), + // Value: []*armpostgresql.Server{ + // { + // Name: to.Ptr("exampleserver1"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup1/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver1"), + // Location: to.Ptr("eastus"), + // Properties: &armpostgresql.ServerProperties{ + // AdministratorLogin: to.Ptr("exampleadministratorlogin"), + // AuthConfig: &armpostgresql.AuthConfig{ + // ActiveDirectoryAuth: to.Ptr(armpostgresql.MicrosoftEntraAuthEnabled), + // PasswordAuth: to.Ptr(armpostgresql.PasswordBasedAuthEnabled), + // TenantID: to.Ptr("tttttt-tttt-tttt-tttt-tttttttttttt"), + // }, + // AvailabilityZone: to.Ptr("1"), + // Backup: &armpostgresql.Backup{ + // BackupRetentionDays: to.Ptr[int32](7), + // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T18:35:22.123456Z"); return t}()), + // GeoRedundantBackup: to.Ptr(armpostgresql.GeographicallyRedundantBackupEnabled), + // }, + // DataEncryption: &armpostgresql.DataEncryption{ + // Type: to.Ptr(armpostgresql.DataEncryptionTypeSystemManaged), + // }, + // FullyQualifiedDomainName: to.Ptr("exampleserver1.postgres.database.azure.com"), + // HighAvailability: &armpostgresql.HighAvailability{ + // Mode: to.Ptr(armpostgresql.FlexibleServerHighAvailabilityModeZoneRedundant), + // StandbyAvailabilityZone: to.Ptr("2"), + // State: to.Ptr(armpostgresql.HighAvailabilityStateHealthy), + // }, + // MaintenanceWindow: &armpostgresql.MaintenanceWindow{ + // CustomWindow: to.Ptr("Disabled"), + // DayOfWeek: to.Ptr[int32](0), + // StartHour: to.Ptr[int32](0), + // StartMinute: to.Ptr[int32](0), + // }, + // MinorVersion: to.Ptr("5"), + // Network: &armpostgresql.Network{ + // 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(armpostgresql.ServerPublicNetworkAccessStateDisabled), + // }, + // Replica: &armpostgresql.Replica{ + // Capacity: to.Ptr[int32](5), + // Role: to.Ptr(armpostgresql.ReplicationRolePrimary), + // }, + // ReplicaCapacity: to.Ptr[int32](5), + // ReplicationRole: to.Ptr(armpostgresql.ReplicationRolePrimary), + // State: to.Ptr(armpostgresql.ServerStateReady), + // Storage: &armpostgresql.Storage{ + // Type: to.Ptr(armpostgresql.StorageType("")), + // AutoGrow: to.Ptr(armpostgresql.StorageAutoGrowDisabled), + // Iops: to.Ptr[int32](2300), + // StorageSizeGB: to.Ptr[int32](512), + // Tier: to.Ptr(armpostgresql.AzureManagedDiskPerformanceTierP20), + // }, + // Version: to.Ptr(armpostgresql.PostgresMajorVersion17), // }, - // PublicNetworkAccess: to.Ptr(armpostgresql.PublicNetworkAccessEnumEnabled), - // SSLEnforcement: to.Ptr(armpostgresql.SSLEnforcementEnumEnabled), - // StorageProfile: &armpostgresql.StorageProfile{ - // BackupRetentionDays: to.Ptr[int32](10), - // GeoRedundantBackup: to.Ptr(armpostgresql.GeoRedundantBackupDisabled), - // StorageMB: to.Ptr[int32](5120), + // SKU: &armpostgresql.SKU{ + // Name: to.Ptr("Standard_D4ds_v5"), + // Tier: to.Ptr(armpostgresql.SKUTierGeneralPurpose), // }, - // UserVisibleState: to.Ptr(armpostgresql.ServerStateReady), - // Version: to.Ptr(armpostgresql.ServerVersionNine5), - // }, - // SKU: &armpostgresql.SKU{ - // Name: to.Ptr("B_Gen4_1"), - // Capacity: to.Ptr[int32](1), - // Family: to.Ptr("Gen4"), - // Tier: to.Ptr(armpostgresql.SKUTierBasic), - // }, - // }, - // { - // Name: to.Ptr("pgtestsvc2"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/servers/pgtestsvc2"), - // Location: to.Ptr("westus"), - // Properties: &armpostgresql.ServerProperties{ - // AdministratorLogin: to.Ptr("testuser"), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-03-07T21:01:55.149Z"); return t}()), - // FullyQualifiedDomainName: to.Ptr("pgtestsvc2.postgres.database.azure.com"), - // MinimalTLSVersion: to.Ptr(armpostgresql.MinimalTLSVersionEnumTLS12), - // PrivateEndpointConnections: []*armpostgresql.ServerPrivateEndpointConnection{ - // { - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/servers/pgtestsvc2/privateEndpointConnections/private-endpoint-name-00000000-1111-2222-3333-444444444444"), - // Properties: &armpostgresql.ServerPrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armpostgresql.PrivateEndpointProperty{ - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/Default-Network/providers/Microsoft.Network/privateEndpoints/private-endpoint-name"), - // }, - // PrivateLinkServiceConnectionState: &armpostgresql.ServerPrivateLinkServiceConnectionStateProperty{ - // Description: to.Ptr("Auto-approved"), - // ActionsRequired: to.Ptr(armpostgresql.PrivateLinkServiceConnectionStateActionsRequireNone), - // Status: to.Ptr(armpostgresql.PrivateLinkServiceConnectionStateStatusApproved), - // }, - // ProvisioningState: to.Ptr(armpostgresql.PrivateEndpointProvisioningState("Succeeded")), - // }, - // }}, - // PublicNetworkAccess: to.Ptr(armpostgresql.PublicNetworkAccessEnumEnabled), - // SSLEnforcement: to.Ptr(armpostgresql.SSLEnforcementEnumEnabled), - // StorageProfile: &armpostgresql.StorageProfile{ - // BackupRetentionDays: to.Ptr[int32](7), - // GeoRedundantBackup: to.Ptr(armpostgresql.GeoRedundantBackupDisabled), - // StorageMB: to.Ptr[int32](5120), + // SystemData: &armpostgresql.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T18:30:22.123456Z"); return t}()), + // }, + // Tags: map[string]*string{ + // "VnetServer": to.Ptr("1"), // }, - // UserVisibleState: to.Ptr(armpostgresql.ServerStateReady), - // Version: to.Ptr(armpostgresql.ServerVersionNine6), // }, - // SKU: &armpostgresql.SKU{ - // Name: to.Ptr("GP_Gen4_2"), - // Capacity: to.Ptr[int32](2), - // Family: to.Ptr("Gen4"), - // Tier: to.Ptr(armpostgresql.SKUTierGeneralPurpose), + // { + // Name: to.Ptr("exampleserver2"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup2/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver2"), + // Location: to.Ptr("eastus"), + // Properties: &armpostgresql.ServerProperties{ + // AdministratorLogin: to.Ptr("exampleadministratorlogin"), + // AuthConfig: &armpostgresql.AuthConfig{ + // ActiveDirectoryAuth: to.Ptr(armpostgresql.MicrosoftEntraAuthEnabled), + // PasswordAuth: to.Ptr(armpostgresql.PasswordBasedAuthEnabled), + // TenantID: to.Ptr("tttttt-tttt-tttt-tttt-tttttttttttt"), + // }, + // AvailabilityZone: to.Ptr("2"), + // Backup: &armpostgresql.Backup{ + // BackupRetentionDays: to.Ptr[int32](7), + // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T19:35:22.123456Z"); return t}()), + // GeoRedundantBackup: to.Ptr(armpostgresql.GeographicallyRedundantBackupEnabled), + // }, + // DataEncryption: &armpostgresql.DataEncryption{ + // Type: to.Ptr(armpostgresql.DataEncryptionTypeSystemManaged), + // }, + // FullyQualifiedDomainName: to.Ptr("exampleserver2.postgres.database.azure.com"), + // HighAvailability: &armpostgresql.HighAvailability{ + // Mode: to.Ptr(armpostgresql.FlexibleServerHighAvailabilityModeZoneRedundant), + // StandbyAvailabilityZone: to.Ptr("1"), + // State: to.Ptr(armpostgresql.HighAvailabilityStateHealthy), + // }, + // MaintenanceWindow: &armpostgresql.MaintenanceWindow{ + // CustomWindow: to.Ptr("Disabled"), + // DayOfWeek: to.Ptr[int32](0), + // StartHour: to.Ptr[int32](0), + // StartMinute: to.Ptr[int32](0), + // }, + // MinorVersion: to.Ptr("5"), + // Network: &armpostgresql.Network{ + // PublicNetworkAccess: to.Ptr(armpostgresql.ServerPublicNetworkAccessStateEnabled), + // }, + // PrivateEndpointConnections: []*armpostgresql.PrivateEndpointConnection{ + // }, + // Replica: &armpostgresql.Replica{ + // Capacity: to.Ptr[int32](5), + // Role: to.Ptr(armpostgresql.ReplicationRolePrimary), + // }, + // ReplicaCapacity: to.Ptr[int32](5), + // ReplicationRole: to.Ptr(armpostgresql.ReplicationRolePrimary), + // State: to.Ptr(armpostgresql.ServerStateReady), + // Storage: &armpostgresql.Storage{ + // Type: to.Ptr(armpostgresql.StorageType("")), + // AutoGrow: to.Ptr(armpostgresql.StorageAutoGrowDisabled), + // Iops: to.Ptr[int32](500), + // StorageSizeGB: to.Ptr[int32](128), + // Tier: to.Ptr(armpostgresql.AzureManagedDiskPerformanceTierP10), + // }, + // Version: to.Ptr(armpostgresql.PostgresMajorVersion17), + // }, + // SKU: &armpostgresql.SKU{ + // Name: to.Ptr("Standard_D4ds_v5"), + // Tier: to.Ptr(armpostgresql.SKUTierGeneralPurpose), + // }, + // SystemData: &armpostgresql.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T19:30:22.123456Z"); return t}()), + // }, + // Tags: map[string]*string{ + // }, // }, - // }, - // { - // Name: to.Ptr("pgtestsvc3"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg1/providers/Microsoft.DBforPostgreSQL/servers/pgtestsvc3"), - // Location: to.Ptr("westus"), - // Properties: &armpostgresql.ServerProperties{ - // AdministratorLogin: to.Ptr("testuser"), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-03-01T00:11:08.550Z"); return t}()), - // FullyQualifiedDomainName: to.Ptr("pgtestsvc3.postgres.database.azure.com"), - // MinimalTLSVersion: to.Ptr(armpostgresql.MinimalTLSVersionEnumTLS10), - // PrivateEndpointConnections: []*armpostgresql.ServerPrivateEndpointConnection{ - // { - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/servers/pgtestsvc3/privateEndpointConnections/private-endpoint-name-00000000-1111-2222-3333-444444444444"), - // Properties: &armpostgresql.ServerPrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armpostgresql.PrivateEndpointProperty{ - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/Default-Network/providers/Microsoft.Network/privateEndpoints/private-endpoint-name"), - // }, - // PrivateLinkServiceConnectionState: &armpostgresql.ServerPrivateLinkServiceConnectionStateProperty{ - // Description: to.Ptr("Auto-approved"), - // ActionsRequired: to.Ptr(armpostgresql.PrivateLinkServiceConnectionStateActionsRequireNone), - // Status: to.Ptr(armpostgresql.PrivateLinkServiceConnectionStateStatusApproved), - // }, - // ProvisioningState: to.Ptr(armpostgresql.PrivateEndpointProvisioningState("Succeeded")), + // { + // Name: to.Ptr("exampleserver3"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup3/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver3"), + // Identity: &armpostgresql.UserAssignedIdentity{ + // Type: to.Ptr(armpostgresql.IdentityTypeSystemAssignedUserAssigned), + // PrincipalID: to.Ptr("rrrrrrrr-rrrr-rrrr-rrrr-rrrrrrrrrrrr"), + // TenantID: to.Ptr("tttttt-tttt-tttt-tttt-tttttttttttt"), + // UserAssignedIdentities: map[string]*armpostgresql.UserIdentity{ + // "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup3/providers/Microsoft.ManagedIdentity/userAssignedIdentities/exampleprimaryidentity3": &armpostgresql.UserIdentity{ + // ClientID: to.Ptr("tttttt-tttt-tttt-tttt-tttttttttttt"), + // PrincipalID: to.Ptr("pppppppp-pppp-pppp-pppp-pppppppppppp"), // }, - // }}, - // PublicNetworkAccess: to.Ptr(armpostgresql.PublicNetworkAccessEnumEnabled), - // SSLEnforcement: to.Ptr(armpostgresql.SSLEnforcementEnumEnabled), - // StorageProfile: &armpostgresql.StorageProfile{ - // BackupRetentionDays: to.Ptr[int32](35), - // GeoRedundantBackup: to.Ptr(armpostgresql.GeoRedundantBackupEnabled), - // StorageMB: to.Ptr[int32](204800), + // }, // }, - // UserVisibleState: to.Ptr(armpostgresql.ServerStateReady), - // Version: to.Ptr(armpostgresql.ServerVersionNine6), - // }, - // SKU: &armpostgresql.SKU{ - // Name: to.Ptr("GP_Gen4_4"), - // Capacity: to.Ptr[int32](4), - // Family: to.Ptr("Gen4"), - // Tier: to.Ptr(armpostgresql.SKUTierGeneralPurpose), - // }, - // }, - // { - // Name: to.Ptr("pgtestsvc4"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/servers/pgtestsvc4"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "ElasticServer": to.Ptr("1"), - // }, - // Properties: &armpostgresql.ServerProperties{ - // AdministratorLogin: to.Ptr("cloudsa"), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-03-14T21:08:24.637Z"); return t}()), - // FullyQualifiedDomainName: to.Ptr("pgtestsvc4.postgres.database.azure.com"), - // MinimalTLSVersion: to.Ptr(armpostgresql.MinimalTLSVersionEnumTLS10), - // PrivateEndpointConnections: []*armpostgresql.ServerPrivateEndpointConnection{ + // Location: to.Ptr("eastus"), + // Properties: &armpostgresql.ServerProperties{ + // AdministratorLogin: to.Ptr("exampleadministratorlogin"), + // AuthConfig: &armpostgresql.AuthConfig{ + // ActiveDirectoryAuth: to.Ptr(armpostgresql.MicrosoftEntraAuthEnabled), + // PasswordAuth: to.Ptr(armpostgresql.PasswordBasedAuthEnabled), + // TenantID: to.Ptr("tttttt-tttt-tttt-tttt-tttttttttttt"), + // }, + // AvailabilityZone: to.Ptr("1"), + // Backup: &armpostgresql.Backup{ + // BackupRetentionDays: to.Ptr[int32](7), + // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T20:35:22.123456Z"); return t}()), + // GeoRedundantBackup: to.Ptr(armpostgresql.GeographicallyRedundantBackupDisabled), + // }, + // DataEncryption: &armpostgresql.DataEncryption{ + // Type: to.Ptr(armpostgresql.DataEncryptionTypeAzureKeyVault), + // PrimaryEncryptionKeyStatus: to.Ptr(armpostgresql.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("exampleserver3.postgres.database.azure.com"), + // HighAvailability: &armpostgresql.HighAvailability{ + // Mode: to.Ptr(armpostgresql.FlexibleServerHighAvailabilityModeDisabled), + // State: to.Ptr(armpostgresql.HighAvailabilityStateNotEnabled), + // }, + // MaintenanceWindow: &armpostgresql.MaintenanceWindow{ + // CustomWindow: to.Ptr("Disabled"), + // DayOfWeek: to.Ptr[int32](0), + // StartHour: to.Ptr[int32](0), + // StartMinute: to.Ptr[int32](0), + // }, + // MinorVersion: to.Ptr("5"), + // Network: &armpostgresql.Network{ + // PublicNetworkAccess: to.Ptr(armpostgresql.ServerPublicNetworkAccessStateEnabled), + // }, + // PrivateEndpointConnections: []*armpostgresql.PrivateEndpointConnection{ + // }, + // Replica: &armpostgresql.Replica{ + // Capacity: to.Ptr[int32](5), + // Role: to.Ptr(armpostgresql.ReplicationRolePrimary), + // }, + // ReplicaCapacity: to.Ptr[int32](5), + // ReplicationRole: to.Ptr(armpostgresql.ReplicationRolePrimary), + // State: to.Ptr(armpostgresql.ServerStateReady), + // Storage: &armpostgresql.Storage{ + // Type: to.Ptr(armpostgresql.StorageType("")), + // AutoGrow: to.Ptr(armpostgresql.StorageAutoGrowDisabled), + // Iops: to.Ptr[int32](500), + // StorageSizeGB: to.Ptr[int32](128), + // Tier: to.Ptr(armpostgresql.AzureManagedDiskPerformanceTierP10), + // }, + // Version: to.Ptr(armpostgresql.PostgresMajorVersion17), + // }, + // SKU: &armpostgresql.SKU{ + // Name: to.Ptr("Standard_D4ds_v5"), + // Tier: to.Ptr(armpostgresql.SKUTierGeneralPurpose), // }, - // PublicNetworkAccess: to.Ptr(armpostgresql.PublicNetworkAccessEnumEnabled), - // SSLEnforcement: to.Ptr(armpostgresql.SSLEnforcementEnumEnabled), - // StorageProfile: &armpostgresql.StorageProfile{ - // BackupRetentionDays: to.Ptr[int32](7), - // GeoRedundantBackup: to.Ptr(armpostgresql.GeoRedundantBackupDisabled), - // StorageMB: to.Ptr[int32](128000), + // SystemData: &armpostgresql.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T20:30:22.123456Z"); return t}()), + // }, + // Tags: map[string]*string{ // }, - // UserVisibleState: to.Ptr(armpostgresql.ServerStateReady), - // Version: to.Ptr(armpostgresql.ServerVersionNine6), // }, - // SKU: &armpostgresql.SKU{ - // Name: to.Ptr("B_Gen4_2"), - // Capacity: to.Ptr[int32](2), - // Family: to.Ptr("Gen4"), - // Tier: to.Ptr(armpostgresql.SKUTierBasic), + // { + // Name: to.Ptr("exampleserver4"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup4/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver4"), + // Location: to.Ptr("eastus"), + // Properties: &armpostgresql.ServerProperties{ + // AdministratorLogin: to.Ptr("exampleadministratorlogin"), + // AuthConfig: &armpostgresql.AuthConfig{ + // ActiveDirectoryAuth: to.Ptr(armpostgresql.MicrosoftEntraAuthDisabled), + // PasswordAuth: to.Ptr(armpostgresql.PasswordBasedAuthEnabled), + // }, + // AvailabilityZone: to.Ptr("2"), + // Backup: &armpostgresql.Backup{ + // BackupRetentionDays: to.Ptr[int32](7), + // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T21:35:22.123456Z"); return t}()), + // GeoRedundantBackup: to.Ptr(armpostgresql.GeographicallyRedundantBackupDisabled), + // }, + // DataEncryption: &armpostgresql.DataEncryption{ + // Type: to.Ptr(armpostgresql.DataEncryptionTypeSystemManaged), + // }, + // FullyQualifiedDomainName: to.Ptr("exampleserver4.postgres.database.azure.com"), + // HighAvailability: &armpostgresql.HighAvailability{ + // Mode: to.Ptr(armpostgresql.FlexibleServerHighAvailabilityModeDisabled), + // State: to.Ptr(armpostgresql.HighAvailabilityStateNotEnabled), + // }, + // MaintenanceWindow: &armpostgresql.MaintenanceWindow{ + // CustomWindow: to.Ptr("Disabled"), + // DayOfWeek: to.Ptr[int32](0), + // StartHour: to.Ptr[int32](0), + // StartMinute: to.Ptr[int32](0), + // }, + // MinorVersion: to.Ptr("5"), + // Network: &armpostgresql.Network{ + // PublicNetworkAccess: to.Ptr(armpostgresql.ServerPublicNetworkAccessStateEnabled), + // }, + // PrivateEndpointConnections: []*armpostgresql.PrivateEndpointConnection{ + // }, + // Replica: &armpostgresql.Replica{ + // Capacity: to.Ptr[int32](5), + // Role: to.Ptr(armpostgresql.ReplicationRolePrimary), + // }, + // ReplicaCapacity: to.Ptr[int32](5), + // ReplicationRole: to.Ptr(armpostgresql.ReplicationRolePrimary), + // State: to.Ptr(armpostgresql.ServerStateReady), + // Storage: &armpostgresql.Storage{ + // Type: to.Ptr(armpostgresql.StorageTypePremiumV2LRS), + // AutoGrow: to.Ptr(armpostgresql.StorageAutoGrowDisabled), + // Iops: to.Ptr[int32](3000), + // StorageSizeGB: to.Ptr[int32](512), + // Throughput: to.Ptr[int32](125), + // }, + // Version: to.Ptr(armpostgresql.PostgresMajorVersion17), + // }, + // SKU: &armpostgresql.SKU{ + // Name: to.Ptr("Standard_D4ds_v5"), + // Tier: to.Ptr(armpostgresql.SKUTierGeneralPurpose), + // }, + // SystemData: &armpostgresql.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T21:30:22.123456Z"); return t}()), + // }, + // Tags: map[string]*string{ + // }, // }, - // }}, + // }, + // }, // } } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/ServerRestart.json -func ExampleServersClient_BeginRestart() { +// Generated from example definition: 2025-08-01/ServersRestart.json +func ExampleServersClient_BeginRestart_restartPostgreSqlDatabaseEngineInAServer() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armpostgresql.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewServersClient().BeginRestart(ctx, "exampleresourcegroup", "exampleserver", 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: 2025-08-01/ServersRestartWithFailover.json +func ExampleServersClient_BeginRestart_restartPostgreSqlDatabaseEngineInAServerWithAForcedFailoverToStandbyServer() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armpostgresql.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewServersClient().BeginRestart(ctx, "exampleresourcegroup", "exampleserver", &armpostgresql.ServersClientBeginRestartOptions{ + Parameters: &armpostgresql.RestartParameter{ + FailoverMode: to.Ptr(armpostgresql.FailoverModeForcedFailover), + RestartWithFailover: to.Ptr(true), + }}) + 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: 2025-08-01/ServersStart.json +func ExampleServersClient_BeginStart() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armpostgresql.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewServersClient().BeginStart(ctx, "exampleresourcegroup", "exampleserver", 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: 2025-08-01/ServersStop.json +func ExampleServersClient_BeginStop() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armpostgresql.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewServersClient().BeginStop(ctx, "exampleresourcegroup", "exampleserver", 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: 2025-08-01/ServersPromoteReplicaAsForcedStandaloneServer.json +func ExampleServersClient_BeginUpdate_promoteAReadReplicaToAStandaloneServerWithForcedDataSynchronizationMeaningThatItDoesnTWaitForDataInTheReadReplicaToBeSynchronizedWithItsSourceServerBeforeItInitiatesThePromotionToAStandaloneServer() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armpostgresql.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewServersClient().BeginUpdate(ctx, "exampleresourcegroup", "exampleserver", armpostgresql.ServerForPatch{ + Properties: &armpostgresql.ServerPropertiesForPatch{ + Replica: &armpostgresql.Replica{ + PromoteMode: to.Ptr(armpostgresql.ReadReplicaPromoteModeStandalone), + PromoteOption: to.Ptr(armpostgresql.ReadReplicaPromoteOptionForced), + }, + }, + }, 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: 2025-08-01/ServersPromoteReplicaAsForcedSwitchover.json +func ExampleServersClient_BeginUpdate_switchOverAReadReplicaToPrimaryServerWithForcedDataSynchronizationMeaningThatItDoesnTWaitForDataInTheReadReplicaToBeSynchronizedWithItsSourceServerBeforeItInitiatesTheSwitchingOfRolesBetweenTheReadReplicaAndThePrimaryServer() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armpostgresql.NewClientFactory("", cred, nil) + clientFactory, err := armpostgresql.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewServersClient().BeginRestart(ctx, "TestGroup", "testserver", nil) + poller, err := clientFactory.NewServersClient().BeginUpdate(ctx, "exampleresourcegroup", "exampleserver", armpostgresql.ServerForPatch{ + Properties: &armpostgresql.ServerPropertiesForPatch{ + Replica: &armpostgresql.Replica{ + PromoteMode: to.Ptr(armpostgresql.ReadReplicaPromoteModeSwitchover), + PromoteOption: to.Ptr(armpostgresql.ReadReplicaPromoteOptionForced), + }, + }, + }, 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: 2025-08-01/ServersPromoteReplicaAsPlannedStandaloneServer.json +func ExampleServersClient_BeginUpdate_promoteAReadReplicaToAStandaloneServerWithPlannedDataSynchronizationMeaningThatItWaitsForDataInTheReadReplicaToBeFullySynchronizedWithItsSourceServerBeforeItInitiatesThePromotionToAStandaloneServer() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armpostgresql.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewServersClient().BeginUpdate(ctx, "exampleresourcegroup", "exampleserver", armpostgresql.ServerForPatch{ + Properties: &armpostgresql.ServerPropertiesForPatch{ + Replica: &armpostgresql.Replica{ + PromoteMode: to.Ptr(armpostgresql.ReadReplicaPromoteModeStandalone), + PromoteOption: to.Ptr(armpostgresql.ReadReplicaPromoteOptionPlanned), + }, + }, + }, 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: 2025-08-01/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 := armpostgresql.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewServersClient().BeginUpdate(ctx, "exampleresourcegroup", "exampleserver", armpostgresql.ServerForPatch{ + Properties: &armpostgresql.ServerPropertiesForPatch{ + Replica: &armpostgresql.Replica{ + PromoteMode: to.Ptr(armpostgresql.ReadReplicaPromoteModeSwitchover), + PromoteOption: to.Ptr(armpostgresql.ReadReplicaPromoteOptionPlanned), + }, + }, + }, 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: 2025-08-01/ServersUpdate.json +func ExampleServersClient_BeginUpdate_updateAnExistingServer() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armpostgresql.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewServersClient().BeginUpdate(ctx, "exampleresourcegroup", "exampleserver", armpostgresql.ServerForPatch{ + Properties: &armpostgresql.ServerPropertiesForPatch{ + AdministratorLoginPassword: to.Ptr("examplenewpassword"), + Backup: &armpostgresql.BackupForPatch{ + BackupRetentionDays: to.Ptr[int32](20), + }, + CreateMode: to.Ptr(armpostgresql.CreateModeForPatchUpdate), + Storage: &armpostgresql.Storage{ + AutoGrow: to.Ptr(armpostgresql.StorageAutoGrowEnabled), + StorageSizeGB: to.Ptr[int32](1024), + Tier: to.Ptr(armpostgresql.AzureManagedDiskPerformanceTierP30), + }, + }, + SKU: &armpostgresql.SKUForPatch{ + Name: to.Ptr("Standard_D8s_v3"), + Tier: to.Ptr(armpostgresql.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: 2025-08-01/ServersUpdateWithCustomMaintenanceWindow.json +func ExampleServersClient_BeginUpdate_updateAnExistingServerWithCustomMaintenanceWindow() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armpostgresql.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewServersClient().BeginUpdate(ctx, "exampleresourcegroup", "exampleserver", armpostgresql.ServerForPatch{ + Properties: &armpostgresql.ServerPropertiesForPatch{ + CreateMode: to.Ptr(armpostgresql.CreateModeForPatchUpdate), + MaintenanceWindow: &armpostgresql.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) + } + _, err = poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } +} + +// Generated from example definition: 2025-08-01/ServersUpdateWithDataEncryptionEnabled.json +func ExampleServersClient_BeginUpdate_updateAnExistingServerWithDataEncryptionBasedOnCustomerManagedKey() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armpostgresql.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewServersClient().BeginUpdate(ctx, "exampleresourcegroup", "exampleserver", armpostgresql.ServerForPatch{ + Identity: &armpostgresql.UserAssignedIdentity{ + Type: to.Ptr(armpostgresql.IdentityTypeUserAssigned), + UserAssignedIdentities: map[string]*armpostgresql.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: &armpostgresql.ServerPropertiesForPatch{ + AdministratorLoginPassword: to.Ptr("examplenewpassword"), + Backup: &armpostgresql.BackupForPatch{ + BackupRetentionDays: to.Ptr[int32](20), + }, + CreateMode: to.Ptr(armpostgresql.CreateModeForPatchUpdate), + DataEncryption: &armpostgresql.DataEncryption{ + Type: to.Ptr(armpostgresql.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: &armpostgresql.SKUForPatch{ + Name: to.Ptr("Standard_D8s_v3"), + Tier: to.Ptr(armpostgresql.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: 2025-08-01/ServersUpdateWithDataEncryptionEnabledAutoUpdate.json +func ExampleServersClient_BeginUpdate_updateAnExistingServerWithDataEncryptionBasedOnCustomerManagedKeyWithAutomaticKeyVersionUpdate() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armpostgresql.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewServersClient().BeginUpdate(ctx, "exampleresourcegroup", "exampleserver", armpostgresql.ServerForPatch{ + Identity: &armpostgresql.UserAssignedIdentity{ + Type: to.Ptr(armpostgresql.IdentityTypeUserAssigned), + UserAssignedIdentities: map[string]*armpostgresql.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: &armpostgresql.ServerPropertiesForPatch{ + AdministratorLoginPassword: to.Ptr("examplenewpassword"), + Backup: &armpostgresql.BackupForPatch{ + BackupRetentionDays: to.Ptr[int32](20), + }, + CreateMode: to.Ptr(armpostgresql.CreateModeForPatchUpdate), + DataEncryption: &armpostgresql.DataEncryption{ + Type: to.Ptr(armpostgresql.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: &armpostgresql.SKUForPatch{ + Name: to.Ptr("Standard_D8s_v3"), + Tier: to.Ptr(armpostgresql.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: 2025-08-01/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 := armpostgresql.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewServersClient().BeginUpdate(ctx, "exampleresourcegroup", "exampleserver", armpostgresql.ServerForPatch{ + Properties: &armpostgresql.ServerPropertiesForPatch{ + CreateMode: to.Ptr(armpostgresql.CreateModeForPatchUpdate), + Version: to.Ptr(armpostgresql.PostgresMajorVersion17), + }, + }, 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: 2025-08-01/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 := armpostgresql.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewServersClient().BeginUpdate(ctx, "exampleresourcegroup", "exampleserver", armpostgresql.ServerForPatch{ + Properties: &armpostgresql.ServerPropertiesForPatch{ + AdministratorLoginPassword: to.Ptr("examplenewpassword"), + AuthConfig: &armpostgresql.AuthConfigForPatch{ + ActiveDirectoryAuth: to.Ptr(armpostgresql.MicrosoftEntraAuthEnabled), + PasswordAuth: to.Ptr(armpostgresql.PasswordBasedAuthEnabled), + TenantID: to.Ptr("tttttt-tttt-tttt-tttt-tttttttttttt"), + }, + Backup: &armpostgresql.BackupForPatch{ + BackupRetentionDays: to.Ptr[int32](20), + }, + CreateMode: to.Ptr(armpostgresql.CreateModeForPatchUpdate), + Storage: &armpostgresql.Storage{ + AutoGrow: to.Ptr(armpostgresql.StorageAutoGrowDisabled), + StorageSizeGB: to.Ptr[int32](1024), + Tier: to.Ptr(armpostgresql.AzureManagedDiskPerformanceTierP30), + }, + }, + SKU: &armpostgresql.SKUForPatch{ + Name: to.Ptr("Standard_D8s_v3"), + Tier: to.Ptr(armpostgresql.SKUTierGeneralPurpose), + }, + }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } diff --git a/sdk/resourcemanager/postgresql/armpostgresql/serversecurityalertpolicies_client.go b/sdk/resourcemanager/postgresql/armpostgresql/serversecurityalertpolicies_client.go deleted file mode 100644 index d066ad941f7b..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresql/serversecurityalertpolicies_client.go +++ /dev/null @@ -1,261 +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 armpostgresql - -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" -) - -// ServerSecurityAlertPoliciesClient contains the methods for the ServerSecurityAlertPolicies group. -// Don't use this type directly, use NewServerSecurityAlertPoliciesClient() instead. -type ServerSecurityAlertPoliciesClient struct { - internal *arm.Client - subscriptionID string -} - -// NewServerSecurityAlertPoliciesClient creates a new instance of ServerSecurityAlertPoliciesClient with the specified values. -// - subscriptionID - The ID of the target subscription. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewServerSecurityAlertPoliciesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ServerSecurityAlertPoliciesClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &ServerSecurityAlertPoliciesClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// BeginCreateOrUpdate - Creates or updates a threat detection policy. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2017-12-01 -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - serverName - The name of the server. -// - securityAlertPolicyName - The name of the threat detection policy. -// - parameters - The server security alert policy. -// - options - ServerSecurityAlertPoliciesClientBeginCreateOrUpdateOptions contains the optional parameters for the ServerSecurityAlertPoliciesClient.BeginCreateOrUpdate -// method. -func (client *ServerSecurityAlertPoliciesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, securityAlertPolicyName SecurityAlertPolicyName, parameters ServerSecurityAlertPolicy, options *ServerSecurityAlertPoliciesClientBeginCreateOrUpdateOptions) (*runtime.Poller[ServerSecurityAlertPoliciesClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, serverName, securityAlertPolicyName, parameters, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ServerSecurityAlertPoliciesClientCreateOrUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ServerSecurityAlertPoliciesClientCreateOrUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// CreateOrUpdate - Creates or updates a threat detection policy. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2017-12-01 -func (client *ServerSecurityAlertPoliciesClient) createOrUpdate(ctx context.Context, resourceGroupName string, serverName string, securityAlertPolicyName SecurityAlertPolicyName, parameters ServerSecurityAlertPolicy, options *ServerSecurityAlertPoliciesClientBeginCreateOrUpdateOptions) (*http.Response, error) { - var err error - const operationName = "ServerSecurityAlertPoliciesClient.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.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, securityAlertPolicyName, 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 -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *ServerSecurityAlertPoliciesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, serverName string, securityAlertPolicyName SecurityAlertPolicyName, parameters ServerSecurityAlertPolicy, options *ServerSecurityAlertPoliciesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/securityAlertPolicies/{securityAlertPolicyName}" - 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 securityAlertPolicyName == "" { - return nil, errors.New("parameter securityAlertPolicyName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{securityAlertPolicyName}", url.PathEscape(string(securityAlertPolicyName))) - 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.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2017-12-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 - Get a server's security alert policy. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2017-12-01 -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - serverName - The name of the server. -// - securityAlertPolicyName - The name of the security alert policy. -// - options - ServerSecurityAlertPoliciesClientGetOptions contains the optional parameters for the ServerSecurityAlertPoliciesClient.Get -// method. -func (client *ServerSecurityAlertPoliciesClient) Get(ctx context.Context, resourceGroupName string, serverName string, securityAlertPolicyName SecurityAlertPolicyName, options *ServerSecurityAlertPoliciesClientGetOptions) (ServerSecurityAlertPoliciesClientGetResponse, error) { - var err error - const operationName = "ServerSecurityAlertPoliciesClient.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, securityAlertPolicyName, options) - if err != nil { - return ServerSecurityAlertPoliciesClientGetResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return ServerSecurityAlertPoliciesClientGetResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return ServerSecurityAlertPoliciesClientGetResponse{}, err - } - resp, err := client.getHandleResponse(httpResp) - return resp, err -} - -// getCreateRequest creates the Get request. -func (client *ServerSecurityAlertPoliciesClient) getCreateRequest(ctx context.Context, resourceGroupName string, serverName string, securityAlertPolicyName SecurityAlertPolicyName, options *ServerSecurityAlertPoliciesClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/securityAlertPolicies/{securityAlertPolicyName}" - 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 securityAlertPolicyName == "" { - return nil, errors.New("parameter securityAlertPolicyName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{securityAlertPolicyName}", url.PathEscape(string(securityAlertPolicyName))) - 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.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2017-12-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *ServerSecurityAlertPoliciesClient) getHandleResponse(resp *http.Response) (ServerSecurityAlertPoliciesClientGetResponse, error) { - result := ServerSecurityAlertPoliciesClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ServerSecurityAlertPolicy); err != nil { - return ServerSecurityAlertPoliciesClientGetResponse{}, err - } - return result, nil -} - -// NewListByServerPager - Get the server's threat detection policies. -// -// Generated from API version 2017-12-01 -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - serverName - The name of the server. -// - options - ServerSecurityAlertPoliciesClientListByServerOptions contains the optional parameters for the ServerSecurityAlertPoliciesClient.NewListByServerPager -// method. -func (client *ServerSecurityAlertPoliciesClient) NewListByServerPager(resourceGroupName string, serverName string, options *ServerSecurityAlertPoliciesClientListByServerOptions) *runtime.Pager[ServerSecurityAlertPoliciesClientListByServerResponse] { - return runtime.NewPager(runtime.PagingHandler[ServerSecurityAlertPoliciesClientListByServerResponse]{ - More: func(page ServerSecurityAlertPoliciesClientListByServerResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *ServerSecurityAlertPoliciesClientListByServerResponse) (ServerSecurityAlertPoliciesClientListByServerResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "ServerSecurityAlertPoliciesClient.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 ServerSecurityAlertPoliciesClientListByServerResponse{}, err - } - return client.listByServerHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listByServerCreateRequest creates the ListByServer request. -func (client *ServerSecurityAlertPoliciesClient) listByServerCreateRequest(ctx context.Context, resourceGroupName string, serverName string, options *ServerSecurityAlertPoliciesClientListByServerOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/securityAlertPolicies" - 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 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.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2017-12-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listByServerHandleResponse handles the ListByServer response. -func (client *ServerSecurityAlertPoliciesClient) listByServerHandleResponse(resp *http.Response) (ServerSecurityAlertPoliciesClientListByServerResponse, error) { - result := ServerSecurityAlertPoliciesClientListByServerResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ServerSecurityAlertPolicyListResult); err != nil { - return ServerSecurityAlertPoliciesClientListByServerResponse{}, err - } - return result, nil -} diff --git a/sdk/resourcemanager/postgresql/armpostgresql/serversecurityalertpolicies_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresql/serversecurityalertpolicies_client_example_test.go index 0fd29dfb552e..0fa20a0358cd 100644 --- a/sdk/resourcemanager/postgresql/armpostgresql/serversecurityalertpolicies_client_example_test.go +++ b/sdk/resourcemanager/postgresql/armpostgresql/serversecurityalertpolicies_client_example_test.go @@ -12,7 +12,7 @@ import ( "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/armpostgresql" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresql/v2" ) // Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/ServerSecurityAlertsGet.json @@ -66,13 +66,13 @@ func ExampleServerSecurityAlertPoliciesClient_BeginCreateOrUpdate_updateAServers DisabledAlerts: []*string{ to.Ptr("Access_Anomaly"), to.Ptr("Usage_Anomaly")}, - EmailAccountAdmins: to.Ptr(true), + EmailAccountAdmins: to.Ptr(true), EmailAddresses: []*string{ to.Ptr("testSecurityAlert@microsoft.com")}, - RetentionDays: to.Ptr[int32](5), - State: to.Ptr(armpostgresql.ServerSecurityAlertPolicyStateEnabled), - StorageAccountAccessKey: to.Ptr("sdlfkjabc+sdlfkjsdlkfsjdfLDKFTERLKFDFKLjsdfksjdflsdkfD2342309432849328476458/3RSD=="), - StorageEndpoint: to.Ptr("https://mystorage.blob.core.windows.net"), + RetentionDays: to.Ptr[int32](5), + State: to.Ptr(armpostgresql.ServerSecurityAlertPolicyStateEnabled), + StorageAccountAccessKey: to.Ptr("sdlfkjabc+sdlfkjsdlkfsjdfLDKFTERLKFDFKLjsdfksjdflsdkfD2342309432849328476458/3RSD=="), + StorageEndpoint: to.Ptr("https://mystorage.blob.core.windows.net"), }, }, nil) if err != nil { @@ -116,8 +116,8 @@ func ExampleServerSecurityAlertPoliciesClient_BeginCreateOrUpdate_updateAServers } poller, err := clientFactory.NewServerSecurityAlertPoliciesClient().BeginCreateOrUpdate(ctx, "securityalert-4799", "securityalert-6440", armpostgresql.SecurityAlertPolicyNameDefault, armpostgresql.ServerSecurityAlertPolicy{ Properties: &armpostgresql.SecurityAlertPolicyProperties{ - EmailAccountAdmins: to.Ptr(true), - State: to.Ptr(armpostgresql.ServerSecurityAlertPolicyStateDisabled), + EmailAccountAdmins: to.Ptr(true), + State: to.Ptr(armpostgresql.ServerSecurityAlertPolicyStateDisabled), }, }, nil) if err != nil { diff --git a/sdk/resourcemanager/postgresql/armpostgresql/serversecurityalertpolicies_live_test.go b/sdk/resourcemanager/postgresql/armpostgresql/serversecurityalertpolicies_live_test.go index 92732279ff5e..e3b98875ec00 100644 --- a/sdk/resourcemanager/postgresql/armpostgresql/serversecurityalertpolicies_live_test.go +++ b/sdk/resourcemanager/postgresql/armpostgresql/serversecurityalertpolicies_live_test.go @@ -13,21 +13,21 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/internal/recording" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3/testutil" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresql" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresql/v2" "github.com/stretchr/testify/suite" ) type ServerSecurityAlertPoliciesTestSuite struct { suite.Suite - ctx context.Context - cred azcore.TokenCredential - options *arm.ClientOptions - serverName string - adminPassword string - location string - resourceGroupName string - subscriptionId string + ctx context.Context + cred azcore.TokenCredential + options *arm.ClientOptions + serverName string + adminPassword string + location string + resourceGroupName string + subscriptionId string } func (testsuite *ServerSecurityAlertPoliciesTestSuite) SetupSuite() { @@ -63,23 +63,23 @@ func (testsuite *ServerSecurityAlertPoliciesTestSuite) Prepare() { serversClient, err := armpostgresql.NewServersClient(testsuite.subscriptionId, testsuite.cred, testsuite.options) testsuite.Require().NoError(err) serversClientCreateResponsePoller, err := serversClient.BeginCreate(testsuite.ctx, testsuite.resourceGroupName, testsuite.serverName, armpostgresql.ServerForCreate{ - Location: to.Ptr(testsuite.location), + Location: to.Ptr(testsuite.location), Properties: &armpostgresql.ServerPropertiesForDefaultCreate{ - CreateMode: to.Ptr(armpostgresql.CreateModeDefault), - MinimalTLSVersion: to.Ptr(armpostgresql.MinimalTLSVersionEnumTLS12), - SSLEnforcement: to.Ptr(armpostgresql.SSLEnforcementEnumEnabled), + CreateMode: to.Ptr(armpostgresql.CreateModeDefault), + MinimalTLSVersion: to.Ptr(armpostgresql.MinimalTLSVersionEnumTLS12), + SSLEnforcement: to.Ptr(armpostgresql.SSLEnforcementEnumEnabled), StorageProfile: &armpostgresql.StorageProfile{ - BackupRetentionDays: to.Ptr[int32](7), - GeoRedundantBackup: to.Ptr(armpostgresql.GeoRedundantBackupDisabled), - StorageMB: to.Ptr[int32](128000), + BackupRetentionDays: to.Ptr[int32](7), + GeoRedundantBackup: to.Ptr(armpostgresql.GeoRedundantBackupDisabled), + StorageMB: to.Ptr[int32](128000), }, - AdministratorLogin: to.Ptr("cloudsa"), - AdministratorLoginPassword: to.Ptr(testsuite.adminPassword), + AdministratorLogin: to.Ptr("cloudsa"), + AdministratorLoginPassword: to.Ptr(testsuite.adminPassword), }, SKU: &armpostgresql.SKU{ - Name: to.Ptr("GP_Gen5_8"), - Family: to.Ptr("Gen5"), - Tier: to.Ptr(armpostgresql.SKUTierGeneralPurpose), + Name: to.Ptr("GP_Gen5_8"), + Family: to.Ptr("Gen5"), + Tier: to.Ptr(armpostgresql.SKUTierGeneralPurpose), }, Tags: map[string]*string{ "ElasticServer": to.Ptr("1"), @@ -99,8 +99,8 @@ func (testsuite *ServerSecurityAlertPoliciesTestSuite) TestServerSecurityAlertPo testsuite.Require().NoError(err) serverSecurityAlertPoliciesClientCreateOrUpdateResponsePoller, err := serverSecurityAlertPoliciesClient.BeginCreateOrUpdate(testsuite.ctx, testsuite.resourceGroupName, testsuite.serverName, armpostgresql.SecurityAlertPolicyNameDefault, armpostgresql.ServerSecurityAlertPolicy{ Properties: &armpostgresql.SecurityAlertPolicyProperties{ - EmailAccountAdmins: to.Ptr(true), - State: to.Ptr(armpostgresql.ServerSecurityAlertPolicyStateDisabled), + EmailAccountAdmins: to.Ptr(true), + State: to.Ptr(armpostgresql.ServerSecurityAlertPolicyStateDisabled), }, }, nil) testsuite.Require().NoError(err) diff --git a/sdk/resourcemanager/postgresql/armpostgresql/serverthreatprotectionsettings_client.go b/sdk/resourcemanager/postgresql/armpostgresql/serverthreatprotectionsettings_client.go new file mode 100644 index 000000000000..5de36c9b6ae9 --- /dev/null +++ b/sdk/resourcemanager/postgresql/armpostgresql/serverthreatprotectionsettings_client.go @@ -0,0 +1,126 @@ +// 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) Go Code Generator. DO NOT EDIT. + +package armpostgresql + +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" +) + +// ServerThreatProtectionSettingsClient contains the methods for the ServerThreatProtectionSettings group. +// Don't use this type directly, use NewServerThreatProtectionSettingsClient() instead. +type ServerThreatProtectionSettingsClient struct { + internal *arm.Client + subscriptionID string +} + +// 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 - 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 { + return nil, err + } + client := &ServerThreatProtectionSettingsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// 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-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serverName - The name of the 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 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 { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ServerThreatProtectionSettingsClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ServerThreatProtectionSettingsClientCreateOrUpdateResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// 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-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) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, threatProtectionName, 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 +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +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") + } + 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.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["Content-Type"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} diff --git a/sdk/resourcemanager/postgresql/armpostgresql/serverthreatprotectionsettings_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresql/serverthreatprotectionsettings_client_example_test.go new file mode 100644 index 000000000000..a5d235bb79ac --- /dev/null +++ b/sdk/resourcemanager/postgresql/armpostgresql/serverthreatprotectionsettings_client_example_test.go @@ -0,0 +1,38 @@ +// 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) Go Code Generator. DO NOT EDIT. + +package armpostgresql_test + +import ( + "context" + "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/armpostgresql/v2" + "log" +) + +// Generated from example definition: 2025-08-01/AdvancedThreatProtectionSettingsCreateOrUpdate.json +func ExampleServerThreatProtectionSettingsClient_BeginCreateOrUpdate() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armpostgresql.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewServerThreatProtectionSettingsClient().BeginCreateOrUpdate(ctx, "exampleresourcegroup", "exampleserver", armpostgresql.ThreatProtectionNameDefault, armpostgresql.AdvancedThreatProtectionSettingsModel{ + Properties: &armpostgresql.AdvancedThreatProtectionSettingsProperties{ + State: to.Ptr(armpostgresql.ThreatProtectionStateEnabled), + }, + }, 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/armpostgresql/testdata/_metadata.json b/sdk/resourcemanager/postgresql/armpostgresql/testdata/_metadata.json new file mode 100644 index 000000000000..f048a0dd49fc --- /dev/null +++ b/sdk/resourcemanager/postgresql/armpostgresql/testdata/_metadata.json @@ -0,0 +1,4 @@ +{ + "apiVersion": "2025-08-01", + "emitterVersion": "0.8.6" +} \ No newline at end of file diff --git a/sdk/resourcemanager/postgresql/armpostgresql/time_rfc3339.go b/sdk/resourcemanager/postgresql/armpostgresql/time_rfc3339.go index bc13c86af717..79a930516eda 100644 --- a/sdk/resourcemanager/postgresql/armpostgresql/time_rfc3339.go +++ b/sdk/resourcemanager/postgresql/armpostgresql/time_rfc3339.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armpostgresql @@ -16,12 +15,16 @@ import ( ) // Azure reports time in UTC but it doesn't include the 'Z' time zone suffix in some cases. -var tzOffsetRegex = regexp.MustCompile(`(Z|z|\+|-)(\d+:\d+)*"*$`) +var tzOffsetRegex = regexp.MustCompile(`(?:Z|z|\+|-)(?:\d+:\d+)*"*$`) const ( - utcDateTimeJSON = `"2006-01-02T15:04:05.999999999"` - utcDateTime = "2006-01-02T15:04:05.999999999" - dateTimeJSON = `"` + time.RFC3339Nano + `"` + utcDateTime = "2006-01-02T15:04:05.999999999" + utcDateTimeJSON = `"` + utcDateTime + `"` + utcDateTimeNoT = "2006-01-02 15:04:05.999999999" + utcDateTimeJSONNoT = `"` + utcDateTimeNoT + `"` + dateTimeNoT = `2006-01-02 15:04:05.999999999Z07:00` + dateTimeJSON = `"` + time.RFC3339Nano + `"` + dateTimeJSONNoT = `"` + dateTimeNoT + `"` ) type dateTimeRFC3339 time.Time @@ -37,17 +40,36 @@ func (t dateTimeRFC3339) MarshalText() ([]byte, error) { } func (t *dateTimeRFC3339) UnmarshalJSON(data []byte) error { - layout := utcDateTimeJSON - if tzOffsetRegex.Match(data) { + tzOffset := tzOffsetRegex.Match(data) + hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t") + var layout string + if tzOffset && hasT { layout = dateTimeJSON + } else if tzOffset { + layout = dateTimeJSONNoT + } else if hasT { + layout = utcDateTimeJSON + } else { + layout = utcDateTimeJSONNoT } return t.Parse(layout, string(data)) } func (t *dateTimeRFC3339) UnmarshalText(data []byte) error { - layout := utcDateTime - if tzOffsetRegex.Match(data) { + if len(data) == 0 { + return nil + } + tzOffset := tzOffsetRegex.Match(data) + hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t") + var layout string + if tzOffset && hasT { layout = time.RFC3339Nano + } else if tzOffset { + layout = dateTimeNoT + } else if hasT { + layout = utcDateTime + } else { + layout = utcDateTimeNoT } return t.Parse(layout, string(data)) } @@ -58,6 +80,10 @@ func (t *dateTimeRFC3339) Parse(layout, value string) error { return err } +func (t dateTimeRFC3339) String() string { + return time.Time(t).Format(time.RFC3339Nano) +} + func populateDateTimeRFC3339(m map[string]any, k string, t *time.Time) { if t == nil { return @@ -71,7 +97,7 @@ func populateDateTimeRFC3339(m map[string]any, k string, t *time.Time) { } func unpopulateDateTimeRFC3339(data json.RawMessage, fn string, t **time.Time) error { - if data == nil || strings.EqualFold(string(data), "null") { + if data == nil || string(data) == "null" { return nil } var aux dateTimeRFC3339 diff --git a/sdk/resourcemanager/postgresql/armpostgresql/tsp-location.yaml b/sdk/resourcemanager/postgresql/armpostgresql/tsp-location.yaml new file mode 100644 index 000000000000..ac6313365425 --- /dev/null +++ b/sdk/resourcemanager/postgresql/armpostgresql/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/postgresql/DBforPostgreSQL.Management +commit: fc6c9fd708a8fd0cc532cfe78fb844d835884cee +repo: i-specs +additionalDirectories: diff --git a/sdk/resourcemanager/postgresql/armpostgresql/tuningoptions_client.go b/sdk/resourcemanager/postgresql/armpostgresql/tuningoptions_client.go new file mode 100644 index 000000000000..94bef4b3588a --- /dev/null +++ b/sdk/resourcemanager/postgresql/armpostgresql/tuningoptions_client.go @@ -0,0 +1,247 @@ +// 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) Go Code Generator. DO NOT EDIT. + +package armpostgresql + +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" +) + +// TuningOptionsClient contains the methods for the TuningOptions group. +// Don't use this type directly, use NewTuningOptionsClient() instead. +type TuningOptionsClient struct { + internal *arm.Client + subscriptionID string +} + +// 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 - 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 { + return nil, err + } + client := &TuningOptionsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// Get - Gets the tuning options of 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. +// - 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 TuningOptionParameterEnum, options *TuningOptionsClientGetOptions) (TuningOptionsClientGetResponse, error) { + var err error + const operationName = "TuningOptionsClient.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, tuningOption, options) + if err != nil { + return TuningOptionsClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return TuningOptionsClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return TuningOptionsClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +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") + } + 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") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *TuningOptionsClient) getHandleResponse(resp *http.Response) (TuningOptionsClientGetResponse, error) { + result := TuningOptionsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.TuningOptions); err != nil { + return TuningOptionsClientGetResponse{}, err + } + return result, nil +} + +// NewListByServerPager - Lists the tuning options of 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 - TuningOptionsClientListByServerOptions contains the optional parameters for the TuningOptionsClient.NewListByServerPager +// method. +func (client *TuningOptionsClient) NewListByServerPager(resourceGroupName string, serverName string, options *TuningOptionsClientListByServerOptions) *runtime.Pager[TuningOptionsClientListByServerResponse] { + return runtime.NewPager(runtime.PagingHandler[TuningOptionsClientListByServerResponse]{ + More: func(page TuningOptionsClientListByServerResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *TuningOptionsClientListByServerResponse) (TuningOptionsClientListByServerResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "TuningOptionsClient.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 TuningOptionsClientListByServerResponse{}, err + } + return client.listByServerHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listByServerCreateRequest creates the ListByServer request. +func (client *TuningOptionsClient) listByServerCreateRequest(ctx context.Context, resourceGroupName string, serverName string, _ *TuningOptionsClientListByServerOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/tuningOptions" + 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 *TuningOptionsClient) listByServerHandleResponse(resp *http.Response) (TuningOptionsClientListByServerResponse, error) { + result := TuningOptionsClientListByServerResponse{} + 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/armpostgresql/tuningoptions_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresql/tuningoptions_client_example_test.go new file mode 100644 index 000000000000..145fba71b20f --- /dev/null +++ b/sdk/resourcemanager/postgresql/armpostgresql/tuningoptions_client_example_test.go @@ -0,0 +1,575 @@ +// 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) Go Code Generator. DO NOT EDIT. + +package armpostgresql_test + +import ( + "context" + "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/armpostgresql/v2" + "log" +) + +// Generated from example definition: 2025-08-01/TuningOptionsGet.json +func ExampleTuningOptionsClient_Get() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armpostgresql.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewTuningOptionsClient().Get(ctx, "exampleresourcegroup", "exampleserver", armpostgresql.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 = armpostgresql.TuningOptionsClientGetResponse{ + // TuningOptions: &armpostgresql.TuningOptions{ + // Name: to.Ptr("index"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/tuningoptions"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/tuningoptions/index"), + // }, + // } +} + +// Generated from example definition: 2025-08-01/TuningOptionsListByServer.json +func ExampleTuningOptionsClient_NewListByServerPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armpostgresql.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewTuningOptionsClient().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 = armpostgresql.TuningOptionsClientListByServerResponse{ + // TuningOptionsList: armpostgresql.TuningOptionsList{ + // Value: []*armpostgresql.TuningOptions{ + // { + // Name: to.Ptr("index"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/tuningoptions"), + // 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"), + // }, + // }, + // }, + // } + } +} + +// Generated from example definition: 2025-08-01/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 := armpostgresql.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewTuningOptionsClient().NewListRecommendationsPager("exampleresourcegroup", "exampleserver", armpostgresql.TuningOptionParameterEnumIndex, 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 = armpostgresql.TuningOptionsClientListRecommendationsResponse{ + // ObjectRecommendationList: armpostgresql.ObjectRecommendationList{ + // Value: []*armpostgresql.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: &armpostgresql.ObjectRecommendationProperties{ + // AnalyzedWorkload: &armpostgresql.ObjectRecommendationPropertiesAnalyzedWorkload{ + // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T20:30:22.123456Z"); return t}()), + // QueryCount: to.Ptr[int32](25), + // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T19:30:22.123456Z"); return t}()), + // }, + // EstimatedImpact: []*armpostgresql.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: &armpostgresql.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.123456Z"); return t}()), + // LastRecommendedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T20:30:22.123456Z"); 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(armpostgresql.RecommendationTypeEnumCreateIndex), + // TimesRecommended: to.Ptr[int32](1), + // Details: &armpostgresql.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: &armpostgresql.ObjectRecommendationProperties{ + // AnalyzedWorkload: &armpostgresql.ObjectRecommendationPropertiesAnalyzedWorkload{ + // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T20:30:22.123456Z"); return t}()), + // QueryCount: to.Ptr[int32](25), + // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T19:30:22.123456Z"); return t}()), + // }, + // EstimatedImpact: []*armpostgresql.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: &armpostgresql.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.123456Z"); return t}()), + // LastRecommendedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T20:30:22.123456Z"); 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(armpostgresql.RecommendationTypeEnumCreateIndex), + // TimesRecommended: to.Ptr[int32](1), + // Details: &armpostgresql.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: 2025-08-01/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 := armpostgresql.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewTuningOptionsClient().NewListRecommendationsPager("exampleresourcegroup", "exampleserver", armpostgresql.TuningOptionParameterEnumIndex, &armpostgresql.TuningOptionsClientListRecommendationsOptions{ + RecommendationType: to.Ptr(armpostgresql.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 = armpostgresql.TuningOptionsClientListRecommendationsResponse{ + // ObjectRecommendationList: armpostgresql.ObjectRecommendationList{ + // Value: []*armpostgresql.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: &armpostgresql.ObjectRecommendationProperties{ + // AnalyzedWorkload: &armpostgresql.ObjectRecommendationPropertiesAnalyzedWorkload{ + // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T20:30:22.123456Z"); return t}()), + // QueryCount: to.Ptr[int32](25), + // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T19:30:22.123456Z"); return t}()), + // }, + // EstimatedImpact: []*armpostgresql.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: &armpostgresql.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.123456Z"); return t}()), + // LastRecommendedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T20:30:22.123456Z"); 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(armpostgresql.RecommendationTypeEnumCreateIndex), + // TimesRecommended: to.Ptr[int32](1), + // Details: &armpostgresql.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: &armpostgresql.ObjectRecommendationProperties{ + // AnalyzedWorkload: &armpostgresql.ObjectRecommendationPropertiesAnalyzedWorkload{ + // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T20:30:22.123456Z"); return t}()), + // QueryCount: to.Ptr[int32](25), + // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T19:30:22.123456Z"); return t}()), + // }, + // EstimatedImpact: []*armpostgresql.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: &armpostgresql.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.123456Z"); return t}()), + // LastRecommendedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T20:30:22.123456Z"); 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(armpostgresql.RecommendationTypeEnumCreateIndex), + // TimesRecommended: to.Ptr[int32](1), + // Details: &armpostgresql.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: 2025-08-01/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 := armpostgresql.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewTuningOptionsClient().NewListRecommendationsPager("exampleresourcegroup", "exampleserver", armpostgresql.TuningOptionParameterEnumTable, 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 = armpostgresql.TuningOptionsClientListRecommendationsResponse{ + // ObjectRecommendationList: armpostgresql.ObjectRecommendationList{ + // Value: []*armpostgresql.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: &armpostgresql.ObjectRecommendationProperties{ + // AnalyzedWorkload: &armpostgresql.ObjectRecommendationPropertiesAnalyzedWorkload{ + // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T20:30:22.123456Z"); return t}()), + // QueryCount: to.Ptr[int32](22), + // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T19:30:22.123456Z"); return t}()), + // }, + // EstimatedImpact: []*armpostgresql.ImpactRecord{ + // }, + // ImplementationDetails: &armpostgresql.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.123456Z"); return t}()), + // LastRecommendedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T20:30:22.123456Z"); 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(armpostgresql.RecommendationTypeEnum("Analyze")), + // TimesRecommended: to.Ptr[int32](1), + // Details: &armpostgresql.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: &armpostgresql.ObjectRecommendationProperties{ + // AnalyzedWorkload: &armpostgresql.ObjectRecommendationPropertiesAnalyzedWorkload{ + // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T20:30:22.123456Z"); return t}()), + // QueryCount: to.Ptr[int32](22), + // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T19:30:22.123456Z"); return t}()), + // }, + // EstimatedImpact: []*armpostgresql.ImpactRecord{ + // }, + // ImplementationDetails: &armpostgresql.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.123456Z"); return t}()), + // LastRecommendedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T20:30:22.123456Z"); return t}()), + // RecommendationReason: to.Ptr("Table \"region\" in schema \"public\" is unanalyzed and appears in the following queries: 3219604056681277471, 6171467644166224729, -4753875211349607298"), + // RecommendationType: to.Ptr(armpostgresql.RecommendationTypeEnum("Analyze")), + // TimesRecommended: to.Ptr[int32](1), + // Details: &armpostgresql.ObjectRecommendationDetails{ + // Schema: to.Ptr("public"), + // DatabaseName: to.Ptr("postgres"), + // Table: to.Ptr("region"), + // }, + // }, + // }, + // }, + // }, + // } + } +} + +// Generated from example definition: 2025-08-01/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 := armpostgresql.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewTuningOptionsClient().NewListRecommendationsPager("exampleresourcegroup", "exampleserver", armpostgresql.TuningOptionParameterEnumTable, &armpostgresql.TuningOptionsClientListRecommendationsOptions{ + RecommendationType: to.Ptr(armpostgresql.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 = armpostgresql.TuningOptionsClientListRecommendationsResponse{ + // ObjectRecommendationList: armpostgresql.ObjectRecommendationList{ + // Value: []*armpostgresql.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: &armpostgresql.ObjectRecommendationProperties{ + // AnalyzedWorkload: &armpostgresql.ObjectRecommendationPropertiesAnalyzedWorkload{ + // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T20:30:22.123456Z"); return t}()), + // QueryCount: to.Ptr[int32](22), + // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T19:30:22.123456Z"); return t}()), + // }, + // EstimatedImpact: []*armpostgresql.ImpactRecord{ + // }, + // ImplementationDetails: &armpostgresql.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.123456Z"); return t}()), + // LastRecommendedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T20:30:22.123456Z"); 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(armpostgresql.RecommendationTypeEnum("Analyze")), + // TimesRecommended: to.Ptr[int32](1), + // Details: &armpostgresql.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: &armpostgresql.ObjectRecommendationProperties{ + // AnalyzedWorkload: &armpostgresql.ObjectRecommendationPropertiesAnalyzedWorkload{ + // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T20:30:22.123456Z"); return t}()), + // QueryCount: to.Ptr[int32](22), + // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T19:30:22.123456Z"); return t}()), + // }, + // EstimatedImpact: []*armpostgresql.ImpactRecord{ + // }, + // ImplementationDetails: &armpostgresql.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.123456Z"); return t}()), + // LastRecommendedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T20:30:22.123456Z"); return t}()), + // RecommendationReason: to.Ptr("Table \"region\" in schema \"public\" is unanalyzed and appears in the following queries: 3219604056681277471, 6171467644166224729, -4753875211349607298"), + // RecommendationType: to.Ptr(armpostgresql.RecommendationTypeEnum("Analyze")), + // TimesRecommended: to.Ptr[int32](1), + // Details: &armpostgresql.ObjectRecommendationDetails{ + // Schema: to.Ptr("public"), + // DatabaseName: to.Ptr("postgres"), + // Table: to.Ptr("region"), + // }, + // }, + // }, + // }, + // }, + // } + } +} diff --git a/sdk/resourcemanager/postgresql/armpostgresql/version.go b/sdk/resourcemanager/postgresql/armpostgresql/version.go new file mode 100644 index 000000000000..2039e78d0008 --- /dev/null +++ b/sdk/resourcemanager/postgresql/armpostgresql/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) Go Code Generator. + +package armpostgresql + +const ( + moduleName = "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresql" + moduleVersion = "v2.0.0" +) diff --git a/sdk/resourcemanager/postgresql/armpostgresql/virtualendpoints_client.go b/sdk/resourcemanager/postgresql/armpostgresql/virtualendpoints_client.go new file mode 100644 index 000000000000..2247a2fedf6f --- /dev/null +++ b/sdk/resourcemanager/postgresql/armpostgresql/virtualendpoints_client.go @@ -0,0 +1,426 @@ +// 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) Go Code Generator. DO NOT EDIT. + +package armpostgresql + +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" +) + +// VirtualEndpointsClient contains the methods for the VirtualEndpoints group. +// Don't use this type directly, use NewVirtualEndpointsClient() instead. +type VirtualEndpointsClient struct { + internal *arm.Client + subscriptionID string +} + +// 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 - 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 { + return nil, err + } + client := &VirtualEndpointsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// 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-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serverName - The name of the server. +// - 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 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 { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualEndpointsClientCreateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualEndpointsClientCreateResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// 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-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) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.createCreateRequest(ctx, resourceGroupName, serverName, virtualEndpointName, 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 +} + +// createCreateRequest creates the Create request. +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") + } + 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 virtualEndpointName == "" { + return nil, errors.New("parameter virtualEndpointName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{virtualEndpointName}", url.PathEscape(virtualEndpointName)) + 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["Content-Type"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} + +// BeginDelete - Deletes a pair of virtual endpoints. +// 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. +// - 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) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, serverName, virtualEndpointName, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualEndpointsClientDeleteResponse]{ + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualEndpointsClientDeleteResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// Delete - Deletes a pair of virtual endpoints. +// If the operation fails it returns an *azcore.ResponseError type. +// +// 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" + 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, virtualEndpointName, 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 *VirtualEndpointsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, serverName string, virtualEndpointName string, _ *VirtualEndpointsClientBeginDeleteOptions) (*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") + } + 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 virtualEndpointName == "" { + return nil, errors.New("parameter virtualEndpointName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{virtualEndpointName}", url.PathEscape(virtualEndpointName)) + 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() + return req, nil +} + +// Get - Gets information about a pair of virtual endpoints. +// 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. +// - 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 + const operationName = "VirtualEndpointsClient.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, virtualEndpointName, options) + if err != nil { + return VirtualEndpointsClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return VirtualEndpointsClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return VirtualEndpointsClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *VirtualEndpointsClient) getCreateRequest(ctx context.Context, resourceGroupName string, serverName string, virtualEndpointName string, _ *VirtualEndpointsClientGetOptions) (*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") + } + 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 virtualEndpointName == "" { + return nil, errors.New("parameter virtualEndpointName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{virtualEndpointName}", url.PathEscape(virtualEndpointName)) + 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 *VirtualEndpointsClient) getHandleResponse(resp *http.Response) (VirtualEndpointsClientGetResponse, error) { + result := VirtualEndpointsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.VirtualEndpoint); err != nil { + return VirtualEndpointsClientGetResponse{}, err + } + return result, nil +} + +// NewListByServerPager - Lists pair of virtual endpoints associated to 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 - VirtualEndpointsClientListByServerOptions contains the optional parameters for the VirtualEndpointsClient.NewListByServerPager +// method. +func (client *VirtualEndpointsClient) NewListByServerPager(resourceGroupName string, serverName string, options *VirtualEndpointsClientListByServerOptions) *runtime.Pager[VirtualEndpointsClientListByServerResponse] { + return runtime.NewPager(runtime.PagingHandler[VirtualEndpointsClientListByServerResponse]{ + More: func(page VirtualEndpointsClientListByServerResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *VirtualEndpointsClientListByServerResponse) (VirtualEndpointsClientListByServerResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "VirtualEndpointsClient.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 VirtualEndpointsClientListByServerResponse{}, err + } + return client.listByServerHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listByServerCreateRequest creates the ListByServer request. +func (client *VirtualEndpointsClient) listByServerCreateRequest(ctx context.Context, resourceGroupName string, serverName string, _ *VirtualEndpointsClientListByServerOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/virtualendpoints" + 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 *VirtualEndpointsClient) listByServerHandleResponse(resp *http.Response) (VirtualEndpointsClientListByServerResponse, error) { + result := VirtualEndpointsClientListByServerResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.VirtualEndpointsList); err != nil { + return VirtualEndpointsClientListByServerResponse{}, err + } + return result, nil +} + +// 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-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serverName - The name of the 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) { + if options == nil || options.ResumeToken == "" { + resp, err := client.update(ctx, resourceGroupName, serverName, virtualEndpointName, parameters, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualEndpointsClientUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualEndpointsClientUpdateResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// 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-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" + 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, virtualEndpointName, 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 *VirtualEndpointsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, serverName string, virtualEndpointName string, parameters VirtualEndpointResourceForPatch, _ *VirtualEndpointsClientBeginUpdateOptions) (*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") + } + 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 virtualEndpointName == "" { + return nil, errors.New("parameter virtualEndpointName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{virtualEndpointName}", url.PathEscape(virtualEndpointName)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, 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["Content-Type"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} diff --git a/sdk/resourcemanager/postgresql/armpostgresql/virtualendpoints_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresql/virtualendpoints_client_example_test.go new file mode 100644 index 000000000000..28bbccbc7b7f --- /dev/null +++ b/sdk/resourcemanager/postgresql/armpostgresql/virtualendpoints_client_example_test.go @@ -0,0 +1,173 @@ +// 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) Go Code Generator. DO NOT EDIT. + +package armpostgresql_test + +import ( + "context" + "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/armpostgresql/v2" + "log" +) + +// Generated from example definition: 2025-08-01/VirtualEndpointCreate.json +func ExampleVirtualEndpointsClient_BeginCreate() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armpostgresql.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewVirtualEndpointsClient().BeginCreate(ctx, "exampleresourcegroup", "exampleserver", "examplebasename", armpostgresql.VirtualEndpoint{ + Properties: &armpostgresql.VirtualEndpointResourceProperties{ + EndpointType: to.Ptr(armpostgresql.VirtualEndpointTypeReadWrite), + Members: []*string{ + to.Ptr("exampleprimaryserver"), + }, + }, + }, 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: 2025-08-01/VirtualEndpointDelete.json +func ExampleVirtualEndpointsClient_BeginDelete() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armpostgresql.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewVirtualEndpointsClient().BeginDelete(ctx, "exampleresourcegroup", "exampleserver", "examplebasename", 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: 2025-08-01/VirtualEndpointsGet.json +func ExampleVirtualEndpointsClient_Get() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armpostgresql.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + 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 = armpostgresql.VirtualEndpointsClientGetResponse{ + // VirtualEndpoint: &armpostgresql.VirtualEndpoint{ + // Name: to.Ptr("examplebasename"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/virtualEndpoints"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/virtualEndpoints/examplebasename"), + // Properties: &armpostgresql.VirtualEndpointResourceProperties{ + // EndpointType: to.Ptr(armpostgresql.VirtualEndpointTypeReadWrite), + // Members: []*string{ + // to.Ptr("exampleprimaryserver"), + // }, + // VirtualEndpoints: []*string{ + // to.Ptr("examplebasename.reader.postgres.database.azure.com"), + // to.Ptr("examplebasename.writer.postgres.database.azure.com"), + // }, + // }, + // }, + // } +} + +// Generated from example definition: 2025-08-01/VirtualEndpointsListByServer.json +func ExampleVirtualEndpointsClient_NewListByServerPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armpostgresql.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewVirtualEndpointsClient().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 = armpostgresql.VirtualEndpointsClientListByServerResponse{ + // VirtualEndpointsList: armpostgresql.VirtualEndpointsList{ + // Value: []*armpostgresql.VirtualEndpoint{ + // { + // Name: to.Ptr("examplebasename"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/virtualEndpoints"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/virtualEndpoints/examplebasename"), + // Properties: &armpostgresql.VirtualEndpointResourceProperties{ + // EndpointType: to.Ptr(armpostgresql.VirtualEndpointTypeReadWrite), + // Members: []*string{ + // to.Ptr("examplebasename"), + // }, + // VirtualEndpoints: []*string{ + // to.Ptr("examplebasename.reader.postgres.database.azure.com"), + // to.Ptr("examplebasename.writer.postgres.database.azure.com"), + // }, + // }, + // }, + // }, + // }, + // } + } +} + +// Generated from example definition: 2025-08-01/VirtualEndpointUpdate.json +func ExampleVirtualEndpointsClient_BeginUpdate() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armpostgresql.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewVirtualEndpointsClient().BeginUpdate(ctx, "exampleresourcegroup", "exampleserver", "examplebasename", armpostgresql.VirtualEndpointResourceForPatch{ + Properties: &armpostgresql.VirtualEndpointResourceProperties{ + EndpointType: to.Ptr(armpostgresql.VirtualEndpointTypeReadWrite), + Members: []*string{ + to.Ptr("exampleprimaryserver"), + }, + }, + }, 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/armpostgresql/virtualnetworkrules_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresql/virtualnetworkrules_client_example_test.go index 79dc3e7bd5b3..30a683e66932 100644 --- a/sdk/resourcemanager/postgresql/armpostgresql/virtualnetworkrules_client_example_test.go +++ b/sdk/resourcemanager/postgresql/armpostgresql/virtualnetworkrules_client_example_test.go @@ -12,7 +12,7 @@ import ( "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/armpostgresql" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresql/v2" ) // Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/VirtualNetworkRulesGet.json @@ -58,8 +58,8 @@ func ExampleVirtualNetworkRulesClient_BeginCreateOrUpdate() { } poller, err := clientFactory.NewVirtualNetworkRulesClient().BeginCreateOrUpdate(ctx, "TestGroup", "vnet-test-svr", "vnet-firewall-rule", armpostgresql.VirtualNetworkRule{ Properties: &armpostgresql.VirtualNetworkRuleProperties{ - IgnoreMissingVnetServiceEndpoint: to.Ptr(false), - VirtualNetworkSubnetID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.Network/virtualNetworks/testvnet/subnets/testsubnet"), + IgnoreMissingVnetServiceEndpoint: to.Ptr(false), + VirtualNetworkSubnetID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.Network/virtualNetworks/testvnet/subnets/testsubnet"), }, }, nil) if err != nil { diff --git a/sdk/resourcemanager/postgresql/armpostgresql/virtualnetworksubnetusage_client.go b/sdk/resourcemanager/postgresql/armpostgresql/virtualnetworksubnetusage_client.go new file mode 100644 index 000000000000..232240c0c951 --- /dev/null +++ b/sdk/resourcemanager/postgresql/armpostgresql/virtualnetworksubnetusage_client.go @@ -0,0 +1,105 @@ +// 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) Go Code Generator. DO NOT EDIT. + +package armpostgresql + +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" +) + +// VirtualNetworkSubnetUsageClient contains the methods for the VirtualNetworkSubnetUsage group. +// Don't use this type directly, use NewVirtualNetworkSubnetUsageClient() instead. +type VirtualNetworkSubnetUsageClient struct { + internal *arm.Client + subscriptionID string +} + +// 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 - 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 { + return nil, err + } + client := &VirtualNetworkSubnetUsageClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// 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-08-01 +// - locationName - The name of the location. +// - parameters - The request body +// - options - VirtualNetworkSubnetUsageClientListOptions contains the optional parameters for the VirtualNetworkSubnetUsageClient.List +// method. +func (client *VirtualNetworkSubnetUsageClient) List(ctx context.Context, locationName string, parameters VirtualNetworkSubnetUsageParameter, options *VirtualNetworkSubnetUsageClientListOptions) (VirtualNetworkSubnetUsageClientListResponse, error) { + var err error + 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.listCreateRequest(ctx, locationName, parameters, options) + if err != nil { + return VirtualNetworkSubnetUsageClientListResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return VirtualNetworkSubnetUsageClientListResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return VirtualNetworkSubnetUsageClientListResponse{}, err + } + resp, err := client.listHandleResponse(httpResp) + return resp, err +} + +// 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") + } + 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"} + req.Raw().Header["Content-Type"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} + +// 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/armpostgresql/virtualnetworksubnetusage_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresql/virtualnetworksubnetusage_client_example_test.go new file mode 100644 index 000000000000..679f40adc9a4 --- /dev/null +++ b/sdk/resourcemanager/postgresql/armpostgresql/virtualnetworksubnetusage_client_example_test.go @@ -0,0 +1,51 @@ +// 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) Go Code Generator. DO NOT EDIT. + +package armpostgresql_test + +import ( + "context" + "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/armpostgresql/v2" + "log" +) + +// Generated from example definition: 2025-08-01/VirtualNetworkSubnetUsageList.json +func ExampleVirtualNetworkSubnetUsageClient_List() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armpostgresql.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewVirtualNetworkSubnetUsageClient().List(ctx, "eastus", armpostgresql.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) + } + // 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 = armpostgresql.VirtualNetworkSubnetUsageClientListResponse{ + // VirtualNetworkSubnetUsageModel: &armpostgresql.VirtualNetworkSubnetUsageModel{ + // DelegatedSubnetsUsage: []*armpostgresql.DelegatedSubnetUsage{ + // { + // SubnetName: to.Ptr("examplesubnet1"), + // Usage: to.Ptr[int64](2), + // }, + // { + // SubnetName: to.Ptr("examplesubnet2"), + // Usage: to.Ptr[int64](3), + // }, + // }, + // Location: to.Ptr("eastus"), + // SubscriptionID: to.Ptr("ffffffff-ffff-ffff-ffff-ffffffffffff"), + // }, + // } +}