From 2aed1a9e1f928e472138a10cea47c8c9a59fc5a6 Mon Sep 17 00:00:00 2001 From: azure-sdk Date: Wed, 3 Jun 2026 17:49:38 +0000 Subject: [PATCH] Configurations: 'specification/postgresql/DBforPostgreSQL.Management/tspconfig.yaml', SDK Release Type: beta, and CommitSHA: 'aaff653c559c45c03ce095a49264e385df8bd9e5' in SpecRepo: 'https://github.com/Azure/azure-rest-api-specs' Pipeline run: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=6390684 Refer to https://eng.ms/docs/products/azure-developer-experience/develop/sdk-release/sdk-release-prerequisites to prepare for SDK release. --- .../CHANGELOG.md | 30 + .../README.md | 6 +- .../_metadata.json | 8 +- .../apiview-properties.json | 33 +- .../mgmt/postgresqlflexibleservers/_client.py | 26 +- .../_configuration.py | 7 +- .../mgmt/postgresqlflexibleservers/_patch.py | 1 - .../_utils/model_base.py | 542 +++- .../_utils/serialization.py | 29 +- .../postgresqlflexibleservers/_version.py | 2 +- .../postgresqlflexibleservers/aio/_client.py | 26 +- .../aio/_configuration.py | 7 +- .../postgresqlflexibleservers/aio/_patch.py | 1 - .../aio/operations/__init__.py | 4 + .../aio/operations/_operations.py | 1580 +++++++++++- .../aio/operations/_patch.py | 1 - .../models/__init__.py | 32 + .../models/_enums.py | 625 ++--- .../models/_models.py | 701 +++++- .../models/_patch.py | 1 - .../operations/__init__.py | 4 + .../operations/_operations.py | 2184 ++++++++++++++--- .../operations/_patch.py | 1 - .../administrators_microsoft_entra_add.py | 2 +- .../administrators_microsoft_entra_delete.py | 2 +- .../administrators_microsoft_entra_get.py | 2 +- ...strators_microsoft_entra_list_by_server.py | 2 +- ...at_protection_settings_create_or_update.py | 2 +- ...advanced_threat_protection_settings_get.py | 2 +- ...reat_protection_settings_list_by_server.py | 2 +- .../backups_automatic_and_on_demand_create.py | 2 +- .../backups_automatic_and_on_demand_delete.py | 2 +- .../backups_automatic_and_on_demand_get.py | 2 +- ..._automatic_and_on_demand_list_by_server.py | 2 +- ...long_term_retention_check_prerequisites.py | 2 +- .../backups_long_term_retention_get.py | 2 +- ...kups_long_term_retention_list_by_server.py | 2 +- .../backups_long_term_retention_start.py | 2 +- .../capabilities_by_location_list.py | 2 +- .../capabilities_by_server_list.py | 2 +- .../captured_logs_list_by_server.py | 2 +- .../generated_samples/configurations_get.py | 2 +- .../configurations_list_by_server.py | 2 +- .../configurations_update.py | 2 +- .../configurations_update_using_put.py | 2 +- .../generated_samples/databases_create.py | 2 +- .../generated_samples/databases_delete.py | 2 +- .../generated_samples/databases_get.py | 2 +- .../databases_list_by_server.py | 2 +- .../firewall_rules_create_or_update.py | 2 +- .../firewall_rules_delete.py | 2 +- .../generated_samples/firewall_rules_get.py | 2 +- .../firewall_rules_list_by_server.py | 2 +- .../maintenance_events_apply_now.py | 43 + .../maintenance_events_get.py | 43 + .../maintenance_events_list_by_server.py | 43 + ...nance_events_list_by_server_with_filter.py | 43 + .../maintenance_events_reschedule.py | 44 + .../major_version_upgrade_precheck_get.py | 43 + ...version_upgrade_precheck_list_by_server.py | 43 + .../generated_samples/migrations_cancel.py | 2 +- .../migrations_check_name_availability.py | 2 +- .../generated_samples/migrations_create.py | 2 +- ...ate_other_source_types_validate_migrate.py | 2 +- .../migrations_create_validate_only.py | 2 +- ...create_with_fully_qualified_domain_name.py | 2 +- .../migrations_create_with_other_users.py | 2 +- ...ns_create_with_private_endpoint_servers.py | 2 +- .../migrations_create_with_roles.py | 2 +- .../generated_samples/migrations_get.py | 2 +- ...ith_successful_validation_and_migration.py | 2 +- ...essful_validation_but_migration_failure.py | 2 +- ...gration_with_successful_validation_only.py | 2 +- ..._get_migration_with_validation_failures.py | 2 +- .../migrations_list_by_target_server.py | 2 +- .../generated_samples/migrations_update.py | 2 +- .../name_availability_check_globally.py | 2 +- .../name_availability_check_with_location.py | 2 +- .../generated_samples/operations_list.py | 2 +- .../private_dns_zone_suffix_get.py | 2 +- .../private_endpoint_connections_delete.py | 2 +- .../private_endpoint_connections_get.py | 2 +- .../private_endpoint_connections_list.py | 2 +- .../private_endpoint_connections_update.py | 2 +- .../private_link_resources_get.py | 2 +- .../private_link_resources_list.py | 2 +- .../quota_usages_for_flexible_servers.py | 2 +- .../replicas_list_by_server.py | 2 +- .../servers_cluster_create.py | 2 +- ...eo_restore_with_data_encryption_enabled.py | 2 +- ...ith_data_encryption_enabled_auto_update.py | 2 +- ...k_with_zone_redundant_high_availability.py | 2 +- ...etwork_with_same_zone_high_availability.py | 2 +- .../servers_create_point_in_time_restore.py | 2 +- .../servers_create_replica.py | 3 +- .../servers_create_revive_dropped.py | 2 +- ...ers_create_with_data_encryption_enabled.py | 2 +- ...ith_data_encryption_enabled_auto_update.py | 2 +- ...rtual_network_without_high_availability.py | 2 +- .../generated_samples/servers_delete.py | 2 +- .../generated_samples/servers_get.py | 2 +- .../servers_get_with_private_endpoints.py | 2 +- .../servers_get_with_vnet.py | 2 +- .../servers_list_by_resource_group.py | 2 +- .../servers_list_by_subscription.py | 2 +- .../servers_migrate_network_mode.py | 2 +- ...ote_replica_as_forced_standalone_server.py | 2 +- ...rs_promote_replica_as_forced_switchover.py | 2 +- ...te_replica_as_planned_standalone_server.py | 2 +- ...s_promote_replica_as_planned_switchover.py | 2 +- .../generated_samples/servers_restart.py | 2 +- .../servers_restart_with_failover.py | 2 +- .../generated_samples/servers_start.py | 2 +- ...rs_start_major_version_upgrade_precheck.py | 43 + .../generated_samples/servers_stop.py | 2 +- .../generated_samples/servers_update.py | 2 +- ...s_update_with_custom_maintenance_window.py | 2 +- ...ers_update_with_data_encryption_enabled.py | 2 +- ...ith_data_encryption_enabled_auto_update.py | 2 +- ...rvers_update_with_major_version_upgrade.py | 2 +- ...ers_update_with_microsoft_entra_enabled.py | 2 +- .../generated_samples/tuning_options_get.py | 2 +- .../tuning_options_list_by_server.py | 2 +- ...ning_options_list_index_recommendations.py | 2 +- ...commendations_filtered_for_create_index.py | 2 +- ...ning_options_list_table_recommendations.py | 2 +- ...ommendations_filtered_for_analyze_table.py | 2 +- .../virtual_endpoint_create.py | 2 +- .../virtual_endpoint_delete.py | 2 +- .../virtual_endpoint_update.py | 2 +- .../virtual_endpoints_get.py | 2 +- .../virtual_endpoints_list_by_server.py | 2 +- .../virtual_network_subnet_usage_list.py | 2 +- ...anagement_maintenance_events_operations.py | 67 + ...ent_maintenance_events_operations_async.py | 72 + ...jor_version_upgrade_precheck_operations.py | 42 + ...rsion_upgrade_precheck_operations_async.py | 43 + ...stgre_sql_management_servers_operations.py | 16 + ...sql_management_servers_operations_async.py | 18 + .../pyproject.toml | 3 +- .../tsp-location.yaml | 2 +- 141 files changed, 5716 insertions(+), 948 deletions(-) create mode 100644 sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/maintenance_events_apply_now.py create mode 100644 sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/maintenance_events_get.py create mode 100644 sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/maintenance_events_list_by_server.py create mode 100644 sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/maintenance_events_list_by_server_with_filter.py create mode 100644 sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/maintenance_events_reschedule.py create mode 100644 sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/major_version_upgrade_precheck_get.py create mode 100644 sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/major_version_upgrade_precheck_list_by_server.py create mode 100644 sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/servers_start_major_version_upgrade_precheck.py create mode 100644 sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_tests/test_postgre_sql_management_maintenance_events_operations.py create mode 100644 sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_tests/test_postgre_sql_management_maintenance_events_operations_async.py create mode 100644 sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_tests/test_postgre_sql_management_major_version_upgrade_precheck_operations.py create mode 100644 sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_tests/test_postgre_sql_management_major_version_upgrade_precheck_operations_async.py diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/CHANGELOG.md b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/CHANGELOG.md index 890d189dcb38..b3f13548db4f 100644 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/CHANGELOG.md +++ b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/CHANGELOG.md @@ -1,5 +1,35 @@ # Release History +## 3.0.0b2 (2026-06-03) + +### Features Added + + - Client `PostgreSQLManagementClient` added operation group `maintenance_events` + - Client `PostgreSQLManagementClient` added operation group `major_version_upgrade_precheck` + - Model `DataEncryption` added property `primary_federated_identity_client_id` + - Model `DataEncryption` added property `geo_backup_federated_identity_client_id` + - Enum `HighAvailabilityState` added member `COMPUTE_UPDATING_BY_FAILOVER` + - Enum `HighAvailabilityState` added member `RECREATING_STANDBY` + - Added model `MaintenanceEventActionResponse` + - Added model `MaintenanceEventRescheduleRequest` + - Added model `MaintenanceEventResource` + - Added model `MaintenanceEventResourceProperties` + - Added enum `MaintenanceEventStatus` + - Added enum `MaintenanceEventStatusFilter` + - Added enum `MaintenanceType` + - Added model `MajorVersionUpgradePrecheckResource` + - Added model `MajorVersionUpgradePrecheckResourceProperties` + - Added enum `MajorVersionUpgradePrecheckStatus` + - Added model `PolicyDetail` + - Added model `PrecheckErrorInfo` + - Added model `PrecheckResult` + - Added model `StartMajorVersionUpgradePrecheckRequest` + - Added model `StartMajorVersionUpgradePrecheckResponse` + - Added model `UpgradeSequence` + - Model `ServersOperations` added method `begin_start_major_version_upgrade_precheck` + - Added model `MaintenanceEventsOperations` + - Added model `MajorVersionUpgradePrecheckOperations` + ## 3.0.0b1 (2026-02-13) ### Features Added diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/README.md b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/README.md index fd72db84a350..a39707df05d7 100644 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/README.md +++ b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/README.md @@ -1,7 +1,7 @@ # Microsoft Azure SDK for Python This is the Microsoft Azure Postgresqlflexibleservers Management Client Library. -This package has been tested with Python 3.9+. +This package has been tested with Python 3.10+. For a more complete view of Azure libraries, see the [azure sdk python release](https://aka.ms/azsdk/python/all). ## _Disclaimer_ @@ -12,7 +12,7 @@ _Azure SDK Python packages support for Python 2.7 has ended 01 January 2022. For ### Prerequisites -- Python 3.9+ is required to use this package. +- Python 3.10+ is required to use this package. - [Azure subscription](https://azure.microsoft.com/free/) ### Install the package @@ -24,7 +24,7 @@ pip install azure-identity ### Authentication -By default, [Azure Active Directory](https://aka.ms/awps/aad) token authentication depends on correct configuration of the following environment variables. +By default, [Microsoft Entra](https://learn.microsoft.com/entra/fundamentals/what-is-entra) token authentication depends on correct configuration of the following environment variables. - `AZURE_CLIENT_ID` for Azure client ID. - `AZURE_TENANT_ID` for Azure tenant ID. diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/_metadata.json b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/_metadata.json index 1d6a83dc04a7..4449dfe808ef 100644 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/_metadata.json +++ b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/_metadata.json @@ -1,10 +1,10 @@ { - "apiVersion": "2026-01-01-preview", + "apiVersion": "2026-04-01-preview", "apiVersions": { - "Microsoft.DBforPostgreSQL": "2026-01-01-preview" + "Microsoft.DBforPostgreSQL": "2026-04-01-preview" }, - "commit": "3afef36df83f47abac337e0cbd850e3d1c00dc8e", + "commit": "aaff653c559c45c03ce095a49264e385df8bd9e5", "repository_url": "https://github.com/Azure/azure-rest-api-specs", "typespec_src": "specification/postgresql/DBforPostgreSQL.Management", - "emitterVersion": "0.60.1" + "emitterVersion": "0.62.1" } \ No newline at end of file diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/apiview-properties.json b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/apiview-properties.json index a55989c115f6..2904cc55a7d0 100644 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/apiview-properties.json +++ b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/apiview-properties.json @@ -54,8 +54,14 @@ "azure.mgmt.postgresqlflexibleservers.models.LtrBackupOperationResponseProperties": "Microsoft.DBforPostgreSQL.LtrBackupOperationResponseProperties", "azure.mgmt.postgresqlflexibleservers.models.LtrPreBackupRequest": "Microsoft.DBforPostgreSQL.LtrPreBackupRequest", "azure.mgmt.postgresqlflexibleservers.models.LtrPreBackupResponse": "Microsoft.DBforPostgreSQL.LtrPreBackupResponse", + "azure.mgmt.postgresqlflexibleservers.models.MaintenanceEventActionResponse": "Microsoft.DBforPostgreSQL.MaintenanceEventActionResponse", + "azure.mgmt.postgresqlflexibleservers.models.MaintenanceEventRescheduleRequest": "Microsoft.DBforPostgreSQL.MaintenanceEventRescheduleRequest", + "azure.mgmt.postgresqlflexibleservers.models.MaintenanceEventResource": "Microsoft.DBforPostgreSQL.MaintenanceEventResource", + "azure.mgmt.postgresqlflexibleservers.models.MaintenanceEventResourceProperties": "Microsoft.DBforPostgreSQL.MaintenanceEventResourceProperties", "azure.mgmt.postgresqlflexibleservers.models.MaintenanceWindow": "Microsoft.DBforPostgreSQL.MaintenanceWindow", "azure.mgmt.postgresqlflexibleservers.models.MaintenanceWindowForPatch": "Microsoft.DBforPostgreSQL.MaintenanceWindowForPatch", + "azure.mgmt.postgresqlflexibleservers.models.MajorVersionUpgradePrecheckResource": "Microsoft.DBforPostgreSQL.MajorVersionUpgradePrecheckResource", + "azure.mgmt.postgresqlflexibleservers.models.MajorVersionUpgradePrecheckResourceProperties": "Microsoft.DBforPostgreSQL.MajorVersionUpgradePrecheckResourceProperties", "azure.mgmt.postgresqlflexibleservers.models.MetricSpecification": "Microsoft.DBforPostgreSQL.MetricSpecification", "azure.mgmt.postgresqlflexibleservers.models.MigrateNetworkStatus": "Microsoft.DBforPostgreSQL.MigrateNetworkStatus", "azure.mgmt.postgresqlflexibleservers.models.TrackedResource": "Azure.ResourceManager.CommonTypes.TrackedResource", @@ -79,6 +85,9 @@ "azure.mgmt.postgresqlflexibleservers.models.Operation": "Microsoft.DBforPostgreSQL.Operation", "azure.mgmt.postgresqlflexibleservers.models.OperationDisplay": "Microsoft.DBforPostgreSQL.OperationDisplay", "azure.mgmt.postgresqlflexibleservers.models.OperationProperties": "Microsoft.DBforPostgreSQL.OperationProperties", + "azure.mgmt.postgresqlflexibleservers.models.PolicyDetail": "Microsoft.DBforPostgreSQL.PolicyDetail", + "azure.mgmt.postgresqlflexibleservers.models.PrecheckErrorInfo": "Microsoft.DBforPostgreSQL.PrecheckErrorInfo", + "azure.mgmt.postgresqlflexibleservers.models.PrecheckResult": "Microsoft.DBforPostgreSQL.PrecheckResult", "azure.mgmt.postgresqlflexibleservers.models.PrivateEndpoint": "Azure.ResourceManager.CommonTypes.PrivateEndpoint", "azure.mgmt.postgresqlflexibleservers.models.PrivateEndpointConnection": "Microsoft.DBforPostgreSQL.PrivateEndpointConnection", "azure.mgmt.postgresqlflexibleservers.models.PrivateEndpointConnectionProperties": "Azure.ResourceManager.CommonTypes.PrivateEndpointConnectionProperties", @@ -99,6 +108,8 @@ "azure.mgmt.postgresqlflexibleservers.models.ServiceSpecification": "Microsoft.DBforPostgreSQL.ServiceSpecification", "azure.mgmt.postgresqlflexibleservers.models.Sku": "Microsoft.DBforPostgreSQL.Sku", "azure.mgmt.postgresqlflexibleservers.models.SkuForPatch": "Microsoft.DBforPostgreSQL.SkuForPatch", + "azure.mgmt.postgresqlflexibleservers.models.StartMajorVersionUpgradePrecheckRequest": "Microsoft.DBforPostgreSQL.StartMajorVersionUpgradePrecheckRequest", + "azure.mgmt.postgresqlflexibleservers.models.StartMajorVersionUpgradePrecheckResponse": "Microsoft.DBforPostgreSQL.StartMajorVersionUpgradePrecheckResponse", "azure.mgmt.postgresqlflexibleservers.models.Storage": "Microsoft.DBforPostgreSQL.Storage", "azure.mgmt.postgresqlflexibleservers.models.StorageEditionCapability": "Microsoft.DBforPostgreSQL.StorageEditionCapability", "azure.mgmt.postgresqlflexibleservers.models.StorageMbCapability": "Microsoft.DBforPostgreSQL.StorageMbCapability", @@ -107,6 +118,7 @@ "azure.mgmt.postgresqlflexibleservers.models.SystemData": "Azure.ResourceManager.CommonTypes.SystemData", "azure.mgmt.postgresqlflexibleservers.models.TuningOptions": "Microsoft.DBforPostgreSQL.TuningOptions", "azure.mgmt.postgresqlflexibleservers.models.TuningOptionsProperties": "Microsoft.DBforPostgreSQL.TuningOptionsProperties", + "azure.mgmt.postgresqlflexibleservers.models.UpgradeSequence": "Microsoft.DBforPostgreSQL.UpgradeSequence", "azure.mgmt.postgresqlflexibleservers.models.UserAssignedIdentity": "Microsoft.DBforPostgreSQL.UserAssignedIdentity", "azure.mgmt.postgresqlflexibleservers.models.UserIdentity": "Microsoft.DBforPostgreSQL.UserIdentity", "azure.mgmt.postgresqlflexibleservers.models.ValidationDetails": "Microsoft.DBforPostgreSQL.ValidationDetails", @@ -160,8 +172,12 @@ "azure.mgmt.postgresqlflexibleservers.models.CreateModeForPatch": "Microsoft.DBforPostgreSQL.CreateModeForPatch", "azure.mgmt.postgresqlflexibleservers.models.FailoverMode": "Microsoft.DBforPostgreSQL.FailoverMode", "azure.mgmt.postgresqlflexibleservers.models.NetworkMigrationState": "Microsoft.DBforPostgreSQL.NetworkMigrationState", + "azure.mgmt.postgresqlflexibleservers.models.MajorVersionUpgradePrecheckStatus": "Microsoft.DBforPostgreSQL.MajorVersionUpgradePrecheckStatus", "azure.mgmt.postgresqlflexibleservers.models.ConfigurationDataType": "Microsoft.DBforPostgreSQL.ConfigurationDataType", "azure.mgmt.postgresqlflexibleservers.models.VirtualEndpointType": "Microsoft.DBforPostgreSQL.VirtualEndpointType", + "azure.mgmt.postgresqlflexibleservers.models.MaintenanceType": "Microsoft.DBforPostgreSQL.MaintenanceType", + "azure.mgmt.postgresqlflexibleservers.models.MaintenanceEventStatus": "Microsoft.DBforPostgreSQL.MaintenanceEventStatus", + "azure.mgmt.postgresqlflexibleservers.models.MaintenanceEventStatusFilter": "Microsoft.DBforPostgreSQL.MaintenanceEventStatusFilter", "azure.mgmt.postgresqlflexibleservers.models.PrincipalType": "Microsoft.DBforPostgreSQL.PrincipalType", "azure.mgmt.postgresqlflexibleservers.models.CapabilityStatus": "Microsoft.DBforPostgreSQL.CapabilityStatus", "azure.mgmt.postgresqlflexibleservers.models.HighAvailabilityMode": "Microsoft.DBforPostgreSQL.HighAvailabilityMode", @@ -215,6 +231,8 @@ "azure.mgmt.postgresqlflexibleservers.aio.operations.ServersOperations.begin_stop": "Microsoft.DBforPostgreSQL.Servers.stop", "azure.mgmt.postgresqlflexibleservers.operations.ServersOperations.begin_migrate_network_mode": "Microsoft.DBforPostgreSQL.Servers.migrateNetworkMode", "azure.mgmt.postgresqlflexibleservers.aio.operations.ServersOperations.begin_migrate_network_mode": "Microsoft.DBforPostgreSQL.Servers.migrateNetworkMode", + "azure.mgmt.postgresqlflexibleservers.operations.ServersOperations.begin_start_major_version_upgrade_precheck": "Microsoft.DBforPostgreSQL.Servers.startMajorVersionUpgradePrecheck", + "azure.mgmt.postgresqlflexibleservers.aio.operations.ServersOperations.begin_start_major_version_upgrade_precheck": "Microsoft.DBforPostgreSQL.Servers.startMajorVersionUpgradePrecheck", "azure.mgmt.postgresqlflexibleservers.operations.ConfigurationsOperations.get": "Microsoft.DBforPostgreSQL.Configurations.get", "azure.mgmt.postgresqlflexibleservers.aio.operations.ConfigurationsOperations.get": "Microsoft.DBforPostgreSQL.Configurations.get", "azure.mgmt.postgresqlflexibleservers.operations.ConfigurationsOperations.begin_put": "Microsoft.DBforPostgreSQL.Configurations.put", @@ -261,6 +279,18 @@ "azure.mgmt.postgresqlflexibleservers.aio.operations.VirtualEndpointsOperations.begin_delete": "Microsoft.DBforPostgreSQL.VirtualEndpoints.delete", "azure.mgmt.postgresqlflexibleservers.operations.VirtualEndpointsOperations.list_by_server": "Microsoft.DBforPostgreSQL.VirtualEndpoints.listByServer", "azure.mgmt.postgresqlflexibleservers.aio.operations.VirtualEndpointsOperations.list_by_server": "Microsoft.DBforPostgreSQL.VirtualEndpoints.listByServer", + "azure.mgmt.postgresqlflexibleservers.operations.MaintenanceEventsOperations.get": "Microsoft.DBforPostgreSQL.MaintenanceEvents.get", + "azure.mgmt.postgresqlflexibleservers.aio.operations.MaintenanceEventsOperations.get": "Microsoft.DBforPostgreSQL.MaintenanceEvents.get", + "azure.mgmt.postgresqlflexibleservers.operations.MaintenanceEventsOperations.list": "Microsoft.DBforPostgreSQL.MaintenanceEvents.list", + "azure.mgmt.postgresqlflexibleservers.aio.operations.MaintenanceEventsOperations.list": "Microsoft.DBforPostgreSQL.MaintenanceEvents.list", + "azure.mgmt.postgresqlflexibleservers.operations.MaintenanceEventsOperations.begin_reschedule": "Microsoft.DBforPostgreSQL.MaintenanceEvents.reschedule", + "azure.mgmt.postgresqlflexibleservers.aio.operations.MaintenanceEventsOperations.begin_reschedule": "Microsoft.DBforPostgreSQL.MaintenanceEvents.reschedule", + "azure.mgmt.postgresqlflexibleservers.operations.MaintenanceEventsOperations.begin_apply_now": "Microsoft.DBforPostgreSQL.MaintenanceEvents.applyNow", + "azure.mgmt.postgresqlflexibleservers.aio.operations.MaintenanceEventsOperations.begin_apply_now": "Microsoft.DBforPostgreSQL.MaintenanceEvents.applyNow", + "azure.mgmt.postgresqlflexibleservers.operations.MajorVersionUpgradePrecheckOperations.get": "Microsoft.DBforPostgreSQL.MajorVersionUpgradePrecheck.get", + "azure.mgmt.postgresqlflexibleservers.aio.operations.MajorVersionUpgradePrecheckOperations.get": "Microsoft.DBforPostgreSQL.MajorVersionUpgradePrecheck.get", + "azure.mgmt.postgresqlflexibleservers.operations.MajorVersionUpgradePrecheckOperations.list": "Microsoft.DBforPostgreSQL.MajorVersionUpgradePrecheck.list", + "azure.mgmt.postgresqlflexibleservers.aio.operations.MajorVersionUpgradePrecheckOperations.list": "Microsoft.DBforPostgreSQL.MajorVersionUpgradePrecheck.list", "azure.mgmt.postgresqlflexibleservers.operations.AdministratorsMicrosoftEntraOperations.get": "Microsoft.DBforPostgreSQL.AdministratorMicrosoftEntras.get", "azure.mgmt.postgresqlflexibleservers.aio.operations.AdministratorsMicrosoftEntraOperations.get": "Microsoft.DBforPostgreSQL.AdministratorMicrosoftEntras.get", "azure.mgmt.postgresqlflexibleservers.operations.AdministratorsMicrosoftEntraOperations.begin_create_or_update": "Microsoft.DBforPostgreSQL.AdministratorMicrosoftEntras.createOrUpdate", @@ -315,5 +345,6 @@ "azure.mgmt.postgresqlflexibleservers.aio.operations.QuotaUsagesOperations.list": "Microsoft.DBforPostgreSQL.QuotaUsagesOperationGroup.list", "azure.mgmt.postgresqlflexibleservers.operations.VirtualNetworkSubnetUsageOperations.list": "Microsoft.DBforPostgreSQL.VirtualNetworkSubnetUsageOperationGroup.list", "azure.mgmt.postgresqlflexibleservers.aio.operations.VirtualNetworkSubnetUsageOperations.list": "Microsoft.DBforPostgreSQL.VirtualNetworkSubnetUsageOperationGroup.list" - } + }, + "CrossLanguageVersion": "8394ed03d5f6" } \ No newline at end of file diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/azure/mgmt/postgresqlflexibleservers/_client.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/azure/mgmt/postgresqlflexibleservers/_client.py index ba4c6b411b98..a369f027ace3 100644 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/azure/mgmt/postgresqlflexibleservers/_client.py +++ b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/azure/mgmt/postgresqlflexibleservers/_client.py @@ -7,8 +7,8 @@ # -------------------------------------------------------------------------- from copy import deepcopy +import sys from typing import Any, Optional, TYPE_CHECKING, cast -from typing_extensions import Self from azure.core.pipeline import policies from azure.core.rest import HttpRequest, HttpResponse @@ -30,6 +30,8 @@ ConfigurationsOperations, DatabasesOperations, FirewallRulesOperations, + MaintenanceEventsOperations, + MajorVersionUpgradePrecheckOperations, MigrationsOperations, NameAvailabilityOperations, Operations, @@ -45,6 +47,11 @@ VirtualNetworkSubnetUsageOperations, ) +if sys.version_info >= (3, 11): + from typing import Self +else: + from typing_extensions import Self # type: ignore + if TYPE_CHECKING: from azure.core import AzureClouds from azure.core.credentials import TokenCredential @@ -79,6 +86,12 @@ class PostgreSQLManagementClient: # pylint: disable=too-many-instance-attribute :ivar virtual_endpoints: VirtualEndpointsOperations operations :vartype virtual_endpoints: azure.mgmt.postgresqlflexibleservers.operations.VirtualEndpointsOperations + :ivar maintenance_events: MaintenanceEventsOperations operations + :vartype maintenance_events: + azure.mgmt.postgresqlflexibleservers.operations.MaintenanceEventsOperations + :ivar major_version_upgrade_precheck: MajorVersionUpgradePrecheckOperations operations + :vartype major_version_upgrade_precheck: + azure.mgmt.postgresqlflexibleservers.operations.MajorVersionUpgradePrecheckOperations :ivar administrators_microsoft_entra: AdministratorsMicrosoftEntraOperations operations :vartype administrators_microsoft_entra: azure.mgmt.postgresqlflexibleservers.operations.AdministratorsMicrosoftEntraOperations @@ -129,8 +142,9 @@ class PostgreSQLManagementClient: # pylint: disable=too-many-instance-attribute None. :paramtype cloud_setting: ~azure.core.AzureClouds :keyword api_version: The API version to use for this operation. Known values are - "2026-01-01-preview" and None. Default value is "2026-01-01-preview". Note that overriding this - default value may result in unsupported behavior. + "2026-04-01-preview" and None. Default value is None. If not set, the operation's default API + version will be used. Note that overriding this default value may result in unsupported + behavior. :paramtype api_version: str :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. @@ -198,6 +212,12 @@ def __init__( self.virtual_endpoints = VirtualEndpointsOperations( self._client, self._config, self._serialize, self._deserialize ) + self.maintenance_events = MaintenanceEventsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.major_version_upgrade_precheck = MajorVersionUpgradePrecheckOperations( + self._client, self._config, self._serialize, self._deserialize + ) self.administrators_microsoft_entra = AdministratorsMicrosoftEntraOperations( self._client, self._config, self._serialize, self._deserialize ) diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/azure/mgmt/postgresqlflexibleservers/_configuration.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/azure/mgmt/postgresqlflexibleservers/_configuration.py index 2357199eacbd..366fd92b4caa 100644 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/azure/mgmt/postgresqlflexibleservers/_configuration.py +++ b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/azure/mgmt/postgresqlflexibleservers/_configuration.py @@ -34,8 +34,9 @@ class PostgreSQLManagementClientConfiguration: # pylint: disable=too-many-insta None. :type cloud_setting: ~azure.core.AzureClouds :keyword api_version: The API version to use for this operation. Known values are - "2026-01-01-preview" and None. Default value is "2026-01-01-preview". Note that overriding this - default value may result in unsupported behavior. + "2026-04-01-preview" and None. Default value is None. If not set, the operation's default API + version will be used. Note that overriding this default value may result in unsupported + behavior. :paramtype api_version: str """ @@ -47,7 +48,7 @@ def __init__( cloud_setting: Optional["AzureClouds"] = None, **kwargs: Any ) -> None: - api_version: str = kwargs.pop("api_version", "2026-01-01-preview") + api_version: str = kwargs.pop("api_version", "2026-04-01-preview") if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/azure/mgmt/postgresqlflexibleservers/_patch.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/azure/mgmt/postgresqlflexibleservers/_patch.py index 87676c65a8f0..ea765788358a 100644 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/azure/mgmt/postgresqlflexibleservers/_patch.py +++ b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/azure/mgmt/postgresqlflexibleservers/_patch.py @@ -8,7 +8,6 @@ Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ - __all__: list[str] = [] # Add all objects you want publicly available to users at this package level diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/azure/mgmt/postgresqlflexibleservers/_utils/model_base.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/azure/mgmt/postgresqlflexibleservers/_utils/model_base.py index c402af2afc63..d725c55906d3 100644 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/azure/mgmt/postgresqlflexibleservers/_utils/model_base.py +++ b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/azure/mgmt/postgresqlflexibleservers/_utils/model_base.py @@ -23,14 +23,19 @@ from json import JSONEncoder import xml.etree.ElementTree as ET from collections.abc import MutableMapping -from typing_extensions import Self import isodate from azure.core.exceptions import DeserializationError from azure.core import CaseInsensitiveEnumMeta from azure.core.pipeline import PipelineResponse from azure.core.serialization import _Null + from azure.core.rest import HttpResponse +if sys.version_info >= (3, 11): + from typing import Self +else: + from typing_extensions import Self + _LOGGER = logging.getLogger(__name__) __all__ = ["SdkJSONEncoder", "Model", "rest_field", "rest_discriminator"] @@ -515,6 +520,8 @@ def setdefault(self, key: str, default: typing.Any = _UNSET) -> typing.Any: return self._data.setdefault(key, default) def __eq__(self, other: typing.Any) -> bool: + if isinstance(other, _MyMutableMapping): + return self._data == other._data try: other_model = self.__class__(other) except Exception: @@ -583,6 +590,239 @@ def _create_value(rf: typing.Optional["_RestField"], value: typing.Any) -> typin return _serialize(value, rf._format) +# ============================================================================ +# Fast-path scalar deserializer functions for rest_field(deserializer=...) +# These are referenced from rest_field declarations to bypass the generic +# _deserialize -> _deserialize_with_callable chain. +# Only simple/primitive types — no models or container types. +# ============================================================================ + + +def _xml_deser_str(value): + if isinstance(value, ET.Element): + return value.text or "" + return str(value) if value is not None else None + + +def _xml_deser_int(value): + if isinstance(value, ET.Element): + return int(value.text) if value.text else None + return int(value) if value is not None else None + + +def _xml_deser_float(value): + if isinstance(value, ET.Element): + return float(value.text) if value.text else None + return float(value) if value is not None else None + + +def _xml_deser_bool(value): + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + if text in (True, False): + return text + return text.lower() == "true" + + +# pylint: disable=docstring-missing-param +def _xml_deser_bytes(value): + """Deserialize bytes from XML (base64).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_bytes(text) + + +def _xml_deser_bytes_base64url(value): + """Deserialize bytes from XML (base64url).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_bytes_base64(text) + + +def _xml_deser_datetime(value): + """Deserialize a datetime from XML (ISO 8601 / rfc3339).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_datetime(text) + + +def _xml_deser_datetime_rfc7231(value): + """Deserialize a datetime from XML (RFC7231 format).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_datetime_rfc7231(text) + + +def _xml_deser_datetime_unix_timestamp(value): + """Deserialize a datetime from XML (Unix timestamp).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_datetime_unix_timestamp(float(text)) + + +def _xml_deser_date(value): + """Deserialize a date from XML (ISO 8601).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_date(text) + + +def _xml_deser_time(value): + """Deserialize a time from XML (ISO 8601).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_time(text) + + +def _xml_deser_duration(value): + """Deserialize a timedelta from XML (ISO 8601 duration).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_duration(text) + + +def _xml_deser_decimal(value): + """Deserialize a Decimal from XML.""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_decimal(text) + + +def _xml_deser_enum_or_str(enum_cls, value): + """Deserialize a Union[EnumType, str] from XML.""" + text = value.text if isinstance(value, ET.Element) else value + if text is None: + return None + try: + return enum_cls(text) + except ValueError: + return text + + +def _extract_xml_model_type(rf_type): + """Extract the concrete Model class from a resolved rf._type partial chain. + + Unwraps ``Optional[Model]`` and ``_deserialize_model(Model, ...)`` + wrappers. Only handles Model and Optional[Model] — other composite + types (List, Dict, Union, etc.) return None and fall through to the + generic ``_deserialize`` path at runtime. + """ + if rf_type is None: + return None + if isinstance(rf_type, type) and _is_model(rf_type): + return rf_type + if not isinstance(rf_type, functools.partial): + return None + func = rf_type.func + args = rf_type.args + if func is _deserialize_with_optional and args: + return _extract_xml_model_type(args[0]) + if func is _deserialize_model and args: + cls = args[0] + return cls if isinstance(cls, type) and _is_model(cls) else None + return None + + +def _build_xml_field_plan( # pylint: disable=docstring-missing-return, docstring-missing-rtype, unused-variable + cls, attr_to_rest_field: dict +) -> list: + """Build a precomputed XML field plan for fast _init_from_xml iteration. + + Called once per model class in __new__. Returns a list of tuples: + (rest_name, xml_name, kind, deser, rf_type, is_optional, items_name) + + kind: 0=wrapped, 1=attribute, 2=unwrapped, 3=text + + For Model and Optional[Model] fields that lack a scalar + ``_deserializer``, this function precomputes the Model class as the + deserializer so ``_init_from_xml`` can call ``ModelClass(element)`` + directly instead of going through the expensive + ``_get_deserialize_callable_from_annotation`` chain at runtime. + """ + model_meta = getattr(cls, "_xml", {}) + model_ns = model_meta.get("ns") or model_meta.get("namespace") + plan = [] + + for rf in attr_to_rest_field.values(): + prop_meta = getattr(rf, "_xml", {}) + deser = rf._deserializer + + xml_name = prop_meta.get("name", rf._rest_name) + xml_ns = _resolve_xml_ns(prop_meta, model_meta) + if xml_ns: + xml_name = "{" + xml_ns + "}" + xml_name + + is_optional = rf._is_optional + + # For Model / Optional[Model] fields without a scalar deserializer, + # precompute the Model class as the deserializer. + if deser is None and rf._type is not None: + model_cls = _extract_xml_model_type(rf._type) + if model_cls is not None: + deser = model_cls + + if prop_meta.get("attribute", False): + plan.append((rf._rest_name, xml_name, 1, deser, rf._type, is_optional, None)) + elif prop_meta.get("unwrapped", False): + items_name = prop_meta.get("itemsName") + if items_name: + items_ns = prop_meta.get("itemsNs") + if items_ns is not None: + xml_ns = items_ns + if xml_ns: + items_name = "{" + xml_ns + "}" + items_name + else: + items_name = xml_name + plan.append((rf._rest_name, xml_name, 2, deser, rf._type, is_optional, items_name)) + elif prop_meta.get("text", False): + plan.append((rf._rest_name, xml_name, 3, deser, rf._type, is_optional, None)) + else: + plan.append((rf._rest_name, xml_name, 0, deser, rf._type, is_optional, None)) + + return plan + + +# pylint: enable=docstring-missing-param class Model(_MyMutableMapping): _is_model = True # label whether current class's _attr_to_rest_field has been calculated @@ -593,59 +833,10 @@ def __init__(self, *args: typing.Any, **kwargs: typing.Any) -> None: class_name = self.__class__.__name__ if len(args) > 1: raise TypeError(f"{class_name}.__init__() takes 2 positional arguments but {len(args) + 1} were given") - dict_to_pass = { - rest_field._rest_name: rest_field._default - for rest_field in self._attr_to_rest_field.values() - if rest_field._default is not _UNSET - } - if args: # pylint: disable=too-many-nested-blocks + dict_to_pass: dict[str, typing.Any] = {} + if args: if isinstance(args[0], ET.Element): - existed_attr_keys = [] - model_meta = getattr(self, "_xml", {}) - - for rf in self._attr_to_rest_field.values(): - prop_meta = getattr(rf, "_xml", {}) - xml_name = prop_meta.get("name", rf._rest_name) - xml_ns = prop_meta.get("ns", model_meta.get("ns", None)) - if xml_ns: - xml_name = "{" + xml_ns + "}" + xml_name - - # attribute - if prop_meta.get("attribute", False) and args[0].get(xml_name) is not None: - existed_attr_keys.append(xml_name) - dict_to_pass[rf._rest_name] = _deserialize(rf._type, args[0].get(xml_name)) - continue - - # unwrapped element is array - if prop_meta.get("unwrapped", False): - # unwrapped array could either use prop items meta/prop meta - if prop_meta.get("itemsName"): - xml_name = prop_meta.get("itemsName") - xml_ns = prop_meta.get("itemNs") - if xml_ns: - xml_name = "{" + xml_ns + "}" + xml_name - items = args[0].findall(xml_name) # pyright: ignore - if len(items) > 0: - existed_attr_keys.append(xml_name) - dict_to_pass[rf._rest_name] = _deserialize(rf._type, items) - continue - - # text element is primitive type - if prop_meta.get("text", False): - if args[0].text is not None: - dict_to_pass[rf._rest_name] = _deserialize(rf._type, args[0].text) - continue - - # wrapped element could be normal property or array, it should only have one element - item = args[0].find(xml_name) - if item is not None: - existed_attr_keys.append(xml_name) - dict_to_pass[rf._rest_name] = _deserialize(rf._type, item) - - # rest thing is additional properties - for e in args[0]: - if e.tag not in existed_attr_keys: - dict_to_pass[e.tag] = _convert_element(e) + dict_to_pass.update(self._init_from_xml(args[0])) else: dict_to_pass.update( {k: _create_value(_get_rest_field(self._attr_to_rest_field, k), v) for k, v in args[0].items()} @@ -662,8 +853,117 @@ def __init__(self, *args: typing.Any, **kwargs: typing.Any) -> None: if v is not None } ) + # Apply client default values for fields the caller didn't set so that + # defaults are part of `_data` and therefore included during serialization. + for rf in self._attr_to_rest_field.values(): + if rf._default is _UNSET: + continue + if rf._rest_name in dict_to_pass: + continue + dict_to_pass[rf._rest_name] = _create_value(rf, rf._default) super().__init__(dict_to_pass) + def _init_from_xml( # pylint: disable=too-many-branches, too-many-statements + self, element: ET.Element + ) -> dict[str, typing.Any]: + """Deserialize an XML element into a dict mapping rest field names to values. + + :param ET.Element element: The XML element to deserialize from. + :returns: A dictionary of rest_name to deserialized value pairs. + :rtype: dict + """ + result: dict[str, typing.Any] = {} + existed_attr_keys: list[str] = [] + + field_plan = getattr(self, "_xml_field_plan", None) + if field_plan: + for rest_name, xml_name, kind, deser, rf_type, is_optional, items_name in field_plan: + if kind == 0: # wrapped element (most common) + item = element.find(xml_name) + if item is not None: + existed_attr_keys.append(xml_name) + if deser: + result[rest_name] = deser(item) + else: + result[rest_name] = _deserialize(rf_type, item) + elif kind == 1: # attribute + attr_val = element.get(xml_name) + if attr_val is not None: + existed_attr_keys.append(xml_name) + if deser: + result[rest_name] = deser(attr_val) + else: + result[rest_name] = attr_val + elif kind == 2: # unwrapped array + items = element.findall(items_name) # pyright: ignore + if len(items) > 0: + existed_attr_keys.append(items_name) + if deser: + result[rest_name] = deser(items) + else: + result[rest_name] = _deserialize(rf_type, items) + elif not is_optional: + existed_attr_keys.append(items_name) + result[rest_name] = [] + elif kind == 3: # text + if element.text is not None: + if deser: + result[rest_name] = deser(element.text) + else: + result[rest_name] = element.text + else: + model_meta = getattr(self, "_xml", {}) + for rf in self._attr_to_rest_field.values(): + prop_meta = getattr(rf, "_xml", {}) + xml_name = prop_meta.get("name", rf._rest_name) + xml_ns = _resolve_xml_ns(prop_meta, model_meta) + if xml_ns: + xml_name = "{" + xml_ns + "}" + xml_name + + # attribute + if prop_meta.get("attribute", False) and element.get(xml_name) is not None: + existed_attr_keys.append(xml_name) + result[rf._rest_name] = _deserialize(rf._type, element.get(xml_name)) + continue + + # unwrapped element is array + if prop_meta.get("unwrapped", False): + _items_name = prop_meta.get("itemsName") + if _items_name: + xml_name = _items_name + _items_ns = prop_meta.get("itemsNs") + if _items_ns is not None: + xml_ns = _items_ns + if xml_ns: + xml_name = "{" + xml_ns + "}" + xml_name + items = element.findall(xml_name) # pyright: ignore + if len(items) > 0: + existed_attr_keys.append(xml_name) + result[rf._rest_name] = _deserialize(rf._type, items) + elif not rf._is_optional: + existed_attr_keys.append(xml_name) + result[rf._rest_name] = [] + continue + + # text element is primitive type + if prop_meta.get("text", False): + if element.text is not None: + result[rf._rest_name] = _deserialize(rf._type, element.text) + continue + + # wrapped element could be normal property or array + item = element.find(xml_name) + if item is not None: + existed_attr_keys.append(xml_name) + result[rf._rest_name] = _deserialize(rf._type, item) + + # rest thing is additional properties + for e in element: + if e.tag not in existed_attr_keys: + result[e.tag] = _convert_element(e) + + return result + def copy(self) -> "Model": return Model(self.__dict__) @@ -688,6 +988,9 @@ def __new__(cls, *args: typing.Any, **kwargs: typing.Any) -> Self: if not rf._rest_name_input: rf._rest_name_input = attr cls._attr_to_rest_field: dict[str, _RestField] = dict(attr_to_rest_field.items()) + # Build XML field plan for fast _init_from_xml (only for XML models) + if getattr(cls, "_xml", None): + cls._xml_field_plan = _build_xml_field_plan(cls, attr_to_rest_field) cls._calculated.add(f"{cls.__module__}.{cls.__qualname__}") return super().__new__(cls) @@ -716,7 +1019,7 @@ def _deserialize(cls, data, exist_discriminators): model_meta = getattr(cls, "_xml", {}) prop_meta = getattr(discriminator, "_xml", {}) xml_name = prop_meta.get("name", discriminator._rest_name) - xml_ns = prop_meta.get("ns", model_meta.get("ns", None)) + xml_ns = _resolve_xml_ns(prop_meta, model_meta) if xml_ns: xml_name = "{" + xml_ns + "}" + xml_name @@ -889,6 +1192,8 @@ def _get_deserialize_callable_from_annotation( # pylint: disable=too-many-retur # is it optional? try: if any(a is _NONE_TYPE for a in annotation.__args__): # pyright: ignore + if rf: + rf._is_optional = True if len(annotation.__args__) <= 2: # pyright: ignore if_obj_deserializer = _get_deserialize_callable_from_annotation( next(a for a in annotation.__args__ if a is not _NONE_TYPE), module, rf # pyright: ignore @@ -981,16 +1286,20 @@ def _deserialize_with_callable( return float(value.text) if value.text else None if deserializer is bool: return value.text == "true" if value.text else None + if deserializer and deserializer in _DESERIALIZE_MAPPING.values(): + return deserializer(value.text) if value.text else None + if deserializer and deserializer in _DESERIALIZE_MAPPING_WITHFORMAT.values(): + return deserializer(value.text) if value.text else None if deserializer is None: return value if deserializer in [int, float, bool]: return deserializer(value) if isinstance(deserializer, CaseInsensitiveEnumMeta): try: - return deserializer(value) + return deserializer(value.text if isinstance(value, ET.Element) else value) except ValueError: # for unknown value, return raw value - return value + return value.text if isinstance(value, ET.Element) else value if isinstance(deserializer, type) and issubclass(deserializer, Model): return deserializer._deserialize(value, []) return typing.cast(typing.Callable[[typing.Any], typing.Any], deserializer)(value) @@ -1043,6 +1352,7 @@ def _failsafe_deserialize_xml( return None +# pylint: disable=too-many-instance-attributes class _RestField: def __init__( self, @@ -1055,6 +1365,7 @@ def __init__( format: typing.Optional[str] = None, is_multipart_file_input: bool = False, xml: typing.Optional[dict[str, typing.Any]] = None, + deserializer: typing.Optional[typing.Callable] = None, ): self._type = type self._rest_name_input = name @@ -1062,10 +1373,12 @@ def __init__( self._is_discriminator = is_discriminator self._visibility = visibility self._is_model = False + self._is_optional = False self._default = default self._format = format self._is_multipart_file_input = is_multipart_file_input self._xml = xml if xml is not None else {} + self._deserializer = deserializer @property def _class_type(self) -> typing.Any: @@ -1085,7 +1398,10 @@ def __get__(self, obj: Model, type=None): # pylint: disable=redefined-builtin # by this point, type and rest_name will have a value bc we default # them in __new__ of the Model class # Use _data.get() directly to avoid triggering __getitem__ which clears the cache - item = obj._data.get(self._rest_name) + item = obj._data.get(self._rest_name, _UNSET) + if item is _UNSET: + # Field not set by user; return the client default if one exists, otherwise None + return self._default if self._default is not _UNSET else None if item is None: return item if self._is_model: @@ -1098,7 +1414,11 @@ def __get__(self, obj: Model, type=None): # pylint: disable=redefined-builtin # Return the value from _data directly (it's been deserialized in place) return obj._data.get(self._rest_name) - deserialized = _deserialize(self._type, _serialize(item, self._format), rf=self) + # Fast path: use _deserializer directly (avoids _serialize/_deserialize chain) + if self._deserializer: + deserialized = self._deserializer(item) + else: + deserialized = _deserialize(self._type, _serialize(item, self._format), rf=self) # For mutable types, store the deserialized value back in _data # so mutations directly affect _data @@ -1144,6 +1464,7 @@ def rest_field( format: typing.Optional[str] = None, is_multipart_file_input: bool = False, xml: typing.Optional[dict[str, typing.Any]] = None, + deserializer: typing.Optional[typing.Callable] = None, ) -> typing.Any: return _RestField( name=name, @@ -1153,6 +1474,7 @@ def rest_field( format=format, is_multipart_file_input=is_multipart_file_input, xml=xml, + deserializer=deserializer, ) @@ -1177,6 +1499,56 @@ def serialize_xml(model: Model, exclude_readonly: bool = False) -> str: return ET.tostring(_get_element(model, exclude_readonly), encoding="unicode") # type: ignore +def _get_xml_ns(meta: dict[str, typing.Any]) -> typing.Optional[str]: + """Return the XML namespace from a metadata dict, checking both 'ns' (old-style) and 'namespace' (DPG) keys. + + :param dict meta: The metadata dictionary to extract namespace from. + :returns: The namespace string if 'ns' or 'namespace' key is present, None otherwise. + :rtype: str or None + """ + ns = meta.get("ns") + if ns is None: + ns = meta.get("namespace") + return ns + + +def _resolve_xml_ns( + prop_meta: dict[str, typing.Any], model_meta: typing.Optional[dict[str, typing.Any]] = None +) -> typing.Optional[str]: + """Resolve XML namespace for a property, falling back to model namespace when appropriate. + + Checks the property metadata first; if no namespace is found and the model does not declare + an explicit prefix, falls back to the model-level namespace. + + :param dict prop_meta: The property metadata dictionary. + :param dict model_meta: The model metadata dictionary, used as fallback. + :returns: The resolved namespace string, or None. + :rtype: str or None + """ + ns = _get_xml_ns(prop_meta) + if ns is None and model_meta is not None and not model_meta.get("prefix"): + ns = _get_xml_ns(model_meta) + return ns + + +def _set_xml_attribute(element: ET.Element, name: str, value: typing.Any, prop_meta: dict[str, typing.Any]) -> None: + """Set an XML attribute on an element, handling namespace prefix registration. + + :param ET.Element element: The element to set the attribute on. + :param str name: The default attribute name (wire name). + :param any value: The attribute value. + :param dict prop_meta: The property metadata dictionary. + """ + xml_name = prop_meta.get("name", name) + _attr_ns = _get_xml_ns(prop_meta) + if _attr_ns: + _attr_prefix = prop_meta.get("prefix") + if _attr_prefix: + _safe_register_namespace(_attr_prefix, _attr_ns) + xml_name = "{" + _attr_ns + "}" + xml_name + element.set(xml_name, _get_primitive_type_value(value)) + + def _get_element( o: typing.Any, exclude_readonly: bool = False, @@ -1188,10 +1560,16 @@ def _get_element( # if prop is a model, then use the prop element directly, else generate a wrapper of model if wrapped_element is None: + # When serializing as an array item (parent_meta is set), check if the parent has an + # explicit itemsName. This ensures correct element names for unwrapped arrays (where + # the element tag is the property/items name, not the model type name). + _items_name = parent_meta.get("itemsName") if parent_meta is not None else None + element_name = _items_name if _items_name else (model_meta.get("name") or o.__class__.__name__) + _model_ns = _get_xml_ns(model_meta) wrapped_element = _create_xml_element( - model_meta.get("name", o.__class__.__name__), + element_name, model_meta.get("prefix"), - model_meta.get("ns"), + _model_ns, ) readonly_props = [] @@ -1213,7 +1591,9 @@ def _get_element( # additional properties will not have rest field, use the wire name as xml name prop_meta = {"name": k} - # if no ns for prop, use model's + # Propagate model namespace to properties only for old-style "ns"-keyed models. + # DPG-generated models use the "namespace" key and explicitly declare namespace on + # each property that needs it, so propagation is intentionally skipped for them. if prop_meta.get("ns") is None and model_meta.get("ns"): prop_meta["ns"] = model_meta.get("ns") prop_meta["prefix"] = model_meta.get("prefix") @@ -1225,12 +1605,7 @@ def _get_element( # text could only set on primitive type wrapped_element.text = _get_primitive_type_value(v) elif prop_meta.get("attribute", False): - xml_name = prop_meta.get("name", k) - if prop_meta.get("ns"): - ET.register_namespace(prop_meta.get("prefix"), prop_meta.get("ns")) # pyright: ignore - xml_name = "{" + prop_meta.get("ns") + "}" + xml_name # pyright: ignore - # attribute should be primitive type - wrapped_element.set(xml_name, _get_primitive_type_value(v)) + _set_xml_attribute(wrapped_element, k, v, prop_meta) else: # other wrapped prop element wrapped_element.append(_get_wrapped_element(v, exclude_readonly, prop_meta)) @@ -1239,6 +1614,7 @@ def _get_element( return [_get_element(x, exclude_readonly, parent_meta) for x in o] # type: ignore if isinstance(o, dict): result = [] + _dict_ns = _get_xml_ns(parent_meta) if parent_meta else None for k, v in o.items(): result.append( _get_wrapped_element( @@ -1246,7 +1622,7 @@ def _get_element( exclude_readonly, { "name": k, - "ns": parent_meta.get("ns") if parent_meta else None, + "ns": _dict_ns, "prefix": parent_meta.get("prefix") if parent_meta else None, }, ) @@ -1255,13 +1631,16 @@ def _get_element( # primitive case need to create element based on parent_meta if parent_meta: + _items_ns = parent_meta.get("itemsNs") + if _items_ns is None: + _items_ns = _get_xml_ns(parent_meta) return _get_wrapped_element( o, exclude_readonly, { "name": parent_meta.get("itemsName", parent_meta.get("name")), "prefix": parent_meta.get("itemsPrefix", parent_meta.get("prefix")), - "ns": parent_meta.get("itemsNs", parent_meta.get("ns")), + "ns": _items_ns, }, ) @@ -1273,8 +1652,9 @@ def _get_wrapped_element( exclude_readonly: bool, meta: typing.Optional[dict[str, typing.Any]], ) -> ET.Element: + _meta_ns = _get_xml_ns(meta) if meta else None wrapped_element = _create_xml_element( - meta.get("name") if meta else None, meta.get("prefix") if meta else None, meta.get("ns") if meta else None + meta.get("name") if meta else None, meta.get("prefix") if meta else None, _meta_ns ) if isinstance(v, (dict, list)): wrapped_element.extend(_get_element(v, exclude_readonly, meta)) @@ -1295,11 +1675,29 @@ def _get_primitive_type_value(v) -> str: return str(v) +def _safe_register_namespace(prefix: str, ns: str) -> None: + """Register an XML namespace prefix, handling reserved prefix patterns. + + Some prefixes (e.g. 'ns2') match Python's reserved 'ns\\d+' pattern used for + auto-generated prefixes, causing register_namespace to raise ValueError. + Falls back to directly registering in the internal namespace map. + + :param str prefix: The namespace prefix to register. + :param str ns: The namespace URI. + """ + try: + ET.register_namespace(prefix, ns) + except ValueError: + _ns_map = getattr(ET, "_namespace_map", None) + if _ns_map is not None: + _ns_map[ns] = prefix + + def _create_xml_element( tag: typing.Any, prefix: typing.Optional[str] = None, ns: typing.Optional[str] = None ) -> ET.Element: if prefix and ns: - ET.register_namespace(prefix, ns) + _safe_register_namespace(prefix, ns) if ns: return ET.Element("{" + ns + "}" + tag) return ET.Element(tag) @@ -1310,6 +1708,8 @@ def _deserialize_xml( value: str, ) -> typing.Any: element = ET.fromstring(value) # nosec + if _is_model(deserializer): + return deserializer._deserialize(element, []) return _deserialize(deserializer, element) diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/azure/mgmt/postgresqlflexibleservers/_utils/serialization.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/azure/mgmt/postgresqlflexibleservers/_utils/serialization.py index 81ec1de5922b..a088671e9c51 100644 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/azure/mgmt/postgresqlflexibleservers/_utils/serialization.py +++ b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/azure/mgmt/postgresqlflexibleservers/_utils/serialization.py @@ -39,11 +39,15 @@ import xml.etree.ElementTree as ET import isodate # type: ignore -from typing_extensions import Self from azure.core.exceptions import DeserializationError, SerializationError from azure.core.serialization import NULL as CoreNull +if sys.version_info >= (3, 11): + from typing import Self +else: + from typing_extensions import Self + _BOM = codecs.BOM_UTF8.decode(encoding="utf-8") JSON = MutableMapping[str, Any] @@ -1401,7 +1405,7 @@ def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: # Otherwise, result are unexpected self.additional_properties_detection = True - def __call__(self, target_obj, response_data, content_type=None): + def __call__(self, target_obj, response_data, content_type=None): # pylint: disable=too-many-return-statements """Call the deserializer to process a REST response. :param str target_obj: Target data type to deserialize to. @@ -1411,6 +1415,27 @@ def __call__(self, target_obj, response_data, content_type=None): :return: Deserialized object. :rtype: object """ + # Fast path for header deserialization: response_data is a plain str or None + # and target_obj is a simple scalar type. This avoids the expensive + # _unpack_content → _deserialize → _classify_target → deserialize_data chain. + if response_data is None: + return None + if target_obj == "str" and isinstance(response_data, str): + return response_data + if isinstance(response_data, str): + if target_obj == "int": + return int(response_data) + if target_obj == "bool": + if response_data in ("true", "1", "True"): + return True + if response_data in ("false", "0", "False"): + return False + return bool(response_data) + if target_obj == "rfc-1123": + return Deserializer.deserialize_rfc(response_data) + if target_obj == "bytearray": + return Deserializer.deserialize_bytearray(response_data) + data = self._unpack_content(response_data, content_type) return self._deserialize(target_obj, data) diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/azure/mgmt/postgresqlflexibleservers/_version.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/azure/mgmt/postgresqlflexibleservers/_version.py index fd5e9189cf06..6683b975dd63 100644 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/azure/mgmt/postgresqlflexibleservers/_version.py +++ b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/azure/mgmt/postgresqlflexibleservers/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "3.0.0b1" +VERSION = "3.0.0b2" diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/azure/mgmt/postgresqlflexibleservers/aio/_client.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/azure/mgmt/postgresqlflexibleservers/aio/_client.py index b249ec57b560..29588508f107 100644 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/azure/mgmt/postgresqlflexibleservers/aio/_client.py +++ b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/azure/mgmt/postgresqlflexibleservers/aio/_client.py @@ -7,8 +7,8 @@ # -------------------------------------------------------------------------- from copy import deepcopy +import sys from typing import Any, Awaitable, Optional, TYPE_CHECKING, cast -from typing_extensions import Self from azure.core.pipeline import policies from azure.core.rest import AsyncHttpResponse, HttpRequest @@ -30,6 +30,8 @@ ConfigurationsOperations, DatabasesOperations, FirewallRulesOperations, + MaintenanceEventsOperations, + MajorVersionUpgradePrecheckOperations, MigrationsOperations, NameAvailabilityOperations, Operations, @@ -45,6 +47,11 @@ VirtualNetworkSubnetUsageOperations, ) +if sys.version_info >= (3, 11): + from typing import Self +else: + from typing_extensions import Self # type: ignore + if TYPE_CHECKING: from azure.core import AzureClouds from azure.core.credentials_async import AsyncTokenCredential @@ -79,6 +86,12 @@ class PostgreSQLManagementClient: # pylint: disable=too-many-instance-attribute :ivar virtual_endpoints: VirtualEndpointsOperations operations :vartype virtual_endpoints: azure.mgmt.postgresqlflexibleservers.aio.operations.VirtualEndpointsOperations + :ivar maintenance_events: MaintenanceEventsOperations operations + :vartype maintenance_events: + azure.mgmt.postgresqlflexibleservers.aio.operations.MaintenanceEventsOperations + :ivar major_version_upgrade_precheck: MajorVersionUpgradePrecheckOperations operations + :vartype major_version_upgrade_precheck: + azure.mgmt.postgresqlflexibleservers.aio.operations.MajorVersionUpgradePrecheckOperations :ivar administrators_microsoft_entra: AdministratorsMicrosoftEntraOperations operations :vartype administrators_microsoft_entra: azure.mgmt.postgresqlflexibleservers.aio.operations.AdministratorsMicrosoftEntraOperations @@ -131,8 +144,9 @@ class PostgreSQLManagementClient: # pylint: disable=too-many-instance-attribute None. :paramtype cloud_setting: ~azure.core.AzureClouds :keyword api_version: The API version to use for this operation. Known values are - "2026-01-01-preview" and None. Default value is "2026-01-01-preview". Note that overriding this - default value may result in unsupported behavior. + "2026-04-01-preview" and None. Default value is None. If not set, the operation's default API + version will be used. Note that overriding this default value may result in unsupported + behavior. :paramtype api_version: str :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. @@ -202,6 +216,12 @@ def __init__( self.virtual_endpoints = VirtualEndpointsOperations( self._client, self._config, self._serialize, self._deserialize ) + self.maintenance_events = MaintenanceEventsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.major_version_upgrade_precheck = MajorVersionUpgradePrecheckOperations( + self._client, self._config, self._serialize, self._deserialize + ) self.administrators_microsoft_entra = AdministratorsMicrosoftEntraOperations( self._client, self._config, self._serialize, self._deserialize ) diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/azure/mgmt/postgresqlflexibleservers/aio/_configuration.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/azure/mgmt/postgresqlflexibleservers/aio/_configuration.py index e602b95298e9..137d39f648f5 100644 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/azure/mgmt/postgresqlflexibleservers/aio/_configuration.py +++ b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/azure/mgmt/postgresqlflexibleservers/aio/_configuration.py @@ -34,8 +34,9 @@ class PostgreSQLManagementClientConfiguration: # pylint: disable=too-many-insta None. :type cloud_setting: ~azure.core.AzureClouds :keyword api_version: The API version to use for this operation. Known values are - "2026-01-01-preview" and None. Default value is "2026-01-01-preview". Note that overriding this - default value may result in unsupported behavior. + "2026-04-01-preview" and None. Default value is None. If not set, the operation's default API + version will be used. Note that overriding this default value may result in unsupported + behavior. :paramtype api_version: str """ @@ -47,7 +48,7 @@ def __init__( cloud_setting: Optional["AzureClouds"] = None, **kwargs: Any ) -> None: - api_version: str = kwargs.pop("api_version", "2026-01-01-preview") + api_version: str = kwargs.pop("api_version", "2026-04-01-preview") if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/azure/mgmt/postgresqlflexibleservers/aio/_patch.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/azure/mgmt/postgresqlflexibleservers/aio/_patch.py index 87676c65a8f0..ea765788358a 100644 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/azure/mgmt/postgresqlflexibleservers/aio/_patch.py +++ b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/azure/mgmt/postgresqlflexibleservers/aio/_patch.py @@ -8,7 +8,6 @@ Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ - __all__: list[str] = [] # Add all objects you want publicly available to users at this package level diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/azure/mgmt/postgresqlflexibleservers/aio/operations/__init__.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/azure/mgmt/postgresqlflexibleservers/aio/operations/__init__.py index ec5ea57d4214..ce31cef7fb90 100644 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/azure/mgmt/postgresqlflexibleservers/aio/operations/__init__.py +++ b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/azure/mgmt/postgresqlflexibleservers/aio/operations/__init__.py @@ -21,6 +21,8 @@ from ._operations import PrivateEndpointConnectionsOperations # type: ignore from ._operations import PrivateLinkResourcesOperations # type: ignore from ._operations import VirtualEndpointsOperations # type: ignore +from ._operations import MaintenanceEventsOperations # type: ignore +from ._operations import MajorVersionUpgradePrecheckOperations # type: ignore from ._operations import AdministratorsMicrosoftEntraOperations # type: ignore from ._operations import CapabilitiesByServerOperations # type: ignore from ._operations import CapturedLogsOperations # type: ignore @@ -50,6 +52,8 @@ "PrivateEndpointConnectionsOperations", "PrivateLinkResourcesOperations", "VirtualEndpointsOperations", + "MaintenanceEventsOperations", + "MajorVersionUpgradePrecheckOperations", "AdministratorsMicrosoftEntraOperations", "CapabilitiesByServerOperations", "CapturedLogsOperations", diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/azure/mgmt/postgresqlflexibleservers/aio/operations/_operations.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/azure/mgmt/postgresqlflexibleservers/aio/operations/_operations.py index 7233674acd3d..b5e17add8d29 100644 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/azure/mgmt/postgresqlflexibleservers/aio/operations/_operations.py +++ b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/azure/mgmt/postgresqlflexibleservers/aio/operations/_operations.py @@ -67,6 +67,12 @@ build_firewall_rules_delete_request, build_firewall_rules_get_request, build_firewall_rules_list_by_server_request, + build_maintenance_events_apply_now_request, + build_maintenance_events_get_request, + build_maintenance_events_list_request, + build_maintenance_events_reschedule_request, + build_major_version_upgrade_precheck_get_request, + build_major_version_upgrade_precheck_list_request, build_migrations_cancel_request, build_migrations_check_name_availability_request, build_migrations_create_request, @@ -93,6 +99,7 @@ build_servers_list_by_subscription_request, build_servers_migrate_network_mode_request, build_servers_restart_request, + build_servers_start_major_version_upgrade_precheck_request, build_servers_start_request, build_servers_stop_request, build_servers_update_request, @@ -181,7 +188,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -194,7 +204,10 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.Operation], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.Operation], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -284,6 +297,7 @@ async def get( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -305,7 +319,7 @@ async def get( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.Migration, response.json()) @@ -466,6 +480,7 @@ async def create( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -487,7 +502,7 @@ async def create( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.Migration, response.json()) @@ -657,6 +672,7 @@ async def update( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -678,7 +694,7 @@ async def update( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.Migration, response.json()) @@ -731,6 +747,7 @@ async def cancel( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -754,7 +771,7 @@ async def cancel( deserialized = None if response.status_code == 200: if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.Migration, response.json()) @@ -832,7 +849,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -845,7 +865,10 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.Migration], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.Migration], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -1026,6 +1049,7 @@ async def check_name_availability( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -1047,7 +1071,7 @@ async def check_name_availability( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.MigrationNameAvailability, response.json()) @@ -1115,6 +1139,7 @@ async def get(self, resource_group_name: str, server_name: str, **kwargs: Any) - } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -1136,7 +1161,7 @@ async def get(self, resource_group_name: str, server_name: str, **kwargs: Any) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.Server, response.json()) @@ -1188,6 +1213,7 @@ async def _create_or_update_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -1214,7 +1240,7 @@ async def _create_or_update_initial( response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -1433,6 +1459,7 @@ async def _update_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -1459,7 +1486,7 @@ async def _update_initial( response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -1664,6 +1691,7 @@ async def _delete_initial(self, resource_group_name: str, server_name: str, **kw } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -1691,7 +1719,7 @@ async def _delete_initial(self, resource_group_name: str, server_name: str, **kw response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -1808,7 +1836,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -1821,7 +1852,10 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.Server], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.Server], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -1896,7 +1930,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -1909,7 +1946,10 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.Server], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.Server], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -1982,6 +2022,7 @@ async def _restart_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -2008,7 +2049,7 @@ async def _restart_initial( response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -2194,6 +2235,7 @@ async def _start_initial(self, resource_group_name: str, server_name: str, **kwa } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -2220,7 +2262,7 @@ async def _start_initial(self, resource_group_name: str, server_name: str, **kwa response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -2311,6 +2353,7 @@ async def _stop_initial(self, resource_group_name: str, server_name: str, **kwar } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -2337,7 +2380,7 @@ async def _stop_initial(self, resource_group_name: str, server_name: str, **kwar response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -2406,7 +2449,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- params_added_on={ "2026-01-01-preview": ["api_version", "subscription_id", "resource_group_name", "server_name", "accept"] }, - api_versions_list=["2026-01-01-preview"], + api_versions_list=["2026-01-01-preview", "2026-04-01-preview"], ) async def _migrate_network_mode_initial( self, resource_group_name: str, server_name: str, **kwargs: Any @@ -2437,6 +2480,7 @@ async def _migrate_network_mode_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -2468,7 +2512,7 @@ async def _migrate_network_mode_initial( response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) response_headers["x-ms-request-id"] = self._deserialize("str", response.headers.get("x-ms-request-id")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -2481,14 +2525,13 @@ async def _migrate_network_mode_initial( params_added_on={ "2026-01-01-preview": ["api_version", "subscription_id", "resource_group_name", "server_name", "accept"] }, - api_versions_list=["2026-01-01-preview"], + api_versions_list=["2026-01-01-preview", "2026-04-01-preview"], ) async def begin_migrate_network_mode( self, resource_group_name: str, server_name: str, **kwargs: Any ) -> AsyncLROPoller[_models.MigrateNetworkStatus]: - """Migrates the network configuration of a PostgreSQL flexible server from customer owned VNET to - Microsoft owned VNET with support for private endpoints, or from Microsoft owned VNET with no - support for private endpoints to Microsoft owned VNET with support for private endpoints. + """Migrates an Azure Database for PostgreSQL server from VNet integration to a Private Link + network model. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -2553,6 +2596,284 @@ def get_long_running_output(pipeline_response): self._client, raw_result, get_long_running_output, polling_method # type: ignore ) + @api_version_validation( + method_added_on="2026-04-01-preview", + params_added_on={ + "2026-04-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "server_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2026-04-01-preview"], + ) + async def _start_major_version_upgrade_precheck_initial( # pylint: disable=name-too-long + self, + resource_group_name: str, + server_name: str, + body: Union[_models.StartMajorVersionUpgradePrecheckRequest, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_servers_start_major_version_upgrade_precheck_request( + resource_group_name=resource_group_name, + server_name=server_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 200: + response_headers["x-ms-request-id"] = self._deserialize("str", response.headers.get("x-ms-request-id")) + + if response.status_code == 202: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_start_major_version_upgrade_precheck( # pylint: disable=name-too-long + self, + resource_group_name: str, + server_name: str, + body: _models.StartMajorVersionUpgradePrecheckRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.StartMajorVersionUpgradePrecheckResponse]: + """Start Major Version Upgrade Prechecks. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param body: The content of the action request. Required. + :type body: + ~azure.mgmt.postgresqlflexibleservers.models.StartMajorVersionUpgradePrecheckRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns StartMajorVersionUpgradePrecheckResponse. + The StartMajorVersionUpgradePrecheckResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.postgresqlflexibleservers.models.StartMajorVersionUpgradePrecheckResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_start_major_version_upgrade_precheck( # pylint: disable=name-too-long + self, + resource_group_name: str, + server_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.StartMajorVersionUpgradePrecheckResponse]: + """Start Major Version Upgrade Prechecks. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param body: The content of the action request. Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns StartMajorVersionUpgradePrecheckResponse. + The StartMajorVersionUpgradePrecheckResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.postgresqlflexibleservers.models.StartMajorVersionUpgradePrecheckResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_start_major_version_upgrade_precheck( # pylint: disable=name-too-long + self, + resource_group_name: str, + server_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.StartMajorVersionUpgradePrecheckResponse]: + """Start Major Version Upgrade Prechecks. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param body: The content of the action request. Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns StartMajorVersionUpgradePrecheckResponse. + The StartMajorVersionUpgradePrecheckResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.postgresqlflexibleservers.models.StartMajorVersionUpgradePrecheckResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + @api_version_validation( + method_added_on="2026-04-01-preview", + params_added_on={ + "2026-04-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "server_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2026-04-01-preview"], + ) + async def begin_start_major_version_upgrade_precheck( # pylint: disable=name-too-long + self, + resource_group_name: str, + server_name: str, + body: Union[_models.StartMajorVersionUpgradePrecheckRequest, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.StartMajorVersionUpgradePrecheckResponse]: + """Start Major Version Upgrade Prechecks. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param body: The content of the action request. Is one of the following types: + StartMajorVersionUpgradePrecheckRequest, JSON, IO[bytes] Required. + :type body: + ~azure.mgmt.postgresqlflexibleservers.models.StartMajorVersionUpgradePrecheckRequest or JSON or + IO[bytes] + :return: An instance of AsyncLROPoller that returns StartMajorVersionUpgradePrecheckResponse. + The StartMajorVersionUpgradePrecheckResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.postgresqlflexibleservers.models.StartMajorVersionUpgradePrecheckResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.StartMajorVersionUpgradePrecheckResponse] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._start_major_version_upgrade_precheck_initial( + resource_group_name=resource_group_name, + server_name=server_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["x-ms-request-id"] = self._deserialize("str", response.headers.get("x-ms-request-id")) + + deserialized = _deserialize(_models.StartMajorVersionUpgradePrecheckResponse, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.StartMajorVersionUpgradePrecheckResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.StartMajorVersionUpgradePrecheckResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + class ConfigurationsOperations: """ @@ -2618,6 +2939,7 @@ async def get( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -2639,7 +2961,7 @@ async def get( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.Configuration, response.json()) @@ -2693,6 +3015,7 @@ async def _put_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -2719,7 +3042,7 @@ async def _put_initial( response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -2967,6 +3290,7 @@ async def _update_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -2993,7 +3317,7 @@ async def _update_initial( response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -3254,7 +3578,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -3267,7 +3594,10 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.Configuration], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.Configuration], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -3358,6 +3688,7 @@ async def get( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -3379,7 +3710,7 @@ async def get( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.Database, response.json()) @@ -3433,6 +3764,7 @@ async def _create_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -3459,7 +3791,7 @@ async def _create_initial( response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -3683,6 +4015,7 @@ async def _delete_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -3710,7 +4043,7 @@ async def _delete_initial( response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -3838,7 +4171,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -3851,7 +4187,10 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.Database], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.Database], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -3941,6 +4280,7 @@ async def get( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -3962,7 +4302,7 @@ async def get( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.FirewallRule, response.json()) @@ -4016,6 +4356,7 @@ async def _create_or_update_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -4042,7 +4383,7 @@ async def _create_or_update_initial( response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -4263,6 +4604,7 @@ async def _delete_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -4290,7 +4632,7 @@ async def _delete_initial( response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -4417,7 +4759,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -4430,7 +4775,10 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.FirewallRule], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.FirewallRule], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -4522,6 +4870,7 @@ async def get( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -4543,7 +4892,7 @@ async def get( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.PrivateEndpointConnection, response.json()) @@ -4597,6 +4946,7 @@ async def _update_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -4623,7 +4973,7 @@ async def _update_initial( response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -4848,6 +5198,7 @@ async def _delete_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -4875,7 +5226,7 @@ async def _delete_initial( response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -5003,7 +5354,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -5016,7 +5370,10 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.PrivateEndpointConnection], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.PrivateEndpointConnection], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -5106,6 +5463,7 @@ async def get( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -5127,7 +5485,7 @@ async def get( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.PrivateLinkResource, response.json()) @@ -5194,7 +5552,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -5207,7 +5568,10 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.PrivateLinkResource], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.PrivateLinkResource], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -5297,6 +5661,7 @@ async def get( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -5318,7 +5683,7 @@ async def get( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.VirtualEndpoint, response.json()) @@ -5372,6 +5737,7 @@ async def _create_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -5398,7 +5764,7 @@ async def _create_initial( response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -5637,6 +6003,7 @@ async def _update_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -5663,7 +6030,7 @@ async def _update_initial( response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -5884,6 +6251,7 @@ async def _delete_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -5911,7 +6279,7 @@ async def _delete_initial( response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -6038,7 +6406,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -6051,7 +6422,10 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.VirtualEndpoint], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.VirtualEndpoint], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -6078,14 +6452,14 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) -class AdministratorsMicrosoftEntraOperations: +class MaintenanceEventsOperations: """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.postgresqlflexibleservers.aio.PostgreSQLManagementClient`'s - :attr:`administrators_microsoft_entra` attribute. + :attr:`maintenance_events` attribute. """ def __init__(self, *args, **kwargs) -> None: @@ -6098,21 +6472,35 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace_async + @api_version_validation( + method_added_on="2026-04-01-preview", + params_added_on={ + "2026-04-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "server_name", + "maintenance_event_id", + "accept", + ] + }, + api_versions_list=["2026-04-01-preview"], + ) async def get( - self, resource_group_name: str, server_name: str, object_id: str, **kwargs: Any - ) -> _models.AdministratorMicrosoftEntra: - """Gets information about a server administrator associated to a Microsoft Entra principal. + self, resource_group_name: str, server_name: str, maintenance_event_id: str, **kwargs: Any + ) -> _models.MaintenanceEventResource: + """Gets information about a maintenance event for a flexible server. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param server_name: The name of the server. Required. :type server_name: str - :param object_id: Object identifier of the Microsoft Entra principal. Required. - :type object_id: str - :return: AdministratorMicrosoftEntra. The AdministratorMicrosoftEntra is compatible with + :param maintenance_event_id: The name of the MaintenanceEventResource. Required. + :type maintenance_event_id: str + :return: MaintenanceEventResource. The MaintenanceEventResource is compatible with MutableMapping - :rtype: ~azure.mgmt.postgresqlflexibleservers.models.AdministratorMicrosoftEntra + :rtype: ~azure.mgmt.postgresqlflexibleservers.models.MaintenanceEventResource :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -6126,12 +6514,12 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.AdministratorMicrosoftEntra] = kwargs.pop("cls", None) + cls: ClsType[_models.MaintenanceEventResource] = kwargs.pop("cls", None) - _request = build_administrators_microsoft_entra_get_request( + _request = build_maintenance_events_get_request( resource_group_name=resource_group_name, server_name=server_name, - object_id=object_id, + maintenance_event_id=maintenance_event_id, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -6142,6 +6530,7 @@ async def get( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -6163,19 +6552,911 @@ async def get( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.AdministratorMicrosoftEntra, response.json()) + deserialized = _deserialize(_models.MaintenanceEventResource, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - async def _create_or_update_initial( - self, - resource_group_name: str, - server_name: str, + @distributed_trace + @api_version_validation( + method_added_on="2026-04-01-preview", + params_added_on={ + "2026-04-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "server_name", + "maintenance_status", + "accept", + ] + }, + api_versions_list=["2026-04-01-preview"], + ) + def list( + self, + resource_group_name: str, + server_name: str, + *, + maintenance_status: Optional[Union[str, _models.MaintenanceEventStatusFilter]] = None, + **kwargs: Any + ) -> AsyncItemPaged["_models.MaintenanceEventResource"]: + """Lists all maintenance events for a flexible server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :keyword maintenance_status: Filter maintenance events by status. Known values are: "Upcoming" + and "Past". Default value is None. + :paramtype maintenance_status: str or + ~azure.mgmt.postgresqlflexibleservers.models.MaintenanceEventStatusFilter + :return: An iterator like instance of MaintenanceEventResource + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.postgresqlflexibleservers.models.MaintenanceEventResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.MaintenanceEventResource]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_maintenance_events_list_request( + resource_group_name=resource_group_name, + server_name=server_name, + subscription_id=self._config.subscription_id, + maintenance_status=maintenance_status, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.MaintenanceEventResource], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @api_version_validation( + method_added_on="2026-04-01-preview", + params_added_on={ + "2026-04-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "server_name", + "maintenance_event_id", + "content_type", + "accept", + ] + }, + api_versions_list=["2026-04-01-preview"], + ) + async def _reschedule_initial( + self, + resource_group_name: str, + server_name: str, + maintenance_event_id: str, + body: Union[_models.MaintenanceEventRescheduleRequest, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_maintenance_events_reschedule_request( + resource_group_name=resource_group_name, + server_name=server_name, + maintenance_event_id=maintenance_event_id, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_reschedule( + self, + resource_group_name: str, + server_name: str, + maintenance_event_id: str, + body: _models.MaintenanceEventRescheduleRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.MaintenanceEventActionResponse]: + """Reschedules a maintenance event to a new date and time. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param maintenance_event_id: The name of the MaintenanceEventResource. Required. + :type maintenance_event_id: str + :param body: The content of the action request. Required. + :type body: ~azure.mgmt.postgresqlflexibleservers.models.MaintenanceEventRescheduleRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns MaintenanceEventActionResponse. The + MaintenanceEventActionResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.postgresqlflexibleservers.models.MaintenanceEventActionResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_reschedule( + self, + resource_group_name: str, + server_name: str, + maintenance_event_id: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.MaintenanceEventActionResponse]: + """Reschedules a maintenance event to a new date and time. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param maintenance_event_id: The name of the MaintenanceEventResource. Required. + :type maintenance_event_id: str + :param body: The content of the action request. Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns MaintenanceEventActionResponse. The + MaintenanceEventActionResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.postgresqlflexibleservers.models.MaintenanceEventActionResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_reschedule( + self, + resource_group_name: str, + server_name: str, + maintenance_event_id: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.MaintenanceEventActionResponse]: + """Reschedules a maintenance event to a new date and time. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param maintenance_event_id: The name of the MaintenanceEventResource. Required. + :type maintenance_event_id: str + :param body: The content of the action request. Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns MaintenanceEventActionResponse. The + MaintenanceEventActionResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.postgresqlflexibleservers.models.MaintenanceEventActionResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + @api_version_validation( + method_added_on="2026-04-01-preview", + params_added_on={ + "2026-04-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "server_name", + "maintenance_event_id", + "content_type", + "accept", + ] + }, + api_versions_list=["2026-04-01-preview"], + ) + async def begin_reschedule( + self, + resource_group_name: str, + server_name: str, + maintenance_event_id: str, + body: Union[_models.MaintenanceEventRescheduleRequest, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.MaintenanceEventActionResponse]: + """Reschedules a maintenance event to a new date and time. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param maintenance_event_id: The name of the MaintenanceEventResource. Required. + :type maintenance_event_id: str + :param body: The content of the action request. Is one of the following types: + MaintenanceEventRescheduleRequest, JSON, IO[bytes] Required. + :type body: ~azure.mgmt.postgresqlflexibleservers.models.MaintenanceEventRescheduleRequest or + JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns MaintenanceEventActionResponse. The + MaintenanceEventActionResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.postgresqlflexibleservers.models.MaintenanceEventActionResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.MaintenanceEventActionResponse] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._reschedule_initial( + resource_group_name=resource_group_name, + server_name=server_name, + maintenance_event_id=maintenance_event_id, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.MaintenanceEventActionResponse, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.MaintenanceEventActionResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.MaintenanceEventActionResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @api_version_validation( + method_added_on="2026-04-01-preview", + params_added_on={ + "2026-04-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "server_name", + "maintenance_event_id", + "accept", + ] + }, + api_versions_list=["2026-04-01-preview"], + ) + async def _apply_now_initial( + self, resource_group_name: str, server_name: str, maintenance_event_id: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_maintenance_events_apply_now_request( + resource_group_name=resource_group_name, + server_name=server_name, + maintenance_event_id=maintenance_event_id, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + @api_version_validation( + method_added_on="2026-04-01-preview", + params_added_on={ + "2026-04-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "server_name", + "maintenance_event_id", + "accept", + ] + }, + api_versions_list=["2026-04-01-preview"], + ) + async def begin_apply_now( + self, resource_group_name: str, server_name: str, maintenance_event_id: str, **kwargs: Any + ) -> AsyncLROPoller[_models.MaintenanceEventActionResponse]: + """Applies the maintenance event immediately. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param maintenance_event_id: The name of the MaintenanceEventResource. Required. + :type maintenance_event_id: str + :return: An instance of AsyncLROPoller that returns MaintenanceEventActionResponse. The + MaintenanceEventActionResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.postgresqlflexibleservers.models.MaintenanceEventActionResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.MaintenanceEventActionResponse] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._apply_now_initial( + resource_group_name=resource_group_name, + server_name=server_name, + maintenance_event_id=maintenance_event_id, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.MaintenanceEventActionResponse, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.MaintenanceEventActionResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.MaintenanceEventActionResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + +class MajorVersionUpgradePrecheckOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.postgresqlflexibleservers.aio.PostgreSQLManagementClient`'s + :attr:`major_version_upgrade_precheck` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: PostgreSQLManagementClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + @api_version_validation( + method_added_on="2026-04-01-preview", + params_added_on={ + "2026-04-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "server_name", + "precheck_validation_id", + "accept", + ] + }, + api_versions_list=["2026-04-01-preview"], + ) + async def get( + self, resource_group_name: str, server_name: str, precheck_validation_id: str, **kwargs: Any + ) -> _models.MajorVersionUpgradePrecheckResource: + """Gets information about a major version upgrade precheck for a flexible server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param precheck_validation_id: The name of the MajorVersionUpgradePrecheckResource. Required. + :type precheck_validation_id: str + :return: MajorVersionUpgradePrecheckResource. The MajorVersionUpgradePrecheckResource is + compatible with MutableMapping + :rtype: ~azure.mgmt.postgresqlflexibleservers.models.MajorVersionUpgradePrecheckResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.MajorVersionUpgradePrecheckResource] = kwargs.pop("cls", None) + + _request = build_major_version_upgrade_precheck_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + precheck_validation_id=precheck_validation_id, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.MajorVersionUpgradePrecheckResource, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + @api_version_validation( + method_added_on="2026-04-01-preview", + params_added_on={ + "2026-04-01-preview": ["api_version", "subscription_id", "resource_group_name", "server_name", "accept"] + }, + api_versions_list=["2026-04-01-preview"], + ) + def list( + self, resource_group_name: str, server_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.MajorVersionUpgradePrecheckResource"]: + """Lists major version upgrade prechecks for a flexible server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :return: An iterator like instance of MajorVersionUpgradePrecheckResource + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.postgresqlflexibleservers.models.MajorVersionUpgradePrecheckResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.MajorVersionUpgradePrecheckResource]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_major_version_upgrade_precheck_list_request( + resource_group_name=resource_group_name, + server_name=server_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.MajorVersionUpgradePrecheckResource], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class AdministratorsMicrosoftEntraOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.postgresqlflexibleservers.aio.PostgreSQLManagementClient`'s + :attr:`administrators_microsoft_entra` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: PostgreSQLManagementClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, resource_group_name: str, server_name: str, object_id: str, **kwargs: Any + ) -> _models.AdministratorMicrosoftEntra: + """Gets information about a server administrator associated to a Microsoft Entra principal. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param object_id: Object identifier of the Microsoft Entra principal. Required. + :type object_id: str + :return: AdministratorMicrosoftEntra. The AdministratorMicrosoftEntra is compatible with + MutableMapping + :rtype: ~azure.mgmt.postgresqlflexibleservers.models.AdministratorMicrosoftEntra + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.AdministratorMicrosoftEntra] = kwargs.pop("cls", None) + + _request = build_administrators_microsoft_entra_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + object_id=object_id, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.AdministratorMicrosoftEntra, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + server_name: str, object_id: str, parameters: Union[_models.AdministratorMicrosoftEntraAdd, JSON, IO[bytes]], **kwargs: Any @@ -6217,6 +7498,7 @@ async def _create_or_update_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -6243,7 +7525,7 @@ async def _create_or_update_initial( response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -6468,6 +7750,7 @@ async def _delete_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -6495,7 +7778,7 @@ async def _delete_initial( response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -6622,7 +7905,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -6635,7 +7921,10 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.AdministratorMicrosoftEntra], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.AdministratorMicrosoftEntra], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -6737,7 +8026,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -6750,7 +8042,10 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.Capability], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.Capability], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -6854,7 +8149,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -6867,7 +8165,10 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.CapturedLog], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.CapturedLog], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -7053,6 +8354,7 @@ async def check_prerequisites( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -7077,7 +8379,7 @@ async def check_prerequisites( response_headers["x-ms-request-id"] = self._deserialize("str", response.headers.get("x-ms-request-id")) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.LtrPreBackupResponse, response.json()) @@ -7129,6 +8431,7 @@ async def _start_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -7160,7 +8463,7 @@ async def _start_initial( response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) response_headers["x-ms-request-id"] = self._deserialize("str", response.headers.get("x-ms-request-id")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -7379,6 +8682,7 @@ async def get( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -7400,7 +8704,7 @@ async def get( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.BackupsLongTermRetentionOperation, response.json()) @@ -7467,7 +8771,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -7480,7 +8787,10 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.BackupsLongTermRetentionOperation], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.BackupsLongTermRetentionOperation], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -7584,7 +8894,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -7597,7 +8910,10 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.Server], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.Server], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -7694,6 +9010,7 @@ async def get( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -7715,7 +9032,7 @@ async def get( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.AdvancedThreatProtectionSettingsModel, response.json()) @@ -7782,7 +9099,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -7796,7 +9116,8 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.AdvancedThreatProtectionSettingsModel], deserialized.get("value", []) + List[_models.AdvancedThreatProtectionSettingsModel], + deserialized.get("value", []), ) if cls: list_of_elem = cls(list_of_elem) # type: ignore @@ -7888,6 +9209,7 @@ async def _create_or_update_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -7914,7 +9236,7 @@ async def _create_or_update_initial( response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -8180,6 +9502,7 @@ async def get( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -8201,7 +9524,7 @@ async def get( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.BackupAutomaticAndOnDemand, response.json()) @@ -8240,6 +9563,7 @@ async def _create_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -8266,7 +9590,7 @@ async def _create_initial( response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -8379,6 +9703,7 @@ async def _delete_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -8406,7 +9731,7 @@ async def _delete_initial( response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -8533,7 +9858,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -8546,7 +9874,10 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.BackupAutomaticAndOnDemand], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.BackupAutomaticAndOnDemand], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -8642,6 +9973,7 @@ async def get( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -8663,7 +9995,7 @@ async def get( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.TuningOptions, response.json()) @@ -8730,7 +10062,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -8743,7 +10078,10 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.TuningOptions], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.TuningOptions], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -8844,7 +10182,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -8857,7 +10198,10 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.ObjectRecommendation], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.ObjectRecommendation], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -8955,7 +10299,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -8968,7 +10315,10 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.Capability], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.Capability], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -9114,6 +10464,7 @@ async def check_globally( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -9135,7 +10486,7 @@ async def check_globally( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.NameAvailabilityModel, response.json()) @@ -9257,6 +10608,7 @@ async def check_with_location( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -9278,7 +10630,7 @@ async def check_with_location( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.NameAvailabilityModel, response.json()) @@ -9338,6 +10690,7 @@ async def get(self, **kwargs: Any) -> str: } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -9359,7 +10712,7 @@ async def get(self, **kwargs: Any) -> str: raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(str, response.json()) @@ -9440,7 +10793,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -9453,7 +10809,10 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.QuotaUsage], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.QuotaUsage], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -9618,6 +10977,7 @@ async def list( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -9639,7 +10999,7 @@ async def list( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.VirtualNetworkSubnetUsageModel, response.json()) diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/azure/mgmt/postgresqlflexibleservers/aio/operations/_patch.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/azure/mgmt/postgresqlflexibleservers/aio/operations/_patch.py index 87676c65a8f0..ea765788358a 100644 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/azure/mgmt/postgresqlflexibleservers/aio/operations/_patch.py +++ b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/azure/mgmt/postgresqlflexibleservers/aio/operations/_patch.py @@ -8,7 +8,6 @@ Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ - __all__: list[str] = [] # Add all objects you want publicly available to users at this package level diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/azure/mgmt/postgresqlflexibleservers/models/__init__.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/azure/mgmt/postgresqlflexibleservers/models/__init__.py index a892dcffa709..b880f087e76d 100644 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/azure/mgmt/postgresqlflexibleservers/models/__init__.py +++ b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/azure/mgmt/postgresqlflexibleservers/models/__init__.py @@ -65,8 +65,14 @@ LtrBackupOperationResponseProperties, LtrPreBackupRequest, LtrPreBackupResponse, + MaintenanceEventActionResponse, + MaintenanceEventRescheduleRequest, + MaintenanceEventResource, + MaintenanceEventResourceProperties, MaintenanceWindow, MaintenanceWindowForPatch, + MajorVersionUpgradePrecheckResource, + MajorVersionUpgradePrecheckResourceProperties, MetricSpecification, MigrateNetworkStatus, Migration, @@ -89,6 +95,9 @@ Operation, OperationDisplay, OperationProperties, + PolicyDetail, + PrecheckErrorInfo, + PrecheckResult, PrivateEndpoint, PrivateEndpointConnection, PrivateEndpointConnectionProperties, @@ -111,6 +120,8 @@ ServiceSpecification, Sku, SkuForPatch, + StartMajorVersionUpgradePrecheckRequest, + StartMajorVersionUpgradePrecheckResponse, Storage, StorageEditionCapability, StorageMbCapability, @@ -120,6 +131,7 @@ TrackedResource, TuningOptions, TuningOptionsProperties, + UpgradeSequence, UserAssignedIdentity, UserIdentity, ValidationDetails, @@ -155,6 +167,10 @@ IdentityType, LocationRestricted, LogicalReplicationOnSourceServer, + MaintenanceEventStatus, + MaintenanceEventStatusFilter, + MaintenanceType, + MajorVersionUpgradePrecheckStatus, MicrosoftEntraAuth, MigrateRolesAndPermissions, MigrationDatabaseState, @@ -254,8 +270,14 @@ "LtrBackupOperationResponseProperties", "LtrPreBackupRequest", "LtrPreBackupResponse", + "MaintenanceEventActionResponse", + "MaintenanceEventRescheduleRequest", + "MaintenanceEventResource", + "MaintenanceEventResourceProperties", "MaintenanceWindow", "MaintenanceWindowForPatch", + "MajorVersionUpgradePrecheckResource", + "MajorVersionUpgradePrecheckResourceProperties", "MetricSpecification", "MigrateNetworkStatus", "Migration", @@ -278,6 +300,9 @@ "Operation", "OperationDisplay", "OperationProperties", + "PolicyDetail", + "PrecheckErrorInfo", + "PrecheckResult", "PrivateEndpoint", "PrivateEndpointConnection", "PrivateEndpointConnectionProperties", @@ -300,6 +325,8 @@ "ServiceSpecification", "Sku", "SkuForPatch", + "StartMajorVersionUpgradePrecheckRequest", + "StartMajorVersionUpgradePrecheckResponse", "Storage", "StorageEditionCapability", "StorageMbCapability", @@ -309,6 +336,7 @@ "TrackedResource", "TuningOptions", "TuningOptionsProperties", + "UpgradeSequence", "UserAssignedIdentity", "UserIdentity", "ValidationDetails", @@ -341,6 +369,10 @@ "IdentityType", "LocationRestricted", "LogicalReplicationOnSourceServer", + "MaintenanceEventStatus", + "MaintenanceEventStatusFilter", + "MaintenanceType", + "MajorVersionUpgradePrecheckStatus", "MicrosoftEntraAuth", "MigrateRolesAndPermissions", "MigrationDatabaseState", diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/azure/mgmt/postgresqlflexibleservers/models/_enums.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/azure/mgmt/postgresqlflexibleservers/models/_enums.py index 0a81f1f0ec54..413309df1070 100644 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/azure/mgmt/postgresqlflexibleservers/models/_enums.py +++ b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/azure/mgmt/postgresqlflexibleservers/models/_enums.py @@ -14,55 +14,58 @@ class AzureManagedDiskPerformanceTier(str, Enum, metaclass=CaseInsensitiveEnumMe """Storage tier of a server.""" P1 = "P1" - """P1.""" + """Entry-level SSD for minimal IOPS, ideal for light development or testing workloads.""" P2 = "P2" - """P2.""" + """Slightly higher IOPS for small-scale applications needing consistent low latency.""" P3 = "P3" - """P3.""" + """Balanced performance for basic production workloads with moderate throughput.""" P4 = "P4" - """P4.""" + """Enhanced IOPS for growing apps with predictable performance needs.""" P6 = "P6" - """P6.""" + """Mid-tier SSD for steady workloads requiring reliable throughput and latency.""" P10 = "P10" - """P10.""" + """Popular choice for general-purpose production workloads with scalable performance.""" P15 = "P15" - """P15.""" + """High IOPS tier for demanding apps with frequent read/write operations.""" P20 = "P20" - """P20.""" + """Entry point for high-performance Solid State Disks (SSDs), suitable for small-scale + I/O-intensive workloads.""" P30 = "P30" - """P30.""" + """Balanced tier for moderate throughput and latency-sensitive applications.""" P40 = "P40" - """P40.""" + """Enhanced performance for growing production workloads with consistent IOPS demands.""" P50 = "P50" - """P50.""" + """Optimized for enterprise-grade applications needing sustained high throughput.""" P60 = "P60" - """P60.""" + """High-capacity tier for large databases and analytics workloads with elevated IOPS.""" P70 = "P70" - """P70.""" + """Designed for mission-critical systems requiring ultra-low latency and high concurrency.""" P80 = "P80" - """P80.""" + """Top-tier SSD for maximum IOPS and throughput, ideal for the most demanding workloads.""" class BackupType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Type of backup.""" FULL = "Full" - """FULL.""" + """A full backup taken automatically by the service. These backups are retained for a period of + time as defined by the backup retention policy, and they cannot be deleted by the customer.""" CUSTOMER_ON_DEMAND = "Customer On-Demand" - """CUSTOMER_ON_DEMAND.""" + """A full backup triggered by the customer. These backups are retained for a period of time as + defined by the backup retention policy, and they can also be deleted by the customer.""" class Cancel(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Indicates if cancel must be triggered for the entire migration.""" TRUE = "True" - """TRUE.""" + """Cancel must be triggered for the entire migration.""" FALSE = "False" - """FALSE.""" + """Cancel must not be triggered for the entire migration.""" class CapabilityStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The status of the capability.""" + """Status of the capability.""" VISIBLE = "Visible" """VISIBLE.""" @@ -87,17 +90,17 @@ class ConfigurationDataType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Data type of the configuration (also known as server parameter).""" BOOLEAN = "Boolean" - """BOOLEAN.""" + """A boolean value.""" NUMERIC = "Numeric" - """NUMERIC.""" + """A numeric value.""" INTEGER = "Integer" - """INTEGER.""" + """An integer value.""" ENUMERATION = "Enumeration" - """ENUMERATION.""" + """An enumeration value.""" STRING = "String" - """STRING.""" + """A string value.""" SET = "Set" - """SET.""" + """A set of values.""" class CreatedByType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -117,37 +120,48 @@ class CreateMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Creation mode of a new server.""" DEFAULT = "Default" - """DEFAULT.""" + """If the operation is triggered on a non-existing server, it's equivalent to 'Create'. If the + operation is triggered on an existing server, it's equivalent to 'Update'.""" CREATE = "Create" - """CREATE.""" + """Operation creates a new server.""" UPDATE = "Update" - """UPDATE.""" + """Operation updates an existing server.""" POINT_IN_TIME_RESTORE = "PointInTimeRestore" - """POINT_IN_TIME_RESTORE.""" + """Operation restores an existing backup of an existing server. This operation creates a new + server, and then restores on it the backup of an existing server at a specific point in time.""" GEO_RESTORE = "GeoRestore" - """GEO_RESTORE.""" + """Operation restores an existing backup of an existing server, on the paired region of the + existing server. This operation creates a new server on the paired region of the existing + server, and then restores on it the backup of an existing server at a specific point in time, + in a different region. This operation is only supported on existing servers that were created + with geographically redundant backups enabled.""" REPLICA = "Replica" - """REPLICA.""" + """Operation creates a replica of an existing server. This operation creates a new server, + restores a base backup of the existing server (referred to as primary), and configures physical + replication to asynchronously stream all changes which are recorded in the transaction log of + the primary.""" REVIVE_DROPPED = "ReviveDropped" - """REVIVE_DROPPED.""" + """Operation creates a new server, initialized with the backup of a server that was recently + deleted.""" class CreateModeForPatch(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Update mode of an existing server.""" DEFAULT = "Default" - """DEFAULT.""" + """It's equivalent to 'Update'.""" UPDATE = "Update" - """UPDATE.""" + """Operation updates an existing server.""" class DataEncryptionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Data encryption type used by a server.""" SYSTEM_MANAGED = "SystemManaged" - """SYSTEM_MANAGED.""" + """Encryption managed by Azure using platform managed keys for simplicity and compliance.""" AZURE_KEY_VAULT = "AzureKeyVault" - """AZURE_KEY_VAULT.""" + """Encryption using customer managed keys stored in Azure Key Vault for enhanced control and + security.""" class EncryptionKeyStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -156,35 +170,41 @@ class EncryptionKeyStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): """ VALID = "Valid" - """VALID.""" + """Key is valid and can be used for encryption.""" INVALID = "Invalid" - """INVALID.""" + """Key is invalid and cannot be used for encryption. Possible causes include key deletion, + permission changes, key being disabled, key type not supported, or current date being outside + of validity period associated to the key.""" class ExecutionStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Service-set extensible enum indicating the status of operation.""" + """Service-set extensible enumeration indicating the status of operation.""" RUNNING = "Running" - """RUNNING.""" + """Operation is currently running.""" CANCELLED = "Cancelled" - """CANCELLED.""" + """Operation has been cancelled.""" FAILED = "Failed" - """FAILED.""" + """Operation has failed.""" SUCCEEDED = "Succeeded" - """SUCCEEDED.""" + """Operation has succeeded.""" class FailoverMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Failover mode.""" PLANNED_FAILOVER = "PlannedFailover" - """PLANNED_FAILOVER.""" + """Trigger a failover from primary to standby without killing the primary database process first. + This is a graceful failover that attempts to preserve data consistency.""" FORCED_FAILOVER = "ForcedFailover" - """FORCED_FAILOVER.""" + """Terminate the primary database process first, then triggers the failover. This is more + aggressive and used when the primary is unresponsive or in an unhealthy state.""" PLANNED_SWITCHOVER = "PlannedSwitchover" - """PLANNED_SWITCHOVER.""" + """Similar to 'PlannedFailover' but prefers a switch over operation where roles are swapped + between primary and standby.""" FORCED_SWITCHOVER = "ForcedSwitchover" - """FORCED_SWITCHOVER.""" + """Terminate the primary database process first, and then triggers a switch over with role + swapping.""" class FastProvisioningSupport(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -194,49 +214,49 @@ class FastProvisioningSupport(str, Enum, metaclass=CaseInsensitiveEnumMeta): """ ENABLED = "Enabled" - """ENABLED.""" + """Fast provisioning is supported.""" DISABLED = "Disabled" - """DISABLED.""" + """Fast provisioning is not supported.""" class FeatureStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Status of the feature. Indicates if the feature is enabled or not.""" ENABLED = "Enabled" - """ENABLED.""" + """Feature is enabled.""" DISABLED = "Disabled" - """DISABLED.""" + """Feature is disabled.""" class GeographicallyRedundantBackup(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Indicates if the server is configured to create geographically redundant backups.""" ENABLED = "Enabled" - """ENABLED.""" + """Server is configured to create geographically redundant backups.""" DISABLED = "Disabled" - """DISABLED.""" + """Server is not configured to create geographically redundant backups.""" class GeographicallyRedundantBackupSupport(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """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'. + """Indicates if geographically redundant backups are supported in this location. Will be + deprecated in the future. Look to Supported Features for 'GeoBackup'. """ ENABLED = "Enabled" - """ENABLED.""" + """Geographically redundant backups are supported in this location.""" DISABLED = "Disabled" - """DISABLED.""" + """Geographically redundant backups are not supported in this location.""" class HighAvailabilityMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Modes of high availability supported for this compute.""" + """Mode of high availability supported for this compute.""" ZONE_REDUNDANT = "ZoneRedundant" - """ZONE_REDUNDANT.""" + """High availability is supported for this compute, with standby server in a different + availability zone than that of the primary.""" SAME_ZONE = "SameZone" - """SAME_ZONE.""" + """High availability is supported for this compute, with standby server in the same availability + zone as the primary.""" class HighAvailabilityState(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -245,203 +265,249 @@ class HighAvailabilityState(str, Enum, metaclass=CaseInsensitiveEnumMeta): """ NOT_ENABLED = "NotEnabled" - """NOT_ENABLED.""" + """High availability is not enabled for the server.""" CREATING_STANDBY = "CreatingStandby" - """CREATING_STANDBY.""" + """Standby server is being created.""" REPLICATING_DATA = "ReplicatingData" - """REPLICATING_DATA.""" + """Data is being replicated to the standby server.""" FAILING_OVER = "FailingOver" - """FAILING_OVER.""" + """Failover operation to the standby server is in progress.""" HEALTHY = "Healthy" - """HEALTHY.""" + """Standby server is healthy and ready to take over in case of a failover.""" REMOVING_STANDBY = "RemovingStandby" - """REMOVING_STANDBY.""" + """Standby server is being removed.""" + RECREATING_STANDBY = "RecreatingStandby" + """Standby server is being recreated.""" + COMPUTE_UPDATING_BY_FAILOVER = "ComputeUpdatingByFailover" + """Compute is being updated due to a failover.""" class IdentityType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Types of identities associated with a server.""" NONE = "None" - """NONE.""" + """No managed identity is assigned to the server.""" USER_ASSIGNED = "UserAssigned" - """USER_ASSIGNED.""" + """One or more managed identities provided by the user are assigned to the server.""" SYSTEM_ASSIGNED = "SystemAssigned" - """SYSTEM_ASSIGNED.""" + """Azure automatically creates and manages the identity associated to the lifecycle of the server.""" SYSTEM_ASSIGNED_USER_ASSIGNED = "SystemAssigned,UserAssigned" - """SYSTEM_ASSIGNED_USER_ASSIGNED.""" + """Both system-assigned and user-assigned identities are assigned to the server.""" class LocationRestricted(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """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 + """Indicates if this location is restricted. Will be deprecated in the future. Look to Supported Features for 'Restricted'. """ ENABLED = "Enabled" - """ENABLED.""" + """Location is restricted.""" DISABLED = "Disabled" - """DISABLED.""" + """Location is not restricted.""" class LogicalReplicationOnSourceServer(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Indicates whether to setup logical replication on source server, if needed.""" TRUE = "True" - """TRUE.""" + """Logical replication will be set up on the source server.""" FALSE = "False" - """FALSE.""" + """Logical replication will not be set up on the source server.""" + + +class MaintenanceEventStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The status of a maintenance event.""" + + PLANNED = "Planned" + """The maintenance event is scheduled and has not yet started.""" + IN_PROGRESS = "InProgress" + """The maintenance event is currently in progress.""" + COMPLETE = "Complete" + """The maintenance event has completed successfully.""" + RESCHEDULED = "Rescheduled" + """The maintenance event has been rescheduled (postponed) by the customer.""" + CANCELED = "Canceled" + """The maintenance event was canceled, failed, or timed out.""" + + +class MaintenanceEventStatusFilter(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Filter for maintenance event status.""" + + UPCOMING = "Upcoming" + """Return events that have a scheduled or in progress status.""" + PAST = "Past" + """Return events that have a completed status.""" + + +class MaintenanceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of a maintenance event resource.""" + + PLANNED_MAINTENANCE = "PlannedMaintenance" + """Planned maintenance event.""" + + +class MajorVersionUpgradePrecheckStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The status of the major version upgrade precheck.""" + + VALIDATING = "Validating" + """Executing prechecks against the source server.""" + SUCCEEDED = "Succeeded" + """Validation succeeded.""" + FAILED = "Failed" + """Validation failed.""" + CANCELED = "Canceled" + """Validation canceled.""" class MicrosoftEntraAuth(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Indicates if the server supports Microsoft Entra authentication.""" ENABLED = "Enabled" - """ENABLED.""" + """Server supports Microsoft Entra authentication.""" DISABLED = "Disabled" - """DISABLED.""" + """Server does not support Microsoft Entra authentication.""" class MigrateRolesAndPermissions(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Indicates if roles and permissions must be migrated.""" TRUE = "True" - """TRUE.""" + """Roles and permissions will be migrated.""" FALSE = "False" - """FALSE.""" + """Roles and permissions will not be migrated.""" class MigrationDatabaseState(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Migration state of a database.""" IN_PROGRESS = "InProgress" - """IN_PROGRESS.""" + """Migration is in progress for the database.""" WAITING_FOR_CUTOVER_TRIGGER = "WaitingForCutoverTrigger" - """WAITING_FOR_CUTOVER_TRIGGER.""" + """Migration is waiting for cutover trigger for the database.""" FAILED = "Failed" - """FAILED.""" + """Migration has failed for the database.""" CANCELED = "Canceled" - """CANCELED.""" + """Migration has been canceled for the database.""" SUCCEEDED = "Succeeded" - """SUCCEEDED.""" + """Migration has succeeded for the database.""" CANCELING = "Canceling" - """CANCELING.""" + """Migration is being canceled for the database.""" class MigrationListFilter(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of MigrationListFilter.""" + """Indicates the filter to apply when listing migrations.""" ACTIVE = "Active" - """ACTIVE.""" + """Only active (in-progress) migrations.""" ALL = "All" - """ALL.""" + """All migrations.""" class MigrationMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Mode used to perform the migration: Online or Offline.""" + """Mode used to perform the migration.""" OFFLINE = "Offline" - """OFFLINE.""" + """Offline migration mode.""" ONLINE = "Online" - """ONLINE.""" + """Online migration mode.""" class MigrationNameAvailabilityReason(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Migration name availability reason.""" INVALID = "Invalid" - """INVALID.""" + """Migration name is invalid.""" ALREADY_EXISTS = "AlreadyExists" - """ALREADY_EXISTS.""" + """Migration name already exists.""" class MigrationOption(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Supported option for a migration.""" VALIDATE = "Validate" - """VALIDATE.""" + """Validate the migration without performing it.""" MIGRATE = "Migrate" - """MIGRATE.""" + """Perform the migration.""" VALIDATE_AND_MIGRATE = "ValidateAndMigrate" - """VALIDATE_AND_MIGRATE.""" + """Validate and perform the migration.""" class MigrationState(str, Enum, metaclass=CaseInsensitiveEnumMeta): """State of migration.""" IN_PROGRESS = "InProgress" - """IN_PROGRESS.""" + """Migration is in progress.""" WAITING_FOR_USER_ACTION = "WaitingForUserAction" - """WAITING_FOR_USER_ACTION.""" + """Migration is waiting for user action.""" CANCELED = "Canceled" - """CANCELED.""" + """Migration has been canceled.""" FAILED = "Failed" - """FAILED.""" + """Migration has failed.""" SUCCEEDED = "Succeeded" - """SUCCEEDED.""" + """Migration has succeeded.""" VALIDATION_FAILED = "ValidationFailed" - """VALIDATION_FAILED.""" + """Validation for migration has failed.""" CLEANING_UP = "CleaningUp" - """CLEANING_UP.""" + """Migration is cleaning up resources.""" class MigrationSubstate(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Substate of migration.""" PERFORMING_PRE_REQUISITE_STEPS = "PerformingPreRequisiteSteps" - """PERFORMING_PRE_REQUISITE_STEPS.""" + """Performing pre-requisite steps for migration.""" WAITING_FOR_LOGICAL_REPLICATION_SETUP_REQUEST_ON_SOURCE_DB = "WaitingForLogicalReplicationSetupRequestOnSourceDB" - """WAITING_FOR_LOGICAL_REPLICATION_SETUP_REQUEST_ON_SOURCE_DB.""" + """Waiting for logical replication setup request on source database.""" WAITING_FOR_DBS_TO_MIGRATE_SPECIFICATION = "WaitingForDBsToMigrateSpecification" - """WAITING_FOR_DBS_TO_MIGRATE_SPECIFICATION.""" + """Waiting for databases to migrate specification.""" WAITING_FOR_TARGET_DB_OVERWRITE_CONFIRMATION = "WaitingForTargetDBOverwriteConfirmation" - """WAITING_FOR_TARGET_DB_OVERWRITE_CONFIRMATION.""" + """Waiting for target database overwrite confirmation.""" WAITING_FOR_DATA_MIGRATION_SCHEDULING = "WaitingForDataMigrationScheduling" - """WAITING_FOR_DATA_MIGRATION_SCHEDULING.""" + """Waiting for data migration scheduling.""" WAITING_FOR_DATA_MIGRATION_WINDOW = "WaitingForDataMigrationWindow" - """WAITING_FOR_DATA_MIGRATION_WINDOW.""" + """Waiting for data migration window.""" MIGRATING_DATA = "MigratingData" - """MIGRATING_DATA.""" + """Migrating data.""" WAITING_FOR_CUTOVER_TRIGGER = "WaitingForCutoverTrigger" - """WAITING_FOR_CUTOVER_TRIGGER.""" + """Waiting for cutover trigger.""" COMPLETING_MIGRATION = "CompletingMigration" - """COMPLETING_MIGRATION.""" + """Completing migration.""" COMPLETED = "Completed" - """COMPLETED.""" + """Migration completed.""" CANCELING_REQUESTED_DB_MIGRATIONS = "CancelingRequestedDBMigrations" - """CANCELING_REQUESTED_DB_MIGRATIONS.""" + """Canceling requested database migrations.""" VALIDATION_IN_PROGRESS = "ValidationInProgress" - """VALIDATION_IN_PROGRESS.""" + """Validation in progress.""" class NetworkMigrationState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The state of the network migration operation.""" + """State of the network migration operation.""" PENDING = "Pending" - """The network migration is pending.""" + """Network migration is pending.""" IN_PROGRESS = "InProgress" - """The network migration is in progress.""" + """Network migration is in progress.""" SUCCEEDED = "Succeeded" - """The network migration succeeded.""" + """Network migration succeeded.""" FAILED = "Failed" - """The network migration failed.""" + """Network migration failed.""" CANCEL_IN_PROGRESS = "CancelInProgress" - """The network migration cancellation is in progress.""" + """Network migration cancellation is in progress.""" CANCELLED = "Cancelled" - """The network migration was cancelled.""" + """Network migration was cancelled.""" class OnlineStorageResizeSupport(str, Enum, metaclass=CaseInsensitiveEnumMeta): """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'. + is supported in this location for the given subscription. Will be deprecated in the future. + Look to Supported Features for 'OnlineResize'. """ ENABLED = "Enabled" - """ENABLED.""" + """Resizing the storage without interrupting the operation of the database engine is supported.""" DISABLED = "Disabled" - """DISABLED.""" + """Resizing the storage without interrupting the operation of the database engine is not + supported.""" class OperationOrigin(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -456,65 +522,66 @@ class OperationOrigin(str, Enum, metaclass=CaseInsensitiveEnumMeta): class OverwriteDatabasesOnTargetServer(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """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. - """ + """Indicates if databases on the target server can be overwritten when already present.""" TRUE = "True" - """TRUE.""" + """Databases on the target server can be overwritten when already present.""" FALSE = "False" - """FALSE.""" + """Databases on the target server cannot be overwritten when already present. When the migration + workflow detects that the database already exists on the target server, it will wait for a + confirmation.""" class PasswordBasedAuth(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Indicates if the server supports password based authentication.""" ENABLED = "Enabled" - """ENABLED.""" + """Server supports password based authentication.""" DISABLED = "Disabled" - """DISABLED.""" + """Server does not support password based authentication.""" class PostgresMajorVersion(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Major version of PostgreSQL database engine.""" EIGHTEEN = "18" - """EIGHTEEN.""" + """PostgreSQL 18.""" SEVENTEEN = "17" - """SEVENTEEN.""" + """PostgreSQL 17.""" SIXTEEN = "16" - """SIXTEEN.""" + """PostgreSQL 16.""" FIFTEEN = "15" - """FIFTEEN.""" + """PostgreSQL 15.""" FOURTEEN = "14" - """FOURTEEN.""" + """PostgreSQL 14.""" THIRTEEN = "13" - """THIRTEEN.""" + """PostgreSQL 13.""" TWELVE = "12" - """TWELVE.""" + """PostgreSQL 12.""" ELEVEN = "11" - """ELEVEN.""" + """PostgreSQL 11.""" class PostgreSqlFlexibleServerHighAvailabilityMode( # pylint: disable=name-too-long str, Enum, metaclass=CaseInsensitiveEnumMeta ): - """Modes of high availability supported for this compute.""" + """Mode of high availability supported for this compute.""" DISABLED = "Disabled" - """DISABLED.""" + """High availability is disabled for the server.""" ZONE_REDUNDANT = "ZoneRedundant" - """ZONE_REDUNDANT.""" + """High availability is enabled for the server, with standby server in a different availability + zone than that of the primary.""" SAME_ZONE = "SameZone" - """SAME_ZONE.""" + """High availability is enabled for the server, with standby server in the same availability zone + as the primary.""" class PrincipalType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Type of Microsoft Entra principal to which the server administrator is associated.""" UNKNOWN = "Unknown" - """The principal type is not known or not specified.""" + """Principal type is not known or not specified.""" USER = "User" """A Microsoft Entra user.""" GROUP = "Group" @@ -550,14 +617,11 @@ class PrivateEndpointServiceConnectionStatus(str, Enum, metaclass=CaseInsensitiv class ReadReplicaPromoteMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """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 of operation to apply on the read replica. This property is write only.""" STANDALONE = "Standalone" - """Read replica will become an independent server.""" + """Read replica will become an independent server, and a completely independent entity from the + replication set.""" SWITCHOVER = "Switchover" """Read replica will swap roles with primary server.""" @@ -568,180 +632,193 @@ class ReadReplicaPromoteOption(str, Enum, metaclass=CaseInsensitiveEnumMeta): """ PLANNED = "Planned" - """The operation will wait for data in the read replica to be fully synchronized with its source - server, before it initiates the operation.""" + """Wait for data in the read replica to be fully synchronized with its source server before it + initiates the operation.""" FORCED = "Forced" - """The operation will not wait for data in the read replica to be synchronized with its source - server, before it initiates the operation.""" + """Initiate the operation immediately, without waiting for data in the read replica to be + synchronized with its source server.""" class RecommendationTypeEnum(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Type for this recommendation.""" CREATE_INDEX = "CreateIndex" - """CREATE_INDEX.""" + """Recommendation to create an index to improve query performance.""" DROP_INDEX = "DropIndex" - """DROP_INDEX.""" + """Recommendation to drop an existing index because it's duplicate or unused.""" RE_INDEX = "ReIndex" - """RE_INDEX.""" + """Recommendation to reindex an existing invalid index.""" ANALYZE_TABLE = "AnalyzeTable" - """ANALYZE_TABLE.""" + """Recommendation to analyze a table to update statistics for the query optimizer.""" VACUUM_TABLE = "VacuumTable" - """VACUUM_TABLE.""" + """Recommendation to vacuum a table to reclaim storage and optimize performance.""" class RecommendationTypeParameterEnum(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Recommendations list filter. Retrieves recommendations based on type.""" CREATE_INDEX = "CreateIndex" - """CREATE_INDEX.""" + """Recommendation to create an index to improve query performance.""" DROP_INDEX = "DropIndex" - """DROP_INDEX.""" + """Recommendation to drop an existing index because it's duplicate or unused.""" RE_INDEX = "ReIndex" - """RE_INDEX.""" + """Recommendation to reindex an existing invalid index.""" ANALYZE_TABLE = "AnalyzeTable" - """ANALYZE_TABLE.""" + """Recommendation to analyze a table to update statistics for the query optimizer.""" VACUUM_TABLE = "VacuumTable" - """VACUUM_TABLE.""" + """Recommendation to vacuum a table to reclaim storage and optimize performance.""" class ReplicationRole(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Role of the server in a replication set.""" NONE = "None" - """NONE.""" + """No replication role assigned; the server operates independently.""" PRIMARY = "Primary" - """PRIMARY.""" + """Acts as the source server for replication to one or more replicas.""" ASYNC_REPLICA = "AsyncReplica" - """ASYNC_REPLICA.""" + """Receives data asynchronously from a primary server within the same region.""" GEO_ASYNC_REPLICA = "GeoAsyncReplica" - """GEO_ASYNC_REPLICA.""" + """Receives data asynchronously from a primary server in a different region for geographical + redundancy.""" class ReplicationState(str, Enum, metaclass=CaseInsensitiveEnumMeta): """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. + target server is a read replica. """ ACTIVE = "Active" - """The read replica server is fully synchronized and actively replicating data from the primary + """Read replica server is fully synchronized and actively replicating data from the primary server.""" CATCHUP = "Catchup" - """The read replica server is behind the primary server and is currently catching up with pending + """Read replica server is behind the primary server and is currently catching up with pending changes.""" PROVISIONING = "Provisioning" - """The read replica server is being created and is in process of getting initialized.""" + """Read replica server is being created and is in process of getting initialized.""" UPDATING = "Updating" - """The read replica server is undergoing some changes it can be changing compute size of promoting - it to primary server.""" + """Read replica server is undergoing some changes it can be changing compute size of promoting it + to primary server.""" BROKEN = "Broken" """Replication has failed or been interrupted.""" RECONFIGURING = "Reconfiguring" - """The read replica server is being reconfigured, possibly due to changes in source or settings.""" + """Read replica server is being reconfigured, possibly due to changes in source or settings.""" class ServerPublicNetworkAccessState(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Indicates if public network access is enabled or not.""" ENABLED = "Enabled" - """ENABLED.""" + """Public network access is enabled. This allows the server to be accessed from the public + internet, provided the necessary firewall rule that allows incoming traffic originating from + the connecting client is in place. This is compatible with the use of private endpoints to + connect to this server.""" DISABLED = "Disabled" - """DISABLED.""" + """Public network access is disabled. This means the server cannot be accessed from the public + internet, but only via private endpoints.""" class ServerState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Possible states of a server.""" + """State of a server.""" READY = "Ready" - """READY.""" + """Server is healthy and not undergoing any operations at the management or control plane level. + This doesn't mean that the server is fully operational at the data plane level.""" DROPPING = "Dropping" - """DROPPING.""" + """Server is being deleted.""" DISABLED = "Disabled" - """DISABLED.""" + """Server is disabled. Typical reasons include: the subscription on which the server is deployed + is explicitly disabled or canceled by the administrator, the spending limit has been reached, + or the bill is past due. May also happen when the server is being moved to another resource + group or subscription.""" STARTING = "Starting" - """STARTING.""" + """PostgreSQL database engine is being restarted.""" STOPPING = "Stopping" - """STOPPING.""" + """Compute resources associated with the server are being stopped and deallocated. If the server + has high availability enabled, the compute resources of the standby server are also stopped and + deallocated.""" STOPPED = "Stopped" - """STOPPED.""" + """Compute resources associated with the server are being stopped and deallocated.""" UPDATING = "Updating" - """UPDATING.""" + """Server is undergoing some changes which may or may not impact the availability of the + PostgreSQL database engine. For example, the compute resources of the server are being scaled + up or down, which may cause temporary unavailability of the database engine. Or, for example, a + firewall rule is being added or removed, which doesn't cause any unavailability of the database + engine.""" RESTARTING = "Restarting" - """RESTARTING.""" + """PostgreSQL database engine is being restarted.""" INACCESSIBLE = "Inaccessible" - """INACCESSIBLE.""" + """Server isn't accessible, because the key provided to encrypt and decrypt the data is in invalid + state.""" PROVISIONING = "Provisioning" - """PROVISIONING.""" + """Server is in the process of being created.""" class SkuTier(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Tier of the compute assigned to a server.""" BURSTABLE = "Burstable" - """BURSTABLE.""" + """Cost-effective tier for infrequent CPU usage, ideal for development and testing workloads with + low performance requirements.""" GENERAL_PURPOSE = "GeneralPurpose" - """GENERAL_PURPOSE.""" + """Balanced compute and memory for most workloads, offering scalable performance and I/O + throughput.""" MEMORY_OPTIMIZED = "MemoryOptimized" - """MEMORY_OPTIMIZED.""" + """High memory-to-core ratio for demanding workloads needing fast in-memory processing and high + concurrency.""" class SourceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """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. - """ + """Source server type used for the migration.""" ON_PREMISES = "OnPremises" - """ON_PREMISES.""" + """On-premises PostgreSQL server.""" AWS = "AWS" - """AWS.""" + """Amazon Web Services PostgreSQL server.""" GCP = "GCP" - """GCP.""" + """Google Cloud Platform PostgreSQL server.""" AZURE_VM = "AzureVM" - """AZURE_VM.""" + """Azure Virtual Machine PostgreSQL server.""" POSTGRE_SQL_SINGLE_SERVER = "PostgreSQLSingleServer" - """POSTGRE_SQL_SINGLE_SERVER.""" + """Azure Database for PostgreSQL single server.""" AWS_RDS = "AWS_RDS" - """AWS_RDS.""" + """Amazon RDS for PostgreSQL.""" AWS_AURORA = "AWS_AURORA" - """AWS_AURORA.""" + """Amazon Aurora for PostgreSQL.""" AWS_EC2 = "AWS_EC2" - """AWS_EC2.""" + """Amazon EC2 for PostgreSQL.""" GCP_CLOUD_SQL = "GCP_CloudSQL" - """GCP_CLOUD_SQL.""" + """Google Cloud SQL for PostgreSQL.""" GCP_ALLOY_DB = "GCP_AlloyDB" - """GCP_ALLOY_DB.""" + """Google Cloud AlloyDB for PostgreSQL.""" GCP_COMPUTE = "GCP_Compute" - """GCP_COMPUTE.""" + """Google Compute Engine for PostgreSQL.""" EDB = "EDB" - """EDB.""" + """EnterpriseDB PostgreSQL server.""" EDB_ORACLE_SERVER = "EDB_Oracle_Server" - """EDB_ORACLE_SERVER.""" + """EnterpriseDB Oracle Server.""" EDB_POSTGRE_SQL = "EDB_PostgreSQL" - """EDB_POSTGRE_SQL.""" + """EnterpriseDB PostgreSQL server.""" POSTGRE_SQL_FLEXIBLE_SERVER = "PostgreSQLFlexibleServer" - """POSTGRE_SQL_FLEXIBLE_SERVER.""" + """Azure Database for PostgreSQL flexible server.""" POSTGRE_SQL_COSMOS_DB = "PostgreSQLCosmosDB" - """POSTGRE_SQL_COSMOS_DB.""" + """.NET Cosmos DB for PostgreSQL.""" HUAWEI_RDS = "Huawei_RDS" - """HUAWEI_RDS.""" + """Huawei RDS for PostgreSQL.""" HUAWEI_COMPUTE = "Huawei_Compute" - """HUAWEI_COMPUTE.""" + """Huawei Compute for PostgreSQL.""" HEROKU_POSTGRE_SQL = "Heroku_PostgreSQL" - """HEROKU_POSTGRE_SQL.""" + """Heroku PostgreSQL.""" CRUNCHY_POSTGRE_SQL = "Crunchy_PostgreSQL" - """CRUNCHY_POSTGRE_SQL.""" + """Crunchy PostgreSQL.""" APSARA_DB_RDS = "ApsaraDB_RDS" - """APSARA_DB_RDS.""" + """ApsaraDB RDS for PostgreSQL.""" DIGITAL_OCEAN_DROPLETS = "Digital_Ocean_Droplets" - """DIGITAL_OCEAN_DROPLETS.""" + """Digital Ocean Droplets for PostgreSQL.""" DIGITAL_OCEAN_POSTGRE_SQL = "Digital_Ocean_PostgreSQL" - """DIGITAL_OCEAN_POSTGRE_SQL.""" + """Digital Ocean PostgreSQL.""" SUPABASE_POSTGRE_SQL = "Supabase_PostgreSQL" - """SUPABASE_POSTGRE_SQL.""" + """Supabase PostgreSQL.""" class SslMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -750,65 +827,68 @@ class SslMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): """ PREFER = "Prefer" - """PREFER.""" + """Prefer SSL connection. If the server does not support SSL, the connection will be established + without SSL.""" REQUIRE = "Require" - """REQUIRE.""" + """Require SSL connection. If the server does not support SSL, the connection will fail.""" VERIFY_CA = "VerifyCA" - """VERIFY_CA.""" + """Require SSL connection and verify the server certificate against the CA certificate.""" VERIFY_FULL = "VerifyFull" - """VERIFY_FULL.""" + """Require SSL connection, verify the server certificate against the CA certificate, and verify + that the server hostname matches the certificate.""" class StartDataMigration(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Indicates if data migration must start right away.""" TRUE = "True" - """TRUE.""" + """Data migration must start right away.""" FALSE = "False" - """FALSE.""" + """Data migration must not start right away.""" class StorageAutoGrow(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """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. + """Indicates if the server is configured to automatically grow storage size when available space + is nearing zero and conditions allow for automatic growing storage size. """ ENABLED = "Enabled" - """ENABLED.""" + """Server should automatically grow storage size when available space is nearing zero and + conditions allow for automatically growing storage size.""" DISABLED = "Disabled" - """DISABLED.""" + """Server should not automatically grow storage size when available space is nearing zero.""" class StorageAutoGrowthSupport(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """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'. + """Indicates if storage autogrow is supported in this location. Will be deprecated in the future. + Look to Supported Features for 'StorageAutoGrowth'. """ ENABLED = "Enabled" - """ENABLED.""" + """Storage autogrow is supported.""" DISABLED = "Disabled" - """DISABLED.""" + """Storage autogrow is not supported.""" class StorageType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """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 of storage assigned to a server. If not specified, it defaults to Premium_LRS.""" PREMIUM_LRS = "Premium_LRS" - """PREMIUM_LRS.""" + """Standard Solid State Disk (SSD) backed storage offering consistent performance for general + purpose workloads.""" PREMIUM_V2_LRS = "PremiumV2_LRS" - """PREMIUM_V2_LRS.""" + """Next generation Solid State Disk (SSD) storage with improved scalability and performance for + demanding enterprise workloads.""" ULTRA_SSD_LRS = "UltraSSD_LRS" - """ULTRA_SSD_LRS.""" + """High-end Solid State Disk (SSD) storage designed for extreme IOPS and latency-sensitive + applications.""" class ThreatProtectionName(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Type of ThreatProtectionName.""" DEFAULT = "Default" - """DEFAULT.""" + """Default advanced threat protection settings.""" class ThreatProtectionState(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -826,63 +906,60 @@ class TriggerCutover(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Indicates if cutover must be triggered for the entire migration.""" TRUE = "True" - """TRUE.""" + """Cutover must be triggered for the entire migration.""" FALSE = "False" - """FALSE.""" + """Cutover must not be triggered for the entire migration.""" class TuningOptionParameterEnum(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The name of the tuning option.""" + """Name of the tuning option.""" INDEX = "index" - """INDEX.""" + """Index related recommendations.""" TABLE = "table" - """TABLE.""" + """Table related recommendations.""" class ValidationState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Validation status for migration.""" + """Validation state for migration.""" FAILED = "Failed" - """FAILED.""" + """Validation has failed.""" SUCCEEDED = "Succeeded" - """SUCCEEDED.""" + """Validation has succeeded.""" WARNING = "Warning" - """WARNING.""" + """Validation has succeeded with warnings.""" class VirtualEndpointType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Type of endpoint for the virtual endpoints.""" READ_WRITE = "ReadWrite" - """READ_WRITE.""" + """Read-write endpoint.""" class ZoneRedundantHighAvailabilityAndGeographicallyRedundantBackupSupport( # pylint: disable=name-too-long str, Enum, metaclass=CaseInsensitiveEnumMeta ): """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 + geographically redundant backups in this location. Will be deprecated in the future. Look to Supported Features for 'ZoneRedundantHaAndGeoBackup'. """ ENABLED = "Enabled" - """ENABLED.""" + """High availability with zone redundancy is supported in conjunction with geographically + redundant backups.""" DISABLED = "Disabled" - """DISABLED.""" + """High availability with zone redundancy is not supported in conjunction with geographically + redundant backups.""" class ZoneRedundantHighAvailabilitySupport(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """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'. + """Indicates if high availability with zone redundancy is supported in this location. Will be + deprecated in the future. Look to Supported Features for 'ZoneRedundantHa'. """ ENABLED = "Enabled" - """ENABLED.""" + """High availability with zone redundancy is supported.""" DISABLED = "Disabled" - """DISABLED.""" + """High availability with zone redundancy is not supported.""" diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/azure/mgmt/postgresqlflexibleservers/models/_models.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/azure/mgmt/postgresqlflexibleservers/models/_models.py index aa8006bcd39a..397db5a117fa 100644 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/azure/mgmt/postgresqlflexibleservers/models/_models.py +++ b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/azure/mgmt/postgresqlflexibleservers/models/_models.py @@ -752,7 +752,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class BackupSettings(_Model): - """The settings for the long term backup. + """Settings for the long term backup. :ivar backup_name: Backup Name for the current backup. Required. :vartype backup_name: str @@ -853,7 +853,7 @@ def __setattr__(self, key: str, value: Any) -> None: class BackupsLongTermRetentionRequest(BackupRequestBase): - """The request that is made for a long term retention backup. + """Request made for a long term retention backup. :ivar backup_settings: Backup Settings. Required. :vartype backup_settings: ~azure.mgmt.postgresqlflexibleservers.models.BackupSettings @@ -1012,27 +1012,27 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class CapabilityBase(_Model): """Base object for representing capability. - :ivar status: The status of the capability. Known values are: "Visible", "Available", - "Default", and "Disabled". + :ivar status: Status of the capability. Known values are: "Visible", "Available", "Default", + and "Disabled". :vartype status: str or ~azure.mgmt.postgresqlflexibleservers.models.CapabilityStatus - :ivar reason: The reason for the capability not being available. + :ivar reason: Reason for the capability not being available. :vartype reason: str """ status: Optional[Union[str, "_models.CapabilityStatus"]] = rest_field(visibility=["read"]) - """The status of the capability. Known values are: \"Visible\", \"Available\", \"Default\", and + """Status of the capability. Known values are: \"Visible\", \"Available\", \"Default\", and \"Disabled\".""" reason: Optional[str] = rest_field(visibility=["read"]) - """The reason for the capability not being available.""" + """Reason for the capability not being available.""" class Capability(CapabilityBase): """Capability for the Azure Database for PostgreSQL flexible server. - :ivar status: The status of the capability. Known values are: "Visible", "Available", - "Default", and "Disabled". + :ivar status: Status of the capability. Known values are: "Visible", "Available", "Default", + and "Disabled". :vartype status: str or ~azure.mgmt.postgresqlflexibleservers.models.CapabilityStatus - :ivar reason: The reason for the capability not being available. + :ivar reason: Reason for the capability not being available. :vartype reason: str :ivar name: Name of flexible servers capabilities. :vartype name: str @@ -1898,6 +1898,12 @@ class DataEncryption(_Model): Known values are: "Valid" and "Invalid". :vartype geo_backup_encryption_key_status: str or ~azure.mgmt.postgresqlflexibleservers.models.EncryptionKeyStatus + :ivar primary_federated_identity_client_id: Client id of multi-tenant Microsoft Entra + application. + :vartype primary_federated_identity_client_id: str + :ivar geo_backup_federated_identity_client_id: Client id of multi-tenant Microsoft Entra + application for when it is configured to support geographically redundant backups. + :vartype geo_backup_federated_identity_client_id: str """ primary_key_uri: Optional[str] = rest_field( @@ -1939,6 +1945,15 @@ class DataEncryption(_Model): """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. Known values are: \"Valid\" and \"Invalid\".""" + primary_federated_identity_client_id: Optional[str] = rest_field( + name="primaryFederatedIdentityClientId", visibility=["read", "create", "update", "delete", "query"] + ) + """Client id of multi-tenant Microsoft Entra application.""" + geo_backup_federated_identity_client_id: Optional[str] = rest_field( + name="geoBackupFederatedIdentityClientId", visibility=["read", "create", "update", "delete", "query"] + ) + """Client id of multi-tenant Microsoft Entra application for when it is configured to support + geographically redundant backups.""" @overload def __init__( @@ -1949,6 +1964,8 @@ def __init__( geo_backup_key_uri: Optional[str] = None, geo_backup_user_assigned_identity_id: Optional[str] = None, type: Optional[Union[str, "_models.DataEncryptionType"]] = None, + primary_federated_identity_client_id: Optional[str] = None, + geo_backup_federated_identity_client_id: Optional[str] = None, ) -> None: ... @overload @@ -2148,10 +2165,10 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class FastProvisioningEditionCapability(CapabilityBase): """Capability of a fast provisioning compute tier. - :ivar status: The status of the capability. Known values are: "Visible", "Available", - "Default", and "Disabled". + :ivar status: Status of the capability. Known values are: "Visible", "Available", "Default", + and "Disabled". :vartype status: str or ~azure.mgmt.postgresqlflexibleservers.models.CapabilityStatus - :ivar reason: The reason for the capability not being available. + :ivar reason: Reason for the capability not being available. :vartype reason: str :ivar supported_tier: Compute tier supporting fast provisioning. :vartype supported_tier: str @@ -2287,7 +2304,8 @@ class HighAvailability(_Model): ~azure.mgmt.postgresqlflexibleservers.models.PostgreSqlFlexibleServerHighAvailabilityMode :ivar state: Possible states of the standby server created when high availability is set to SameZone or ZoneRedundant. Known values are: "NotEnabled", "CreatingStandby", - "ReplicatingData", "FailingOver", "Healthy", and "RemovingStandby". + "ReplicatingData", "FailingOver", "Healthy", "RemovingStandby", "RecreatingStandby", and + "ComputeUpdatingByFailover". :vartype state: str or ~azure.mgmt.postgresqlflexibleservers.models.HighAvailabilityState :ivar standby_availability_zone: Availability zone associated to the standby server created when high availability is set to SameZone or ZoneRedundant. @@ -2302,7 +2320,8 @@ class HighAvailability(_Model): state: Optional[Union[str, "_models.HighAvailabilityState"]] = rest_field(visibility=["read"]) """Possible states of the standby server created when high availability is set to SameZone or ZoneRedundant. Known values are: \"NotEnabled\", \"CreatingStandby\", \"ReplicatingData\", - \"FailingOver\", \"Healthy\", and \"RemovingStandby\".""" + \"FailingOver\", \"Healthy\", \"RemovingStandby\", \"RecreatingStandby\", and + \"ComputeUpdatingByFailover\".""" standby_availability_zone: Optional[str] = rest_field( name="standbyAvailabilityZone", visibility=["read", "create", "update", "delete", "query"] ) @@ -2337,7 +2356,8 @@ class HighAvailabilityForPatch(_Model): ~azure.mgmt.postgresqlflexibleservers.models.PostgreSqlFlexibleServerHighAvailabilityMode :ivar state: Possible states of the standby server created when high availability is set to SameZone or ZoneRedundant. Known values are: "NotEnabled", "CreatingStandby", - "ReplicatingData", "FailingOver", "Healthy", and "RemovingStandby". + "ReplicatingData", "FailingOver", "Healthy", "RemovingStandby", "RecreatingStandby", and + "ComputeUpdatingByFailover". :vartype state: str or ~azure.mgmt.postgresqlflexibleservers.models.HighAvailabilityState :ivar standby_availability_zone: Availability zone associated to the standby server created when high availability is set to SameZone or ZoneRedundant. @@ -2352,7 +2372,8 @@ class HighAvailabilityForPatch(_Model): state: Optional[Union[str, "_models.HighAvailabilityState"]] = rest_field(visibility=["read"]) """Possible states of the standby server created when high availability is set to SameZone or ZoneRedundant. Known values are: \"NotEnabled\", \"CreatingStandby\", \"ReplicatingData\", - \"FailingOver\", \"Healthy\", and \"RemovingStandby\".""" + \"FailingOver\", \"Healthy\", \"RemovingStandby\", \"RecreatingStandby\", and + \"ComputeUpdatingByFailover\".""" standby_availability_zone: Optional[str] = rest_field( name="standbyAvailabilityZone", visibility=["read", "create", "update", "delete", "query"] ) @@ -2488,11 +2509,11 @@ class LtrBackupOperationResponseProperties(_Model): :vartype start_time: ~datetime.datetime :ivar end_time: End time of the operation. :vartype end_time: ~datetime.datetime - :ivar percent_complete: PercentageCompleted. + :ivar percent_complete: Percentage completed. :vartype percent_complete: float - :ivar error_code: The error code. + :ivar error_code: Error code. :vartype error_code: str - :ivar error_message: The error message. + :ivar error_message: Error message. :vartype error_message: str """ @@ -2529,11 +2550,11 @@ class LtrBackupOperationResponseProperties(_Model): percent_complete: Optional[float] = rest_field( name="percentComplete", visibility=["read", "create", "update", "delete", "query"] ) - """PercentageCompleted.""" + """Percentage completed.""" error_code: Optional[str] = rest_field(name="errorCode", visibility=["read"]) - """The error code.""" + """Error code.""" error_message: Optional[str] = rest_field(name="errorMessage", visibility=["read"]) - """The error message.""" + """Error message.""" @overload def __init__( @@ -2636,6 +2657,228 @@ def __setattr__(self, key: str, value: Any) -> None: super().__setattr__(key, value) +class MaintenanceEventActionResponse(_Model): + """Response model for maintenance event reschedule and apply-now actions. + + :ivar maintenance_event_id: The maintenance event name (maintenance ID). + :vartype maintenance_event_id: str + :ivar server_id: The full Azure resource ID of the server. + :vartype server_id: str + :ivar status: The status of the maintenance event. Known values are: "Planned", "InProgress", + "Complete", "Rescheduled", and "Canceled". + :vartype status: str or ~azure.mgmt.postgresqlflexibleservers.models.MaintenanceEventStatus + :ivar planned_start_time: The planned start time of the maintenance event (UTC). + :vartype planned_start_time: ~datetime.datetime + :ivar planned_end_time: The planned end time of the maintenance event (UTC). + :vartype planned_end_time: ~datetime.datetime + :ivar applied_now: A value indicating whether this was an apply-now (immediate) action. True + for ApplyNow; false for Reschedule. + :vartype applied_now: bool + :ivar last_updated_time: The time this maintenance event record was last updated (UTC). + :vartype last_updated_time: ~datetime.datetime + """ + + maintenance_event_id: Optional[str] = rest_field( + name="maintenanceEventId", visibility=["read", "create", "update", "delete", "query"] + ) + """The maintenance event name (maintenance ID).""" + server_id: Optional[str] = rest_field(name="serverId", visibility=["read", "create", "update", "delete", "query"]) + """The full Azure resource ID of the server.""" + status: Optional[Union[str, "_models.MaintenanceEventStatus"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The status of the maintenance event. Known values are: \"Planned\", \"InProgress\", + \"Complete\", \"Rescheduled\", and \"Canceled\".""" + planned_start_time: Optional[datetime.datetime] = rest_field( + name="plannedStartTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """The planned start time of the maintenance event (UTC).""" + planned_end_time: Optional[datetime.datetime] = rest_field( + name="plannedEndTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """The planned end time of the maintenance event (UTC).""" + applied_now: Optional[bool] = rest_field( + name="appliedNow", visibility=["read", "create", "update", "delete", "query"] + ) + """A value indicating whether this was an apply-now (immediate) action. True for ApplyNow; false + for Reschedule.""" + last_updated_time: Optional[datetime.datetime] = rest_field( + name="lastUpdatedTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """The time this maintenance event record was last updated (UTC).""" + + @overload + def __init__( + self, + *, + maintenance_event_id: Optional[str] = None, + server_id: Optional[str] = None, + status: Optional[Union[str, "_models.MaintenanceEventStatus"]] = None, + planned_start_time: Optional[datetime.datetime] = None, + planned_end_time: Optional[datetime.datetime] = None, + applied_now: Optional[bool] = None, + last_updated_time: Optional[datetime.datetime] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class MaintenanceEventRescheduleRequest(_Model): + """Parameters to reschedule a maintenance event. + + :ivar postpone_to_date_time: New start time in RFC3339 format. Required. + :vartype postpone_to_date_time: ~datetime.datetime + """ + + postpone_to_date_time: datetime.datetime = rest_field( + name="postponeToDateTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """New start time in RFC3339 format. Required.""" + + @overload + def __init__( + self, + *, + postpone_to_date_time: datetime.datetime, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class MaintenanceEventResource(ProxyResource): + """Maintenance event resource for a PostgreSQL flexible server. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.postgresqlflexibleservers.models.SystemData + :ivar properties: The resource-specific properties for this resource. + :vartype properties: + ~azure.mgmt.postgresqlflexibleservers.models.MaintenanceEventResourceProperties + """ + + properties: Optional["_models.MaintenanceEventResourceProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The resource-specific properties for this resource.""" + + @overload + def __init__( + self, + *, + properties: Optional["_models.MaintenanceEventResourceProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class MaintenanceEventResourceProperties(_Model): + """Properties of a maintenance event resource. + + :ivar maintenance_event_id: A service-generated identifier for this maintenance event, assigned + by the platform (e.g., 'YL1T-HFG'). The format is not contractual and clients should not + attempt to parse or construct this value. + :vartype maintenance_event_id: str + :ivar maintenance_type: The maintenance type (e.g., 'PlannedMaintenance'). Required. + "PlannedMaintenance" + :vartype maintenance_type: str or ~azure.mgmt.postgresqlflexibleservers.models.MaintenanceType + :ivar description: The human-readable description of the maintenance event. + :vartype description: str + :ivar status: The customer-facing status of the maintenance event. Required. Known values are: + "Planned", "InProgress", "Complete", "Rescheduled", and "Canceled". + :vartype status: str or ~azure.mgmt.postgresqlflexibleservers.models.MaintenanceEventStatus + :ivar start_time: The scheduled start time of the maintenance event (UTC). Required. + :vartype start_time: ~datetime.datetime + :ivar end_time: The scheduled end time of the maintenance event (UTC). Required. + :vartype end_time: ~datetime.datetime + :ivar estimated_downtime: The estimated downtime as an ISO 8601 duration string (e.g., 'PT60S' + = 60 seconds). + :vartype estimated_downtime: str + :ivar deferrable: A value indicating whether this maintenance event can be rescheduled by the + customer. Required. + :vartype deferrable: bool + :ivar deferral_deadline: The latest date/time this maintenance event can be postponed to (UTC). + Present only when deferrable is true. + :vartype deferral_deadline: ~datetime.datetime + :ivar rescheduled_from: The previous scheduled start time before the most recent reschedule + (UTC). Null if the event has never been rescheduled. + :vartype rescheduled_from: ~datetime.datetime + :ivar last_updated_time: The time this maintenance event record was last updated (UTC). + :vartype last_updated_time: ~datetime.datetime + :ivar original_start_time: The initial scheduled start time before any reschedule (UTC). Equals + startTime when the event has never been rescheduled. Required. + :vartype original_start_time: ~datetime.datetime + """ + + maintenance_event_id: Optional[str] = rest_field(name="maintenanceEventId", visibility=["read"]) + """A service-generated identifier for this maintenance event, assigned by the platform (e.g., + 'YL1T-HFG'). The format is not contractual and clients should not attempt to parse or construct + this value.""" + maintenance_type: Union[str, "_models.MaintenanceType"] = rest_field(name="maintenanceType", visibility=["read"]) + """The maintenance type (e.g., 'PlannedMaintenance'). Required. \"PlannedMaintenance\"""" + description: Optional[str] = rest_field(visibility=["read"]) + """The human-readable description of the maintenance event.""" + status: Union[str, "_models.MaintenanceEventStatus"] = rest_field(visibility=["read"]) + """The customer-facing status of the maintenance event. Required. Known values are: \"Planned\", + \"InProgress\", \"Complete\", \"Rescheduled\", and \"Canceled\".""" + start_time: datetime.datetime = rest_field(name="startTime", visibility=["read"], format="rfc3339") + """The scheduled start time of the maintenance event (UTC). Required.""" + end_time: datetime.datetime = rest_field(name="endTime", visibility=["read"], format="rfc3339") + """The scheduled end time of the maintenance event (UTC). Required.""" + estimated_downtime: Optional[str] = rest_field(name="estimatedDowntime", visibility=["read"]) + """The estimated downtime as an ISO 8601 duration string (e.g., 'PT60S' = 60 seconds).""" + deferrable: bool = rest_field(visibility=["read"]) + """A value indicating whether this maintenance event can be rescheduled by the customer. Required.""" + deferral_deadline: Optional[datetime.datetime] = rest_field( + name="deferralDeadline", visibility=["read"], format="rfc3339" + ) + """The latest date/time this maintenance event can be postponed to (UTC). Present only when + deferrable is true.""" + rescheduled_from: Optional[datetime.datetime] = rest_field( + name="rescheduledFrom", visibility=["read"], format="rfc3339" + ) + """The previous scheduled start time before the most recent reschedule (UTC). Null if the event + has never been rescheduled.""" + last_updated_time: Optional[datetime.datetime] = rest_field( + name="lastUpdatedTime", visibility=["read"], format="rfc3339" + ) + """The time this maintenance event record was last updated (UTC).""" + original_start_time: datetime.datetime = rest_field(name="originalStartTime", visibility=["read"], format="rfc3339") + """The initial scheduled start time before any reschedule (UTC). Equals startTime when the event + has never been rescheduled. Required.""" + + class MaintenanceWindow(_Model): """Maintenance window properties of a server. @@ -2734,6 +2977,112 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) +class MajorVersionUpgradePrecheckResource(ProxyResource): + """Major version upgrade precheck resource for a PostgreSQL flexible server. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.postgresqlflexibleservers.models.SystemData + :ivar properties: The resource-specific properties for this resource. + :vartype properties: + ~azure.mgmt.postgresqlflexibleservers.models.MajorVersionUpgradePrecheckResourceProperties + """ + + properties: Optional["_models.MajorVersionUpgradePrecheckResourceProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The resource-specific properties for this resource.""" + + @overload + def __init__( + self, + *, + properties: Optional["_models.MajorVersionUpgradePrecheckResourceProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class MajorVersionUpgradePrecheckResourceProperties(_Model): # pylint: disable=name-too-long + """Major version upgrade precheck resource with validation results. + + :ivar create_time: The time when the precheck was created. + :vartype create_time: ~datetime.datetime + :ivar status: The status of the precheck validation. Known values are: "Validating", + "Succeeded", "Failed", and "Canceled". + :vartype status: str or + ~azure.mgmt.postgresqlflexibleservers.models.MajorVersionUpgradePrecheckStatus + :ivar precheck_result: The detailed result of the precheck operation. + :vartype precheck_result: ~azure.mgmt.postgresqlflexibleservers.models.PrecheckResult + :ivar target_version: The target PostgreSQL major version for the upgrade. Known values are: + "18", "17", "16", "15", "14", "13", "12", and "11". + :vartype target_version: str or + ~azure.mgmt.postgresqlflexibleservers.models.PostgresMajorVersion + :ivar policy_details: Array of policy validation details. + :vartype policy_details: list[~azure.mgmt.postgresqlflexibleservers.models.PolicyDetail] + """ + + create_time: Optional[datetime.datetime] = rest_field( + name="createTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """The time when the precheck was created.""" + status: Optional[Union[str, "_models.MajorVersionUpgradePrecheckStatus"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The status of the precheck validation. Known values are: \"Validating\", \"Succeeded\", + \"Failed\", and \"Canceled\".""" + precheck_result: Optional["_models.PrecheckResult"] = rest_field( + name="precheckResult", visibility=["read", "create", "update", "delete", "query"] + ) + """The detailed result of the precheck operation.""" + target_version: Optional[Union[str, "_models.PostgresMajorVersion"]] = rest_field( + name="targetVersion", visibility=["read", "create", "update", "delete", "query"] + ) + """The target PostgreSQL major version for the upgrade. Known values are: \"18\", \"17\", \"16\", + \"15\", \"14\", \"13\", \"12\", and \"11\".""" + policy_details: Optional[list["_models.PolicyDetail"]] = rest_field( + name="policyDetails", visibility=["read", "create", "update", "delete", "query"] + ) + """Array of policy validation details.""" + + @overload + def __init__( + self, + *, + create_time: Optional[datetime.datetime] = None, + status: Optional[Union[str, "_models.MajorVersionUpgradePrecheckStatus"]] = None, + precheck_result: Optional["_models.PrecheckResult"] = None, + target_version: Optional[Union[str, "_models.PostgresMajorVersion"]] = None, + policy_details: Optional[list["_models.PolicyDetail"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + class MetricSpecification(_Model): """Metric specification for an operation. @@ -2808,15 +3157,15 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class MigrateNetworkStatus(_Model): - """The status of a network migration operation. + """Status of a network migration operation. - :ivar subscription_id: The ID of the subscription. + :ivar subscription_id: Identifier of the subscription. :vartype subscription_id: str - :ivar resource_group_name: The name of the resource group. + :ivar resource_group_name: Name of the resource group. :vartype resource_group_name: str - :ivar server_name: The name of the server. + :ivar server_name: Name of the server. :vartype server_name: str - :ivar state: The state of the network migration operation. Known values are: "Pending", + :ivar state: State of the network migration operation. Known values are: "Pending", "InProgress", "Succeeded", "Failed", "CancelInProgress", and "Cancelled". :vartype state: str or ~azure.mgmt.postgresqlflexibleservers.models.NetworkMigrationState """ @@ -2824,17 +3173,17 @@ class MigrateNetworkStatus(_Model): subscription_id: Optional[str] = rest_field( name="subscriptionId", visibility=["read", "create", "update", "delete", "query"] ) - """The ID of the subscription.""" + """Identifier of the subscription.""" resource_group_name: Optional[str] = rest_field( name="resourceGroupName", visibility=["read", "create", "update", "delete", "query"] ) - """The name of the resource group.""" + """Name of the resource group.""" server_name: Optional[str] = rest_field( name="serverName", visibility=["read", "create", "update", "delete", "query"] ) - """The name of the server.""" + """Name of the server.""" state: Optional[Union[str, "_models.NetworkMigrationState"]] = rest_field(visibility=["read"]) - """The state of the network migration operation. Known values are: \"Pending\", \"InProgress\", + """State of the network migration operation. Known values are: \"Pending\", \"InProgress\", \"Succeeded\", \"Failed\", \"CancelInProgress\", and \"Cancelled\".""" @overload @@ -4268,6 +4617,137 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) +class PolicyDetail(_Model): + """Policy validation details. + + :ivar policy_name: The name of the policy. + :vartype policy_name: str + :ivar passed: Whether the policy validation passed. + :vartype passed: bool + :ivar error_code: The error code if validation failed. + :vartype error_code: int + :ivar error_message: The error message if validation failed. + :vartype error_message: str + :ivar policy_description: Description of what the policy validates. + :vartype policy_description: str + """ + + policy_name: Optional[str] = rest_field( + name="policyName", visibility=["read", "create", "update", "delete", "query"] + ) + """The name of the policy.""" + passed: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether the policy validation passed.""" + error_code: Optional[int] = rest_field(name="errorCode", visibility=["read", "create", "update", "delete", "query"]) + """The error code if validation failed.""" + error_message: Optional[str] = rest_field( + name="errorMessage", visibility=["read", "create", "update", "delete", "query"] + ) + """The error message if validation failed.""" + policy_description: Optional[str] = rest_field( + name="policyDescription", visibility=["read", "create", "update", "delete", "query"] + ) + """Description of what the policy validates.""" + + @overload + def __init__( + self, + *, + policy_name: Optional[str] = None, + passed: Optional[bool] = None, + error_code: Optional[int] = None, + error_message: Optional[str] = None, + policy_description: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class PrecheckErrorInfo(_Model): + """Error information from precheck validation. + + :ivar error_code: The error code. + :vartype error_code: int + :ivar error_message: The error message. + :vartype error_message: str + """ + + error_code: Optional[int] = rest_field(name="errorCode", visibility=["read", "create", "update", "delete", "query"]) + """The error code.""" + error_message: Optional[str] = rest_field( + name="errorMessage", visibility=["read", "create", "update", "delete", "query"] + ) + """The error message.""" + + @overload + def __init__( + self, + *, + error_code: Optional[int] = None, + error_message: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class PrecheckResult(_Model): + """Precheck result details. + + :ivar action: The action performed. + :vartype action: str + :ivar upgrade_sequence: The upgrade sequence information. + :vartype upgrade_sequence: ~azure.mgmt.postgresqlflexibleservers.models.UpgradeSequence + :ivar error_info: Array of error information. + :vartype error_info: list[~azure.mgmt.postgresqlflexibleservers.models.PrecheckErrorInfo] + """ + + action: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The action performed.""" + upgrade_sequence: Optional["_models.UpgradeSequence"] = rest_field( + name="upgradeSequence", visibility=["read", "create", "update", "delete", "query"] + ) + """The upgrade sequence information.""" + error_info: Optional[list["_models.PrecheckErrorInfo"]] = rest_field( + name="errorInfo", visibility=["read", "create", "update", "delete", "query"] + ) + """Array of error information.""" + + @overload + def __init__( + self, + *, + action: Optional[str] = None, + upgrade_sequence: Optional["_models.UpgradeSequence"] = None, + error_info: Optional[list["_models.PrecheckErrorInfo"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + class PrivateEndpoint(_Model): """The private endpoint resource. @@ -4811,10 +5291,10 @@ def __setattr__(self, key: str, value: Any) -> None: class ServerEditionCapability(CapabilityBase): """Capabilities in terms of compute tier. - :ivar status: The status of the capability. Known values are: "Visible", "Available", - "Default", and "Disabled". + :ivar status: Status of the capability. Known values are: "Visible", "Available", "Default", + and "Disabled". :vartype status: str or ~azure.mgmt.postgresqlflexibleservers.models.CapabilityStatus - :ivar reason: The reason for the capability not being available. + :ivar reason: Reason for the capability not being available. :vartype reason: str :ivar name: Name of compute tier. :vartype name: str @@ -5280,10 +5760,10 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class ServerSkuCapability(CapabilityBase): """Capabilities in terms of compute. - :ivar status: The status of the capability. Known values are: "Visible", "Available", - "Default", and "Disabled". + :ivar status: Status of the capability. Known values are: "Visible", "Available", "Default", + and "Disabled". :vartype status: str or ~azure.mgmt.postgresqlflexibleservers.models.CapabilityStatus - :ivar reason: The reason for the capability not being available. + :ivar reason: Reason for the capability not being available. :vartype reason: str :ivar name: Name of the compute (SKU). :vartype name: str @@ -5332,10 +5812,10 @@ class ServerSkuCapability(CapabilityBase): class ServerVersionCapability(CapabilityBase): """Capabilities in terms of major versions of PostgreSQL database engine. - :ivar status: The status of the capability. Known values are: "Visible", "Available", - "Default", and "Disabled". + :ivar status: Status of the capability. Known values are: "Visible", "Available", "Default", + and "Disabled". :vartype status: str or ~azure.mgmt.postgresqlflexibleservers.models.CapabilityStatus - :ivar reason: The reason for the capability not being available. + :ivar reason: Reason for the capability not being available. :vartype reason: str :ivar name: Major version of PostgreSQL database engine. :vartype name: str @@ -5453,6 +5933,84 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) +class StartMajorVersionUpgradePrecheckRequest(_Model): + """Request model for starting a major version upgrade precheck. + + :ivar target_version: The target major version to upgrade to. Required. Known values are: "18", + "17", "16", "15", "14", "13", "12", and "11". + :vartype target_version: str or + ~azure.mgmt.postgresqlflexibleservers.models.PostgresMajorVersion + """ + + target_version: Union[str, "_models.PostgresMajorVersion"] = rest_field( + name="targetVersion", visibility=["read", "create", "update", "delete", "query"] + ) + """The target major version to upgrade to. Required. Known values are: \"18\", \"17\", \"16\", + \"15\", \"14\", \"13\", \"12\", and \"11\".""" + + @overload + def __init__( + self, + *, + target_version: Union[str, "_models.PostgresMajorVersion"], + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class StartMajorVersionUpgradePrecheckResponse(_Model): + """Response model for starting a major version upgrade precheck. + + :ivar name: The precheck validation ID. + :vartype name: str + :ivar create_time: The time when the precheck was created. + :vartype create_time: ~datetime.datetime + :ivar status: The status of the precheck validation. Known values are: "Validating", + "Succeeded", "Failed", and "Canceled". + :vartype status: str or + ~azure.mgmt.postgresqlflexibleservers.models.MajorVersionUpgradePrecheckStatus + """ + + name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The precheck validation ID.""" + create_time: Optional[datetime.datetime] = rest_field( + name="createTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """The time when the precheck was created.""" + status: Optional[Union[str, "_models.MajorVersionUpgradePrecheckStatus"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The status of the precheck validation. Known values are: \"Validating\", \"Succeeded\", + \"Failed\", and \"Canceled\".""" + + @overload + def __init__( + self, + *, + name: Optional[str] = None, + create_time: Optional[datetime.datetime] = None, + status: Optional[Union[str, "_models.MajorVersionUpgradePrecheckStatus"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + class Storage(_Model): """Storage properties of a server. @@ -5532,10 +6090,10 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class StorageEditionCapability(CapabilityBase): """Capabilities in terms of storage tier. - :ivar status: The status of the capability. Known values are: "Visible", "Available", - "Default", and "Disabled". + :ivar status: Status of the capability. Known values are: "Visible", "Available", "Default", + and "Disabled". :vartype status: str or ~azure.mgmt.postgresqlflexibleservers.models.CapabilityStatus - :ivar reason: The reason for the capability not being available. + :ivar reason: Reason for the capability not being available. :vartype reason: str :ivar name: Name of storage tier. :vartype name: str @@ -5559,10 +6117,10 @@ class StorageEditionCapability(CapabilityBase): class StorageMbCapability(CapabilityBase): """Storage size (in MB) capability. - :ivar status: The status of the capability. Known values are: "Visible", "Available", - "Default", and "Disabled". + :ivar status: Status of the capability. Known values are: "Visible", "Available", "Default", + and "Disabled". :vartype status: str or ~azure.mgmt.postgresqlflexibleservers.models.CapabilityStatus - :ivar reason: The reason for the capability not being available. + :ivar reason: Reason for the capability not being available. :vartype reason: str :ivar supported_iops: Minimum IOPS supported by the storage size. :vartype supported_iops: int @@ -5606,10 +6164,10 @@ class StorageMbCapability(CapabilityBase): class StorageTierCapability(CapabilityBase): """Capability of a storage tier. - :ivar status: The status of the capability. Known values are: "Visible", "Available", - "Default", and "Disabled". + :ivar status: Status of the capability. Known values are: "Visible", "Available", "Default", + and "Disabled". :vartype status: str or ~azure.mgmt.postgresqlflexibleservers.models.CapabilityStatus - :ivar reason: The reason for the capability not being available. + :ivar reason: Reason for the capability not being available. :vartype reason: str :ivar name: Name of the storage tier. :vartype name: str @@ -5760,6 +6318,49 @@ class TuningOptionsProperties(_Model): """State of the tuning option.""" +class UpgradeSequence(_Model): + """Upgrade sequence information. + + :ivar source_version: The source PostgreSQL version. Known values are: "18", "17", "16", "15", + "14", "13", "12", and "11". + :vartype source_version: str or + ~azure.mgmt.postgresqlflexibleservers.models.PostgresMajorVersion + :ivar target_version: The target PostgreSQL version. Known values are: "18", "17", "16", "15", + "14", "13", "12", and "11". + :vartype target_version: str or + ~azure.mgmt.postgresqlflexibleservers.models.PostgresMajorVersion + """ + + source_version: Optional[Union[str, "_models.PostgresMajorVersion"]] = rest_field( + name="sourceVersion", visibility=["read", "create", "update", "delete", "query"] + ) + """The source PostgreSQL version. Known values are: \"18\", \"17\", \"16\", \"15\", \"14\", + \"13\", \"12\", and \"11\".""" + target_version: Optional[Union[str, "_models.PostgresMajorVersion"]] = rest_field( + name="targetVersion", visibility=["read", "create", "update", "delete", "query"] + ) + """The target PostgreSQL version. Known values are: \"18\", \"17\", \"16\", \"15\", \"14\", + \"13\", \"12\", and \"11\".""" + + @overload + def __init__( + self, + *, + source_version: Optional[Union[str, "_models.PostgresMajorVersion"]] = None, + target_version: Optional[Union[str, "_models.PostgresMajorVersion"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + class UserAssignedIdentity(_Model): """Identities associated with a server. diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/azure/mgmt/postgresqlflexibleservers/models/_patch.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/azure/mgmt/postgresqlflexibleservers/models/_patch.py index 87676c65a8f0..ea765788358a 100644 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/azure/mgmt/postgresqlflexibleservers/models/_patch.py +++ b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/azure/mgmt/postgresqlflexibleservers/models/_patch.py @@ -8,7 +8,6 @@ Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ - __all__: list[str] = [] # Add all objects you want publicly available to users at this package level diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/azure/mgmt/postgresqlflexibleservers/operations/__init__.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/azure/mgmt/postgresqlflexibleservers/operations/__init__.py index ec5ea57d4214..ce31cef7fb90 100644 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/azure/mgmt/postgresqlflexibleservers/operations/__init__.py +++ b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/azure/mgmt/postgresqlflexibleservers/operations/__init__.py @@ -21,6 +21,8 @@ from ._operations import PrivateEndpointConnectionsOperations # type: ignore from ._operations import PrivateLinkResourcesOperations # type: ignore from ._operations import VirtualEndpointsOperations # type: ignore +from ._operations import MaintenanceEventsOperations # type: ignore +from ._operations import MajorVersionUpgradePrecheckOperations # type: ignore from ._operations import AdministratorsMicrosoftEntraOperations # type: ignore from ._operations import CapabilitiesByServerOperations # type: ignore from ._operations import CapturedLogsOperations # type: ignore @@ -50,6 +52,8 @@ "PrivateEndpointConnectionsOperations", "PrivateLinkResourcesOperations", "VirtualEndpointsOperations", + "MaintenanceEventsOperations", + "MajorVersionUpgradePrecheckOperations", "AdministratorsMicrosoftEntraOperations", "CapabilitiesByServerOperations", "CapturedLogsOperations", diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/azure/mgmt/postgresqlflexibleservers/operations/_operations.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/azure/mgmt/postgresqlflexibleservers/operations/_operations.py index 778519de6997..fc0160096f83 100644 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/azure/mgmt/postgresqlflexibleservers/operations/_operations.py +++ b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/azure/mgmt/postgresqlflexibleservers/operations/_operations.py @@ -51,7 +51,7 @@ def build_operations_list_request(**kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-01-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -72,7 +72,7 @@ def build_migrations_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-01-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -102,7 +102,7 @@ def build_migrations_create_request( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-01-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -134,7 +134,7 @@ def build_migrations_update_request( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-01-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -165,7 +165,7 @@ def build_migrations_cancel_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-01-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -199,7 +199,7 @@ def build_migrations_list_by_target_server_request( # pylint: disable=name-too- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-01-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -230,7 +230,7 @@ def build_migrations_check_name_availability_request( # pylint: disable=name-to _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-01-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -260,7 +260,7 @@ def build_servers_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-01-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -289,7 +289,7 @@ def build_servers_create_or_update_request( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-01-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}" path_format_arguments = { @@ -317,7 +317,7 @@ def build_servers_update_request( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-01-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}" path_format_arguments = { @@ -343,7 +343,7 @@ def build_servers_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-01-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}" path_format_arguments = { @@ -366,7 +366,7 @@ def build_servers_list_by_resource_group_request( # pylint: disable=name-too-lo _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-01-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -393,7 +393,7 @@ def build_servers_list_by_subscription_request( # pylint: disable=name-too-long _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-01-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -420,7 +420,7 @@ def build_servers_restart_request( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-01-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/restart" path_format_arguments = { @@ -446,7 +446,7 @@ def build_servers_start_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-01-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/start" path_format_arguments = { @@ -468,7 +468,7 @@ def build_servers_stop_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-01-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/stop" path_format_arguments = { @@ -491,7 +491,7 @@ def build_servers_migrate_network_mode_request( # pylint: disable=name-too-long _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-01-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -513,13 +513,44 @@ def build_servers_migrate_network_mode_request( # pylint: disable=name-too-long return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) +def build_servers_start_major_version_upgrade_precheck_request( # pylint: disable=name-too-long + resource_group_name: str, server_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/startMajorVersionUpgradePrecheck" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + def build_configurations_get_request( resource_group_name: str, server_name: str, configuration_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-01-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -549,7 +580,7 @@ def build_configurations_put_request( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-01-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/configurations/{configurationName}" path_format_arguments = { @@ -578,7 +609,7 @@ def build_configurations_update_request( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-01-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/configurations/{configurationName}" path_format_arguments = { @@ -606,7 +637,7 @@ def build_configurations_list_by_server_request( # pylint: disable=name-too-lon _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-01-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -634,7 +665,7 @@ def build_databases_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-01-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -664,7 +695,7 @@ def build_databases_create_request( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-01-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/databases/{databaseName}" path_format_arguments = { @@ -691,7 +722,7 @@ def build_databases_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-01-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/databases/{databaseName}" path_format_arguments = { @@ -715,7 +746,7 @@ def build_databases_list_by_server_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-01-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -743,7 +774,7 @@ def build_firewall_rules_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-01-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -773,7 +804,7 @@ def build_firewall_rules_create_or_update_request( # pylint: disable=name-too-l _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-01-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/firewallRules/{firewallRuleName}" path_format_arguments = { @@ -800,7 +831,7 @@ def build_firewall_rules_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-01-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/firewallRules/{firewallRuleName}" path_format_arguments = { @@ -824,7 +855,7 @@ def build_firewall_rules_list_by_server_request( # pylint: disable=name-too-lon _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-01-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -856,7 +887,7 @@ def build_private_endpoint_connections_get_request( # pylint: disable=name-too- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-01-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -892,7 +923,7 @@ def build_private_endpoint_connections_update_request( # pylint: disable=name-t _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-01-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/privateEndpointConnections/{privateEndpointConnectionName}" path_format_arguments = { @@ -925,7 +956,7 @@ def build_private_endpoint_connections_delete_request( # pylint: disable=name-t ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-01-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/privateEndpointConnections/{privateEndpointConnectionName}" path_format_arguments = { @@ -951,7 +982,7 @@ def build_private_endpoint_connections_list_by_server_request( # pylint: disabl _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-01-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -979,7 +1010,7 @@ def build_private_link_resources_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-01-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1008,7 +1039,7 @@ def build_private_link_resources_list_by_server_request( # pylint: disable=name _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-01-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1036,7 +1067,7 @@ def build_virtual_endpoints_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-01-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1066,7 +1097,7 @@ def build_virtual_endpoints_create_request( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-01-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/virtualendpoints/{virtualEndpointName}" path_format_arguments = { @@ -1095,7 +1126,7 @@ def build_virtual_endpoints_update_request( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-01-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/virtualendpoints/{virtualEndpointName}" path_format_arguments = { @@ -1122,7 +1153,7 @@ def build_virtual_endpoints_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-01-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/virtualendpoints/{virtualEndpointName}" path_format_arguments = { @@ -1146,7 +1177,7 @@ def build_virtual_endpoints_list_by_server_request( # pylint: disable=name-too- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-01-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1168,13 +1199,195 @@ def build_virtual_endpoints_list_by_server_request( # pylint: disable=name-too- return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) +def build_maintenance_events_get_request( + resource_group_name: str, server_name: str, maintenance_event_id: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/maintenanceEvents/{maintenanceEventId}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "maintenanceEventId": _SERIALIZER.url("maintenance_event_id", maintenance_event_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_maintenance_events_list_request( + resource_group_name: str, + server_name: str, + subscription_id: str, + *, + maintenance_status: Optional[Union[str, _models.MaintenanceEventStatusFilter]] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/maintenanceEvents" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if maintenance_status is not None: + _params["maintenanceStatus"] = _SERIALIZER.query("maintenance_status", maintenance_status, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_maintenance_events_reschedule_request( # pylint: disable=name-too-long + resource_group_name: str, server_name: str, maintenance_event_id: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/maintenanceEvents/{maintenanceEventId}/reschedule" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "maintenanceEventId": _SERIALIZER.url("maintenance_event_id", maintenance_event_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_maintenance_events_apply_now_request( # pylint: disable=name-too-long + resource_group_name: str, server_name: str, maintenance_event_id: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/maintenanceEvents/{maintenanceEventId}/applyNow" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "maintenanceEventId": _SERIALIZER.url("maintenance_event_id", maintenance_event_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_major_version_upgrade_precheck_get_request( # pylint: disable=name-too-long + resource_group_name: str, server_name: str, precheck_validation_id: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/majorVersionUpgradePrecheck/{precheckValidationId}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "precheckValidationId": _SERIALIZER.url("precheck_validation_id", precheck_validation_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_major_version_upgrade_precheck_list_request( # pylint: disable=name-too-long + resource_group_name: str, server_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/majorVersionUpgradePrecheck" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + def build_administrators_microsoft_entra_get_request( # pylint: disable=name-too-long resource_group_name: str, server_name: str, object_id: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-01-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1204,7 +1417,7 @@ def build_administrators_microsoft_entra_create_or_update_request( # pylint: di _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-01-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/administrators/{objectId}" path_format_arguments = { @@ -1231,7 +1444,7 @@ def build_administrators_microsoft_entra_delete_request( # pylint: disable=name ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-01-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/administrators/{objectId}" path_format_arguments = { @@ -1255,7 +1468,7 @@ def build_administrators_microsoft_entra_list_by_server_request( # pylint: disa _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-01-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1283,7 +1496,7 @@ def build_capabilities_by_server_list_request( # pylint: disable=name-too-long _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-01-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1311,7 +1524,7 @@ def build_captured_logs_list_by_server_request( # pylint: disable=name-too-long _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-01-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1340,7 +1553,7 @@ def build_backups_long_term_retention_check_prerequisites_request( # pylint: di _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-01-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1371,7 +1584,7 @@ def build_backups_long_term_retention_start_request( # pylint: disable=name-too _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-01-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1401,7 +1614,7 @@ def build_backups_long_term_retention_get_request( # pylint: disable=name-too-l _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-01-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1430,7 +1643,7 @@ def build_backups_long_term_retention_list_by_server_request( # pylint: disable _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-01-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1458,7 +1671,7 @@ def build_replicas_list_by_server_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-01-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1490,7 +1703,7 @@ def build_advanced_threat_protection_settings_get_request( # pylint: disable=na _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-01-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1519,7 +1732,7 @@ def build_advanced_threat_protection_settings_list_by_server_request( # pylint: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-01-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1552,7 +1765,7 @@ def build_server_threat_protection_settings_create_or_update_request( # pylint: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-01-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/advancedThreatProtectionSettings/{threatProtectionName}" path_format_arguments = { @@ -1580,7 +1793,7 @@ def build_backups_automatic_and_on_demand_get_request( # pylint: disable=name-t _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-01-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1608,7 +1821,7 @@ def build_backups_automatic_and_on_demand_create_request( # pylint: disable=nam ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-01-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/backups/{backupName}" path_format_arguments = { @@ -1631,7 +1844,7 @@ def build_backups_automatic_and_on_demand_delete_request( # pylint: disable=nam ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-01-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/backups/{backupName}" path_format_arguments = { @@ -1655,7 +1868,7 @@ def build_backups_automatic_and_on_demand_list_by_server_request( # pylint: dis _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-01-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1687,7 +1900,7 @@ def build_tuning_options_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-01-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1716,7 +1929,7 @@ def build_tuning_options_list_by_server_request( # pylint: disable=name-too-lon _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-01-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1750,7 +1963,7 @@ def build_tuning_options_list_recommendations_request( # pylint: disable=name-t _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-01-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1781,7 +1994,7 @@ def build_capabilities_by_location_list_request( # pylint: disable=name-too-lon _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-01-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1809,7 +2022,7 @@ def build_name_availability_check_globally_request( # pylint: disable=name-too- _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-01-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1838,7 +2051,7 @@ def build_name_availability_check_with_location_request( # pylint: disable=name _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-01-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1865,7 +2078,7 @@ def build_private_dns_zone_suffix_get_request(**kwargs: Any) -> HttpRequest: # _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-01-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1884,7 +2097,7 @@ def build_quota_usages_list_request(location_name: str, subscription_id: str, ** _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-01-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1912,7 +2125,7 @@ def build_virtual_network_subnet_usage_list_request( # pylint: disable=name-too _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-01-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -2001,7 +2214,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -2014,7 +2230,10 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.Operation], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.Operation], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -2102,6 +2321,7 @@ def get(self, resource_group_name: str, server_name: str, migration_name: str, * } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -2123,7 +2343,7 @@ def get(self, resource_group_name: str, server_name: str, migration_name: str, * raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.Migration, response.json()) @@ -2284,6 +2504,7 @@ def create( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -2305,7 +2526,7 @@ def create( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.Migration, response.json()) @@ -2475,6 +2696,7 @@ def update( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -2496,7 +2718,7 @@ def update( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.Migration, response.json()) @@ -2549,6 +2771,7 @@ def cancel( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -2572,7 +2795,7 @@ def cancel( deserialized = None if response.status_code == 200: if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.Migration, response.json()) @@ -2649,7 +2872,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -2662,7 +2888,10 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.Migration], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.Migration], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -2843,6 +3072,7 @@ def check_name_availability( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -2864,7 +3094,7 @@ def check_name_availability( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.MigrationNameAvailability, response.json()) @@ -2932,6 +3162,7 @@ def get(self, resource_group_name: str, server_name: str, **kwargs: Any) -> _mod } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -2953,7 +3184,7 @@ def get(self, resource_group_name: str, server_name: str, **kwargs: Any) -> _mod raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.Server, response.json()) @@ -3005,6 +3236,7 @@ def _create_or_update_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -3031,7 +3263,7 @@ def _create_or_update_initial( response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -3250,6 +3482,7 @@ def _update_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -3276,7 +3509,7 @@ def _update_initial( response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -3481,6 +3714,7 @@ def _delete_initial(self, resource_group_name: str, server_name: str, **kwargs: } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -3508,7 +3742,7 @@ def _delete_initial(self, resource_group_name: str, server_name: str, **kwargs: response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -3624,7 +3858,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -3637,7 +3874,10 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.Server], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.Server], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -3711,7 +3951,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -3724,7 +3967,10 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.Server], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.Server], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -3797,6 +4043,7 @@ def _restart_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -3823,7 +4070,7 @@ def _restart_initial( response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -4009,6 +4256,7 @@ def _start_initial(self, resource_group_name: str, server_name: str, **kwargs: A } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -4035,7 +4283,7 @@ def _start_initial(self, resource_group_name: str, server_name: str, **kwargs: A response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -4126,6 +4374,7 @@ def _stop_initial(self, resource_group_name: str, server_name: str, **kwargs: An } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -4152,7 +4401,7 @@ def _stop_initial(self, resource_group_name: str, server_name: str, **kwargs: An response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -4221,7 +4470,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- params_added_on={ "2026-01-01-preview": ["api_version", "subscription_id", "resource_group_name", "server_name", "accept"] }, - api_versions_list=["2026-01-01-preview"], + api_versions_list=["2026-01-01-preview", "2026-04-01-preview"], ) def _migrate_network_mode_initial( self, resource_group_name: str, server_name: str, **kwargs: Any @@ -4252,6 +4501,7 @@ def _migrate_network_mode_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -4283,7 +4533,7 @@ def _migrate_network_mode_initial( response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) response_headers["x-ms-request-id"] = self._deserialize("str", response.headers.get("x-ms-request-id")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -4296,14 +4546,13 @@ def _migrate_network_mode_initial( params_added_on={ "2026-01-01-preview": ["api_version", "subscription_id", "resource_group_name", "server_name", "accept"] }, - api_versions_list=["2026-01-01-preview"], + api_versions_list=["2026-01-01-preview", "2026-04-01-preview"], ) def begin_migrate_network_mode( self, resource_group_name: str, server_name: str, **kwargs: Any ) -> LROPoller[_models.MigrateNetworkStatus]: - """Migrates the network configuration of a PostgreSQL flexible server from customer owned VNET to - Microsoft owned VNET with support for private endpoints, or from Microsoft owned VNET with no - support for private endpoints to Microsoft owned VNET with support for private endpoints. + """Migrates an Azure Database for PostgreSQL server from VNet integration to a Private Link + network model. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -4368,44 +4617,27 @@ def get_long_running_output(pipeline_response): self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - -class ConfigurationsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.postgresqlflexibleservers.PostgreSQLManagementClient`'s - :attr:`configurations` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: PostgreSQLManagementClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def get( - self, resource_group_name: str, server_name: str, configuration_name: str, **kwargs: Any - ) -> _models.Configuration: - """Gets information about a specific configuration (also known as server parameter) of a server. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param server_name: The name of the server. Required. - :type server_name: str - :param configuration_name: Name of the configuration (also known as server parameter). - Required. - :type configuration_name: str - :return: Configuration. The Configuration is compatible with MutableMapping - :rtype: ~azure.mgmt.postgresqlflexibleservers.models.Configuration - :raises ~azure.core.exceptions.HttpResponseError: - """ + @api_version_validation( + method_added_on="2026-04-01-preview", + params_added_on={ + "2026-04-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "server_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2026-04-01-preview"], + ) + def _start_major_version_upgrade_precheck_initial( # pylint: disable=name-too-long + self, + resource_group_name: str, + server_name: str, + body: Union[_models.StartMajorVersionUpgradePrecheckRequest, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -4414,17 +4646,26 @@ def get( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.Configuration] = kwargs.pop("cls", None) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - _request = build_configurations_get_request( + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_servers_start_major_version_upgrade_precheck_request( resource_group_name=resource_group_name, server_name=server_name, - configuration_name=configuration_name, subscription_id=self._config.subscription_id, + content_type=content_type, api_version=self._config.api_version, + content=_content, headers=_headers, params=_params, ) @@ -4433,14 +4674,301 @@ def get( } _request.url = self._client.format_url(_request.url, **path_format_arguments) - _stream = kwargs.pop("stream", False) + _decompress = kwargs.pop("decompress", True) + _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response - if response.status_code not in [200]: + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 200: + response_headers["x-ms-request-id"] = self._deserialize("str", response.headers.get("x-ms-request-id")) + + if response.status_code == 202: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_start_major_version_upgrade_precheck( # pylint: disable=name-too-long + self, + resource_group_name: str, + server_name: str, + body: _models.StartMajorVersionUpgradePrecheckRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.StartMajorVersionUpgradePrecheckResponse]: + """Start Major Version Upgrade Prechecks. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param body: The content of the action request. Required. + :type body: + ~azure.mgmt.postgresqlflexibleservers.models.StartMajorVersionUpgradePrecheckRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns StartMajorVersionUpgradePrecheckResponse. The + StartMajorVersionUpgradePrecheckResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.postgresqlflexibleservers.models.StartMajorVersionUpgradePrecheckResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_start_major_version_upgrade_precheck( # pylint: disable=name-too-long + self, + resource_group_name: str, + server_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.StartMajorVersionUpgradePrecheckResponse]: + """Start Major Version Upgrade Prechecks. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param body: The content of the action request. Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns StartMajorVersionUpgradePrecheckResponse. The + StartMajorVersionUpgradePrecheckResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.postgresqlflexibleservers.models.StartMajorVersionUpgradePrecheckResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_start_major_version_upgrade_precheck( # pylint: disable=name-too-long + self, + resource_group_name: str, + server_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.StartMajorVersionUpgradePrecheckResponse]: + """Start Major Version Upgrade Prechecks. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param body: The content of the action request. Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns StartMajorVersionUpgradePrecheckResponse. The + StartMajorVersionUpgradePrecheckResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.postgresqlflexibleservers.models.StartMajorVersionUpgradePrecheckResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + @api_version_validation( + method_added_on="2026-04-01-preview", + params_added_on={ + "2026-04-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "server_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2026-04-01-preview"], + ) + def begin_start_major_version_upgrade_precheck( # pylint: disable=name-too-long + self, + resource_group_name: str, + server_name: str, + body: Union[_models.StartMajorVersionUpgradePrecheckRequest, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.StartMajorVersionUpgradePrecheckResponse]: + """Start Major Version Upgrade Prechecks. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param body: The content of the action request. Is one of the following types: + StartMajorVersionUpgradePrecheckRequest, JSON, IO[bytes] Required. + :type body: + ~azure.mgmt.postgresqlflexibleservers.models.StartMajorVersionUpgradePrecheckRequest or JSON or + IO[bytes] + :return: An instance of LROPoller that returns StartMajorVersionUpgradePrecheckResponse. The + StartMajorVersionUpgradePrecheckResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.postgresqlflexibleservers.models.StartMajorVersionUpgradePrecheckResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.StartMajorVersionUpgradePrecheckResponse] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._start_major_version_upgrade_precheck_initial( + resource_group_name=resource_group_name, + server_name=server_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["x-ms-request-id"] = self._deserialize("str", response.headers.get("x-ms-request-id")) + + deserialized = _deserialize(_models.StartMajorVersionUpgradePrecheckResponse, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.StartMajorVersionUpgradePrecheckResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.StartMajorVersionUpgradePrecheckResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + +class ConfigurationsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.postgresqlflexibleservers.PostgreSQLManagementClient`'s + :attr:`configurations` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: PostgreSQLManagementClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, resource_group_name: str, server_name: str, configuration_name: str, **kwargs: Any + ) -> _models.Configuration: + """Gets information about a specific configuration (also known as server parameter) of a server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param configuration_name: Name of the configuration (also known as server parameter). + Required. + :type configuration_name: str + :return: Configuration. The Configuration is compatible with MutableMapping + :rtype: ~azure.mgmt.postgresqlflexibleservers.models.Configuration + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.Configuration] = kwargs.pop("cls", None) + + _request = build_configurations_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + configuration_name=configuration_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: if _stream: try: response.read() # Load the body in memory and close the socket @@ -4454,7 +4982,7 @@ def get( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.Configuration, response.json()) @@ -4508,6 +5036,7 @@ def _put_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -4534,7 +5063,7 @@ def _put_initial( response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -4782,6 +5311,7 @@ def _update_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -4808,7 +5338,7 @@ def _update_initial( response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -5069,7 +5599,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -5082,7 +5615,10 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.Configuration], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.Configuration], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -5171,6 +5707,7 @@ def get(self, resource_group_name: str, server_name: str, database_name: str, ** } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -5192,7 +5729,7 @@ def get(self, resource_group_name: str, server_name: str, database_name: str, ** raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.Database, response.json()) @@ -5246,6 +5783,7 @@ def _create_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -5272,7 +5810,7 @@ def _create_initial( response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -5492,6 +6030,7 @@ def _delete_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -5519,7 +6058,7 @@ def _delete_initial( response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -5646,7 +6185,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -5659,7 +6201,10 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.Database], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.Database], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -5749,6 +6294,7 @@ def get( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -5770,7 +6316,7 @@ def get( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.FirewallRule, response.json()) @@ -5824,6 +6370,7 @@ def _create_or_update_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -5850,7 +6397,7 @@ def _create_or_update_initial( response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -6071,6 +6618,7 @@ def _delete_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -6098,7 +6646,7 @@ def _delete_initial( response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -6224,7 +6772,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -6237,7 +6788,10 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.FirewallRule], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.FirewallRule], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -6329,6 +6883,7 @@ def get( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -6350,7 +6905,7 @@ def get( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.PrivateEndpointConnection, response.json()) @@ -6404,6 +6959,7 @@ def _update_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -6430,7 +6986,7 @@ def _update_initial( response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -6655,6 +7211,7 @@ def _delete_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -6682,7 +7239,7 @@ def _delete_initial( response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -6810,7 +7367,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -6823,7 +7383,10 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.PrivateEndpointConnection], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.PrivateEndpointConnection], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -6913,6 +7476,7 @@ def get( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -6934,7 +7498,7 @@ def get( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.PrivateLinkResource, response.json()) @@ -7001,7 +7565,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -7014,7 +7581,10 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.PrivateLinkResource], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.PrivateLinkResource], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -7104,6 +7674,7 @@ def get( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -7125,7 +7696,7 @@ def get( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.VirtualEndpoint, response.json()) @@ -7179,6 +7750,7 @@ def _create_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -7205,7 +7777,7 @@ def _create_initial( response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -7403,8 +7975,753 @@ def _update_initial( self, resource_group_name: str, server_name: str, - virtual_endpoint_name: str, - parameters: Union[_models.VirtualEndpointResourceForPatch, JSON, IO[bytes]], + virtual_endpoint_name: str, + parameters: Union[_models.VirtualEndpointResourceForPatch, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_virtual_endpoints_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + virtual_endpoint_name=virtual_endpoint_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_update( + self, + resource_group_name: str, + server_name: str, + virtual_endpoint_name: str, + parameters: _models.VirtualEndpointResourceForPatch, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.VirtualEndpoint]: + """Updates a pair of virtual endpoints for a server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param virtual_endpoint_name: Base name of the virtual endpoints. Required. + :type virtual_endpoint_name: str + :param parameters: Parameters required to update a pair of virtual endpoints. Required. + :type parameters: ~azure.mgmt.postgresqlflexibleservers.models.VirtualEndpointResourceForPatch + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns VirtualEndpoint. The VirtualEndpoint is + compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.postgresqlflexibleservers.models.VirtualEndpoint] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + server_name: str, + virtual_endpoint_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.VirtualEndpoint]: + """Updates a pair of virtual endpoints for a server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param virtual_endpoint_name: Base name of the virtual endpoints. Required. + :type virtual_endpoint_name: str + :param parameters: Parameters required to update a pair of virtual endpoints. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns VirtualEndpoint. The VirtualEndpoint is + compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.postgresqlflexibleservers.models.VirtualEndpoint] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + server_name: str, + virtual_endpoint_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.VirtualEndpoint]: + """Updates a pair of virtual endpoints for a server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param virtual_endpoint_name: Base name of the virtual endpoints. Required. + :type virtual_endpoint_name: str + :param parameters: Parameters required to update a pair of virtual endpoints. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns VirtualEndpoint. The VirtualEndpoint is + compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.postgresqlflexibleservers.models.VirtualEndpoint] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_update( + self, + resource_group_name: str, + server_name: str, + virtual_endpoint_name: str, + parameters: Union[_models.VirtualEndpointResourceForPatch, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.VirtualEndpoint]: + """Updates a pair of virtual endpoints for a server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param virtual_endpoint_name: Base name of the virtual endpoints. Required. + :type virtual_endpoint_name: str + :param parameters: Parameters required to update a pair of virtual endpoints. Is one of the + following types: VirtualEndpointResourceForPatch, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.postgresqlflexibleservers.models.VirtualEndpointResourceForPatch + or JSON or IO[bytes] + :return: An instance of LROPoller that returns VirtualEndpoint. The VirtualEndpoint is + compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.postgresqlflexibleservers.models.VirtualEndpoint] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VirtualEndpoint] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._update_initial( + resource_group_name=resource_group_name, + server_name=server_name, + virtual_endpoint_name=virtual_endpoint_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.VirtualEndpoint, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.VirtualEndpoint].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.VirtualEndpoint]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial( + self, resource_group_name: str, server_name: str, virtual_endpoint_name: str, **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_virtual_endpoints_delete_request( + resource_group_name=resource_group_name, + server_name=server_name, + virtual_endpoint_name=virtual_endpoint_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_delete( + self, resource_group_name: str, server_name: str, virtual_endpoint_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Deletes a pair of virtual endpoints. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param virtual_endpoint_name: Base name of the virtual endpoints. Required. + :type virtual_endpoint_name: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + server_name=server_name, + virtual_endpoint_name=virtual_endpoint_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_server( + self, resource_group_name: str, server_name: str, **kwargs: Any + ) -> ItemPaged["_models.VirtualEndpoint"]: + """Lists pair of virtual endpoints associated to a server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :return: An iterator like instance of VirtualEndpoint + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.postgresqlflexibleservers.models.VirtualEndpoint] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.VirtualEndpoint]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_virtual_endpoints_list_by_server_request( + resource_group_name=resource_group_name, + server_name=server_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.VirtualEndpoint], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class MaintenanceEventsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.postgresqlflexibleservers.PostgreSQLManagementClient`'s + :attr:`maintenance_events` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: PostgreSQLManagementClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + @api_version_validation( + method_added_on="2026-04-01-preview", + params_added_on={ + "2026-04-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "server_name", + "maintenance_event_id", + "accept", + ] + }, + api_versions_list=["2026-04-01-preview"], + ) + def get( + self, resource_group_name: str, server_name: str, maintenance_event_id: str, **kwargs: Any + ) -> _models.MaintenanceEventResource: + """Gets information about a maintenance event for a flexible server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param maintenance_event_id: The name of the MaintenanceEventResource. Required. + :type maintenance_event_id: str + :return: MaintenanceEventResource. The MaintenanceEventResource is compatible with + MutableMapping + :rtype: ~azure.mgmt.postgresqlflexibleservers.models.MaintenanceEventResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.MaintenanceEventResource] = kwargs.pop("cls", None) + + _request = build_maintenance_events_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + maintenance_event_id=maintenance_event_id, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.MaintenanceEventResource, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + @api_version_validation( + method_added_on="2026-04-01-preview", + params_added_on={ + "2026-04-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "server_name", + "maintenance_status", + "accept", + ] + }, + api_versions_list=["2026-04-01-preview"], + ) + def list( + self, + resource_group_name: str, + server_name: str, + *, + maintenance_status: Optional[Union[str, _models.MaintenanceEventStatusFilter]] = None, + **kwargs: Any + ) -> ItemPaged["_models.MaintenanceEventResource"]: + """Lists all maintenance events for a flexible server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :keyword maintenance_status: Filter maintenance events by status. Known values are: "Upcoming" + and "Past". Default value is None. + :paramtype maintenance_status: str or + ~azure.mgmt.postgresqlflexibleservers.models.MaintenanceEventStatusFilter + :return: An iterator like instance of MaintenanceEventResource + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.postgresqlflexibleservers.models.MaintenanceEventResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.MaintenanceEventResource]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_maintenance_events_list_request( + resource_group_name=resource_group_name, + server_name=server_name, + subscription_id=self._config.subscription_id, + maintenance_status=maintenance_status, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.MaintenanceEventResource], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @api_version_validation( + method_added_on="2026-04-01-preview", + params_added_on={ + "2026-04-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "server_name", + "maintenance_event_id", + "content_type", + "accept", + ] + }, + api_versions_list=["2026-04-01-preview"], + ) + def _reschedule_initial( + self, + resource_group_name: str, + server_name: str, + maintenance_event_id: str, + body: Union[_models.MaintenanceEventRescheduleRequest, JSON, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { @@ -7423,15 +8740,15 @@ def _update_initial( content_type = content_type or "application/json" _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters + if isinstance(body, (IOBase, bytes)): + _content = body else: - _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_virtual_endpoints_update_request( + _request = build_maintenance_events_reschedule_request( resource_group_name=resource_group_name, server_name=server_name, - virtual_endpoint_name=virtual_endpoint_name, + maintenance_event_id=maintenance_event_id, subscription_id=self._config.subscription_id, content_type=content_type, api_version=self._config.api_version, @@ -7444,6 +8761,7 @@ def _update_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -7451,7 +8769,7 @@ def _update_initial( response = pipeline_response.http_response - if response.status_code not in [202]: + if response.status_code not in [200, 202]: try: response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -7464,13 +8782,14 @@ def _update_initial( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + if response.status_code == 202: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -7478,143 +8797,158 @@ def _update_initial( return deserialized # type: ignore @overload - def begin_update( + def begin_reschedule( self, resource_group_name: str, server_name: str, - virtual_endpoint_name: str, - parameters: _models.VirtualEndpointResourceForPatch, + maintenance_event_id: str, + body: _models.MaintenanceEventRescheduleRequest, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.VirtualEndpoint]: - """Updates a pair of virtual endpoints for a server. + ) -> LROPoller[_models.MaintenanceEventActionResponse]: + """Reschedules a maintenance event to a new date and time. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param server_name: The name of the server. Required. :type server_name: str - :param virtual_endpoint_name: Base name of the virtual endpoints. Required. - :type virtual_endpoint_name: str - :param parameters: Parameters required to update a pair of virtual endpoints. Required. - :type parameters: ~azure.mgmt.postgresqlflexibleservers.models.VirtualEndpointResourceForPatch + :param maintenance_event_id: The name of the MaintenanceEventResource. Required. + :type maintenance_event_id: str + :param body: The content of the action request. Required. + :type body: ~azure.mgmt.postgresqlflexibleservers.models.MaintenanceEventRescheduleRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns VirtualEndpoint. The VirtualEndpoint is - compatible with MutableMapping + :return: An instance of LROPoller that returns MaintenanceEventActionResponse. The + MaintenanceEventActionResponse is compatible with MutableMapping :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.postgresqlflexibleservers.models.VirtualEndpoint] + ~azure.core.polling.LROPoller[~azure.mgmt.postgresqlflexibleservers.models.MaintenanceEventActionResponse] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_update( + def begin_reschedule( self, resource_group_name: str, server_name: str, - virtual_endpoint_name: str, - parameters: JSON, + maintenance_event_id: str, + body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.VirtualEndpoint]: - """Updates a pair of virtual endpoints for a server. + ) -> LROPoller[_models.MaintenanceEventActionResponse]: + """Reschedules a maintenance event to a new date and time. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param server_name: The name of the server. Required. :type server_name: str - :param virtual_endpoint_name: Base name of the virtual endpoints. Required. - :type virtual_endpoint_name: str - :param parameters: Parameters required to update a pair of virtual endpoints. Required. - :type parameters: JSON + :param maintenance_event_id: The name of the MaintenanceEventResource. Required. + :type maintenance_event_id: str + :param body: The content of the action request. Required. + :type body: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns VirtualEndpoint. The VirtualEndpoint is - compatible with MutableMapping + :return: An instance of LROPoller that returns MaintenanceEventActionResponse. The + MaintenanceEventActionResponse is compatible with MutableMapping :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.postgresqlflexibleservers.models.VirtualEndpoint] + ~azure.core.polling.LROPoller[~azure.mgmt.postgresqlflexibleservers.models.MaintenanceEventActionResponse] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_update( + def begin_reschedule( self, resource_group_name: str, server_name: str, - virtual_endpoint_name: str, - parameters: IO[bytes], + maintenance_event_id: str, + body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.VirtualEndpoint]: - """Updates a pair of virtual endpoints for a server. + ) -> LROPoller[_models.MaintenanceEventActionResponse]: + """Reschedules a maintenance event to a new date and time. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param server_name: The name of the server. Required. :type server_name: str - :param virtual_endpoint_name: Base name of the virtual endpoints. Required. - :type virtual_endpoint_name: str - :param parameters: Parameters required to update a pair of virtual endpoints. Required. - :type parameters: IO[bytes] + :param maintenance_event_id: The name of the MaintenanceEventResource. Required. + :type maintenance_event_id: str + :param body: The content of the action request. Required. + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns VirtualEndpoint. The VirtualEndpoint is - compatible with MutableMapping + :return: An instance of LROPoller that returns MaintenanceEventActionResponse. The + MaintenanceEventActionResponse is compatible with MutableMapping :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.postgresqlflexibleservers.models.VirtualEndpoint] + ~azure.core.polling.LROPoller[~azure.mgmt.postgresqlflexibleservers.models.MaintenanceEventActionResponse] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace - def begin_update( + @api_version_validation( + method_added_on="2026-04-01-preview", + params_added_on={ + "2026-04-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "server_name", + "maintenance_event_id", + "content_type", + "accept", + ] + }, + api_versions_list=["2026-04-01-preview"], + ) + def begin_reschedule( self, resource_group_name: str, server_name: str, - virtual_endpoint_name: str, - parameters: Union[_models.VirtualEndpointResourceForPatch, JSON, IO[bytes]], + maintenance_event_id: str, + body: Union[_models.MaintenanceEventRescheduleRequest, JSON, IO[bytes]], **kwargs: Any - ) -> LROPoller[_models.VirtualEndpoint]: - """Updates a pair of virtual endpoints for a server. + ) -> LROPoller[_models.MaintenanceEventActionResponse]: + """Reschedules a maintenance event to a new date and time. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param server_name: The name of the server. Required. :type server_name: str - :param virtual_endpoint_name: Base name of the virtual endpoints. Required. - :type virtual_endpoint_name: str - :param parameters: Parameters required to update a pair of virtual endpoints. Is one of the - following types: VirtualEndpointResourceForPatch, JSON, IO[bytes] Required. - :type parameters: ~azure.mgmt.postgresqlflexibleservers.models.VirtualEndpointResourceForPatch - or JSON or IO[bytes] - :return: An instance of LROPoller that returns VirtualEndpoint. The VirtualEndpoint is - compatible with MutableMapping + :param maintenance_event_id: The name of the MaintenanceEventResource. Required. + :type maintenance_event_id: str + :param body: The content of the action request. Is one of the following types: + MaintenanceEventRescheduleRequest, JSON, IO[bytes] Required. + :type body: ~azure.mgmt.postgresqlflexibleservers.models.MaintenanceEventRescheduleRequest or + JSON or IO[bytes] + :return: An instance of LROPoller that returns MaintenanceEventActionResponse. The + MaintenanceEventActionResponse is compatible with MutableMapping :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.postgresqlflexibleservers.models.VirtualEndpoint] + ~azure.core.polling.LROPoller[~azure.mgmt.postgresqlflexibleservers.models.MaintenanceEventActionResponse] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.VirtualEndpoint] = kwargs.pop("cls", None) + cls: ClsType[_models.MaintenanceEventActionResponse] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._update_initial( + raw_result = self._reschedule_initial( resource_group_name=resource_group_name, server_name=server_name, - virtual_endpoint_name=virtual_endpoint_name, - parameters=parameters, + maintenance_event_id=maintenance_event_id, + body=body, content_type=content_type, cls=lambda x, y, z: x, headers=_headers, @@ -7625,17 +8959,10 @@ def begin_update( kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - response_headers = {} response = pipeline_response.http_response - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = _deserialize(_models.VirtualEndpoint, response.json()) + deserialized = _deserialize(_models.MaintenanceEventActionResponse, response.json()) if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized path_format_arguments = { @@ -7651,18 +8978,32 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller[_models.VirtualEndpoint].from_continuation_token( + return LROPoller[_models.MaintenanceEventActionResponse].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[_models.VirtualEndpoint]( + return LROPoller[_models.MaintenanceEventActionResponse]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - def _delete_initial( - self, resource_group_name: str, server_name: str, virtual_endpoint_name: str, **kwargs: Any + @api_version_validation( + method_added_on="2026-04-01-preview", + params_added_on={ + "2026-04-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "server_name", + "maintenance_event_id", + "accept", + ] + }, + api_versions_list=["2026-04-01-preview"], + ) + def _apply_now_initial( + self, resource_group_name: str, server_name: str, maintenance_event_id: str, **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -7677,10 +9018,10 @@ def _delete_initial( cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - _request = build_virtual_endpoints_delete_request( + _request = build_maintenance_events_apply_now_request( resource_group_name=resource_group_name, server_name=server_name, - virtual_endpoint_name=virtual_endpoint_name, + maintenance_event_id=maintenance_event_id, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -7691,6 +9032,7 @@ def _delete_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -7698,7 +9040,7 @@ def _delete_initial( response = pipeline_response.http_response - if response.status_code not in [202, 204]: + if response.status_code not in [200, 202]: try: response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -7718,7 +9060,7 @@ def _delete_initial( response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -7726,34 +9068,50 @@ def _delete_initial( return deserialized # type: ignore @distributed_trace - def begin_delete( - self, resource_group_name: str, server_name: str, virtual_endpoint_name: str, **kwargs: Any - ) -> LROPoller[None]: - """Deletes a pair of virtual endpoints. + @api_version_validation( + method_added_on="2026-04-01-preview", + params_added_on={ + "2026-04-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "server_name", + "maintenance_event_id", + "accept", + ] + }, + api_versions_list=["2026-04-01-preview"], + ) + def begin_apply_now( + self, resource_group_name: str, server_name: str, maintenance_event_id: str, **kwargs: Any + ) -> LROPoller[_models.MaintenanceEventActionResponse]: + """Applies the maintenance event immediately. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param server_name: The name of the server. Required. :type server_name: str - :param virtual_endpoint_name: Base name of the virtual endpoints. Required. - :type virtual_endpoint_name: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] + :param maintenance_event_id: The name of the MaintenanceEventResource. Required. + :type maintenance_event_id: str + :return: An instance of LROPoller that returns MaintenanceEventActionResponse. The + MaintenanceEventActionResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.postgresqlflexibleservers.models.MaintenanceEventActionResponse] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[None] = kwargs.pop("cls", None) + cls: ClsType[_models.MaintenanceEventActionResponse] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._delete_initial( + raw_result = self._apply_now_initial( resource_group_name=resource_group_name, server_name=server_name, - virtual_endpoint_name=virtual_endpoint_name, + maintenance_event_id=maintenance_event_id, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -7762,9 +9120,12 @@ def begin_delete( raw_result.http_response.read() # type: ignore kwargs.pop("error_map", None) - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.MaintenanceEventActionResponse, response.json()) if cls: - return cls(pipeline_response, None, {}) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized path_format_arguments = { "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), @@ -7779,34 +9140,153 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller[None].from_continuation_token( + return LROPoller[_models.MaintenanceEventActionResponse].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + return LROPoller[_models.MaintenanceEventActionResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + +class MajorVersionUpgradePrecheckOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.postgresqlflexibleservers.PostgreSQLManagementClient`'s + :attr:`major_version_upgrade_precheck` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: PostgreSQLManagementClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace - def list_by_server( + @api_version_validation( + method_added_on="2026-04-01-preview", + params_added_on={ + "2026-04-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "server_name", + "precheck_validation_id", + "accept", + ] + }, + api_versions_list=["2026-04-01-preview"], + ) + def get( + self, resource_group_name: str, server_name: str, precheck_validation_id: str, **kwargs: Any + ) -> _models.MajorVersionUpgradePrecheckResource: + """Gets information about a major version upgrade precheck for a flexible server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param precheck_validation_id: The name of the MajorVersionUpgradePrecheckResource. Required. + :type precheck_validation_id: str + :return: MajorVersionUpgradePrecheckResource. The MajorVersionUpgradePrecheckResource is + compatible with MutableMapping + :rtype: ~azure.mgmt.postgresqlflexibleservers.models.MajorVersionUpgradePrecheckResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.MajorVersionUpgradePrecheckResource] = kwargs.pop("cls", None) + + _request = build_major_version_upgrade_precheck_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + precheck_validation_id=precheck_validation_id, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.MajorVersionUpgradePrecheckResource, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + @api_version_validation( + method_added_on="2026-04-01-preview", + params_added_on={ + "2026-04-01-preview": ["api_version", "subscription_id", "resource_group_name", "server_name", "accept"] + }, + api_versions_list=["2026-04-01-preview"], + ) + def list( self, resource_group_name: str, server_name: str, **kwargs: Any - ) -> ItemPaged["_models.VirtualEndpoint"]: - """Lists pair of virtual endpoints associated to a server. + ) -> ItemPaged["_models.MajorVersionUpgradePrecheckResource"]: + """Lists major version upgrade prechecks for a flexible server. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param server_name: The name of the server. Required. :type server_name: str - :return: An iterator like instance of VirtualEndpoint + :return: An iterator like instance of MajorVersionUpgradePrecheckResource :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.postgresqlflexibleservers.models.VirtualEndpoint] + ~azure.core.paging.ItemPaged[~azure.mgmt.postgresqlflexibleservers.models.MajorVersionUpgradePrecheckResource] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.VirtualEndpoint]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.MajorVersionUpgradePrecheckResource]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -7819,7 +9299,7 @@ def list_by_server( def prepare_request(next_link=None): if not next_link: - _request = build_virtual_endpoints_list_by_server_request( + _request = build_major_version_upgrade_precheck_list_request( resource_group_name=resource_group_name, server_name=server_name, subscription_id=self._config.subscription_id, @@ -7845,7 +9325,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -7858,7 +9341,10 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.VirtualEndpoint], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.MajorVersionUpgradePrecheckResource], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -7949,6 +9435,7 @@ def get( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -7970,7 +9457,7 @@ def get( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.AdministratorMicrosoftEntra, response.json()) @@ -8024,6 +9511,7 @@ def _create_or_update_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -8050,7 +9538,7 @@ def _create_or_update_initial( response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -8275,6 +9763,7 @@ def _delete_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -8302,7 +9791,7 @@ def _delete_initial( response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -8429,7 +9918,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -8442,7 +9934,10 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.AdministratorMicrosoftEntra], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.AdministratorMicrosoftEntra], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -8543,7 +10038,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -8556,7 +10054,10 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.Capability], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.Capability], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -8659,7 +10160,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -8672,7 +10176,10 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.CapturedLog], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.CapturedLog], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -8858,6 +10365,7 @@ def check_prerequisites( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -8882,7 +10390,7 @@ def check_prerequisites( response_headers["x-ms-request-id"] = self._deserialize("str", response.headers.get("x-ms-request-id")) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.LtrPreBackupResponse, response.json()) @@ -8934,6 +10442,7 @@ def _start_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -8965,7 +10474,7 @@ def _start_initial( response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) response_headers["x-ms-request-id"] = self._deserialize("str", response.headers.get("x-ms-request-id")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -9184,6 +10693,7 @@ def get( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -9205,7 +10715,7 @@ def get( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.BackupsLongTermRetentionOperation, response.json()) @@ -9272,7 +10782,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -9285,7 +10798,10 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.BackupsLongTermRetentionOperation], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.BackupsLongTermRetentionOperation], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -9386,7 +10902,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -9399,7 +10918,10 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.Server], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.Server], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -9496,6 +11018,7 @@ def get( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -9517,7 +11040,7 @@ def get( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.AdvancedThreatProtectionSettingsModel, response.json()) @@ -9584,7 +11107,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -9598,7 +11124,8 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.AdvancedThreatProtectionSettingsModel], deserialized.get("value", []) + List[_models.AdvancedThreatProtectionSettingsModel], + deserialized.get("value", []), ) if cls: list_of_elem = cls(list_of_elem) # type: ignore @@ -9690,6 +11217,7 @@ def _create_or_update_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -9716,7 +11244,7 @@ def _create_or_update_initial( response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -9982,6 +11510,7 @@ def get( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -10003,7 +11532,7 @@ def get( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.BackupAutomaticAndOnDemand, response.json()) @@ -10042,6 +11571,7 @@ def _create_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -10068,7 +11598,7 @@ def _create_initial( response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -10181,6 +11711,7 @@ def _delete_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -10208,7 +11739,7 @@ def _delete_initial( response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -10335,7 +11866,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -10348,7 +11882,10 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.BackupAutomaticAndOnDemand], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.BackupAutomaticAndOnDemand], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -10444,6 +11981,7 @@ def get( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -10465,7 +12003,7 @@ def get( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.TuningOptions, response.json()) @@ -10532,7 +12070,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -10545,7 +12086,10 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.TuningOptions], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.TuningOptions], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -10646,7 +12190,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -10659,7 +12206,10 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.ObjectRecommendation], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.ObjectRecommendation], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -10756,7 +12306,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -10769,7 +12322,10 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.Capability], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.Capability], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -10915,6 +12471,7 @@ def check_globally( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -10936,7 +12493,7 @@ def check_globally( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.NameAvailabilityModel, response.json()) @@ -11058,6 +12615,7 @@ def check_with_location( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -11079,7 +12637,7 @@ def check_with_location( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.NameAvailabilityModel, response.json()) @@ -11139,6 +12697,7 @@ def get(self, **kwargs: Any) -> str: } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -11160,7 +12719,7 @@ def get(self, **kwargs: Any) -> str: raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(str, response.json()) @@ -11240,7 +12799,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -11253,7 +12815,10 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.QuotaUsage], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.QuotaUsage], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -11418,6 +12983,7 @@ def list( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -11439,7 +13005,7 @@ def list( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.VirtualNetworkSubnetUsageModel, response.json()) diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/azure/mgmt/postgresqlflexibleservers/operations/_patch.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/azure/mgmt/postgresqlflexibleservers/operations/_patch.py index 87676c65a8f0..ea765788358a 100644 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/azure/mgmt/postgresqlflexibleservers/operations/_patch.py +++ b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/azure/mgmt/postgresqlflexibleservers/operations/_patch.py @@ -8,7 +8,6 @@ Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ - __all__: list[str] = [] # Add all objects you want publicly available to users at this package level diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/administrators_microsoft_entra_add.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/administrators_microsoft_entra_add.py index 2f298494007a..b65ff7f01d3e 100644 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/administrators_microsoft_entra_add.py +++ b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/administrators_microsoft_entra_add.py @@ -45,6 +45,6 @@ def main(): print(response) -# x-ms-original-file: 2026-01-01-preview/AdministratorsMicrosoftEntraAdd.json +# x-ms-original-file: 2026-04-01-preview/AdministratorsMicrosoftEntraAdd.json if __name__ == "__main__": main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/administrators_microsoft_entra_delete.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/administrators_microsoft_entra_delete.py index b2ff0d9b1130..107167d341bc 100644 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/administrators_microsoft_entra_delete.py +++ b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/administrators_microsoft_entra_delete.py @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: 2026-01-01-preview/AdministratorsMicrosoftEntraDelete.json +# x-ms-original-file: 2026-04-01-preview/AdministratorsMicrosoftEntraDelete.json if __name__ == "__main__": main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/administrators_microsoft_entra_get.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/administrators_microsoft_entra_get.py index e5e5ed66d00b..ae24282f60f5 100644 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/administrators_microsoft_entra_get.py +++ b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/administrators_microsoft_entra_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2026-01-01-preview/AdministratorsMicrosoftEntraGet.json +# x-ms-original-file: 2026-04-01-preview/AdministratorsMicrosoftEntraGet.json if __name__ == "__main__": main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/administrators_microsoft_entra_list_by_server.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/administrators_microsoft_entra_list_by_server.py index 6dfab21bb0a9..f7b11708d1c5 100644 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/administrators_microsoft_entra_list_by_server.py +++ b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/administrators_microsoft_entra_list_by_server.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: 2026-01-01-preview/AdministratorsMicrosoftEntraListByServer.json +# x-ms-original-file: 2026-04-01-preview/AdministratorsMicrosoftEntraListByServer.json if __name__ == "__main__": main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/advanced_threat_protection_settings_create_or_update.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/advanced_threat_protection_settings_create_or_update.py index 61be9f2aa5e1..bf0167e96d6f 100644 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/advanced_threat_protection_settings_create_or_update.py +++ b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/advanced_threat_protection_settings_create_or_update.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: 2026-01-01-preview/AdvancedThreatProtectionSettingsCreateOrUpdate.json +# x-ms-original-file: 2026-04-01-preview/AdvancedThreatProtectionSettingsCreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/advanced_threat_protection_settings_get.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/advanced_threat_protection_settings_get.py index c38449dac308..3e29bddbf02b 100644 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/advanced_threat_protection_settings_get.py +++ b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/advanced_threat_protection_settings_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2026-01-01-preview/AdvancedThreatProtectionSettingsGet.json +# x-ms-original-file: 2026-04-01-preview/AdvancedThreatProtectionSettingsGet.json if __name__ == "__main__": main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/advanced_threat_protection_settings_list_by_server.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/advanced_threat_protection_settings_list_by_server.py index 59de3101b3ab..f1d046ddf451 100644 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/advanced_threat_protection_settings_list_by_server.py +++ b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/advanced_threat_protection_settings_list_by_server.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: 2026-01-01-preview/AdvancedThreatProtectionSettingsListByServer.json +# x-ms-original-file: 2026-04-01-preview/AdvancedThreatProtectionSettingsListByServer.json if __name__ == "__main__": main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/backups_automatic_and_on_demand_create.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/backups_automatic_and_on_demand_create.py index d569c850f9ab..8f645f32c0ac 100644 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/backups_automatic_and_on_demand_create.py +++ b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/backups_automatic_and_on_demand_create.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2026-01-01-preview/BackupsAutomaticAndOnDemandCreate.json +# x-ms-original-file: 2026-04-01-preview/BackupsAutomaticAndOnDemandCreate.json if __name__ == "__main__": main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/backups_automatic_and_on_demand_delete.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/backups_automatic_and_on_demand_delete.py index cd6a5bf2dcaa..94112d91adc8 100644 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/backups_automatic_and_on_demand_delete.py +++ b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/backups_automatic_and_on_demand_delete.py @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: 2026-01-01-preview/BackupsAutomaticAndOnDemandDelete.json +# x-ms-original-file: 2026-04-01-preview/BackupsAutomaticAndOnDemandDelete.json if __name__ == "__main__": main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/backups_automatic_and_on_demand_get.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/backups_automatic_and_on_demand_get.py index 37b35c5f94d6..51f5939c2250 100644 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/backups_automatic_and_on_demand_get.py +++ b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/backups_automatic_and_on_demand_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2026-01-01-preview/BackupsAutomaticAndOnDemandGet.json +# x-ms-original-file: 2026-04-01-preview/BackupsAutomaticAndOnDemandGet.json if __name__ == "__main__": main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/backups_automatic_and_on_demand_list_by_server.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/backups_automatic_and_on_demand_list_by_server.py index 1a4dd3a3ef41..abb75616b855 100644 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/backups_automatic_and_on_demand_list_by_server.py +++ b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/backups_automatic_and_on_demand_list_by_server.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: 2026-01-01-preview/BackupsAutomaticAndOnDemandListByServer.json +# x-ms-original-file: 2026-04-01-preview/BackupsAutomaticAndOnDemandListByServer.json if __name__ == "__main__": main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/backups_long_term_retention_check_prerequisites.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/backups_long_term_retention_check_prerequisites.py index 5d2937d28a40..fc8c3ff8c449 100644 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/backups_long_term_retention_check_prerequisites.py +++ b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/backups_long_term_retention_check_prerequisites.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2026-01-01-preview/BackupsLongTermRetentionCheckPrerequisites.json +# x-ms-original-file: 2026-04-01-preview/BackupsLongTermRetentionCheckPrerequisites.json if __name__ == "__main__": main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/backups_long_term_retention_get.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/backups_long_term_retention_get.py index f7cb69a29e9a..429d294cd0fe 100644 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/backups_long_term_retention_get.py +++ b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/backups_long_term_retention_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2026-01-01-preview/BackupsLongTermRetentionGet.json +# x-ms-original-file: 2026-04-01-preview/BackupsLongTermRetentionGet.json if __name__ == "__main__": main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/backups_long_term_retention_list_by_server.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/backups_long_term_retention_list_by_server.py index 22d5b04962ef..6c9d6e9d08e4 100644 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/backups_long_term_retention_list_by_server.py +++ b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/backups_long_term_retention_list_by_server.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: 2026-01-01-preview/BackupsLongTermRetentionListByServer.json +# x-ms-original-file: 2026-04-01-preview/BackupsLongTermRetentionListByServer.json if __name__ == "__main__": main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/backups_long_term_retention_start.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/backups_long_term_retention_start.py index 5537b1e15b5e..e590bcfc4dd3 100644 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/backups_long_term_retention_start.py +++ b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/backups_long_term_retention_start.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2026-01-01-preview/BackupsLongTermRetentionStart.json +# x-ms-original-file: 2026-04-01-preview/BackupsLongTermRetentionStart.json if __name__ == "__main__": main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/capabilities_by_location_list.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/capabilities_by_location_list.py index 0adc888e9379..581d6d20ccd6 100644 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/capabilities_by_location_list.py +++ b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/capabilities_by_location_list.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: 2026-01-01-preview/CapabilitiesByLocationList.json +# x-ms-original-file: 2026-04-01-preview/CapabilitiesByLocationList.json if __name__ == "__main__": main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/capabilities_by_server_list.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/capabilities_by_server_list.py index 0e4e2069d469..e08d23a5f762 100644 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/capabilities_by_server_list.py +++ b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/capabilities_by_server_list.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: 2026-01-01-preview/CapabilitiesByServerList.json +# x-ms-original-file: 2026-04-01-preview/CapabilitiesByServerList.json if __name__ == "__main__": main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/captured_logs_list_by_server.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/captured_logs_list_by_server.py index 6c6b4ac51ca8..0a202104e378 100644 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/captured_logs_list_by_server.py +++ b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/captured_logs_list_by_server.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: 2026-01-01-preview/CapturedLogsListByServer.json +# x-ms-original-file: 2026-04-01-preview/CapturedLogsListByServer.json if __name__ == "__main__": main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/configurations_get.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/configurations_get.py index 91044820943f..5b071fb5827c 100644 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/configurations_get.py +++ b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/configurations_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2026-01-01-preview/ConfigurationsGet.json +# x-ms-original-file: 2026-04-01-preview/ConfigurationsGet.json if __name__ == "__main__": main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/configurations_list_by_server.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/configurations_list_by_server.py index 72f0b66ee0ca..047fe455fb93 100644 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/configurations_list_by_server.py +++ b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/configurations_list_by_server.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: 2026-01-01-preview/ConfigurationsListByServer.json +# x-ms-original-file: 2026-04-01-preview/ConfigurationsListByServer.json if __name__ == "__main__": main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/configurations_update.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/configurations_update.py index cf7a8d3a24a4..4c05145f71cf 100644 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/configurations_update.py +++ b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/configurations_update.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: 2026-01-01-preview/ConfigurationsUpdate.json +# x-ms-original-file: 2026-04-01-preview/ConfigurationsUpdate.json if __name__ == "__main__": main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/configurations_update_using_put.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/configurations_update_using_put.py index 5c0bc77527f2..c90bdccca60b 100644 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/configurations_update_using_put.py +++ b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/configurations_update_using_put.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: 2026-01-01-preview/ConfigurationsUpdateUsingPut.json +# x-ms-original-file: 2026-04-01-preview/ConfigurationsUpdateUsingPut.json if __name__ == "__main__": main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/databases_create.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/databases_create.py index b3568ad926ee..d7e84ba0c16a 100644 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/databases_create.py +++ b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/databases_create.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: 2026-01-01-preview/DatabasesCreate.json +# x-ms-original-file: 2026-04-01-preview/DatabasesCreate.json if __name__ == "__main__": main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/databases_delete.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/databases_delete.py index 446b48772803..d8944ed7e568 100644 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/databases_delete.py +++ b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/databases_delete.py @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: 2026-01-01-preview/DatabasesDelete.json +# x-ms-original-file: 2026-04-01-preview/DatabasesDelete.json if __name__ == "__main__": main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/databases_get.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/databases_get.py index e72ca3e95c36..14bbfd45eef5 100644 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/databases_get.py +++ b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/databases_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2026-01-01-preview/DatabasesGet.json +# x-ms-original-file: 2026-04-01-preview/DatabasesGet.json if __name__ == "__main__": main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/databases_list_by_server.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/databases_list_by_server.py index a9392540139d..4435398aec7c 100644 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/databases_list_by_server.py +++ b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/databases_list_by_server.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: 2026-01-01-preview/DatabasesListByServer.json +# x-ms-original-file: 2026-04-01-preview/DatabasesListByServer.json if __name__ == "__main__": main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/firewall_rules_create_or_update.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/firewall_rules_create_or_update.py index c604ff20158a..7d6bddde2dfb 100644 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/firewall_rules_create_or_update.py +++ b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/firewall_rules_create_or_update.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: 2026-01-01-preview/FirewallRulesCreateOrUpdate.json +# x-ms-original-file: 2026-04-01-preview/FirewallRulesCreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/firewall_rules_delete.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/firewall_rules_delete.py index c1eaa92ee0f8..6f583c8ee615 100644 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/firewall_rules_delete.py +++ b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/firewall_rules_delete.py @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: 2026-01-01-preview/FirewallRulesDelete.json +# x-ms-original-file: 2026-04-01-preview/FirewallRulesDelete.json if __name__ == "__main__": main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/firewall_rules_get.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/firewall_rules_get.py index ccb9e119cb75..85b343e8e5aa 100644 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/firewall_rules_get.py +++ b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/firewall_rules_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2026-01-01-preview/FirewallRulesGet.json +# x-ms-original-file: 2026-04-01-preview/FirewallRulesGet.json if __name__ == "__main__": main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/firewall_rules_list_by_server.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/firewall_rules_list_by_server.py index 6cec21301257..b889023456e4 100644 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/firewall_rules_list_by_server.py +++ b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/firewall_rules_list_by_server.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: 2026-01-01-preview/FirewallRulesListByServer.json +# x-ms-original-file: 2026-04-01-preview/FirewallRulesListByServer.json if __name__ == "__main__": main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/maintenance_events_apply_now.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/maintenance_events_apply_now.py new file mode 100644 index 000000000000..a68ea9d8a1e9 --- /dev/null +++ b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/maintenance_events_apply_now.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.postgresqlflexibleservers import PostgreSQLManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-postgresqlflexibleservers +# USAGE + python maintenance_events_apply_now.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PostgreSQLManagementClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.maintenance_events.begin_apply_now( + resource_group_name="exampleresourcegroup", + server_name="exampleserver", + maintenance_event_id="XXXX-111", + ).result() + print(response) + + +# x-ms-original-file: 2026-04-01-preview/MaintenanceEventsApplyNow.json +if __name__ == "__main__": + main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/maintenance_events_get.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/maintenance_events_get.py new file mode 100644 index 000000000000..b85c77685f78 --- /dev/null +++ b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/maintenance_events_get.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.postgresqlflexibleservers import PostgreSQLManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-postgresqlflexibleservers +# USAGE + python maintenance_events_get.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PostgreSQLManagementClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.maintenance_events.get( + resource_group_name="exampleresourcegroup", + server_name="exampleserver", + maintenance_event_id="XXXX-111", + ) + print(response) + + +# x-ms-original-file: 2026-04-01-preview/MaintenanceEventsGet.json +if __name__ == "__main__": + main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/maintenance_events_list_by_server.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/maintenance_events_list_by_server.py new file mode 100644 index 000000000000..d20c6cec682d --- /dev/null +++ b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/maintenance_events_list_by_server.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.postgresqlflexibleservers import PostgreSQLManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-postgresqlflexibleservers +# USAGE + python maintenance_events_list_by_server.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PostgreSQLManagementClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.maintenance_events.list( + resource_group_name="exampleresourcegroup", + server_name="exampleserver", + ) + for item in response: + print(item) + + +# x-ms-original-file: 2026-04-01-preview/MaintenanceEventsListByServer.json +if __name__ == "__main__": + main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/maintenance_events_list_by_server_with_filter.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/maintenance_events_list_by_server_with_filter.py new file mode 100644 index 000000000000..9e9e67e4c91f --- /dev/null +++ b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/maintenance_events_list_by_server_with_filter.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.postgresqlflexibleservers import PostgreSQLManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-postgresqlflexibleservers +# USAGE + python maintenance_events_list_by_server_with_filter.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PostgreSQLManagementClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.maintenance_events.list( + resource_group_name="exampleresourcegroup", + server_name="exampleserver", + ) + for item in response: + print(item) + + +# x-ms-original-file: 2026-04-01-preview/MaintenanceEventsListByServerWithFilter.json +if __name__ == "__main__": + main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/maintenance_events_reschedule.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/maintenance_events_reschedule.py new file mode 100644 index 000000000000..8f6985bd8330 --- /dev/null +++ b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/maintenance_events_reschedule.py @@ -0,0 +1,44 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.postgresqlflexibleservers import PostgreSQLManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-postgresqlflexibleservers +# USAGE + python maintenance_events_reschedule.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PostgreSQLManagementClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.maintenance_events.begin_reschedule( + resource_group_name="exampleresourcegroup", + server_name="exampleserver", + maintenance_event_id="XXXX-111", + body={"postponeToDateTime": "2026-04-10T10:00:00+00:00"}, + ).result() + print(response) + + +# x-ms-original-file: 2026-04-01-preview/MaintenanceEventsReschedule.json +if __name__ == "__main__": + main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/major_version_upgrade_precheck_get.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/major_version_upgrade_precheck_get.py new file mode 100644 index 000000000000..1e4fadf87466 --- /dev/null +++ b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/major_version_upgrade_precheck_get.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.postgresqlflexibleservers import PostgreSQLManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-postgresqlflexibleservers +# USAGE + python major_version_upgrade_precheck_get.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PostgreSQLManagementClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.major_version_upgrade_precheck.get( + resource_group_name="exampleresourcegroup", + server_name="exampleserver", + precheck_validation_id="pppppppp-pppp-pppp-pppp-pppppppppppp", + ) + print(response) + + +# x-ms-original-file: 2026-04-01-preview/MajorVersionUpgradePrecheckGet.json +if __name__ == "__main__": + main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/major_version_upgrade_precheck_list_by_server.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/major_version_upgrade_precheck_list_by_server.py new file mode 100644 index 000000000000..5534e3aef7b5 --- /dev/null +++ b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/major_version_upgrade_precheck_list_by_server.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.postgresqlflexibleservers import PostgreSQLManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-postgresqlflexibleservers +# USAGE + python major_version_upgrade_precheck_list_by_server.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PostgreSQLManagementClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.major_version_upgrade_precheck.list( + resource_group_name="exampleresourcegroup", + server_name="exampleserver", + ) + for item in response: + print(item) + + +# x-ms-original-file: 2026-04-01-preview/MajorVersionUpgradePrecheckListByServer.json +if __name__ == "__main__": + main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/migrations_cancel.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/migrations_cancel.py index b373ff1262c0..50210f530b1f 100644 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/migrations_cancel.py +++ b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/migrations_cancel.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2026-01-01-preview/MigrationsCancel.json +# x-ms-original-file: 2026-04-01-preview/MigrationsCancel.json if __name__ == "__main__": main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/migrations_check_name_availability.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/migrations_check_name_availability.py index e4dde717298e..6ffb2cba2414 100644 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/migrations_check_name_availability.py +++ b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/migrations_check_name_availability.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2026-01-01-preview/MigrationsCheckNameAvailability.json +# x-ms-original-file: 2026-04-01-preview/MigrationsCheckNameAvailability.json if __name__ == "__main__": main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/migrations_create.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/migrations_create.py index 66a2cab7d43d..2445d1ef6c08 100644 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/migrations_create.py +++ b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/migrations_create.py @@ -54,6 +54,6 @@ def main(): print(response) -# x-ms-original-file: 2026-01-01-preview/MigrationsCreate.json +# x-ms-original-file: 2026-04-01-preview/MigrationsCreate.json if __name__ == "__main__": main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/migrations_create_other_source_types_validate_migrate.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/migrations_create_other_source_types_validate_migrate.py index 8b3d58c7143c..62c2a3249781 100644 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/migrations_create_other_source_types_validate_migrate.py +++ b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/migrations_create_other_source_types_validate_migrate.py @@ -56,6 +56,6 @@ def main(): print(response) -# x-ms-original-file: 2026-01-01-preview/MigrationsCreateOtherSourceTypesValidateMigrate.json +# x-ms-original-file: 2026-04-01-preview/MigrationsCreateOtherSourceTypesValidateMigrate.json if __name__ == "__main__": main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/migrations_create_validate_only.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/migrations_create_validate_only.py index c6dc1bc091b5..e5fefaa686c9 100644 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/migrations_create_validate_only.py +++ b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/migrations_create_validate_only.py @@ -55,6 +55,6 @@ def main(): print(response) -# x-ms-original-file: 2026-01-01-preview/MigrationsCreateValidateOnly.json +# x-ms-original-file: 2026-04-01-preview/MigrationsCreateValidateOnly.json if __name__ == "__main__": main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/migrations_create_with_fully_qualified_domain_name.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/migrations_create_with_fully_qualified_domain_name.py index ff613a5d419d..6067cb1304f1 100644 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/migrations_create_with_fully_qualified_domain_name.py +++ b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/migrations_create_with_fully_qualified_domain_name.py @@ -53,6 +53,6 @@ def main(): print(response) -# x-ms-original-file: 2026-01-01-preview/MigrationsCreateWithFullyQualifiedDomainName.json +# x-ms-original-file: 2026-04-01-preview/MigrationsCreateWithFullyQualifiedDomainName.json if __name__ == "__main__": main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/migrations_create_with_other_users.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/migrations_create_with_other_users.py index 93df2b4ba191..b9d7b4884cb8 100644 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/migrations_create_with_other_users.py +++ b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/migrations_create_with_other_users.py @@ -55,6 +55,6 @@ def main(): print(response) -# x-ms-original-file: 2026-01-01-preview/MigrationsCreateWithOtherUsers.json +# x-ms-original-file: 2026-04-01-preview/MigrationsCreateWithOtherUsers.json if __name__ == "__main__": main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/migrations_create_with_private_endpoint_servers.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/migrations_create_with_private_endpoint_servers.py index b0464f902d86..ecc171e96a79 100644 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/migrations_create_with_private_endpoint_servers.py +++ b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/migrations_create_with_private_endpoint_servers.py @@ -55,6 +55,6 @@ def main(): print(response) -# x-ms-original-file: 2026-01-01-preview/MigrationsCreateWithPrivateEndpointServers.json +# x-ms-original-file: 2026-04-01-preview/MigrationsCreateWithPrivateEndpointServers.json if __name__ == "__main__": main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/migrations_create_with_roles.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/migrations_create_with_roles.py index 71783b788a8e..253a353b4d91 100644 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/migrations_create_with_roles.py +++ b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/migrations_create_with_roles.py @@ -55,6 +55,6 @@ def main(): print(response) -# x-ms-original-file: 2026-01-01-preview/MigrationsCreateWithRoles.json +# x-ms-original-file: 2026-04-01-preview/MigrationsCreateWithRoles.json if __name__ == "__main__": main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/migrations_get.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/migrations_get.py index 3bf1d1348349..c1bd27a9e57d 100644 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/migrations_get.py +++ b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/migrations_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2026-01-01-preview/MigrationsGet.json +# x-ms-original-file: 2026-04-01-preview/MigrationsGet.json if __name__ == "__main__": main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/migrations_get_migration_with_successful_validation_and_migration.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/migrations_get_migration_with_successful_validation_and_migration.py index e82517b5753d..8288b243a2e7 100644 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/migrations_get_migration_with_successful_validation_and_migration.py +++ b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/migrations_get_migration_with_successful_validation_and_migration.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2026-01-01-preview/MigrationsGetMigrationWithSuccessfulValidationAndMigration.json +# x-ms-original-file: 2026-04-01-preview/MigrationsGetMigrationWithSuccessfulValidationAndMigration.json if __name__ == "__main__": main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/migrations_get_migration_with_successful_validation_but_migration_failure.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/migrations_get_migration_with_successful_validation_but_migration_failure.py index 6ee7e8feb62c..73fc8a8eae0c 100644 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/migrations_get_migration_with_successful_validation_but_migration_failure.py +++ b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/migrations_get_migration_with_successful_validation_but_migration_failure.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2026-01-01-preview/MigrationsGetMigrationWithSuccessfulValidationButMigrationFailure.json +# x-ms-original-file: 2026-04-01-preview/MigrationsGetMigrationWithSuccessfulValidationButMigrationFailure.json if __name__ == "__main__": main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/migrations_get_migration_with_successful_validation_only.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/migrations_get_migration_with_successful_validation_only.py index 78a5780de844..799854bda228 100644 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/migrations_get_migration_with_successful_validation_only.py +++ b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/migrations_get_migration_with_successful_validation_only.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2026-01-01-preview/MigrationsGetMigrationWithSuccessfulValidationOnly.json +# x-ms-original-file: 2026-04-01-preview/MigrationsGetMigrationWithSuccessfulValidationOnly.json if __name__ == "__main__": main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/migrations_get_migration_with_validation_failures.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/migrations_get_migration_with_validation_failures.py index 964429c3b665..24a71ce26f4c 100644 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/migrations_get_migration_with_validation_failures.py +++ b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/migrations_get_migration_with_validation_failures.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2026-01-01-preview/MigrationsGetMigrationWithValidationFailures.json +# x-ms-original-file: 2026-04-01-preview/MigrationsGetMigrationWithValidationFailures.json if __name__ == "__main__": main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/migrations_list_by_target_server.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/migrations_list_by_target_server.py index 4658155a72bb..1cc3f25864ba 100644 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/migrations_list_by_target_server.py +++ b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/migrations_list_by_target_server.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: 2026-01-01-preview/MigrationsListByTargetServer.json +# x-ms-original-file: 2026-04-01-preview/MigrationsListByTargetServer.json if __name__ == "__main__": main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/migrations_update.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/migrations_update.py index c85bbbee5d5b..644847d2876b 100644 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/migrations_update.py +++ b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/migrations_update.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: 2026-01-01-preview/MigrationsUpdate.json +# x-ms-original-file: 2026-04-01-preview/MigrationsUpdate.json if __name__ == "__main__": main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/name_availability_check_globally.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/name_availability_check_globally.py index 870808e45eb2..349f52a33821 100644 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/name_availability_check_globally.py +++ b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/name_availability_check_globally.py @@ -36,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: 2026-01-01-preview/NameAvailabilityCheckGlobally.json +# x-ms-original-file: 2026-04-01-preview/NameAvailabilityCheckGlobally.json if __name__ == "__main__": main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/name_availability_check_with_location.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/name_availability_check_with_location.py index 72cd0753cd4e..100542f519e2 100644 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/name_availability_check_with_location.py +++ b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/name_availability_check_with_location.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2026-01-01-preview/NameAvailabilityCheckWithLocation.json +# x-ms-original-file: 2026-04-01-preview/NameAvailabilityCheckWithLocation.json if __name__ == "__main__": main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/operations_list.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/operations_list.py index 35590fd02b79..f3ba7ade59f6 100644 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/operations_list.py +++ b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/operations_list.py @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: 2026-01-01-preview/OperationsList.json +# x-ms-original-file: 2026-04-01-preview/OperationsList.json if __name__ == "__main__": main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/private_dns_zone_suffix_get.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/private_dns_zone_suffix_get.py index 83fc38d4a64c..463c8d7aa69a 100644 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/private_dns_zone_suffix_get.py +++ b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/private_dns_zone_suffix_get.py @@ -34,6 +34,6 @@ def main(): print(response) -# x-ms-original-file: 2026-01-01-preview/PrivateDnsZoneSuffixGet.json +# x-ms-original-file: 2026-04-01-preview/PrivateDnsZoneSuffixGet.json if __name__ == "__main__": main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/private_endpoint_connections_delete.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/private_endpoint_connections_delete.py index c84f8be06688..6477daa26d0b 100644 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/private_endpoint_connections_delete.py +++ b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/private_endpoint_connections_delete.py @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: 2026-01-01-preview/PrivateEndpointConnectionsDelete.json +# x-ms-original-file: 2026-04-01-preview/PrivateEndpointConnectionsDelete.json if __name__ == "__main__": main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/private_endpoint_connections_get.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/private_endpoint_connections_get.py index a6d9ed0ea950..57ed7e31fdce 100644 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/private_endpoint_connections_get.py +++ b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/private_endpoint_connections_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2026-01-01-preview/PrivateEndpointConnectionsGet.json +# x-ms-original-file: 2026-04-01-preview/PrivateEndpointConnectionsGet.json if __name__ == "__main__": main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/private_endpoint_connections_list.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/private_endpoint_connections_list.py index 1947236e6fa3..9b8f23921567 100644 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/private_endpoint_connections_list.py +++ b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/private_endpoint_connections_list.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: 2026-01-01-preview/PrivateEndpointConnectionsList.json +# x-ms-original-file: 2026-04-01-preview/PrivateEndpointConnectionsList.json if __name__ == "__main__": main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/private_endpoint_connections_update.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/private_endpoint_connections_update.py index b932e31d9add..2dc057723de6 100644 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/private_endpoint_connections_update.py +++ b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/private_endpoint_connections_update.py @@ -46,6 +46,6 @@ def main(): print(response) -# x-ms-original-file: 2026-01-01-preview/PrivateEndpointConnectionsUpdate.json +# x-ms-original-file: 2026-04-01-preview/PrivateEndpointConnectionsUpdate.json if __name__ == "__main__": main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/private_link_resources_get.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/private_link_resources_get.py index 98f2ec6cb683..953dcedaaac1 100644 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/private_link_resources_get.py +++ b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/private_link_resources_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2026-01-01-preview/PrivateLinkResourcesGet.json +# x-ms-original-file: 2026-04-01-preview/PrivateLinkResourcesGet.json if __name__ == "__main__": main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/private_link_resources_list.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/private_link_resources_list.py index 74fc82f6a1e1..271e85dadac3 100644 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/private_link_resources_list.py +++ b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/private_link_resources_list.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: 2026-01-01-preview/PrivateLinkResourcesList.json +# x-ms-original-file: 2026-04-01-preview/PrivateLinkResourcesList.json if __name__ == "__main__": main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/quota_usages_for_flexible_servers.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/quota_usages_for_flexible_servers.py index 56f5b6724a26..dbf3fce52b70 100644 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/quota_usages_for_flexible_servers.py +++ b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/quota_usages_for_flexible_servers.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: 2026-01-01-preview/QuotaUsagesForFlexibleServers.json +# x-ms-original-file: 2026-04-01-preview/QuotaUsagesForFlexibleServers.json if __name__ == "__main__": main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/replicas_list_by_server.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/replicas_list_by_server.py index cc218c18bf89..22c82b00a7f3 100644 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/replicas_list_by_server.py +++ b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/replicas_list_by_server.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: 2026-01-01-preview/ReplicasListByServer.json +# x-ms-original-file: 2026-04-01-preview/ReplicasListByServer.json if __name__ == "__main__": main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/servers_cluster_create.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/servers_cluster_create.py index 077cd4d13aa1..13973e52a498 100644 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/servers_cluster_create.py +++ b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/servers_cluster_create.py @@ -52,6 +52,6 @@ def main(): print(response) -# x-ms-original-file: 2026-01-01-preview/ServersClusterCreate.json +# x-ms-original-file: 2026-04-01-preview/ServersClusterCreate.json if __name__ == "__main__": main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/servers_create_geo_restore_with_data_encryption_enabled.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/servers_create_geo_restore_with_data_encryption_enabled.py index 69789832d6a6..2d4bf15efe6d 100644 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/servers_create_geo_restore_with_data_encryption_enabled.py +++ b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/servers_create_geo_restore_with_data_encryption_enabled.py @@ -60,6 +60,6 @@ def main(): print(response) -# x-ms-original-file: 2026-01-01-preview/ServersCreateGeoRestoreWithDataEncryptionEnabled.json +# x-ms-original-file: 2026-04-01-preview/ServersCreateGeoRestoreWithDataEncryptionEnabled.json if __name__ == "__main__": main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/servers_create_geo_restore_with_data_encryption_enabled_auto_update.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/servers_create_geo_restore_with_data_encryption_enabled_auto_update.py index d42bb13c0348..035062ba7118 100644 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/servers_create_geo_restore_with_data_encryption_enabled_auto_update.py +++ b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/servers_create_geo_restore_with_data_encryption_enabled_auto_update.py @@ -60,6 +60,6 @@ def main(): print(response) -# x-ms-original-file: 2026-01-01-preview/ServersCreateGeoRestoreWithDataEncryptionEnabledAutoUpdate.json +# x-ms-original-file: 2026-04-01-preview/ServersCreateGeoRestoreWithDataEncryptionEnabledAutoUpdate.json if __name__ == "__main__": main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/servers_create_in_microsoft_owned_virtual_network_with_zone_redundant_high_availability.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/servers_create_in_microsoft_owned_virtual_network_with_zone_redundant_high_availability.py index eb710aa4d6c5..e1ee634a54f9 100644 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/servers_create_in_microsoft_owned_virtual_network_with_zone_redundant_high_availability.py +++ b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/servers_create_in_microsoft_owned_virtual_network_with_zone_redundant_high_availability.py @@ -54,6 +54,6 @@ def main(): print(response) -# x-ms-original-file: 2026-01-01-preview/ServersCreateInMicrosoftOwnedVirtualNetworkWithZoneRedundantHighAvailability.json +# x-ms-original-file: 2026-04-01-preview/ServersCreateInMicrosoftOwnedVirtualNetworkWithZoneRedundantHighAvailability.json if __name__ == "__main__": main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/servers_create_in_your_own_virtual_network_with_same_zone_high_availability.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/servers_create_in_your_own_virtual_network_with_same_zone_high_availability.py index 7af08e32489e..51ae87873b03 100644 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/servers_create_in_your_own_virtual_network_with_same_zone_high_availability.py +++ b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/servers_create_in_your_own_virtual_network_with_same_zone_high_availability.py @@ -57,6 +57,6 @@ def main(): print(response) -# x-ms-original-file: 2026-01-01-preview/ServersCreateInYourOwnVirtualNetworkWithSameZoneHighAvailability.json +# x-ms-original-file: 2026-04-01-preview/ServersCreateInYourOwnVirtualNetworkWithSameZoneHighAvailability.json if __name__ == "__main__": main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/servers_create_point_in_time_restore.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/servers_create_point_in_time_restore.py index 43ebeab2225f..82d9b5b876fa 100644 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/servers_create_point_in_time_restore.py +++ b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/servers_create_point_in_time_restore.py @@ -46,6 +46,6 @@ def main(): print(response) -# x-ms-original-file: 2026-01-01-preview/ServersCreatePointInTimeRestore.json +# x-ms-original-file: 2026-04-01-preview/ServersCreatePointInTimeRestore.json if __name__ == "__main__": main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/servers_create_replica.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/servers_create_replica.py index 7998ea8a3373..4b80137de3ec 100644 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/servers_create_replica.py +++ b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/servers_create_replica.py @@ -51,7 +51,6 @@ def main(): "primaryUserAssignedIdentityId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/exampleprimaryidentity", "type": "AzureKeyVault", }, - "pointInTimeUTC": "2025-06-01T18:35:22.123456Z", "sourceServerResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/examplesourceserver", }, }, @@ -59,6 +58,6 @@ def main(): print(response) -# x-ms-original-file: 2026-01-01-preview/ServersCreateReplica.json +# x-ms-original-file: 2026-04-01-preview/ServersCreateReplica.json if __name__ == "__main__": main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/servers_create_revive_dropped.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/servers_create_revive_dropped.py index a2e99706bf04..1495030632f8 100644 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/servers_create_revive_dropped.py +++ b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/servers_create_revive_dropped.py @@ -46,6 +46,6 @@ def main(): print(response) -# x-ms-original-file: 2026-01-01-preview/ServersCreateReviveDropped.json +# x-ms-original-file: 2026-04-01-preview/ServersCreateReviveDropped.json if __name__ == "__main__": main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/servers_create_with_data_encryption_enabled.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/servers_create_with_data_encryption_enabled.py index 32676daefac3..3e4adb967f02 100644 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/servers_create_with_data_encryption_enabled.py +++ b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/servers_create_with_data_encryption_enabled.py @@ -69,6 +69,6 @@ def main(): print(response) -# x-ms-original-file: 2026-01-01-preview/ServersCreateWithDataEncryptionEnabled.json +# x-ms-original-file: 2026-04-01-preview/ServersCreateWithDataEncryptionEnabled.json if __name__ == "__main__": main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/servers_create_with_data_encryption_enabled_auto_update.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/servers_create_with_data_encryption_enabled_auto_update.py index c62fca7783f5..c4d28a2ebc4f 100644 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/servers_create_with_data_encryption_enabled_auto_update.py +++ b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/servers_create_with_data_encryption_enabled_auto_update.py @@ -69,6 +69,6 @@ def main(): print(response) -# x-ms-original-file: 2026-01-01-preview/ServersCreateWithDataEncryptionEnabledAutoUpdate.json +# x-ms-original-file: 2026-04-01-preview/ServersCreateWithDataEncryptionEnabledAutoUpdate.json if __name__ == "__main__": main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/servers_create_with_microsoft_entra_enabled_in_your_own_virtual_network_without_high_availability.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/servers_create_with_microsoft_entra_enabled_in_your_own_virtual_network_without_high_availability.py index c41db6191001..0e261d09ddb8 100644 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/servers_create_with_microsoft_entra_enabled_in_your_own_virtual_network_without_high_availability.py +++ b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/servers_create_with_microsoft_entra_enabled_in_your_own_virtual_network_without_high_availability.py @@ -62,6 +62,6 @@ def main(): print(response) -# x-ms-original-file: 2026-01-01-preview/ServersCreateWithMicrosoftEntraEnabledInYourOwnVirtualNetworkWithoutHighAvailability.json +# x-ms-original-file: 2026-04-01-preview/ServersCreateWithMicrosoftEntraEnabledInYourOwnVirtualNetworkWithoutHighAvailability.json if __name__ == "__main__": main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/servers_delete.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/servers_delete.py index e58b39f89dff..ca0468f6d31b 100644 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/servers_delete.py +++ b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/servers_delete.py @@ -36,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: 2026-01-01-preview/ServersDelete.json +# x-ms-original-file: 2026-04-01-preview/ServersDelete.json if __name__ == "__main__": main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/servers_get.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/servers_get.py index 59d8b3f5e762..cba2960ff543 100644 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/servers_get.py +++ b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/servers_get.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2026-01-01-preview/ServersGet.json +# x-ms-original-file: 2026-04-01-preview/ServersGet.json if __name__ == "__main__": main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/servers_get_with_private_endpoints.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/servers_get_with_private_endpoints.py index 5cba40d6ae6a..824242f7f8cd 100644 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/servers_get_with_private_endpoints.py +++ b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/servers_get_with_private_endpoints.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2026-01-01-preview/ServersGetWithPrivateEndpoints.json +# x-ms-original-file: 2026-04-01-preview/ServersGetWithPrivateEndpoints.json if __name__ == "__main__": main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/servers_get_with_vnet.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/servers_get_with_vnet.py index 6e21abb29595..97cc198c4852 100644 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/servers_get_with_vnet.py +++ b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/servers_get_with_vnet.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2026-01-01-preview/ServersGetWithVnet.json +# x-ms-original-file: 2026-04-01-preview/ServersGetWithVnet.json if __name__ == "__main__": main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/servers_list_by_resource_group.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/servers_list_by_resource_group.py index 682695a703eb..c1fb9681ef6b 100644 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/servers_list_by_resource_group.py +++ b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/servers_list_by_resource_group.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: 2026-01-01-preview/ServersListByResourceGroup.json +# x-ms-original-file: 2026-04-01-preview/ServersListByResourceGroup.json if __name__ == "__main__": main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/servers_list_by_subscription.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/servers_list_by_subscription.py index 936860513f51..9028e0d513b8 100644 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/servers_list_by_subscription.py +++ b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/servers_list_by_subscription.py @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: 2026-01-01-preview/ServersListBySubscription.json +# x-ms-original-file: 2026-04-01-preview/ServersListBySubscription.json if __name__ == "__main__": main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/servers_migrate_network_mode.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/servers_migrate_network_mode.py index 4b379655e541..410ad50185dd 100644 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/servers_migrate_network_mode.py +++ b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/servers_migrate_network_mode.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2026-01-01-preview/ServersMigrateNetworkMode.json +# x-ms-original-file: 2026-04-01-preview/ServersMigrateNetworkMode.json if __name__ == "__main__": main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/servers_promote_replica_as_forced_standalone_server.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/servers_promote_replica_as_forced_standalone_server.py index 1d671eb949d3..da726d17fe6a 100644 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/servers_promote_replica_as_forced_standalone_server.py +++ b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/servers_promote_replica_as_forced_standalone_server.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2026-01-01-preview/ServersPromoteReplicaAsForcedStandaloneServer.json +# x-ms-original-file: 2026-04-01-preview/ServersPromoteReplicaAsForcedStandaloneServer.json if __name__ == "__main__": main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/servers_promote_replica_as_forced_switchover.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/servers_promote_replica_as_forced_switchover.py index 5fdc8430594a..99790874f465 100644 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/servers_promote_replica_as_forced_switchover.py +++ b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/servers_promote_replica_as_forced_switchover.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2026-01-01-preview/ServersPromoteReplicaAsForcedSwitchover.json +# x-ms-original-file: 2026-04-01-preview/ServersPromoteReplicaAsForcedSwitchover.json if __name__ == "__main__": main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/servers_promote_replica_as_planned_standalone_server.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/servers_promote_replica_as_planned_standalone_server.py index c22725c8aece..9a192616622f 100644 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/servers_promote_replica_as_planned_standalone_server.py +++ b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/servers_promote_replica_as_planned_standalone_server.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2026-01-01-preview/ServersPromoteReplicaAsPlannedStandaloneServer.json +# x-ms-original-file: 2026-04-01-preview/ServersPromoteReplicaAsPlannedStandaloneServer.json if __name__ == "__main__": main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/servers_promote_replica_as_planned_switchover.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/servers_promote_replica_as_planned_switchover.py index e33c5a42802f..c33b2e136aaa 100644 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/servers_promote_replica_as_planned_switchover.py +++ b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/servers_promote_replica_as_planned_switchover.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2026-01-01-preview/ServersPromoteReplicaAsPlannedSwitchover.json +# x-ms-original-file: 2026-04-01-preview/ServersPromoteReplicaAsPlannedSwitchover.json if __name__ == "__main__": main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/servers_restart.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/servers_restart.py index e5773081ccf5..434ffe15d90b 100644 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/servers_restart.py +++ b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/servers_restart.py @@ -36,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: 2026-01-01-preview/ServersRestart.json +# x-ms-original-file: 2026-04-01-preview/ServersRestart.json if __name__ == "__main__": main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/servers_restart_with_failover.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/servers_restart_with_failover.py index da4874a70271..ef84bb15adcf 100644 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/servers_restart_with_failover.py +++ b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/servers_restart_with_failover.py @@ -36,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: 2026-01-01-preview/ServersRestartWithFailover.json +# x-ms-original-file: 2026-04-01-preview/ServersRestartWithFailover.json if __name__ == "__main__": main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/servers_start.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/servers_start.py index 2d2682324d52..216de12f71ce 100644 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/servers_start.py +++ b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/servers_start.py @@ -36,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: 2026-01-01-preview/ServersStart.json +# x-ms-original-file: 2026-04-01-preview/ServersStart.json if __name__ == "__main__": main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/servers_start_major_version_upgrade_precheck.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/servers_start_major_version_upgrade_precheck.py new file mode 100644 index 000000000000..1ceda764f51d --- /dev/null +++ b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/servers_start_major_version_upgrade_precheck.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.postgresqlflexibleservers import PostgreSQLManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-postgresqlflexibleservers +# USAGE + python servers_start_major_version_upgrade_precheck.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PostgreSQLManagementClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.servers.begin_start_major_version_upgrade_precheck( + resource_group_name="exampleresourcegroup", + server_name="exampleserver", + body={"targetVersion": "18"}, + ).result() + print(response) + + +# x-ms-original-file: 2026-04-01-preview/ServersStartMajorVersionUpgradePrecheck.json +if __name__ == "__main__": + main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/servers_stop.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/servers_stop.py index 79acbec0b15e..08550df95eb6 100644 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/servers_stop.py +++ b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/servers_stop.py @@ -36,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: 2026-01-01-preview/ServersStop.json +# x-ms-original-file: 2026-04-01-preview/ServersStop.json if __name__ == "__main__": main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/servers_update.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/servers_update.py index e7b768f96dbb..a5c9cc37de3c 100644 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/servers_update.py +++ b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/servers_update.py @@ -46,6 +46,6 @@ def main(): print(response) -# x-ms-original-file: 2026-01-01-preview/ServersUpdate.json +# x-ms-original-file: 2026-04-01-preview/ServersUpdate.json if __name__ == "__main__": main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/servers_update_with_custom_maintenance_window.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/servers_update_with_custom_maintenance_window.py index 1f5c5a67bc6c..eea1e0915933 100644 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/servers_update_with_custom_maintenance_window.py +++ b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/servers_update_with_custom_maintenance_window.py @@ -43,6 +43,6 @@ def main(): print(response) -# x-ms-original-file: 2026-01-01-preview/ServersUpdateWithCustomMaintenanceWindow.json +# x-ms-original-file: 2026-04-01-preview/ServersUpdateWithCustomMaintenanceWindow.json if __name__ == "__main__": main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/servers_update_with_data_encryption_enabled.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/servers_update_with_data_encryption_enabled.py index f02746051776..eff86b07430f 100644 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/servers_update_with_data_encryption_enabled.py +++ b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/servers_update_with_data_encryption_enabled.py @@ -60,6 +60,6 @@ def main(): print(response) -# x-ms-original-file: 2026-01-01-preview/ServersUpdateWithDataEncryptionEnabled.json +# x-ms-original-file: 2026-04-01-preview/ServersUpdateWithDataEncryptionEnabled.json if __name__ == "__main__": main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/servers_update_with_data_encryption_enabled_auto_update.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/servers_update_with_data_encryption_enabled_auto_update.py index 0be57e4fe3bb..5fa74addfdb3 100644 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/servers_update_with_data_encryption_enabled_auto_update.py +++ b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/servers_update_with_data_encryption_enabled_auto_update.py @@ -60,6 +60,6 @@ def main(): print(response) -# x-ms-original-file: 2026-01-01-preview/ServersUpdateWithDataEncryptionEnabledAutoUpdate.json +# x-ms-original-file: 2026-04-01-preview/ServersUpdateWithDataEncryptionEnabledAutoUpdate.json if __name__ == "__main__": main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/servers_update_with_major_version_upgrade.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/servers_update_with_major_version_upgrade.py index 0373fbb91d7e..a6d67588afa3 100644 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/servers_update_with_major_version_upgrade.py +++ b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/servers_update_with_major_version_upgrade.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2026-01-01-preview/ServersUpdateWithMajorVersionUpgrade.json +# x-ms-original-file: 2026-04-01-preview/ServersUpdateWithMajorVersionUpgrade.json if __name__ == "__main__": main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/servers_update_with_microsoft_entra_enabled.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/servers_update_with_microsoft_entra_enabled.py index 4a5902dd81d4..a4c03797de11 100644 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/servers_update_with_microsoft_entra_enabled.py +++ b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/servers_update_with_microsoft_entra_enabled.py @@ -51,6 +51,6 @@ def main(): print(response) -# x-ms-original-file: 2026-01-01-preview/ServersUpdateWithMicrosoftEntraEnabled.json +# x-ms-original-file: 2026-04-01-preview/ServersUpdateWithMicrosoftEntraEnabled.json if __name__ == "__main__": main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/tuning_options_get.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/tuning_options_get.py index 072dea5c7ba0..37de986d6221 100644 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/tuning_options_get.py +++ b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/tuning_options_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2026-01-01-preview/TuningOptionsGet.json +# x-ms-original-file: 2026-04-01-preview/TuningOptionsGet.json if __name__ == "__main__": main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/tuning_options_list_by_server.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/tuning_options_list_by_server.py index ddbfdead5e2f..e730967739b6 100644 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/tuning_options_list_by_server.py +++ b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/tuning_options_list_by_server.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: 2026-01-01-preview/TuningOptionsListByServer.json +# x-ms-original-file: 2026-04-01-preview/TuningOptionsListByServer.json if __name__ == "__main__": main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/tuning_options_list_index_recommendations.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/tuning_options_list_index_recommendations.py index e7b09bcf5368..b5c8df532dca 100644 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/tuning_options_list_index_recommendations.py +++ b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/tuning_options_list_index_recommendations.py @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: 2026-01-01-preview/TuningOptionsListIndexRecommendations.json +# x-ms-original-file: 2026-04-01-preview/TuningOptionsListIndexRecommendations.json if __name__ == "__main__": main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/tuning_options_list_index_recommendations_filtered_for_create_index.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/tuning_options_list_index_recommendations_filtered_for_create_index.py index b2484b04a91a..f8b509edd86a 100644 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/tuning_options_list_index_recommendations_filtered_for_create_index.py +++ b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/tuning_options_list_index_recommendations_filtered_for_create_index.py @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: 2026-01-01-preview/TuningOptionsListIndexRecommendationsFilteredForCreateIndex.json +# x-ms-original-file: 2026-04-01-preview/TuningOptionsListIndexRecommendationsFilteredForCreateIndex.json if __name__ == "__main__": main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/tuning_options_list_table_recommendations.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/tuning_options_list_table_recommendations.py index dcf47c29674b..80551c428f5a 100644 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/tuning_options_list_table_recommendations.py +++ b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/tuning_options_list_table_recommendations.py @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: 2026-01-01-preview/TuningOptionsListTableRecommendations.json +# x-ms-original-file: 2026-04-01-preview/TuningOptionsListTableRecommendations.json if __name__ == "__main__": main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/tuning_options_list_table_recommendations_filtered_for_analyze_table.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/tuning_options_list_table_recommendations_filtered_for_analyze_table.py index 92b7f78dcacd..da4697be8509 100644 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/tuning_options_list_table_recommendations_filtered_for_analyze_table.py +++ b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/tuning_options_list_table_recommendations_filtered_for_analyze_table.py @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: 2026-01-01-preview/TuningOptionsListTableRecommendationsFilteredForAnalyzeTable.json +# x-ms-original-file: 2026-04-01-preview/TuningOptionsListTableRecommendationsFilteredForAnalyzeTable.json if __name__ == "__main__": main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/virtual_endpoint_create.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/virtual_endpoint_create.py index a2eeab100c5e..b4ddd43f5f04 100644 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/virtual_endpoint_create.py +++ b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/virtual_endpoint_create.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: 2026-01-01-preview/VirtualEndpointCreate.json +# x-ms-original-file: 2026-04-01-preview/VirtualEndpointCreate.json if __name__ == "__main__": main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/virtual_endpoint_delete.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/virtual_endpoint_delete.py index f4b5a4f33957..189885bdd0c1 100644 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/virtual_endpoint_delete.py +++ b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/virtual_endpoint_delete.py @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: 2026-01-01-preview/VirtualEndpointDelete.json +# x-ms-original-file: 2026-04-01-preview/VirtualEndpointDelete.json if __name__ == "__main__": main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/virtual_endpoint_update.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/virtual_endpoint_update.py index 9f2d93ada6ee..87853b883a24 100644 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/virtual_endpoint_update.py +++ b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/virtual_endpoint_update.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: 2026-01-01-preview/VirtualEndpointUpdate.json +# x-ms-original-file: 2026-04-01-preview/VirtualEndpointUpdate.json if __name__ == "__main__": main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/virtual_endpoints_get.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/virtual_endpoints_get.py index 51c0c3cac30f..e9ef4867cb24 100644 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/virtual_endpoints_get.py +++ b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/virtual_endpoints_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2026-01-01-preview/VirtualEndpointsGet.json +# x-ms-original-file: 2026-04-01-preview/VirtualEndpointsGet.json if __name__ == "__main__": main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/virtual_endpoints_list_by_server.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/virtual_endpoints_list_by_server.py index af99e6c08110..c047524f2cc5 100644 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/virtual_endpoints_list_by_server.py +++ b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/virtual_endpoints_list_by_server.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: 2026-01-01-preview/VirtualEndpointsListByServer.json +# x-ms-original-file: 2026-04-01-preview/VirtualEndpointsListByServer.json if __name__ == "__main__": main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/virtual_network_subnet_usage_list.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/virtual_network_subnet_usage_list.py index ab56900c42b2..0419ce8c468e 100644 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/virtual_network_subnet_usage_list.py +++ b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/virtual_network_subnet_usage_list.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: 2026-01-01-preview/VirtualNetworkSubnetUsageList.json +# x-ms-original-file: 2026-04-01-preview/VirtualNetworkSubnetUsageList.json if __name__ == "__main__": main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_tests/test_postgre_sql_management_maintenance_events_operations.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_tests/test_postgre_sql_management_maintenance_events_operations.py new file mode 100644 index 000000000000..8f7216de3d64 --- /dev/null +++ b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_tests/test_postgre_sql_management_maintenance_events_operations.py @@ -0,0 +1,67 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.postgresqlflexibleservers import PostgreSQLManagementClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestPostgreSQLManagementMaintenanceEventsOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(PostgreSQLManagementClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_maintenance_events_get(self, resource_group): + response = self.client.maintenance_events.get( + resource_group_name=resource_group.name, + server_name="str", + maintenance_event_id="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_maintenance_events_list(self, resource_group): + response = self.client.maintenance_events.list( + resource_group_name=resource_group.name, + server_name="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_maintenance_events_begin_reschedule(self, resource_group): + response = self.client.maintenance_events.begin_reschedule( + resource_group_name=resource_group.name, + server_name="str", + maintenance_event_id="str", + body={"postponeToDateTime": "2020-02-20 00:00:00"}, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_maintenance_events_begin_apply_now(self, resource_group): + response = self.client.maintenance_events.begin_apply_now( + resource_group_name=resource_group.name, + server_name="str", + maintenance_event_id="str", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_tests/test_postgre_sql_management_maintenance_events_operations_async.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_tests/test_postgre_sql_management_maintenance_events_operations_async.py new file mode 100644 index 000000000000..61b2b7852a3a --- /dev/null +++ b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_tests/test_postgre_sql_management_maintenance_events_operations_async.py @@ -0,0 +1,72 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.postgresqlflexibleservers.aio import PostgreSQLManagementClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestPostgreSQLManagementMaintenanceEventsOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(PostgreSQLManagementClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_maintenance_events_get(self, resource_group): + response = await self.client.maintenance_events.get( + resource_group_name=resource_group.name, + server_name="str", + maintenance_event_id="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_maintenance_events_list(self, resource_group): + response = self.client.maintenance_events.list( + resource_group_name=resource_group.name, + server_name="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_maintenance_events_begin_reschedule(self, resource_group): + response = await ( + await self.client.maintenance_events.begin_reschedule( + resource_group_name=resource_group.name, + server_name="str", + maintenance_event_id="str", + body={"postponeToDateTime": "2020-02-20 00:00:00"}, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_maintenance_events_begin_apply_now(self, resource_group): + response = await ( + await self.client.maintenance_events.begin_apply_now( + resource_group_name=resource_group.name, + server_name="str", + maintenance_event_id="str", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_tests/test_postgre_sql_management_major_version_upgrade_precheck_operations.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_tests/test_postgre_sql_management_major_version_upgrade_precheck_operations.py new file mode 100644 index 000000000000..bbb7f1696f69 --- /dev/null +++ b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_tests/test_postgre_sql_management_major_version_upgrade_precheck_operations.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.postgresqlflexibleservers import PostgreSQLManagementClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestPostgreSQLManagementMajorVersionUpgradePrecheckOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(PostgreSQLManagementClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_major_version_upgrade_precheck_get(self, resource_group): + response = self.client.major_version_upgrade_precheck.get( + resource_group_name=resource_group.name, + server_name="str", + precheck_validation_id="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_major_version_upgrade_precheck_list(self, resource_group): + response = self.client.major_version_upgrade_precheck.list( + resource_group_name=resource_group.name, + server_name="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_tests/test_postgre_sql_management_major_version_upgrade_precheck_operations_async.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_tests/test_postgre_sql_management_major_version_upgrade_precheck_operations_async.py new file mode 100644 index 000000000000..75ff9abb2fb5 --- /dev/null +++ b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_tests/test_postgre_sql_management_major_version_upgrade_precheck_operations_async.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.postgresqlflexibleservers.aio import PostgreSQLManagementClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestPostgreSQLManagementMajorVersionUpgradePrecheckOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(PostgreSQLManagementClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_major_version_upgrade_precheck_get(self, resource_group): + response = await self.client.major_version_upgrade_precheck.get( + resource_group_name=resource_group.name, + server_name="str", + precheck_validation_id="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_major_version_upgrade_precheck_list(self, resource_group): + response = self.client.major_version_upgrade_precheck.list( + resource_group_name=resource_group.name, + server_name="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_tests/test_postgre_sql_management_servers_operations.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_tests/test_postgre_sql_management_servers_operations.py index 067298656e25..c50aac237a55 100644 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_tests/test_postgre_sql_management_servers_operations.py +++ b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_tests/test_postgre_sql_management_servers_operations.py @@ -59,9 +59,11 @@ def test_servers_begin_create_or_update(self, resource_group): "createMode": "str", "dataEncryption": { "geoBackupEncryptionKeyStatus": "str", + "geoBackupFederatedIdentityClientId": "str", "geoBackupKeyURI": "str", "geoBackupUserAssignedIdentityId": "str", "primaryEncryptionKeyStatus": "str", + "primaryFederatedIdentityClientId": "str", "primaryKeyURI": "str", "primaryUserAssignedIdentityId": "str", "type": "str", @@ -166,9 +168,11 @@ def test_servers_begin_update(self, resource_group): "createMode": "str", "dataEncryption": { "geoBackupEncryptionKeyStatus": "str", + "geoBackupFederatedIdentityClientId": "str", "geoBackupKeyURI": "str", "geoBackupUserAssignedIdentityId": "str", "primaryEncryptionKeyStatus": "str", + "primaryFederatedIdentityClientId": "str", "primaryKeyURI": "str", "primaryUserAssignedIdentityId": "str", "type": "str", @@ -278,3 +282,15 @@ def test_servers_begin_migrate_network_mode(self, resource_group): # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_servers_begin_start_major_version_upgrade_precheck(self, resource_group): + response = self.client.servers.begin_start_major_version_upgrade_precheck( + resource_group_name=resource_group.name, + server_name="str", + body={"targetVersion": "str"}, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_tests/test_postgre_sql_management_servers_operations_async.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_tests/test_postgre_sql_management_servers_operations_async.py index 3a3c024ba5a9..b6a313537030 100644 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_tests/test_postgre_sql_management_servers_operations_async.py +++ b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_tests/test_postgre_sql_management_servers_operations_async.py @@ -61,9 +61,11 @@ async def test_servers_begin_create_or_update(self, resource_group): "createMode": "str", "dataEncryption": { "geoBackupEncryptionKeyStatus": "str", + "geoBackupFederatedIdentityClientId": "str", "geoBackupKeyURI": "str", "geoBackupUserAssignedIdentityId": "str", "primaryEncryptionKeyStatus": "str", + "primaryFederatedIdentityClientId": "str", "primaryKeyURI": "str", "primaryUserAssignedIdentityId": "str", "type": "str", @@ -170,9 +172,11 @@ async def test_servers_begin_update(self, resource_group): "createMode": "str", "dataEncryption": { "geoBackupEncryptionKeyStatus": "str", + "geoBackupFederatedIdentityClientId": "str", "geoBackupKeyURI": "str", "geoBackupUserAssignedIdentityId": "str", "primaryEncryptionKeyStatus": "str", + "primaryFederatedIdentityClientId": "str", "primaryKeyURI": "str", "primaryUserAssignedIdentityId": "str", "type": "str", @@ -293,3 +297,17 @@ async def test_servers_begin_migrate_network_mode(self, resource_group): # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_servers_begin_start_major_version_upgrade_precheck(self, resource_group): + response = await ( + await self.client.servers.begin_start_major_version_upgrade_precheck( + resource_group_name=resource_group.name, + server_name="str", + body={"targetVersion": "str"}, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/pyproject.toml b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/pyproject.toml index 367fef8be4d1..f6dd04caaba1 100644 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/pyproject.toml +++ b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/pyproject.toml @@ -17,13 +17,12 @@ classifiers = [ "Programming Language :: Python", "Programming Language :: Python :: 3 :: Only", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", ] -requires-python = ">=3.9" +requires-python = ">=3.10" keywords = [ "azure", "azure sdk", diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/tsp-location.yaml b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/tsp-location.yaml index 5054212479f8..8e28f5cb4a1c 100644 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/tsp-location.yaml +++ b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/tsp-location.yaml @@ -1,4 +1,4 @@ directory: specification/postgresql/DBforPostgreSQL.Management -commit: 3afef36df83f47abac337e0cbd850e3d1c00dc8e +commit: aaff653c559c45c03ce095a49264e385df8bd9e5 repo: Azure/azure-rest-api-specs additionalDirectories: