From 8d477bc5a1e41564660c9e21159c9c321fbda69b Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Wed, 5 Jun 2024 03:45:48 +0000 Subject: [PATCH] CodeGen from PR 29316 in Azure/azure-rest-api-specs Merge 08a92a0e84fd5a2b506934ca731f21e4eff6eb93 into f6f50c6388fd5836fa142384641b8353a99874ef --- sdk/sql/azure-mgmt-sql/_meta.json | 8 +- .../azure-mgmt-sql/azure/mgmt/sql/_patch.py | 1 + .../azure/mgmt/sql/_sql_management_client.py | 18 +- .../azure-mgmt-sql/azure/mgmt/sql/_version.py | 2 +- .../azure/mgmt/sql/aio/_patch.py | 1 + .../mgmt/sql/aio/_sql_management_client.py | 18 +- .../azure/mgmt/sql/aio/operations/__init__.py | 8 +- ...hort_term_retention_policies_operations.py | 15 +- .../operations/_capabilities_operations.py | 9 +- .../_data_masking_policies_operations.py | 11 +- .../_data_masking_rules_operations.py | 11 +- ...ta_warehouse_user_activities_operations.py | 11 +- ...d_threat_protection_settings_operations.py | 13 +- .../_database_advisors_operations.py | 13 +- .../_database_automatic_tuning_operations.py | 11 +- ...abase_blob_auditing_policies_operations.py | 13 +- .../_database_columns_operations.py | 13 +- ...tabase_encryption_protectors_operations.py | 11 +- .../_database_extensions_operations.py | 13 +- .../_database_operations_operations.py | 11 +- ...database_recommended_actions_operations.py | 13 +- .../_database_schemas_operations.py | 11 +- ...base_security_alert_policies_operations.py | 13 +- ...ability_assessment_baselines_operations.py | 13 +- ...lity_assessment_execute_scan_operations.py | 9 +- ...ty_assessment_rule_baselines_operations.py | 15 +- ...ility_assessment_scan_result_operations.py | 11 +- ...lnerability_assessment_scans_operations.py | 11 +- ...ability_assessments_settings_operations.py | 11 +- .../operations/_database_tables_operations.py | 11 +- .../operations/_database_usages_operations.py | 9 +- ...ty_assessment_rule_baselines_operations.py | 13 +- ...lnerability_assessment_scans_operations.py | 15 +- ...se_vulnerability_assessments_operations.py | 15 +- .../aio/operations/_databases_operations.py | 39 +- .../operations/_deleted_servers_operations.py | 15 +- ...tributed_availability_groups_operations.py | 463 +---------- .../_elastic_pool_activities_operations.py | 9 +- ...tic_pool_database_activities_operations.py | 9 +- .../_elastic_pool_operations_operations.py | 11 +- .../operations/_elastic_pools_operations.py | 23 +- .../_encryption_protectors_operations.py | 15 +- .../_endpoint_certificates_operations.py | 11 +- ...abase_blob_auditing_policies_operations.py | 13 +- ...erver_blob_auditing_policies_operations.py | 13 +- .../operations/_failover_groups_operations.py | 51 +- .../operations/_firewall_rules_operations.py | 17 +- .../_geo_backup_policies_operations.py | 13 +- .../_instance_failover_groups_operations.py | 19 +- .../operations/_instance_pools_operations.py | 19 +- .../_ipv6_firewall_rules_operations.py | 15 +- .../aio/operations/_job_agents_operations.py | 17 +- .../operations/_job_credentials_operations.py | 15 +- .../operations/_job_executions_operations.py | 19 +- .../_job_private_endpoints_operations.py | 15 +- .../_job_step_executions_operations.py | 11 +- .../aio/operations/_job_steps_operations.py | 19 +- .../_job_target_executions_operations.py | 13 +- .../_job_target_groups_operations.py | 15 +- .../operations/_job_versions_operations.py | 11 +- .../sql/aio/operations/_jobs_operations.py | 15 +- .../_ledger_digest_uploads_operations.py | 15 +- ..._long_term_retention_backups_operations.py | 39 +- ...ion_managed_instance_backups_operations.py | 27 +- ...long_term_retention_policies_operations.py | 13 +- .../_maintenance_window_options_operations.py | 9 +- .../_maintenance_windows_operations.py | 11 +- ...hort_term_retention_policies_operations.py | 15 +- ...d_threat_protection_settings_operations.py | 13 +- .../_managed_database_columns_operations.py | 13 +- ...ged_database_move_operations_operations.py | 11 +- .../_managed_database_queries_operations.py | 11 +- ...commended_sensitivity_labels_operations.py | 9 +- ...ged_database_restore_details_operations.py | 9 +- .../_managed_database_schemas_operations.py | 11 +- ...base_security_alert_policies_operations.py | 13 +- ...ged_database_security_events_operations.py | 9 +- ..._database_sensitivity_labels_operations.py | 23 +- .../_managed_database_tables_operations.py | 11 +- ..._transparent_data_encryption_operations.py | 13 +- ...ty_assessment_rule_baselines_operations.py | 13 +- ...lnerability_assessment_scans_operations.py | 15 +- ...se_vulnerability_assessments_operations.py | 15 +- .../_managed_databases_operations.py | 27 +- ...aged_instance_administrators_operations.py | 15 +- ...d_threat_protection_settings_operations.py | 13 +- ...zure_ad_only_authentications_operations.py | 15 +- .../_managed_instance_dtcs_operations.py | 13 +- ...stance_encryption_protectors_operations.py | 15 +- .../_managed_instance_keys_operations.py | 15 +- ...long_term_retention_policies_operations.py | 13 +- ..._managed_instance_operations_operations.py | 13 +- ...private_endpoint_connections_operations.py | 15 +- ...tance_private_link_resources_operations.py | 11 +- ...ed_instance_tde_certificates_operations.py | 9 +- ...ce_vulnerability_assessments_operations.py | 15 +- .../_managed_instances_operations.py | 257 ++---- ...anaged_ledger_digest_uploads_operations.py | 15 +- ...hort_term_retention_policies_operations.py | 15 +- .../_managed_server_dns_aliases_operations.py | 17 +- ...rver_security_alert_policies_operations.py | 13 +- .../mgmt/sql/aio/operations/_operations.py | 9 +- .../_outbound_firewall_rules_operations.py | 15 +- ...private_endpoint_connections_operations.py | 15 +- .../_private_link_resources_operations.py | 11 +- ...commended_sensitivity_labels_operations.py | 9 +- .../_recoverable_databases_operations.py | 11 +- ...ecoverable_managed_databases_operations.py | 11 +- .../_replication_links_operations.py | 466 ++++++++++- ...restorable_dropped_databases_operations.py | 11 +- ...le_dropped_managed_databases_operations.py | 11 +- .../operations/_restore_points_operations.py | 15 +- .../_sensitivity_labels_operations.py | 23 +- ...d_threat_protection_settings_operations.py | 13 +- .../operations/_server_advisors_operations.py | 13 +- .../_server_automatic_tuning_operations.py | 11 +- ...rver_azure_ad_administrators_operations.py | 15 +- ...zure_ad_only_authentications_operations.py | 15 +- ...erver_blob_auditing_policies_operations.py | 13 +- .../_server_communication_links_operations.py | 15 +- ...server_configuration_options_operations.py | 13 +- .../_server_connection_policies_operations.py | 13 +- ...erver_dev_ops_audit_settings_operations.py | 13 +- .../_server_dns_aliases_operations.py | 17 +- .../aio/operations/_server_keys_operations.py | 15 +- .../_server_operations_operations.py | 9 +- ...rver_security_alert_policies_operations.py | 13 +- .../_server_trust_certificates_operations.py | 15 +- .../_server_trust_groups_operations.py | 17 +- .../operations/_server_usages_operations.py | 9 +- ...er_vulnerability_assessments_operations.py | 15 +- .../sql/aio/operations/_servers_operations.py | 25 +- .../_service_objectives_operations.py | 11 +- .../aio/operations/_sql_agent_operations.py | 11 +- ...rability_assessment_baseline_operations.py | 11 +- ...ability_assessment_baselines_operations.py | 9 +- ...lity_assessment_execute_scan_operations.py | 9 +- ...ity_assessment_rule_baseline_operations.py | 13 +- ...ty_assessment_rule_baselines_operations.py | 9 +- ...ility_assessment_scan_result_operations.py | 11 +- ...lnerability_assessment_scans_operations.py | 11 +- ...ql_vulnerability_assessments_operations.py | 9 +- ...ability_assessments_settings_operations.py | 13 +- ...p_managed_instance_schedules_operations.py | 15 +- .../_subscription_usages_operations.py | 11 +- .../_synapse_link_workspaces_operations.py | 9 +- .../aio/operations/_sync_agents_operations.py | 19 +- .../aio/operations/_sync_groups_operations.py | 29 +- .../operations/_sync_members_operations.py | 21 +- .../_tde_certificates_operations.py | 9 +- .../aio/operations/_time_zones_operations.py | 11 +- ...transparent_data_encryptions_operations.py | 13 +- .../sql/aio/operations/_usages_operations.py | 9 +- .../_virtual_clusters_operations.py | 19 +- .../_virtual_network_rules_operations.py | 15 +- .../_workload_classifiers_operations.py | 15 +- .../operations/_workload_groups_operations.py | 15 +- .../azure/mgmt/sql/models/__init__.py | 48 +- .../azure/mgmt/sql/models/_models_py3.py | 762 ++++-------------- .../models/_sql_management_client_enums.py | 135 +--- .../azure/mgmt/sql/operations/__init__.py | 8 +- ...hort_term_retention_policies_operations.py | 15 +- .../operations/_capabilities_operations.py | 9 +- .../_data_masking_policies_operations.py | 11 +- .../_data_masking_rules_operations.py | 11 +- ...ta_warehouse_user_activities_operations.py | 11 +- ...d_threat_protection_settings_operations.py | 13 +- .../_database_advisors_operations.py | 13 +- .../_database_automatic_tuning_operations.py | 11 +- ...abase_blob_auditing_policies_operations.py | 13 +- .../_database_columns_operations.py | 13 +- ...tabase_encryption_protectors_operations.py | 11 +- .../_database_extensions_operations.py | 13 +- .../_database_operations_operations.py | 11 +- ...database_recommended_actions_operations.py | 13 +- .../_database_schemas_operations.py | 11 +- ...base_security_alert_policies_operations.py | 13 +- ...ability_assessment_baselines_operations.py | 13 +- ...lity_assessment_execute_scan_operations.py | 9 +- ...ty_assessment_rule_baselines_operations.py | 15 +- ...ility_assessment_scan_result_operations.py | 11 +- ...lnerability_assessment_scans_operations.py | 11 +- ...ability_assessments_settings_operations.py | 11 +- .../operations/_database_tables_operations.py | 11 +- .../operations/_database_usages_operations.py | 9 +- ...ty_assessment_rule_baselines_operations.py | 13 +- ...lnerability_assessment_scans_operations.py | 15 +- ...se_vulnerability_assessments_operations.py | 15 +- .../sql/operations/_databases_operations.py | 39 +- .../operations/_deleted_servers_operations.py | 15 +- ...tributed_availability_groups_operations.py | 573 +------------ .../_elastic_pool_activities_operations.py | 9 +- ...tic_pool_database_activities_operations.py | 9 +- .../_elastic_pool_operations_operations.py | 11 +- .../operations/_elastic_pools_operations.py | 23 +- .../_encryption_protectors_operations.py | 15 +- .../_endpoint_certificates_operations.py | 11 +- ...abase_blob_auditing_policies_operations.py | 13 +- ...erver_blob_auditing_policies_operations.py | 13 +- .../operations/_failover_groups_operations.py | 67 +- .../operations/_firewall_rules_operations.py | 17 +- .../_geo_backup_policies_operations.py | 13 +- .../_instance_failover_groups_operations.py | 19 +- .../operations/_instance_pools_operations.py | 19 +- .../_ipv6_firewall_rules_operations.py | 15 +- .../sql/operations/_job_agents_operations.py | 17 +- .../operations/_job_credentials_operations.py | 15 +- .../operations/_job_executions_operations.py | 19 +- .../_job_private_endpoints_operations.py | 15 +- .../_job_step_executions_operations.py | 11 +- .../sql/operations/_job_steps_operations.py | 19 +- .../_job_target_executions_operations.py | 13 +- .../_job_target_groups_operations.py | 15 +- .../operations/_job_versions_operations.py | 11 +- .../mgmt/sql/operations/_jobs_operations.py | 15 +- .../_ledger_digest_uploads_operations.py | 15 +- ..._long_term_retention_backups_operations.py | 39 +- ...ion_managed_instance_backups_operations.py | 27 +- ...long_term_retention_policies_operations.py | 13 +- .../_maintenance_window_options_operations.py | 9 +- .../_maintenance_windows_operations.py | 11 +- ...hort_term_retention_policies_operations.py | 15 +- ...d_threat_protection_settings_operations.py | 13 +- .../_managed_database_columns_operations.py | 13 +- ...ged_database_move_operations_operations.py | 11 +- .../_managed_database_queries_operations.py | 11 +- ...commended_sensitivity_labels_operations.py | 9 +- ...ged_database_restore_details_operations.py | 9 +- .../_managed_database_schemas_operations.py | 11 +- ...base_security_alert_policies_operations.py | 13 +- ...ged_database_security_events_operations.py | 9 +- ..._database_sensitivity_labels_operations.py | 23 +- .../_managed_database_tables_operations.py | 11 +- ..._transparent_data_encryption_operations.py | 13 +- ...ty_assessment_rule_baselines_operations.py | 13 +- ...lnerability_assessment_scans_operations.py | 15 +- ...se_vulnerability_assessments_operations.py | 15 +- .../_managed_databases_operations.py | 27 +- ...aged_instance_administrators_operations.py | 15 +- ...d_threat_protection_settings_operations.py | 13 +- ...zure_ad_only_authentications_operations.py | 15 +- .../_managed_instance_dtcs_operations.py | 13 +- ...stance_encryption_protectors_operations.py | 15 +- .../_managed_instance_keys_operations.py | 15 +- ...long_term_retention_policies_operations.py | 13 +- ..._managed_instance_operations_operations.py | 13 +- ...private_endpoint_connections_operations.py | 15 +- ...tance_private_link_resources_operations.py | 11 +- ...ed_instance_tde_certificates_operations.py | 9 +- ...ce_vulnerability_assessments_operations.py | 15 +- .../_managed_instances_operations.py | 331 ++------ ...anaged_ledger_digest_uploads_operations.py | 15 +- ...hort_term_retention_policies_operations.py | 15 +- .../_managed_server_dns_aliases_operations.py | 17 +- ...rver_security_alert_policies_operations.py | 13 +- .../azure/mgmt/sql/operations/_operations.py | 9 +- .../_outbound_firewall_rules_operations.py | 15 +- ...private_endpoint_connections_operations.py | 15 +- .../_private_link_resources_operations.py | 11 +- ...commended_sensitivity_labels_operations.py | 9 +- .../_recoverable_databases_operations.py | 11 +- ...ecoverable_managed_databases_operations.py | 11 +- .../_replication_links_operations.py | 548 ++++++++++++- ...restorable_dropped_databases_operations.py | 11 +- ...le_dropped_managed_databases_operations.py | 11 +- .../operations/_restore_points_operations.py | 15 +- .../_sensitivity_labels_operations.py | 23 +- ...d_threat_protection_settings_operations.py | 13 +- .../operations/_server_advisors_operations.py | 13 +- .../_server_automatic_tuning_operations.py | 11 +- ...rver_azure_ad_administrators_operations.py | 15 +- ...zure_ad_only_authentications_operations.py | 15 +- ...erver_blob_auditing_policies_operations.py | 13 +- .../_server_communication_links_operations.py | 15 +- ...server_configuration_options_operations.py | 13 +- .../_server_connection_policies_operations.py | 13 +- ...erver_dev_ops_audit_settings_operations.py | 13 +- .../_server_dns_aliases_operations.py | 17 +- .../sql/operations/_server_keys_operations.py | 15 +- .../_server_operations_operations.py | 9 +- ...rver_security_alert_policies_operations.py | 13 +- .../_server_trust_certificates_operations.py | 15 +- .../_server_trust_groups_operations.py | 17 +- .../operations/_server_usages_operations.py | 9 +- ...er_vulnerability_assessments_operations.py | 15 +- .../sql/operations/_servers_operations.py | 25 +- .../_service_objectives_operations.py | 11 +- .../sql/operations/_sql_agent_operations.py | 11 +- ...rability_assessment_baseline_operations.py | 11 +- ...ability_assessment_baselines_operations.py | 9 +- ...lity_assessment_execute_scan_operations.py | 9 +- ...ity_assessment_rule_baseline_operations.py | 13 +- ...ty_assessment_rule_baselines_operations.py | 9 +- ...ility_assessment_scan_result_operations.py | 11 +- ...lnerability_assessment_scans_operations.py | 11 +- ...ql_vulnerability_assessments_operations.py | 9 +- ...ability_assessments_settings_operations.py | 13 +- ...p_managed_instance_schedules_operations.py | 15 +- .../_subscription_usages_operations.py | 11 +- .../_synapse_link_workspaces_operations.py | 9 +- .../sql/operations/_sync_agents_operations.py | 19 +- .../sql/operations/_sync_groups_operations.py | 29 +- .../operations/_sync_members_operations.py | 21 +- .../_tde_certificates_operations.py | 9 +- .../sql/operations/_time_zones_operations.py | 11 +- ...transparent_data_encryptions_operations.py | 13 +- .../mgmt/sql/operations/_usages_operations.py | 9 +- .../_virtual_clusters_operations.py | 19 +- .../_virtual_network_rules_operations.py | 15 +- .../_workload_classifiers_operations.py | 15 +- .../operations/_workload_groups_operations.py | 15 +- ...distributed_availability_groups_create.py} | 12 +- .../distributed_availability_groups_delete.py | 4 +- .../distributed_availability_groups_get.py | 4 +- ...ed_availability_groups_list_by_instance.py | 2 +- .../distributed_availability_groups_update.py | 2 +- .../failover_group_create_or_update.py | 2 +- ...roup_create_or_update_standby_secondary.py | 61 ++ .../failover_group_delete.py | 2 +- .../failover_group_failover.py | 2 +- ...er_group_force_failover_allow_data_loss.py | 2 +- .../generated_samples/failover_group_get.py | 2 +- .../generated_samples/failover_group_list.py | 2 +- ...roup_try_planned_before_forced_failover.py | 2 +- .../failover_group_update.py | 2 +- ...ailover_group_update_standby_secondary.py} | 24 +- .../failover_managed_instance.py | 2 +- ...etwork_dependencies_by_managed_instance.py | 2 +- .../managed_instance_create_max.py | 4 +- .../managed_instance_create_min.py | 4 +- .../managed_instance_delete.py | 4 +- .../generated_samples/managed_instance_get.py | 4 +- .../managed_instance_get_while_updating.py | 42 - ...e_get_with_expand_equals_administrators.py | 4 +- .../managed_instance_list.py | 4 +- .../managed_instance_list_by_instance_pool.py | 4 +- ..._pool_with_expand_equals_administrators.py | 4 +- ...managed_instance_list_by_resource_group.py | 4 +- ...group_with_expand_equals_administrators.py | 4 +- ..._list_with_expand_equals_administrators.py | 4 +- ...ance_refresh_external_governance_status.py | 42 - ...stance_remove_maintenance_configuration.py | 6 +- .../managed_instance_top_queries_list.py | 2 +- .../managed_instance_top_queries_list_max.py | 2 +- .../managed_instance_top_queries_list_min.py | 2 +- .../managed_instance_update_max.py | 11 +- .../managed_instance_update_min.py | 4 +- ...y => replication_link_create_or_update.py} | 15 +- .../replication_link_delete.py | 2 +- .../replication_link_failover.py | 2 +- ...plication_link_failover_allow_data_loss.py | 2 +- .../generated_samples/replication_link_get.py | 2 +- .../replication_link_list_by_database.py | 2 +- .../replication_link_list_by_server.py | 2 +- ...failover.py => replication_link_update.py} | 15 +- .../start_managed_instance.py | 5 +- .../stop_managed_instance.py | 5 +- 357 files changed, 4364 insertions(+), 3777 deletions(-) rename sdk/sql/azure-mgmt-sql/generated_samples/{distributed_availability_groups_create_min.py => distributed_availability_groups_create.py} (81%) create mode 100644 sdk/sql/azure-mgmt-sql/generated_samples/failover_group_create_or_update_standby_secondary.py rename sdk/sql/azure-mgmt-sql/generated_samples/{distributed_availability_groups_create_max.py => failover_group_update_standby_secondary.py} (66%) delete mode 100644 sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_get_while_updating.py delete mode 100644 sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_refresh_external_governance_status.py rename sdk/sql/azure-mgmt-sql/generated_samples/{distributed_availability_groups_set_role.py => replication_link_create_or_update.py} (76%) rename sdk/sql/azure-mgmt-sql/generated_samples/{distributed_availability_groups_failover.py => replication_link_update.py} (77%) diff --git a/sdk/sql/azure-mgmt-sql/_meta.json b/sdk/sql/azure-mgmt-sql/_meta.json index 1e966b11c51c..c83f2e18f979 100644 --- a/sdk/sql/azure-mgmt-sql/_meta.json +++ b/sdk/sql/azure-mgmt-sql/_meta.json @@ -1,11 +1,11 @@ { - "commit": "33c4457b1d13f83965f4fe3367dca4a6df898100", + "commit": "bf01996149405027c6599cea8030b2f84a3b565b", "repository_url": "https://github.com/Azure/azure-rest-api-specs", - "autorest": "3.9.7", + "autorest": "3.10.2", "use": [ - "@autorest/python@6.13.7", + "@autorest/python@6.13.16", "@autorest/modelerfour@4.27.0" ], - "autorest_command": "autorest specification/sql/resource-manager/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --use=@autorest/python@6.13.7 --use=@autorest/modelerfour@4.27.0 --version=3.9.7 --version-tolerant=False", + "autorest_command": "autorest specification/sql/resource-manager/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-python/sdk --use=@autorest/python@6.13.16 --use=@autorest/modelerfour@4.27.0 --version=3.10.2 --version-tolerant=False", "readme": "specification/sql/resource-manager/readme.md" } \ No newline at end of file diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/_patch.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/_patch.py index f99e77fef986..17dbc073e01b 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/_patch.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/_patch.py @@ -25,6 +25,7 @@ # # -------------------------------------------------------------------------- + # This file is used for handwritten extensions to the generated code. Example: # https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md def patch_sdk(): diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/_sql_management_client.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/_sql_management_client.py index 037d8fdd18eb..6e8cf9a2492f 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/_sql_management_client.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/_sql_management_client.py @@ -483,8 +483,6 @@ class SqlManagementClient: # pylint: disable=client-accepts-api-version-keyword ManagedInstanceAdvancedThreatProtectionSettingsOperations operations :vartype managed_instance_advanced_threat_protection_settings: azure.mgmt.sql.operations.ManagedInstanceAdvancedThreatProtectionSettingsOperations - :ivar replication_links: ReplicationLinksOperations operations - :vartype replication_links: azure.mgmt.sql.operations.ReplicationLinksOperations :ivar managed_database_move_operations: ManagedDatabaseMoveOperationsOperations operations :vartype managed_database_move_operations: azure.mgmt.sql.operations.ManagedDatabaseMoveOperationsOperations @@ -504,6 +502,8 @@ class SqlManagementClient: # pylint: disable=client-accepts-api-version-keyword azure.mgmt.sql.operations.DatabaseEncryptionProtectorsOperations :ivar managed_databases: ManagedDatabasesOperations operations :vartype managed_databases: azure.mgmt.sql.operations.ManagedDatabasesOperations + :ivar managed_instances: ManagedInstancesOperations operations + :vartype managed_instances: azure.mgmt.sql.operations.ManagedInstancesOperations :ivar managed_ledger_digest_uploads: ManagedLedgerDigestUploadsOperations operations :vartype managed_ledger_digest_uploads: azure.mgmt.sql.operations.ManagedLedgerDigestUploadsOperations @@ -594,10 +594,10 @@ class SqlManagementClient: # pylint: disable=client-accepts-api-version-keyword :ivar long_term_retention_policies: LongTermRetentionPoliciesOperations operations :vartype long_term_retention_policies: azure.mgmt.sql.operations.LongTermRetentionPoliciesOperations - :ivar managed_instances: ManagedInstancesOperations operations - :vartype managed_instances: azure.mgmt.sql.operations.ManagedInstancesOperations :ivar servers: ServersOperations operations :vartype servers: azure.mgmt.sql.operations.ServersOperations + :ivar replication_links: ReplicationLinksOperations operations + :vartype replication_links: azure.mgmt.sql.operations.ReplicationLinksOperations :param credential: Credential needed for the client to connect to Azure. Required. :type credential: ~azure.core.credentials.TokenCredential :param subscription_id: The subscription ID that identifies an Azure subscription. Required. @@ -936,9 +936,6 @@ def __init__( self._client, self._config, self._serialize, self._deserialize ) ) - self.replication_links = ReplicationLinksOperations( - self._client, self._config, self._serialize, self._deserialize - ) self.managed_database_move_operations = ManagedDatabaseMoveOperationsOperations( self._client, self._config, self._serialize, self._deserialize ) @@ -963,6 +960,9 @@ def __init__( self.managed_databases = ManagedDatabasesOperations( self._client, self._config, self._serialize, self._deserialize ) + self.managed_instances = ManagedInstancesOperations( + self._client, self._config, self._serialize, self._deserialize + ) self.managed_ledger_digest_uploads = ManagedLedgerDigestUploadsOperations( self._client, self._config, self._serialize, self._deserialize ) @@ -1044,10 +1044,10 @@ def __init__( self.long_term_retention_policies = LongTermRetentionPoliciesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.managed_instances = ManagedInstancesOperations( + self.servers = ServersOperations(self._client, self._config, self._serialize, self._deserialize) + self.replication_links = ReplicationLinksOperations( self._client, self._config, self._serialize, self._deserialize ) - self.servers = ServersOperations(self._client, self._config, self._serialize, self._deserialize) def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse: """Runs the network request through the client's chained policies. diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/_version.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/_version.py index 27054ac4327a..c78e629b6f08 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/_version.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "4.0.0b17" +VERSION = "0.9.0" diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/_patch.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/_patch.py index f99e77fef986..17dbc073e01b 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/_patch.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/_patch.py @@ -25,6 +25,7 @@ # # -------------------------------------------------------------------------- + # This file is used for handwritten extensions to the generated code. Example: # https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md def patch_sdk(): diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/_sql_management_client.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/_sql_management_client.py index 72794f7187bb..42b16d6b15cd 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/_sql_management_client.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/_sql_management_client.py @@ -488,8 +488,6 @@ class SqlManagementClient: # pylint: disable=client-accepts-api-version-keyword ManagedInstanceAdvancedThreatProtectionSettingsOperations operations :vartype managed_instance_advanced_threat_protection_settings: azure.mgmt.sql.aio.operations.ManagedInstanceAdvancedThreatProtectionSettingsOperations - :ivar replication_links: ReplicationLinksOperations operations - :vartype replication_links: azure.mgmt.sql.aio.operations.ReplicationLinksOperations :ivar managed_database_move_operations: ManagedDatabaseMoveOperationsOperations operations :vartype managed_database_move_operations: azure.mgmt.sql.aio.operations.ManagedDatabaseMoveOperationsOperations @@ -510,6 +508,8 @@ class SqlManagementClient: # pylint: disable=client-accepts-api-version-keyword azure.mgmt.sql.aio.operations.DatabaseEncryptionProtectorsOperations :ivar managed_databases: ManagedDatabasesOperations operations :vartype managed_databases: azure.mgmt.sql.aio.operations.ManagedDatabasesOperations + :ivar managed_instances: ManagedInstancesOperations operations + :vartype managed_instances: azure.mgmt.sql.aio.operations.ManagedInstancesOperations :ivar managed_ledger_digest_uploads: ManagedLedgerDigestUploadsOperations operations :vartype managed_ledger_digest_uploads: azure.mgmt.sql.aio.operations.ManagedLedgerDigestUploadsOperations @@ -600,10 +600,10 @@ class SqlManagementClient: # pylint: disable=client-accepts-api-version-keyword :ivar long_term_retention_policies: LongTermRetentionPoliciesOperations operations :vartype long_term_retention_policies: azure.mgmt.sql.aio.operations.LongTermRetentionPoliciesOperations - :ivar managed_instances: ManagedInstancesOperations operations - :vartype managed_instances: azure.mgmt.sql.aio.operations.ManagedInstancesOperations :ivar servers: ServersOperations operations :vartype servers: azure.mgmt.sql.aio.operations.ServersOperations + :ivar replication_links: ReplicationLinksOperations operations + :vartype replication_links: azure.mgmt.sql.aio.operations.ReplicationLinksOperations :param credential: Credential needed for the client to connect to Azure. Required. :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: The subscription ID that identifies an Azure subscription. Required. @@ -942,9 +942,6 @@ def __init__( self._client, self._config, self._serialize, self._deserialize ) ) - self.replication_links = ReplicationLinksOperations( - self._client, self._config, self._serialize, self._deserialize - ) self.managed_database_move_operations = ManagedDatabaseMoveOperationsOperations( self._client, self._config, self._serialize, self._deserialize ) @@ -969,6 +966,9 @@ def __init__( self.managed_databases = ManagedDatabasesOperations( self._client, self._config, self._serialize, self._deserialize ) + self.managed_instances = ManagedInstancesOperations( + self._client, self._config, self._serialize, self._deserialize + ) self.managed_ledger_digest_uploads = ManagedLedgerDigestUploadsOperations( self._client, self._config, self._serialize, self._deserialize ) @@ -1050,10 +1050,10 @@ def __init__( self.long_term_retention_policies = LongTermRetentionPoliciesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.managed_instances = ManagedInstancesOperations( + self.servers = ServersOperations(self._client, self._config, self._serialize, self._deserialize) + self.replication_links = ReplicationLinksOperations( self._client, self._config, self._serialize, self._deserialize ) - self.servers = ServersOperations(self._client, self._config, self._serialize, self._deserialize) def _send_request( self, request: HttpRequest, *, stream: bool = False, **kwargs: Any diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/__init__.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/__init__.py index 9d571ab6d5e8..137da16d048c 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/__init__.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/__init__.py @@ -138,7 +138,6 @@ from ._managed_instance_advanced_threat_protection_settings_operations import ( ManagedInstanceAdvancedThreatProtectionSettingsOperations, ) -from ._replication_links_operations import ReplicationLinksOperations from ._managed_database_move_operations_operations import ManagedDatabaseMoveOperationsOperations from ._managed_instance_dtcs_operations import ManagedInstanceDtcsOperations from ._synapse_link_workspaces_operations import SynapseLinkWorkspacesOperations @@ -147,6 +146,7 @@ from ._managed_database_restore_details_operations import ManagedDatabaseRestoreDetailsOperations from ._database_encryption_protectors_operations import DatabaseEncryptionProtectorsOperations from ._managed_databases_operations import ManagedDatabasesOperations +from ._managed_instances_operations import ManagedInstancesOperations from ._managed_ledger_digest_uploads_operations import ManagedLedgerDigestUploadsOperations from ._recoverable_databases_operations import RecoverableDatabasesOperations from ._restorable_dropped_databases_operations import RestorableDroppedDatabasesOperations @@ -184,8 +184,8 @@ from ._instance_pools_operations import InstancePoolsOperations from ._long_term_retention_backups_operations import LongTermRetentionBackupsOperations from ._long_term_retention_policies_operations import LongTermRetentionPoliciesOperations -from ._managed_instances_operations import ManagedInstancesOperations from ._servers_operations import ServersOperations +from ._replication_links_operations import ReplicationLinksOperations from ._patch import __all__ as _patch_all from ._patch import * # pylint: disable=unused-wildcard-import @@ -304,7 +304,6 @@ "ManagedServerDnsAliasesOperations", "ManagedDatabaseAdvancedThreatProtectionSettingsOperations", "ManagedInstanceAdvancedThreatProtectionSettingsOperations", - "ReplicationLinksOperations", "ManagedDatabaseMoveOperationsOperations", "ManagedInstanceDtcsOperations", "SynapseLinkWorkspacesOperations", @@ -313,6 +312,7 @@ "ManagedDatabaseRestoreDetailsOperations", "DatabaseEncryptionProtectorsOperations", "ManagedDatabasesOperations", + "ManagedInstancesOperations", "ManagedLedgerDigestUploadsOperations", "RecoverableDatabasesOperations", "RestorableDroppedDatabasesOperations", @@ -340,8 +340,8 @@ "InstancePoolsOperations", "LongTermRetentionBackupsOperations", "LongTermRetentionPoliciesOperations", - "ManagedInstancesOperations", "ServersOperations", + "ReplicationLinksOperations", ] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_backup_short_term_retention_policies_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_backup_short_term_retention_policies_operations.py index 651eeaff2abf..9a364c207df4 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_backup_short_term_retention_policies_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_backup_short_term_retention_policies_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -37,6 +38,10 @@ build_update_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -84,7 +89,7 @@ async def get( :rtype: ~azure.mgmt.sql.models.BackupShortTermRetentionPolicy :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -138,7 +143,7 @@ async def _create_or_update_initial( parameters: Union[_models.BackupShortTermRetentionPolicy, IO[bytes]], **kwargs: Any ) -> Optional[_models.BackupShortTermRetentionPolicy]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -354,7 +359,7 @@ async def _update_initial( parameters: Union[_models.BackupShortTermRetentionPolicy, IO[bytes]], **kwargs: Any ) -> Optional[_models.BackupShortTermRetentionPolicy]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -586,7 +591,7 @@ def list_by_database( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) cls: ClsType[_models.BackupShortTermRetentionPolicyListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_capabilities_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_capabilities_operations.py index 4d16098552b1..dfa862b48bfd 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_capabilities_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_capabilities_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar, Union +import sys +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -27,6 +28,10 @@ from ..._vendor import _convert_request from ...operations._capabilities_operations import build_list_by_location_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -67,7 +72,7 @@ async def list_by_location( :rtype: ~azure.mgmt.sql.models.LocationCapabilities :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_data_masking_policies_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_data_masking_policies_operations.py index 797064967ee5..586676da3e88 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_data_masking_policies_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_data_masking_policies_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Literal, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Literal, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from ..._vendor import _convert_request from ...operations._data_masking_policies_operations import build_create_or_update_request, build_get_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -136,7 +141,7 @@ async def create_or_update( :rtype: ~azure.mgmt.sql.models.DataMaskingPolicy :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -211,7 +216,7 @@ async def get( :rtype: ~azure.mgmt.sql.models.DataMaskingPolicy :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_data_masking_rules_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_data_masking_rules_operations.py index eb433ab94376..a058a4af9beb 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_data_masking_rules_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_data_masking_rules_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Literal, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Literal, Optional, Type, TypeVar, Union, overload from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._vendor import _convert_request from ...operations._data_masking_rules_operations import build_create_or_update_request, build_list_by_database_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -149,7 +154,7 @@ async def create_or_update( :rtype: ~azure.mgmt.sql.models.DataMaskingRule :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -236,7 +241,7 @@ def list_by_database( data_masking_policy_name: Literal["Default"] = kwargs.pop("data_masking_policy_name", "Default") cls: ClsType[_models.DataMaskingRuleListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_data_warehouse_user_activities_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_data_warehouse_user_activities_operations.py index 2e425d11f26b..4e1ab9f474ec 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_data_warehouse_user_activities_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_data_warehouse_user_activities_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._data_warehouse_user_activities_operations import build_get_request, build_list_by_database_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -78,7 +83,7 @@ async def get( :rtype: ~azure.mgmt.sql.models.DataWarehouseUserActivities :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -148,7 +153,7 @@ def list_by_database( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.DataWarehouseUserActivitiesListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_advanced_threat_protection_settings_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_advanced_threat_protection_settings_operations.py index 3de93c4a41ca..d6ed442e4fcd 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_advanced_threat_protection_settings_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_advanced_threat_protection_settings_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -34,6 +35,10 @@ build_list_by_database_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -82,7 +87,7 @@ def list_by_database( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) cls: ClsType[_models.DatabaseAdvancedThreatProtectionListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -162,7 +167,7 @@ async def get( :rtype: ~azure.mgmt.sql.models.DatabaseAdvancedThreatProtection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -307,7 +312,7 @@ async def create_or_update( :rtype: ~azure.mgmt.sql.models.DatabaseAdvancedThreatProtection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_advisors_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_advisors_operations.py index 523208dc0c2d..858ab6351c03 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_advisors_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_advisors_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, List, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, List, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -32,6 +33,10 @@ build_update_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -79,7 +84,7 @@ async def list_by_database( :rtype: list[~azure.mgmt.sql.models.Advisor] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -143,7 +148,7 @@ async def get( :rtype: ~azure.mgmt.sql.models.Advisor :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -282,7 +287,7 @@ async def update( :rtype: ~azure.mgmt.sql.models.Advisor :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_automatic_tuning_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_automatic_tuning_operations.py index 07278ab0a82d..bf28a5095686 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_automatic_tuning_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_automatic_tuning_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from ..._vendor import _convert_request from ...operations._database_automatic_tuning_operations import build_get_request, build_update_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -68,7 +73,7 @@ async def get( :rtype: ~azure.mgmt.sql.models.DatabaseAutomaticTuning :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -197,7 +202,7 @@ async def update( :rtype: ~azure.mgmt.sql.models.DatabaseAutomaticTuning :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_blob_auditing_policies_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_blob_auditing_policies_operations.py index b2dd044d7afd..148e47b24616 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_blob_auditing_policies_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_blob_auditing_policies_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Literal, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Literal, Optional, Type, TypeVar, Union, overload from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -34,6 +35,10 @@ build_list_by_database_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -82,7 +87,7 @@ def list_by_database( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) cls: ClsType[_models.DatabaseBlobAuditingPolicyListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -153,7 +158,7 @@ async def get( :rtype: ~azure.mgmt.sql.models.DatabaseBlobAuditingPolicy :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -284,7 +289,7 @@ async def create_or_update( :rtype: ~azure.mgmt.sql.models.DatabaseBlobAuditingPolicy :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_columns_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_columns_operations.py index 977e1d27a0bd..9b1d9fb46f6a 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_columns_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_columns_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, List, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, List, Optional, Type, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -33,6 +34,10 @@ build_list_by_table_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -99,7 +104,7 @@ def list_by_database( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.DatabaseColumnListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -195,7 +200,7 @@ def list_by_table( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.DatabaseColumnListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -282,7 +287,7 @@ async def get( :rtype: ~azure.mgmt.sql.models.DatabaseColumn :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_encryption_protectors_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_encryption_protectors_operations.py index ca17826c3c7b..b2d7d256c61c 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_encryption_protectors_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_encryption_protectors_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar, Union, cast +import sys +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union, cast from azure.core.exceptions import ( ClientAuthenticationError, @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._database_encryption_protectors_operations import build_revalidate_request, build_revert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -60,7 +65,7 @@ async def _revalidate_initial( # pylint: disable=inconsistent-return-statements encryption_protector_name: Union[str, _models.EncryptionProtectorName], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -177,7 +182,7 @@ async def _revert_initial( # pylint: disable=inconsistent-return-statements encryption_protector_name: Union[str, _models.EncryptionProtectorName], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_extensions_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_extensions_operations.py index 5b0c5c0c1ab6..472f8ee80190 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_extensions_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_extensions_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -36,6 +37,10 @@ build_list_by_database_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -78,7 +83,7 @@ async def get( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -128,7 +133,7 @@ async def _create_or_update_initial( parameters: Union[_models.DatabaseExtensions, IO[bytes]], **kwargs: Any ) -> Optional[_models.ImportExportExtensionsOperationResult]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -360,7 +365,7 @@ def list_by_database( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) cls: ClsType[_models.ImportExportExtensionsOperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_operations_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_operations_operations.py index 51d60ae2deb6..08eab5af37f3 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_operations_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_operations_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._database_operations_operations import build_cancel_request, build_list_by_database_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -75,7 +80,7 @@ def list_by_database( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) cls: ClsType[_models.DatabaseOperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -148,7 +153,7 @@ async def cancel( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_recommended_actions_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_recommended_actions_operations.py index e3bb80bd395f..d46ecfafd8ad 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_recommended_actions_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_recommended_actions_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, List, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, List, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -32,6 +33,10 @@ build_update_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -74,7 +79,7 @@ async def list_by_database_advisor( :rtype: list[~azure.mgmt.sql.models.RecommendedAction] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -146,7 +151,7 @@ async def get( :rtype: ~azure.mgmt.sql.models.RecommendedAction :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -295,7 +300,7 @@ async def update( :rtype: ~azure.mgmt.sql.models.RecommendedAction :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_schemas_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_schemas_operations.py index 8d220683eaa8..b0071c2fb6da 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_schemas_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_schemas_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._database_schemas_operations import build_get_request, build_list_by_database_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -83,7 +88,7 @@ def list_by_database( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.DatabaseSchemaListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -157,7 +162,7 @@ async def get( :rtype: ~azure.mgmt.sql.models.DatabaseSchema :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_security_alert_policies_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_security_alert_policies_operations.py index f50743adefe6..d3af5c0d5f25 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_security_alert_policies_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_security_alert_policies_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -34,6 +35,10 @@ build_list_by_database_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -82,7 +87,7 @@ async def get( :rtype: ~azure.mgmt.sql.models.DatabaseSecurityAlertPolicy :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -224,7 +229,7 @@ async def create_or_update( :rtype: ~azure.mgmt.sql.models.DatabaseSecurityAlertPolicy :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -311,7 +316,7 @@ def list_by_database( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.DatabaseSecurityAlertListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_sql_vulnerability_assessment_baselines_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_sql_vulnerability_assessment_baselines_operations.py index f8bb9df975b7..e8605d7e931a 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_sql_vulnerability_assessment_baselines_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_sql_vulnerability_assessment_baselines_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -34,6 +35,10 @@ build_list_by_sql_vulnerability_assessment_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -90,7 +95,7 @@ def list_by_sql_vulnerability_assessment( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) cls: ClsType[_models.DatabaseSqlVulnerabilityAssessmentBaselineSetListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -175,7 +180,7 @@ async def get( :rtype: ~azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentBaselineSet :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -329,7 +334,7 @@ async def create_or_update( :rtype: ~azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentBaselineSet :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_sql_vulnerability_assessment_execute_scan_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_sql_vulnerability_assessment_execute_scan_operations.py index 344c07832f99..036dd319d5f1 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_sql_vulnerability_assessment_execute_scan_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_sql_vulnerability_assessment_execute_scan_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar, Union, cast +import sys +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union, cast from azure.core.exceptions import ( ClientAuthenticationError, @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._database_sql_vulnerability_assessment_execute_scan_operations import build_execute_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -60,7 +65,7 @@ async def _execute_initial( # pylint: disable=inconsistent-return-statements vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_sql_vulnerability_assessment_rule_baselines_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_sql_vulnerability_assessment_rule_baselines_operations.py index c1c4383201e5..701af3a29e46 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_sql_vulnerability_assessment_rule_baselines_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_sql_vulnerability_assessment_rule_baselines_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -35,6 +36,10 @@ build_list_by_baseline_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -94,7 +99,7 @@ def list_by_baseline( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) cls: ClsType[_models.DatabaseSqlVulnerabilityAssessmentRuleBaselineListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -183,7 +188,7 @@ async def get( :rtype: ~azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentRuleBaseline :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -346,7 +351,7 @@ async def create_or_update( :rtype: ~azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentRuleBaseline :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -436,7 +441,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_sql_vulnerability_assessment_scan_result_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_sql_vulnerability_assessment_scan_result_operations.py index 36d9d0eefa5f..146f9d9c1498 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_sql_vulnerability_assessment_scan_result_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_sql_vulnerability_assessment_scan_result_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -32,6 +33,10 @@ build_list_by_scan_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -93,7 +98,7 @@ def list_by_scan( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) cls: ClsType[_models.SQLVulnerabilityAssessmentScanListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -182,7 +187,7 @@ async def get( :rtype: ~azure.mgmt.sql.models.SqlVulnerabilityAssessmentScanResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_sql_vulnerability_assessment_scans_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_sql_vulnerability_assessment_scans_operations.py index 2d47d9a7a089..f0cd5139f43c 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_sql_vulnerability_assessment_scans_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_sql_vulnerability_assessment_scans_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -32,6 +33,10 @@ build_list_by_sql_vulnerability_assessments_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -88,7 +93,7 @@ def list_by_sql_vulnerability_assessments( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) cls: ClsType[_models.SqlVulnerabilityAssessmentScanRecordListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -171,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.sql.models.SqlVulnerabilityAssessmentScanRecord :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_sql_vulnerability_assessments_settings_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_sql_vulnerability_assessments_settings_operations.py index eefb4e06b459..d49903817240 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_sql_vulnerability_assessments_settings_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_sql_vulnerability_assessments_settings_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -32,6 +33,10 @@ build_list_by_database_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -80,7 +85,7 @@ def list_by_database( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) cls: ClsType[_models.SqlVulnerabilityAssessmentListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -160,7 +165,7 @@ async def get( :rtype: ~azure.mgmt.sql.models.SqlVulnerabilityAssessment :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_tables_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_tables_operations.py index 47a393e7ffca..b48b915c634d 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_tables_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_tables_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._database_tables_operations import build_get_request, build_list_by_schema_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -86,7 +91,7 @@ def list_by_schema( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.DatabaseTableListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -169,7 +174,7 @@ async def get( :rtype: ~azure.mgmt.sql.models.DatabaseTable :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_usages_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_usages_operations.py index c6c6c81570e3..f6116b108f10 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_usages_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_usages_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -28,6 +29,10 @@ from ..._vendor import _convert_request from ...operations._database_usages_operations import build_list_by_database_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -74,7 +79,7 @@ def list_by_database( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) cls: ClsType[_models.DatabaseUsageListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_vulnerability_assessment_rule_baselines_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_vulnerability_assessment_rule_baselines_operations.py index 30881b234934..be1fe393c796 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_vulnerability_assessment_rule_baselines_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_vulnerability_assessment_rule_baselines_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -32,6 +33,10 @@ build_get_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -89,7 +94,7 @@ async def get( :rtype: ~azure.mgmt.sql.models.DatabaseVulnerabilityAssessmentRuleBaseline :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -261,7 +266,7 @@ async def create_or_update( :rtype: ~azure.mgmt.sql.models.DatabaseVulnerabilityAssessmentRuleBaseline :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -354,7 +359,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_vulnerability_assessment_scans_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_vulnerability_assessment_scans_operations.py index 0ef903caa509..a3a5508b51fb 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_vulnerability_assessment_scans_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_vulnerability_assessment_scans_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union, cast +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar, Union, cast from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -36,6 +37,10 @@ build_list_by_database_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -68,7 +73,7 @@ async def _initiate_scan_initial( # pylint: disable=inconsistent-return-stateme scan_id: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -213,7 +218,7 @@ def list_by_database( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.VulnerabilityAssessmentScanRecordListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -296,7 +301,7 @@ async def get( :rtype: ~azure.mgmt.sql.models.VulnerabilityAssessmentScanRecord :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -370,7 +375,7 @@ async def export( :rtype: ~azure.mgmt.sql.models.DatabaseVulnerabilityAssessmentScansExport :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_vulnerability_assessments_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_vulnerability_assessments_operations.py index 3345bb61a2f6..bc4e2d1b4d1b 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_vulnerability_assessments_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_vulnerability_assessments_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -35,6 +36,10 @@ build_list_by_database_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -84,7 +89,7 @@ async def get( :rtype: ~azure.mgmt.sql.models.DatabaseVulnerabilityAssessment :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -229,7 +234,7 @@ async def create_or_update( :rtype: ~azure.mgmt.sql.models.DatabaseVulnerabilityAssessment :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -316,7 +321,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -383,7 +388,7 @@ def list_by_database( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.DatabaseVulnerabilityAssessmentListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_databases_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_databases_operations.py index 7b1bcdee2196..d4cddf5e798a 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_databases_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_databases_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -50,6 +51,10 @@ build_upgrade_data_warehouse_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -99,7 +104,7 @@ def list_metrics( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) cls: ClsType[_models.MetricListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -177,7 +182,7 @@ def list_metric_definitions( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) cls: ClsType[_models.MetricDefinitionListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -254,7 +259,7 @@ def list_by_server( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-02-01-preview")) cls: ClsType[_models.DatabaseListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -336,7 +341,7 @@ async def get( :rtype: ~azure.mgmt.sql.models.Database :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -390,7 +395,7 @@ async def _create_or_update_initial( parameters: Union[_models.Database, IO[bytes]], **kwargs: Any ) -> Optional[_models.Database]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -592,7 +597,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -699,7 +704,7 @@ async def _update_initial( parameters: Union[_models.DatabaseUpdate, IO[bytes]], **kwargs: Any ) -> Optional[_models.Database]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -902,7 +907,7 @@ async def _export_initial( parameters: Union[_models.ExportDatabaseDefinition, IO[bytes]], **kwargs: Any ) -> Optional[_models.ImportExportOperationResult]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1103,7 +1108,7 @@ async def _failover_initial( # pylint: disable=inconsistent-return-statements replica_type: Optional[Union[str, _models.ReplicaType]] = None, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1218,7 +1223,7 @@ async def _import_initial( parameters: Union[_models.ImportExistingDatabaseDefinition, IO[bytes]], **kwargs: Any ) -> Optional[_models.ImportExportOperationResult]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1496,7 +1501,7 @@ async def rename( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1551,7 +1556,7 @@ async def rename( # pylint: disable=inconsistent-return-statements async def _pause_initial( self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any ) -> Optional[_models.Database]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1662,7 +1667,7 @@ def get_long_running_output(pipeline_response): async def _resume_initial( self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any ) -> Optional[_models.Database]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1773,7 +1778,7 @@ def get_long_running_output(pipeline_response): async def _upgrade_data_warehouse_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1893,7 +1898,7 @@ def list_by_elastic_pool( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-02-01-preview")) cls: ClsType[_models.DatabaseListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1968,7 +1973,7 @@ def list_inaccessible_by_server( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-02-01-preview")) cls: ClsType[_models.DatabaseListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_deleted_servers_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_deleted_servers_operations.py index 5cf0366f4e33..0bf63df571b0 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_deleted_servers_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_deleted_servers_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union, cast +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar, Union, cast from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -36,6 +37,10 @@ build_recover_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -73,7 +78,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.DeletedServer"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.DeletedServerListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -136,7 +141,7 @@ async def get(self, location_name: str, deleted_server_name: str, **kwargs: Any) :rtype: ~azure.mgmt.sql.models.DeletedServer :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -195,7 +200,7 @@ def list_by_location(self, location_name: str, **kwargs: Any) -> AsyncIterable[" api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.DeletedServerListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -250,7 +255,7 @@ async def get_next(next_link=None): async def _recover_initial( self, location_name: str, deleted_server_name: str, **kwargs: Any ) -> Optional[_models.DeletedServer]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_distributed_availability_groups_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_distributed_availability_groups_operations.py index 50e76f03b53d..f14b80763b91 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_distributed_availability_groups_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_distributed_availability_groups_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -33,13 +34,15 @@ from ...operations._distributed_availability_groups_operations import ( build_create_or_update_request, build_delete_request, - build_failover_request, build_get_request, build_list_by_instance_request, - build_set_role_request, build_update_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -83,10 +86,10 @@ def list_by_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) cls: ClsType[_models.DistributedAvailabilityGroupsListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -133,8 +136,7 @@ async def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) return pipeline_response @@ -161,7 +163,7 @@ async def get( :rtype: ~azure.mgmt.sql.models.DistributedAvailabilityGroup :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -172,7 +174,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) cls: ClsType[_models.DistributedAvailabilityGroup] = kwargs.pop("cls", None) _request = build_get_request( @@ -196,8 +198,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) deserialized = self._deserialize("DistributedAvailabilityGroup", pipeline_response) @@ -214,7 +215,7 @@ async def _create_or_update_initial( parameters: Union[_models.DistributedAvailabilityGroup, IO[bytes]], **kwargs: Any ) -> Optional[_models.DistributedAvailabilityGroup]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -225,7 +226,7 @@ async def _create_or_update_initial( _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", "2023-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.DistributedAvailabilityGroup]] = kwargs.pop("cls", None) @@ -261,8 +262,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) deserialized = None if response.status_code == 200: @@ -367,7 +367,7 @@ async def begin_create_or_update( _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", "2023-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DistributedAvailabilityGroup] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -418,7 +418,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements distributed_availability_group_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -429,7 +429,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) _request = build_delete_request( @@ -453,8 +453,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) # type: ignore @@ -483,7 +482,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -528,7 +527,7 @@ async def _update_initial( parameters: Union[_models.DistributedAvailabilityGroup, IO[bytes]], **kwargs: Any ) -> Optional[_models.DistributedAvailabilityGroup]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -539,7 +538,7 @@ async def _update_initial( _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", "2023-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.DistributedAvailabilityGroup]] = kwargs.pop("cls", None) @@ -575,8 +574,7 @@ async def _update_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) deserialized = None if response.status_code == 200: @@ -678,7 +676,7 @@ async def begin_update( _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", "2023-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DistributedAvailabilityGroup] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -721,416 +719,3 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller[_models.DistributedAvailabilityGroup]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - - async def _failover_initial( - self, - resource_group_name: str, - managed_instance_name: str, - distributed_availability_group_name: str, - parameters: Union[_models.DistributedAvailabilityGroupsFailoverRequest, IO[bytes]], - **kwargs: Any - ) -> Optional[_models.DistributedAvailabilityGroup]: - error_map = { - 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 = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-08-01-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.DistributedAvailabilityGroup]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "DistributedAvailabilityGroupsFailoverRequest") - - _request = build_failover_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - distributed_availability_group_name=distributed_availability_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - _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, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("DistributedAvailabilityGroup", pipeline_response) - - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_failover( - self, - resource_group_name: str, - managed_instance_name: str, - distributed_availability_group_name: str, - parameters: _models.DistributedAvailabilityGroupsFailoverRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.DistributedAvailabilityGroup]: - """Performs requested failover type in this distributed availability group. - - :param resource_group_name: The name of the resource group that contains the resource. You can - obtain this value from the Azure Resource Manager API or the portal. Required. - :type resource_group_name: str - :param managed_instance_name: The name of the managed instance. Required. - :type managed_instance_name: str - :param distributed_availability_group_name: The distributed availability group name. Required. - :type distributed_availability_group_name: str - :param parameters: The distributed availability group failover request parameters. Required. - :type parameters: ~azure.mgmt.sql.models.DistributedAvailabilityGroupsFailoverRequest - :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 either DistributedAvailabilityGroup or the - result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.DistributedAvailabilityGroup] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_failover( - self, - resource_group_name: str, - managed_instance_name: str, - distributed_availability_group_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.DistributedAvailabilityGroup]: - """Performs requested failover type in this distributed availability group. - - :param resource_group_name: The name of the resource group that contains the resource. You can - obtain this value from the Azure Resource Manager API or the portal. Required. - :type resource_group_name: str - :param managed_instance_name: The name of the managed instance. Required. - :type managed_instance_name: str - :param distributed_availability_group_name: The distributed availability group name. Required. - :type distributed_availability_group_name: str - :param parameters: The distributed availability group failover request parameters. 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 AsyncLROPoller that returns either DistributedAvailabilityGroup or the - result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.DistributedAvailabilityGroup] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_failover( - self, - resource_group_name: str, - managed_instance_name: str, - distributed_availability_group_name: str, - parameters: Union[_models.DistributedAvailabilityGroupsFailoverRequest, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.DistributedAvailabilityGroup]: - """Performs requested failover type in this distributed availability group. - - :param resource_group_name: The name of the resource group that contains the resource. You can - obtain this value from the Azure Resource Manager API or the portal. Required. - :type resource_group_name: str - :param managed_instance_name: The name of the managed instance. Required. - :type managed_instance_name: str - :param distributed_availability_group_name: The distributed availability group name. Required. - :type distributed_availability_group_name: str - :param parameters: The distributed availability group failover request parameters. Is either a - DistributedAvailabilityGroupsFailoverRequest type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.DistributedAvailabilityGroupsFailoverRequest or - IO[bytes] - :return: An instance of AsyncLROPoller that returns either DistributedAvailabilityGroup or the - result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.DistributedAvailabilityGroup] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _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", "2023-08-01-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.DistributedAvailabilityGroup] = 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._failover_initial( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - distributed_availability_group_name=distributed_availability_group_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("DistributedAvailabilityGroup", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.DistributedAvailabilityGroup].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.DistributedAvailabilityGroup]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _set_role_initial( - self, - resource_group_name: str, - managed_instance_name: str, - distributed_availability_group_name: str, - parameters: Union[_models.DistributedAvailabilityGroupSetRole, IO[bytes]], - **kwargs: Any - ) -> Optional[_models.DistributedAvailabilityGroup]: - error_map = { - 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 = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-08-01-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.DistributedAvailabilityGroup]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "DistributedAvailabilityGroupSetRole") - - _request = build_set_role_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - distributed_availability_group_name=distributed_availability_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - _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, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize("DistributedAvailabilityGroup", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_set_role( - self, - resource_group_name: str, - managed_instance_name: str, - distributed_availability_group_name: str, - parameters: _models.DistributedAvailabilityGroupSetRole, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.DistributedAvailabilityGroup]: - """Sets the role for managed instance in a distributed availability group. - - :param resource_group_name: The name of the resource group that contains the resource. You can - obtain this value from the Azure Resource Manager API or the portal. Required. - :type resource_group_name: str - :param managed_instance_name: The name of the managed instance. Required. - :type managed_instance_name: str - :param distributed_availability_group_name: The distributed availability group name. Required. - :type distributed_availability_group_name: str - :param parameters: The distributed availability group set role request parameters. Required. - :type parameters: ~azure.mgmt.sql.models.DistributedAvailabilityGroupSetRole - :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 either DistributedAvailabilityGroup or the - result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.DistributedAvailabilityGroup] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_set_role( - self, - resource_group_name: str, - managed_instance_name: str, - distributed_availability_group_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.DistributedAvailabilityGroup]: - """Sets the role for managed instance in a distributed availability group. - - :param resource_group_name: The name of the resource group that contains the resource. You can - obtain this value from the Azure Resource Manager API or the portal. Required. - :type resource_group_name: str - :param managed_instance_name: The name of the managed instance. Required. - :type managed_instance_name: str - :param distributed_availability_group_name: The distributed availability group name. Required. - :type distributed_availability_group_name: str - :param parameters: The distributed availability group set role request parameters. 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 AsyncLROPoller that returns either DistributedAvailabilityGroup or the - result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.DistributedAvailabilityGroup] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_set_role( - self, - resource_group_name: str, - managed_instance_name: str, - distributed_availability_group_name: str, - parameters: Union[_models.DistributedAvailabilityGroupSetRole, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.DistributedAvailabilityGroup]: - """Sets the role for managed instance in a distributed availability group. - - :param resource_group_name: The name of the resource group that contains the resource. You can - obtain this value from the Azure Resource Manager API or the portal. Required. - :type resource_group_name: str - :param managed_instance_name: The name of the managed instance. Required. - :type managed_instance_name: str - :param distributed_availability_group_name: The distributed availability group name. Required. - :type distributed_availability_group_name: str - :param parameters: The distributed availability group set role request parameters. Is either a - DistributedAvailabilityGroupSetRole type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.DistributedAvailabilityGroupSetRole or IO[bytes] - :return: An instance of AsyncLROPoller that returns either DistributedAvailabilityGroup or the - result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.DistributedAvailabilityGroup] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _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", "2023-08-01-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.DistributedAvailabilityGroup] = 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._set_role_initial( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - distributed_availability_group_name=distributed_availability_group_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("DistributedAvailabilityGroup", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.DistributedAvailabilityGroup].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.DistributedAvailabilityGroup]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_elastic_pool_activities_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_elastic_pool_activities_operations.py index 6c83c1790e77..7e0d1cbfe24b 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_elastic_pool_activities_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_elastic_pool_activities_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -28,6 +29,10 @@ from ..._vendor import _convert_request from ...operations._elastic_pool_activities_operations import build_list_by_elastic_pool_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -75,7 +80,7 @@ def list_by_elastic_pool( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) cls: ClsType[_models.ElasticPoolActivityListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_elastic_pool_database_activities_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_elastic_pool_database_activities_operations.py index f2f53b54d839..2090b5aa69dd 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_elastic_pool_database_activities_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_elastic_pool_database_activities_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -28,6 +29,10 @@ from ..._vendor import _convert_request from ...operations._elastic_pool_database_activities_operations import build_list_by_elastic_pool_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -76,7 +81,7 @@ def list_by_elastic_pool( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) cls: ClsType[_models.ElasticPoolDatabaseActivityListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_elastic_pool_operations_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_elastic_pool_operations_operations.py index 0e2842258d51..8e75829f7a85 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_elastic_pool_operations_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_elastic_pool_operations_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._elastic_pool_operations_operations import build_cancel_request, build_list_by_elastic_pool_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -71,7 +76,7 @@ async def cancel( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -136,7 +141,7 @@ def list_by_elastic_pool( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.ElasticPoolOperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_elastic_pools_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_elastic_pools_operations.py index 361b10cd0600..5bbec78b38b1 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_elastic_pools_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_elastic_pools_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -41,6 +42,10 @@ build_update_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -90,7 +95,7 @@ def list_metrics( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) cls: ClsType[_models.MetricListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -168,7 +173,7 @@ def list_metric_definitions( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) cls: ClsType[_models.MetricDefinitionListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -245,7 +250,7 @@ def list_by_server( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[_models.ElasticPoolListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -316,7 +321,7 @@ async def get( :rtype: ~azure.mgmt.sql.models.ElasticPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -368,7 +373,7 @@ async def _create_or_update_initial( parameters: Union[_models.ElasticPool, IO[bytes]], **kwargs: Any ) -> Optional[_models.ElasticPool]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -570,7 +575,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, server_name: str, elastic_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -677,7 +682,7 @@ async def _update_initial( parameters: Union[_models.ElasticPoolUpdate, IO[bytes]], **kwargs: Any ) -> Optional[_models.ElasticPool]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -875,7 +880,7 @@ def get_long_running_output(pipeline_response): async def _failover_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, server_name: str, elastic_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_encryption_protectors_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_encryption_protectors_operations.py index db66fbff2977..ddea87e80ce5 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_encryption_protectors_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_encryption_protectors_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -37,6 +38,10 @@ build_revalidate_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -81,7 +86,7 @@ def list_by_server( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.EncryptionProtectorListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -156,7 +161,7 @@ async def get( :rtype: ~azure.mgmt.sql.models.EncryptionProtector :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -208,7 +213,7 @@ async def _create_or_update_initial( parameters: Union[_models.EncryptionProtector, IO[bytes]], **kwargs: Any ) -> Optional[_models.EncryptionProtector]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -411,7 +416,7 @@ async def _revalidate_initial( # pylint: disable=inconsistent-return-statements encryption_protector_name: Union[str, _models.EncryptionProtectorName], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_endpoint_certificates_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_endpoint_certificates_operations.py index 00c175f3d75b..0b10bab450da 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_endpoint_certificates_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_endpoint_certificates_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._endpoint_certificates_operations import build_get_request, build_list_by_instance_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -73,7 +78,7 @@ def list_by_instance( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) cls: ClsType[_models.EndpointCertificateListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -144,7 +149,7 @@ async def get( :rtype: ~azure.mgmt.sql.models.EndpointCertificate :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_extended_database_blob_auditing_policies_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_extended_database_blob_auditing_policies_operations.py index 3bf881422854..d98fe611aeeb 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_extended_database_blob_auditing_policies_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_extended_database_blob_auditing_policies_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Literal, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Literal, Optional, Type, TypeVar, Union, overload from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -34,6 +35,10 @@ build_list_by_database_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -82,7 +87,7 @@ def list_by_database( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) cls: ClsType[_models.ExtendedDatabaseBlobAuditingPolicyListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -153,7 +158,7 @@ async def get( :rtype: ~azure.mgmt.sql.models.ExtendedDatabaseBlobAuditingPolicy :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -284,7 +289,7 @@ async def create_or_update( :rtype: ~azure.mgmt.sql.models.ExtendedDatabaseBlobAuditingPolicy :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_extended_server_blob_auditing_policies_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_extended_server_blob_auditing_policies_operations.py index 5c1dd121d9d5..6e20b7407cc1 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_extended_server_blob_auditing_policies_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_extended_server_blob_auditing_policies_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Literal, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Literal, Optional, Type, TypeVar, Union, cast, overload from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -36,6 +37,10 @@ build_list_by_server_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -82,7 +87,7 @@ def list_by_server( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) cls: ClsType[_models.ExtendedServerBlobAuditingPolicyListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -150,7 +155,7 @@ async def get( :rtype: ~azure.mgmt.sql.models.ExtendedServerBlobAuditingPolicy :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -202,7 +207,7 @@ async def _create_or_update_initial( parameters: Union[_models.ExtendedServerBlobAuditingPolicy, IO[bytes]], **kwargs: Any ) -> Optional[_models.ExtendedServerBlobAuditingPolicy]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_failover_groups_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_failover_groups_operations.py index bf87e2d571df..d6e46183d502 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_failover_groups_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_failover_groups_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -41,6 +42,10 @@ build_update_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -82,10 +87,10 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01-preview")) cls: ClsType[_models.FailoverGroupListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -155,7 +160,7 @@ async def get( :rtype: ~azure.mgmt.sql.models.FailoverGroup :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -166,7 +171,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01-preview")) cls: ClsType[_models.FailoverGroup] = kwargs.pop("cls", None) _request = build_get_request( @@ -207,7 +212,7 @@ async def _create_or_update_initial( parameters: Union[_models.FailoverGroup, IO[bytes]], **kwargs: Any ) -> Optional[_models.FailoverGroup]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -218,7 +223,7 @@ async def _create_or_update_initial( _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", "2023-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.FailoverGroup]] = kwargs.pop("cls", None) @@ -359,7 +364,7 @@ async def begin_create_or_update( _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", "2023-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.FailoverGroup] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -406,7 +411,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, server_name: str, failover_group_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -417,7 +422,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) _request = build_delete_request( @@ -466,7 +471,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -511,7 +516,7 @@ async def _update_initial( parameters: Union[_models.FailoverGroupUpdate, IO[bytes]], **kwargs: Any ) -> Optional[_models.FailoverGroup]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -522,7 +527,7 @@ async def _update_initial( _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", "2023-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.FailoverGroup]] = kwargs.pop("cls", None) @@ -660,7 +665,7 @@ async def begin_update( _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", "2023-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.FailoverGroup] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -707,7 +712,7 @@ def get_long_running_output(pipeline_response): async def _failover_initial( self, resource_group_name: str, server_name: str, failover_group_name: str, **kwargs: Any ) -> Optional[_models.FailoverGroup]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -718,7 +723,7 @@ async def _failover_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01-preview")) cls: ClsType[Optional[_models.FailoverGroup]] = kwargs.pop("cls", None) _request = build_failover_request( @@ -774,7 +779,7 @@ async def begin_failover( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01-preview")) cls: ClsType[_models.FailoverGroup] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -818,7 +823,7 @@ def get_long_running_output(pipeline_response): async def _force_failover_allow_data_loss_initial( self, resource_group_name: str, server_name: str, failover_group_name: str, **kwargs: Any ) -> Optional[_models.FailoverGroup]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -829,7 +834,7 @@ async def _force_failover_allow_data_loss_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01-preview")) cls: ClsType[Optional[_models.FailoverGroup]] = kwargs.pop("cls", None) _request = build_force_failover_allow_data_loss_request( @@ -886,7 +891,7 @@ async def begin_force_failover_allow_data_loss( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01-preview")) cls: ClsType[_models.FailoverGroup] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -930,7 +935,7 @@ def get_long_running_output(pipeline_response): async def _try_planned_before_forced_failover_initial( # pylint: disable=name-too-long self, resource_group_name: str, server_name: str, failover_group_name: str, **kwargs: Any ) -> Optional[_models.FailoverGroup]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -941,7 +946,7 @@ async def _try_planned_before_forced_failover_initial( # pylint: disable=name-t _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01-preview")) cls: ClsType[Optional[_models.FailoverGroup]] = kwargs.pop("cls", None) _request = build_try_planned_before_forced_failover_request( @@ -1002,7 +1007,7 @@ async def begin_try_planned_before_forced_failover( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01-preview")) cls: ClsType[_models.FailoverGroup] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_firewall_rules_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_firewall_rules_operations.py index e739f4d219f4..4d1002fe6dbd 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_firewall_rules_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_firewall_rules_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -36,6 +37,10 @@ build_replace_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -76,7 +81,7 @@ async def get( :rtype: ~azure.mgmt.sql.models.FirewallRule :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -205,7 +210,7 @@ async def create_or_update( :rtype: ~azure.mgmt.sql.models.FirewallRule :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -282,7 +287,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -343,7 +348,7 @@ def list_by_server( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.FirewallRuleListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -471,7 +476,7 @@ async def replace( :rtype: ~azure.mgmt.sql.models.FirewallRule or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_geo_backup_policies_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_geo_backup_policies_operations.py index c7a0683251a2..d86b44cb82a1 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_geo_backup_policies_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_geo_backup_policies_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -34,6 +35,10 @@ build_list_by_database_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -153,7 +158,7 @@ async def create_or_update( :rtype: ~azure.mgmt.sql.models.GeoBackupPolicy :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -238,7 +243,7 @@ async def get( :rtype: ~azure.mgmt.sql.models.GeoBackupPolicy :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -306,7 +311,7 @@ def list_by_database( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) cls: ClsType[_models.GeoBackupPolicyListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_instance_failover_groups_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_instance_failover_groups_operations.py index 203b86eaf2a2..b9ec5a21c783 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_instance_failover_groups_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_instance_failover_groups_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -39,6 +40,10 @@ build_list_by_location_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -84,7 +89,7 @@ def list_by_location( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01-preview")) cls: ClsType[_models.InstanceFailoverGroupListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -154,7 +159,7 @@ async def get( :rtype: ~azure.mgmt.sql.models.InstanceFailoverGroup :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -206,7 +211,7 @@ async def _create_or_update_initial( parameters: Union[_models.InstanceFailoverGroup, IO[bytes]], **kwargs: Any ) -> Optional[_models.InstanceFailoverGroup]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -405,7 +410,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, location_name: str, failover_group_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -505,7 +510,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _failover_initial( self, resource_group_name: str, location_name: str, failover_group_name: str, **kwargs: Any ) -> Optional[_models.InstanceFailoverGroup]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -616,7 +621,7 @@ def get_long_running_output(pipeline_response): async def _force_failover_allow_data_loss_initial( self, resource_group_name: str, location_name: str, failover_group_name: str, **kwargs: Any ) -> Optional[_models.InstanceFailoverGroup]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_instance_pools_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_instance_pools_operations.py index 928fd6defb97..b49eaf55c27d 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_instance_pools_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_instance_pools_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -39,6 +40,10 @@ build_update_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -76,7 +81,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.InstancePool"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01-preview")) cls: ClsType[_models.InstancePoolListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -144,7 +149,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01-preview")) cls: ClsType[_models.InstancePoolListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -209,7 +214,7 @@ async def get(self, resource_group_name: str, instance_pool_name: str, **kwargs: :rtype: ~azure.mgmt.sql.models.InstancePool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -259,7 +264,7 @@ async def _create_or_update_initial( parameters: Union[_models.InstancePool, IO[bytes]], **kwargs: Any ) -> Optional[_models.InstancePool]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -447,7 +452,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, instance_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -547,7 +552,7 @@ async def _update_initial( parameters: Union[_models.InstancePoolUpdate, IO[bytes]], **kwargs: Any ) -> Optional[_models.InstancePool]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_ipv6_firewall_rules_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_ipv6_firewall_rules_operations.py index 9312c337475a..5326f8f5e7af 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_ipv6_firewall_rules_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_ipv6_firewall_rules_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -35,6 +36,10 @@ build_list_by_server_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -79,7 +84,7 @@ def list_by_server( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) cls: ClsType[_models.IPv6FirewallRuleListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -149,7 +154,7 @@ async def get( :rtype: ~azure.mgmt.sql.models.IPv6FirewallRule :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -280,7 +285,7 @@ async def create_or_update( :rtype: ~azure.mgmt.sql.models.IPv6FirewallRule :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -357,7 +362,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_job_agents_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_job_agents_operations.py index c981bedf4e80..0c78d914cc16 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_job_agents_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_job_agents_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -82,7 +87,7 @@ def list_by_server( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.JobAgentListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -152,7 +157,7 @@ async def get( :rtype: ~azure.mgmt.sql.models.JobAgent :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -204,7 +209,7 @@ async def _create_or_update_initial( parameters: Union[_models.JobAgent, IO[bytes]], **kwargs: Any ) -> Optional[_models.JobAgent]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -403,7 +408,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, server_name: str, job_agent_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -508,7 +513,7 @@ async def _update_initial( parameters: Union[_models.JobAgentUpdate, IO[bytes]], **kwargs: Any ) -> Optional[_models.JobAgent]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_job_credentials_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_job_credentials_operations.py index 03715b00524d..d88cde199d6b 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_job_credentials_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_job_credentials_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -35,6 +36,10 @@ build_list_by_agent_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -81,7 +86,7 @@ def list_by_agent( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.JobCredentialListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -154,7 +159,7 @@ async def get( :rtype: ~azure.mgmt.sql.models.JobCredential :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -293,7 +298,7 @@ async def create_or_update( :rtype: ~azure.mgmt.sql.models.JobCredential :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -373,7 +378,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_job_executions_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_job_executions_operations.py index e95670dfbcbb..3f4552027b87 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_job_executions_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_job_executions_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import datetime -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union, cast +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar, Union, cast from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -39,6 +40,10 @@ build_list_by_job_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -115,7 +120,7 @@ def list_by_agent( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.JobExecutionListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -203,7 +208,7 @@ async def cancel( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -248,7 +253,7 @@ async def cancel( # pylint: disable=inconsistent-return-statements async def _create_initial( self, resource_group_name: str, server_name: str, job_agent_name: str, job_name: str, **kwargs: Any ) -> Optional[_models.JobExecution]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -416,7 +421,7 @@ def list_by_job( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.JobExecutionListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -505,7 +510,7 @@ async def get( :rtype: ~azure.mgmt.sql.models.JobExecution :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -560,7 +565,7 @@ async def _create_or_update_initial( job_execution_id: str, **kwargs: Any ) -> Optional[_models.JobExecution]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_job_private_endpoints_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_job_private_endpoints_operations.py index 5b34d0ddfc53..71b4bfc19521 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_job_private_endpoints_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_job_private_endpoints_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -37,6 +38,10 @@ build_list_by_agent_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -83,7 +88,7 @@ def list_by_agent( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01-preview")) cls: ClsType[_models.JobPrivateEndpointListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -156,7 +161,7 @@ async def get( :rtype: ~azure.mgmt.sql.models.JobPrivateEndpoint :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -210,7 +215,7 @@ async def _create_or_update_initial( parameters: Union[_models.JobPrivateEndpoint, IO[bytes]], **kwargs: Any ) -> Optional[_models.JobPrivateEndpoint]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -422,7 +427,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, server_name: str, job_agent_name: str, private_endpoint_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_job_step_executions_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_job_step_executions_operations.py index b465f5e450ac..8b272b5638de 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_job_step_executions_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_job_step_executions_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import datetime -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._vendor import _convert_request from ...operations._job_step_executions_operations import build_get_request, build_list_by_job_execution_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -112,7 +117,7 @@ def list_by_job_execution( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.JobExecutionListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -205,7 +210,7 @@ async def get( :rtype: ~azure.mgmt.sql.models.JobExecution :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_job_steps_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_job_steps_operations.py index d342177236cf..c13ac212be39 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_job_steps_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_job_steps_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -37,6 +38,10 @@ build_list_by_version_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -93,7 +98,7 @@ def list_by_version( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.JobStepListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -179,7 +184,7 @@ async def get_by_version( :rtype: ~azure.mgmt.sql.models.JobStep :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -251,7 +256,7 @@ def list_by_job( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.JobStepListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -333,7 +338,7 @@ async def get( :rtype: ~azure.mgmt.sql.models.JobStep :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -482,7 +487,7 @@ async def create_or_update( :rtype: ~azure.mgmt.sql.models.JobStep :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -571,7 +576,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_job_target_executions_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_job_target_executions_operations.py index f11cdc657a19..cfc58cd8afe5 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_job_target_executions_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_job_target_executions_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import datetime -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -34,6 +35,10 @@ build_list_by_step_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -116,7 +121,7 @@ def list_by_job_execution( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.JobExecutionListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -241,7 +246,7 @@ def list_by_step( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.JobExecutionListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -338,7 +343,7 @@ async def get( :rtype: ~azure.mgmt.sql.models.JobExecution :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_job_target_groups_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_job_target_groups_operations.py index b1654352c197..dad2bd1d4b5d 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_job_target_groups_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_job_target_groups_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -35,6 +36,10 @@ build_list_by_agent_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -81,7 +86,7 @@ def list_by_agent( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.JobTargetGroupListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -154,7 +159,7 @@ async def get( :rtype: ~azure.mgmt.sql.models.JobTargetGroup :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -293,7 +298,7 @@ async def create_or_update( :rtype: ~azure.mgmt.sql.models.JobTargetGroup :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -373,7 +378,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_job_versions_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_job_versions_operations.py index aca0571fb133..d1a860f611a4 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_job_versions_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_job_versions_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._job_versions_operations import build_get_request, build_list_by_job_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -77,7 +82,7 @@ def list_by_job( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.JobVersionListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -159,7 +164,7 @@ async def get( :rtype: ~azure.mgmt.sql.models.JobVersion :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_jobs_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_jobs_operations.py index 3eef9d16bf8a..3c450752aee0 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_jobs_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_jobs_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -35,6 +36,10 @@ build_list_by_agent_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -81,7 +86,7 @@ def list_by_agent( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.JobListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -154,7 +159,7 @@ async def get( :rtype: ~azure.mgmt.sql.models.Job :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -292,7 +297,7 @@ async def create_or_update( :rtype: ~azure.mgmt.sql.models.Job :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -372,7 +377,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_ledger_digest_uploads_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_ledger_digest_uploads_operations.py index 118e6626fce0..e965755b5b5e 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_ledger_digest_uploads_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_ledger_digest_uploads_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -37,6 +38,10 @@ build_list_by_database_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -84,7 +89,7 @@ async def get( :rtype: ~azure.mgmt.sql.models.LedgerDigestUploads :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -138,7 +143,7 @@ async def _create_or_update_initial( parameters: Union[_models.LedgerDigestUploads, IO[bytes]], **kwargs: Any ) -> Optional[_models.LedgerDigestUploads]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -367,7 +372,7 @@ def list_by_database( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) cls: ClsType[_models.LedgerDigestUploadsListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -429,7 +434,7 @@ async def _disable_initial( ledger_digest_uploads: Union[str, _models.LedgerDigestUploadsName], **kwargs: Any ) -> Optional[_models.LedgerDigestUploads]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_long_term_retention_backups_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_long_term_retention_backups_operations.py index 5df48b2f7cb2..4e5e80ed47e3 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_long_term_retention_backups_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_long_term_retention_backups_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -49,6 +50,10 @@ build_update_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -101,7 +106,7 @@ def list_by_location( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01-preview")) cls: ClsType[_models.LongTermRetentionBackupListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -188,7 +193,7 @@ def list_by_server( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01-preview")) cls: ClsType[_models.LongTermRetentionBackupListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -279,7 +284,7 @@ def list_by_database( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01-preview")) cls: ClsType[_models.LongTermRetentionBackupListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -359,7 +364,7 @@ async def get( :rtype: ~azure.mgmt.sql.models.LongTermRetentionBackup :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -413,7 +418,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements backup_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -528,7 +533,7 @@ async def _change_access_tier_initial( parameters: Union[_models.ChangeLongTermRetentionBackupAccessTierParameters, IO[bytes]], **kwargs: Any ) -> Optional[_models.LongTermRetentionBackup]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -740,7 +745,7 @@ async def _copy_initial( parameters: Union[_models.CopyLongTermRetentionBackupParameters, IO[bytes]], **kwargs: Any ) -> Optional[_models.LongTermRetentionBackupOperationResult]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -954,7 +959,7 @@ async def _update_initial( parameters: Union[_models.UpdateLongTermRetentionBackupParameters, IO[bytes]], **kwargs: Any ) -> Optional[_models.LongTermRetentionBackupOperationResult]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1192,7 +1197,7 @@ def list_by_resource_group_location( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01-preview")) cls: ClsType[_models.LongTermRetentionBackupListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1284,7 +1289,7 @@ def list_by_resource_group_server( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01-preview")) cls: ClsType[_models.LongTermRetentionBackupListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1380,7 +1385,7 @@ def list_by_resource_group_database( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01-preview")) cls: ClsType[_models.LongTermRetentionBackupListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1465,7 +1470,7 @@ async def get_by_resource_group( :rtype: ~azure.mgmt.sql.models.LongTermRetentionBackup :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1521,7 +1526,7 @@ async def _delete_by_resource_group_initial( # pylint: disable=inconsistent-ret backup_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1643,7 +1648,7 @@ async def _change_access_tier_by_resource_group_initial( # pylint: disable=name parameters: Union[_models.ChangeLongTermRetentionBackupAccessTierParameters, IO[bytes]], **kwargs: Any ) -> Optional[_models.LongTermRetentionBackup]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1870,7 +1875,7 @@ async def _copy_by_resource_group_initial( parameters: Union[_models.CopyLongTermRetentionBackupParameters, IO[bytes]], **kwargs: Any ) -> Optional[_models.LongTermRetentionBackupOperationResult]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2099,7 +2104,7 @@ async def _update_by_resource_group_initial( parameters: Union[_models.UpdateLongTermRetentionBackupParameters, IO[bytes]], **kwargs: Any ) -> Optional[_models.LongTermRetentionBackupOperationResult]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_long_term_retention_managed_instance_backups_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_long_term_retention_managed_instance_backups_operations.py index 17e4f542ef6a..6e8c3662114d 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_long_term_retention_managed_instance_backups_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_long_term_retention_managed_instance_backups_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union, cast +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar, Union, cast from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -42,6 +43,10 @@ build_list_by_resource_group_location_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -83,7 +88,7 @@ async def get( :rtype: ~azure.mgmt.sql.models.ManagedInstanceLongTermRetentionBackup :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -131,7 +136,7 @@ async def get( async def _delete_initial( # pylint: disable=inconsistent-return-statements self, location_name: str, managed_instance_name: str, database_name: str, backup_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -267,7 +272,7 @@ def list_by_database( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01-preview")) cls: ClsType[_models.ManagedInstanceLongTermRetentionBackupListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -356,7 +361,7 @@ def list_by_instance( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01-preview")) cls: ClsType[_models.ManagedInstanceLongTermRetentionBackupListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -441,7 +446,7 @@ def list_by_location( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01-preview")) cls: ClsType[_models.ManagedInstanceLongTermRetentionBackupListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -522,7 +527,7 @@ async def get_by_resource_group( :rtype: ~azure.mgmt.sql.models.ManagedInstanceLongTermRetentionBackup :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -577,7 +582,7 @@ async def _delete_by_resource_group_initial( # pylint: disable=inconsistent-ret backup_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -728,7 +733,7 @@ def list_by_resource_group_database( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01-preview")) cls: ClsType[_models.ManagedInstanceLongTermRetentionBackupListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -822,7 +827,7 @@ def list_by_resource_group_instance( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01-preview")) cls: ClsType[_models.ManagedInstanceLongTermRetentionBackupListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -912,7 +917,7 @@ def list_by_resource_group_location( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01-preview")) cls: ClsType[_models.ManagedInstanceLongTermRetentionBackupListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_long_term_retention_policies_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_long_term_retention_policies_operations.py index 6a56d2bb6941..f09035e48321 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_long_term_retention_policies_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_long_term_retention_policies_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -36,6 +37,10 @@ build_list_by_database_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -83,7 +88,7 @@ def list_by_database( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01-preview")) cls: ClsType[_models.LongTermRetentionPolicyListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -162,7 +167,7 @@ async def get( :rtype: ~azure.mgmt.sql.models.LongTermRetentionPolicy :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -217,7 +222,7 @@ async def _create_or_update_initial( parameters: Union[_models.LongTermRetentionPolicy, IO[bytes]], **kwargs: Any ) -> Optional[_models.LongTermRetentionPolicy]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_maintenance_window_options_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_maintenance_window_options_operations.py index 640838bc2b3d..b70205f4ddaf 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_maintenance_window_options_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_maintenance_window_options_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -27,6 +28,10 @@ from ..._vendor import _convert_request from ...operations._maintenance_window_options_operations import build_get_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -75,7 +80,7 @@ async def get( :rtype: ~azure.mgmt.sql.models.MaintenanceWindowOptions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_maintenance_windows_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_maintenance_windows_operations.py index aa0f200989f3..fe92e0b647e5 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_maintenance_windows_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_maintenance_windows_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from ..._vendor import _convert_request from ...operations._maintenance_windows_operations import build_create_or_update_request, build_get_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -75,7 +80,7 @@ async def get( :rtype: ~azure.mgmt.sql.models.MaintenanceWindows :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -213,7 +218,7 @@ async def create_or_update( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_backup_short_term_retention_policies_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_backup_short_term_retention_policies_operations.py index 2a6c419ba182..f58dd5e1c42b 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_backup_short_term_retention_policies_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_backup_short_term_retention_policies_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -37,6 +38,10 @@ build_update_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -84,7 +89,7 @@ async def get( :rtype: ~azure.mgmt.sql.models.ManagedBackupShortTermRetentionPolicy :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -138,7 +143,7 @@ async def _create_or_update_initial( parameters: Union[_models.ManagedBackupShortTermRetentionPolicy, IO[bytes]], **kwargs: Any ) -> Optional[_models.ManagedBackupShortTermRetentionPolicy]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -354,7 +359,7 @@ async def _update_initial( parameters: Union[_models.ManagedBackupShortTermRetentionPolicy, IO[bytes]], **kwargs: Any ) -> Optional[_models.ManagedBackupShortTermRetentionPolicy]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -586,7 +591,7 @@ def list_by_database( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.ManagedBackupShortTermRetentionPolicyListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_advanced_threat_protection_settings_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_advanced_threat_protection_settings_operations.py index 4bedd317dd5d..5e160a12e845 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_advanced_threat_protection_settings_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_advanced_threat_protection_settings_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -34,6 +35,10 @@ build_list_by_database_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -82,7 +87,7 @@ def list_by_database( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01-preview")) cls: ClsType[_models.ManagedDatabaseAdvancedThreatProtectionListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -162,7 +167,7 @@ async def get( :rtype: ~azure.mgmt.sql.models.ManagedDatabaseAdvancedThreatProtection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -307,7 +312,7 @@ async def create_or_update( :rtype: ~azure.mgmt.sql.models.ManagedDatabaseAdvancedThreatProtection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_columns_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_columns_operations.py index 41b652160918..6eded8b98ed3 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_columns_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_columns_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, List, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, List, Optional, Type, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -33,6 +34,10 @@ build_list_by_table_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -99,7 +104,7 @@ def list_by_database( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.DatabaseColumnListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -195,7 +200,7 @@ def list_by_table( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.DatabaseColumnListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -282,7 +287,7 @@ async def get( :rtype: ~azure.mgmt.sql.models.DatabaseColumn :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_move_operations_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_move_operations_operations.py index d81fe2dfd7fc..7411d553ee22 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_move_operations_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_move_operations_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._managed_database_move_operations_operations import build_get_request, build_list_by_location_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -86,7 +91,7 @@ def list_by_location( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01-preview")) cls: ClsType[_models.ManagedDatabaseMoveOperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -158,7 +163,7 @@ async def get( :rtype: ~azure.mgmt.sql.models.ManagedDatabaseMoveOperationResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_queries_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_queries_operations.py index bd42888c0dfa..727ea3682899 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_queries_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_queries_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._managed_database_queries_operations import build_get_request, build_list_by_query_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -71,7 +76,7 @@ async def get( :rtype: ~azure.mgmt.sql.models.ManagedInstanceQuery :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -156,7 +161,7 @@ def list_by_query( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.ManagedInstanceQueryStatistics] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_recommended_sensitivity_labels_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_recommended_sensitivity_labels_operations.py index fa0d63049f45..ee5eef542533 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_recommended_sensitivity_labels_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_recommended_sensitivity_labels_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from ..._vendor import _convert_request from ...operations._managed_database_recommended_sensitivity_labels_operations import build_update_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -136,7 +141,7 @@ async def update( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_restore_details_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_restore_details_operations.py index 5b5f7b7b42c7..d997b19c78c4 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_restore_details_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_restore_details_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar, Union +import sys +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -27,6 +28,10 @@ from ..._vendor import _convert_request from ...operations._managed_database_restore_details_operations import build_get_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -74,7 +79,7 @@ async def get( :rtype: ~azure.mgmt.sql.models.ManagedDatabaseRestoreDetailsResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_schemas_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_schemas_operations.py index 91d49c82ffbd..df5b9c323d54 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_schemas_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_schemas_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._managed_database_schemas_operations import build_get_request, build_list_by_database_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -83,7 +88,7 @@ def list_by_database( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.DatabaseSchemaListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -157,7 +162,7 @@ async def get( :rtype: ~azure.mgmt.sql.models.DatabaseSchema :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_security_alert_policies_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_security_alert_policies_operations.py index 3e0fd432f89b..93cd3439ca2d 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_security_alert_policies_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_security_alert_policies_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -34,6 +35,10 @@ build_list_by_database_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -82,7 +87,7 @@ async def get( :rtype: ~azure.mgmt.sql.models.ManagedDatabaseSecurityAlertPolicy :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -224,7 +229,7 @@ async def create_or_update( :rtype: ~azure.mgmt.sql.models.ManagedDatabaseSecurityAlertPolicy :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -311,7 +316,7 @@ def list_by_database( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.ManagedDatabaseSecurityAlertPolicyListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_security_events_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_security_events_operations.py index 1f6a8d497ba9..7eef6b4d8c10 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_security_events_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_security_events_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -28,6 +29,10 @@ from ..._vendor import _convert_request from ...operations._managed_database_security_events_operations import build_list_by_database_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -93,7 +98,7 @@ def list_by_database( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.SecurityEventCollection] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_sensitivity_labels_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_sensitivity_labels_operations.py index 4634a794d78f..51b758fc3adf 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_sensitivity_labels_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_sensitivity_labels_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Literal, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Literal, Optional, Type, TypeVar, Union, overload from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -39,6 +40,10 @@ build_update_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -96,7 +101,7 @@ async def get( :rtype: ~azure.mgmt.sql.models.SensitivityLabel :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -256,7 +261,7 @@ async def create_or_update( :rtype: ~azure.mgmt.sql.models.SensitivityLabel :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -351,7 +356,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -426,7 +431,7 @@ async def disable_recommendation( # pylint: disable=inconsistent-return-stateme :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -502,7 +507,7 @@ async def enable_recommendation( # pylint: disable=inconsistent-return-statemen :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -584,7 +589,7 @@ def list_current_by_database( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.SensitivityLabelListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -725,7 +730,7 @@ async def update( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -815,7 +820,7 @@ def list_recommended_by_database( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.SensitivityLabelListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_tables_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_tables_operations.py index 56d08106c216..5da74cc001c2 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_tables_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_tables_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._managed_database_tables_operations import build_get_request, build_list_by_schema_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -86,7 +91,7 @@ def list_by_schema( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.DatabaseTableListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -169,7 +174,7 @@ async def get( :rtype: ~azure.mgmt.sql.models.DatabaseTable :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_transparent_data_encryption_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_transparent_data_encryption_operations.py index c5430cd2dfef..19df8b5ef159 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_transparent_data_encryption_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_transparent_data_encryption_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -34,6 +35,10 @@ build_list_by_database_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -82,7 +87,7 @@ async def get( :rtype: ~azure.mgmt.sql.models.ManagedTransparentDataEncryption :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -224,7 +229,7 @@ async def create_or_update( :rtype: ~azure.mgmt.sql.models.ManagedTransparentDataEncryption :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -311,7 +316,7 @@ def list_by_database( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.ManagedTransparentDataEncryptionListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_vulnerability_assessment_rule_baselines_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_vulnerability_assessment_rule_baselines_operations.py index affdbfcf06ff..3210d20911b8 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_vulnerability_assessment_rule_baselines_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_vulnerability_assessment_rule_baselines_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -32,6 +33,10 @@ build_get_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -89,7 +94,7 @@ async def get( :rtype: ~azure.mgmt.sql.models.DatabaseVulnerabilityAssessmentRuleBaseline :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -261,7 +266,7 @@ async def create_or_update( :rtype: ~azure.mgmt.sql.models.DatabaseVulnerabilityAssessmentRuleBaseline :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -354,7 +359,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_vulnerability_assessment_scans_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_vulnerability_assessment_scans_operations.py index 554488a3dac6..60e42f92b9cd 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_vulnerability_assessment_scans_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_vulnerability_assessment_scans_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union, cast +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar, Union, cast from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -36,6 +37,10 @@ build_list_by_database_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -68,7 +73,7 @@ async def _initiate_scan_initial( # pylint: disable=inconsistent-return-stateme scan_id: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -208,7 +213,7 @@ async def export( :rtype: ~azure.mgmt.sql.models.DatabaseVulnerabilityAssessmentScansExport :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -291,7 +296,7 @@ def list_by_database( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.VulnerabilityAssessmentScanRecordListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -374,7 +379,7 @@ async def get( :rtype: ~azure.mgmt.sql.models.VulnerabilityAssessmentScanRecord :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_vulnerability_assessments_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_vulnerability_assessments_operations.py index 185c083a36cb..d9d152f5d34a 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_vulnerability_assessments_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_vulnerability_assessments_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -35,6 +36,10 @@ build_list_by_database_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -84,7 +89,7 @@ async def get( :rtype: ~azure.mgmt.sql.models.DatabaseVulnerabilityAssessment :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -229,7 +234,7 @@ async def create_or_update( :rtype: ~azure.mgmt.sql.models.DatabaseVulnerabilityAssessment :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -316,7 +321,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -383,7 +388,7 @@ def list_by_database( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.DatabaseVulnerabilityAssessmentListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_databases_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_databases_operations.py index 39c1a45c97a5..f95e11732ac7 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_databases_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_databases_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -43,6 +44,10 @@ build_update_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -87,7 +92,7 @@ def list_by_instance( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[_models.ManagedDatabaseListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -157,7 +162,7 @@ async def get( :rtype: ~azure.mgmt.sql.models.ManagedDatabase :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -209,7 +214,7 @@ async def _create_or_update_initial( parameters: Union[_models.ManagedDatabase, IO[bytes]], **kwargs: Any ) -> Optional[_models.ManagedDatabase]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -408,7 +413,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, managed_instance_name: str, database_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -513,7 +518,7 @@ async def _update_initial( parameters: Union[_models.ManagedDatabaseUpdate, IO[bytes]], **kwargs: Any ) -> Optional[_models.ManagedDatabase]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -714,7 +719,7 @@ async def _cancel_move_initial( # pylint: disable=inconsistent-return-statement parameters: Union[_models.ManagedDatabaseMoveDefinition, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -902,7 +907,7 @@ async def _complete_move_initial( # pylint: disable=inconsistent-return-stateme parameters: Union[_models.ManagedDatabaseMoveDefinition, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1090,7 +1095,7 @@ async def _complete_restore_initial( # pylint: disable=inconsistent-return-stat parameters: Union[_models.CompleteDatabaseRestoreDefinition, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1280,7 +1285,7 @@ async def _start_move_initial( # pylint: disable=inconsistent-return-statements parameters: Union[_models.ManagedDatabaseStartMoveDefinition, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1481,7 +1486,7 @@ def list_inaccessible_by_instance( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[_models.ManagedDatabaseListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instance_administrators_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instance_administrators_operations.py index c2d6d3a67e0e..2898ae6b5ffd 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instance_administrators_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instance_administrators_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -37,6 +38,10 @@ build_list_by_instance_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -83,7 +88,7 @@ def list_by_instance( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.ManagedInstanceAdministratorListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -157,7 +162,7 @@ async def get( :rtype: ~azure.mgmt.sql.models.ManagedInstanceAdministrator :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -209,7 +214,7 @@ async def _create_or_update_initial( parameters: Union[_models.ManagedInstanceAdministrator, IO[bytes]], **kwargs: Any ) -> Optional[_models.ManagedInstanceAdministrator]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -412,7 +417,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements administrator_name: Union[str, _models.AdministratorName], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instance_advanced_threat_protection_settings_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instance_advanced_threat_protection_settings_operations.py index f10c0e4d5810..407620ae72e1 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instance_advanced_threat_protection_settings_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instance_advanced_threat_protection_settings_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -36,6 +37,10 @@ build_list_by_instance_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -82,7 +87,7 @@ def list_by_instance( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01-preview")) cls: ClsType[_models.ManagedInstanceAdvancedThreatProtectionListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -158,7 +163,7 @@ async def get( :rtype: ~azure.mgmt.sql.models.ManagedInstanceAdvancedThreatProtection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -210,7 +215,7 @@ async def _create_or_update_initial( parameters: Union[_models.ManagedInstanceAdvancedThreatProtection, IO[bytes]], **kwargs: Any ) -> Optional[_models.ManagedInstanceAdvancedThreatProtection]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instance_azure_ad_only_authentications_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instance_azure_ad_only_authentications_operations.py index 47c83cd49398..0bb614063650 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instance_azure_ad_only_authentications_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instance_azure_ad_only_authentications_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -37,6 +38,10 @@ build_list_by_instance_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -82,7 +87,7 @@ async def get( :rtype: ~azure.mgmt.sql.models.ManagedInstanceAzureADOnlyAuthentication :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -134,7 +139,7 @@ async def _create_or_update_initial( parameters: Union[_models.ManagedInstanceAzureADOnlyAuthentication, IO[bytes]], **kwargs: Any ) -> Optional[_models.ManagedInstanceAzureADOnlyAuthentication]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -349,7 +354,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements authentication_name: Union[str, _models.AuthenticationName], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -474,7 +479,7 @@ def list_by_instance( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.ManagedInstanceAzureADOnlyAuthListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instance_dtcs_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instance_dtcs_operations.py index c71ba46e99bd..976414caba41 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instance_dtcs_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instance_dtcs_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -36,6 +37,10 @@ build_list_by_managed_instance_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -80,7 +85,7 @@ def list_by_managed_instance( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01-preview")) cls: ClsType[_models.ManagedInstanceDtcListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -150,7 +155,7 @@ async def get( :rtype: ~azure.mgmt.sql.models.ManagedInstanceDtc :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -202,7 +207,7 @@ async def _create_or_update_initial( parameters: Union[_models.ManagedInstanceDtc, IO[bytes]], **kwargs: Any ) -> _models.ManagedInstanceDtc: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instance_encryption_protectors_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instance_encryption_protectors_operations.py index 7c7b8bbfd29b..0b3291b59761 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instance_encryption_protectors_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instance_encryption_protectors_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -37,6 +38,10 @@ build_revalidate_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -67,7 +72,7 @@ async def _revalidate_initial( # pylint: disable=inconsistent-return-statements encryption_protector_name: Union[str, _models.EncryptionProtectorName], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -192,7 +197,7 @@ def list_by_instance( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.ManagedInstanceEncryptionProtectorListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -267,7 +272,7 @@ async def get( :rtype: ~azure.mgmt.sql.models.ManagedInstanceEncryptionProtector :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -319,7 +324,7 @@ async def _create_or_update_initial( parameters: Union[_models.ManagedInstanceEncryptionProtector, IO[bytes]], **kwargs: Any ) -> Optional[_models.ManagedInstanceEncryptionProtector]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instance_keys_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instance_keys_operations.py index e7b0a5ddcf7c..8f8d7a315e02 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instance_keys_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instance_keys_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -37,6 +38,10 @@ build_list_by_instance_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -84,7 +89,7 @@ def list_by_instance( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.ManagedInstanceKeyListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -155,7 +160,7 @@ async def get( :rtype: ~azure.mgmt.sql.models.ManagedInstanceKey :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -207,7 +212,7 @@ async def _create_or_update_initial( parameters: Union[_models.ManagedInstanceKey, IO[bytes]], **kwargs: Any ) -> Optional[_models.ManagedInstanceKey]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -409,7 +414,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, managed_instance_name: str, key_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instance_long_term_retention_policies_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instance_long_term_retention_policies_operations.py index e7b1e4135eee..bdb01e0a7009 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instance_long_term_retention_policies_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instance_long_term_retention_policies_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -36,6 +37,10 @@ build_list_by_database_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -83,7 +88,7 @@ async def get( :rtype: ~azure.mgmt.sql.models.ManagedInstanceLongTermRetentionPolicy :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -137,7 +142,7 @@ async def _create_or_update_initial( parameters: Union[_models.ManagedInstanceLongTermRetentionPolicy, IO[bytes]], **kwargs: Any ) -> Optional[_models.ManagedInstanceLongTermRetentionPolicy]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -369,7 +374,7 @@ def list_by_database( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.ManagedInstanceLongTermRetentionPolicyListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instance_operations_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instance_operations_operations.py index c8434a3adee0..930d405154e0 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instance_operations_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instance_operations_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -33,6 +34,10 @@ build_list_by_managed_instance_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -79,7 +84,7 @@ def list_by_managed_instance( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.ManagedInstanceOperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -149,7 +154,7 @@ async def get( :rtype: ~azure.mgmt.sql.models.ManagedInstanceOperation :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -210,7 +215,7 @@ async def cancel( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instance_private_endpoint_connections_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instance_private_endpoint_connections_operations.py index b695b0ca7a37..6433765fabb6 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instance_private_endpoint_connections_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instance_private_endpoint_connections_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -37,6 +38,10 @@ build_list_by_managed_instance_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -77,7 +82,7 @@ async def get( :rtype: ~azure.mgmt.sql.models.ManagedInstancePrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -129,7 +134,7 @@ async def _create_or_update_initial( parameters: Union[_models.ManagedInstancePrivateEndpointConnection, IO[bytes]], **kwargs: Any ) -> Optional[_models.ManagedInstancePrivateEndpointConnection]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -328,7 +333,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, managed_instance_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -448,7 +453,7 @@ def list_by_managed_instance( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.ManagedInstancePrivateEndpointConnectionListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instance_private_link_resources_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instance_private_link_resources_operations.py index 8c1143b08573..cba0b9d13f29 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instance_private_link_resources_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instance_private_link_resources_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -32,6 +33,10 @@ build_list_by_managed_instance_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -78,7 +83,7 @@ def list_by_managed_instance( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.ManagedInstancePrivateLinkListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -148,7 +153,7 @@ async def get( :rtype: ~azure.mgmt.sql.models.ManagedInstancePrivateLink :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instance_tde_certificates_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instance_tde_certificates_operations.py index 2d16693a82c1..c760bf498ba1 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instance_tde_certificates_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instance_tde_certificates_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -30,6 +31,10 @@ from ..._vendor import _convert_request from ...operations._managed_instance_tde_certificates_operations import build_create_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -60,7 +65,7 @@ async def _create_initial( # pylint: disable=inconsistent-return-statements parameters: Union[_models.TdeCertificate, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instance_vulnerability_assessments_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instance_vulnerability_assessments_operations.py index 3a73dff7b38e..bf17df75b883 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instance_vulnerability_assessments_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instance_vulnerability_assessments_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -35,6 +36,10 @@ build_list_by_instance_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -81,7 +86,7 @@ async def get( :rtype: ~azure.mgmt.sql.models.ManagedInstanceVulnerabilityAssessment :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -222,7 +227,7 @@ async def create_or_update( :rtype: ~azure.mgmt.sql.models.ManagedInstanceVulnerabilityAssessment :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -305,7 +310,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -369,7 +374,7 @@ def list_by_instance( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.ManagedInstanceVulnerabilityAssessmentListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instances_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instances_operations.py index 2f95d67864dc..fb8ae6792669 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instances_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instances_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -40,12 +41,15 @@ build_list_by_resource_group_request, build_list_outbound_network_dependencies_by_managed_instance_request, build_list_request, - build_refresh_status_request, build_start_request, build_stop_request, build_update_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -82,10 +86,10 @@ def list(self, expand: Optional[str] = None, **kwargs: Any) -> AsyncIterable["_m _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[_models.ManagedInstanceListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -157,10 +161,10 @@ def list_by_instance_pool( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[_models.ManagedInstanceListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -232,10 +236,10 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[_models.ManagedInstanceListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -305,7 +309,7 @@ async def get( :rtype: ~azure.mgmt.sql.models.ManagedInstance :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -316,7 +320,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[_models.ManagedInstance] = kwargs.pop("cls", None) _request = build_get_request( @@ -356,7 +360,7 @@ async def _create_or_update_initial( parameters: Union[_models.ManagedInstance, IO[bytes]], **kwargs: Any ) -> Optional[_models.ManagedInstance]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -367,7 +371,7 @@ async def _create_or_update_initial( _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", "2023-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.ManagedInstance]] = kwargs.pop("cls", None) @@ -498,7 +502,7 @@ async def begin_create_or_update( _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", "2023-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ManagedInstance] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -544,7 +548,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, managed_instance_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -555,7 +559,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) _request = build_delete_request( @@ -601,7 +605,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -644,7 +648,7 @@ async def _update_initial( parameters: Union[_models.ManagedInstanceUpdate, IO[bytes]], **kwargs: Any ) -> Optional[_models.ManagedInstance]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -655,7 +659,7 @@ async def _update_initial( _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", "2023-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.ManagedInstance]] = kwargs.pop("cls", None) @@ -783,7 +787,7 @@ async def begin_update( _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", "2023-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ManagedInstance] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -833,7 +837,7 @@ async def _failover_initial( # pylint: disable=inconsistent-return-statements replica_type: Optional[Union[str, _models.ReplicaType]] = None, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -844,7 +848,7 @@ async def _failover_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) _request = build_failover_request( @@ -898,7 +902,7 @@ async def begin_failover( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -955,10 +959,10 @@ def list_outbound_network_dependencies_by_managed_instance( # pylint: disable=n _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[_models.OutboundEnvironmentEndpointCollection] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1011,121 +1015,10 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - async def _refresh_status_initial( + async def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, managed_instance_name: str, **kwargs: Any - ) -> Optional[_models.RefreshExternalGovernanceStatusOperationResultMI]: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01-preview")) - cls: ClsType[Optional[_models.RefreshExternalGovernanceStatusOperationResultMI]] = kwargs.pop("cls", None) - - _request = build_refresh_status_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - _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, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize("RefreshExternalGovernanceStatusOperationResultMI", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_refresh_status( - self, resource_group_name: str, managed_instance_name: str, **kwargs: Any - ) -> AsyncLROPoller[_models.RefreshExternalGovernanceStatusOperationResultMI]: - """Refresh external governance enablement status. - - :param resource_group_name: The name of the resource group that contains the resource. You can - obtain this value from the Azure Resource Manager API or the portal. Required. - :type resource_group_name: str - :param managed_instance_name: The name of the managed instance. Required. - :type managed_instance_name: str - :return: An instance of AsyncLROPoller that returns either - RefreshExternalGovernanceStatusOperationResultMI or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.RefreshExternalGovernanceStatusOperationResultMI] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01-preview")) - cls: ClsType[_models.RefreshExternalGovernanceStatusOperationResultMI] = 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._refresh_status_initial( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("RefreshExternalGovernanceStatusOperationResultMI", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.RefreshExternalGovernanceStatusOperationResultMI].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.RefreshExternalGovernanceStatusOperationResultMI]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _start_initial( - self, resource_group_name: str, managed_instance_name: str, **kwargs: Any - ) -> Optional[_models.ManagedInstance]: - error_map = { + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1136,8 +1029,8 @@ async def _start_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01-preview")) - cls: ClsType[Optional[_models.ManagedInstance]] = kwargs.pop("cls", None) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) + cls: ClsType[None] = kwargs.pop("cls", None) _request = build_start_request( resource_group_name=resource_group_name, @@ -1157,23 +1050,17 @@ async def _start_initial( response = pipeline_response.http_response - if response.status_code not in [200, 202]: + if response.status_code not in [202]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize("ManagedInstance", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_start( self, resource_group_name: str, managed_instance_name: str, **kwargs: Any - ) -> AsyncLROPoller[_models.ManagedInstance]: + ) -> AsyncLROPoller[None]: """Starts the managed instance. :param resource_group_name: The name of the resource group that contains the resource. You can @@ -1181,21 +1068,20 @@ async def begin_start( :type resource_group_name: str :param managed_instance_name: The name of the managed instance. Required. :type managed_instance_name: str - :return: An instance of AsyncLROPoller that returns either ManagedInstance or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedInstance] + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01-preview")) - cls: ClsType[_models.ManagedInstance] = kwargs.pop("cls", None) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) + cls: ClsType[None] = 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_initial( + raw_result = await self._start_initial( # type: ignore resource_group_name=resource_group_name, managed_instance_name=managed_instance_name, api_version=api_version, @@ -1206,11 +1092,9 @@ async def begin_start( ) kwargs.pop("error_map", None) - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ManagedInstance", pipeline_response) + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast( @@ -1221,20 +1105,18 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller[_models.ManagedInstance].from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller[_models.ManagedInstance]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - async def _stop_initial( + async def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, managed_instance_name: str, **kwargs: Any - ) -> Optional[_models.ManagedInstance]: - error_map = { + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1245,8 +1127,8 @@ async def _stop_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01-preview")) - cls: ClsType[Optional[_models.ManagedInstance]] = kwargs.pop("cls", None) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) + cls: ClsType[None] = kwargs.pop("cls", None) _request = build_stop_request( resource_group_name=resource_group_name, @@ -1266,23 +1148,17 @@ async def _stop_initial( response = pipeline_response.http_response - if response.status_code not in [200, 202]: + if response.status_code not in [202]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize("ManagedInstance", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_stop( self, resource_group_name: str, managed_instance_name: str, **kwargs: Any - ) -> AsyncLROPoller[_models.ManagedInstance]: + ) -> AsyncLROPoller[None]: """Stops the managed instance. :param resource_group_name: The name of the resource group that contains the resource. You can @@ -1290,21 +1166,20 @@ async def begin_stop( :type resource_group_name: str :param managed_instance_name: The name of the managed instance. Required. :type managed_instance_name: str - :return: An instance of AsyncLROPoller that returns either ManagedInstance or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedInstance] + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01-preview")) - cls: ClsType[_models.ManagedInstance] = kwargs.pop("cls", None) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) + cls: ClsType[None] = 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._stop_initial( + raw_result = await self._stop_initial( # type: ignore resource_group_name=resource_group_name, managed_instance_name=managed_instance_name, api_version=api_version, @@ -1315,11 +1190,9 @@ async def begin_stop( ) kwargs.pop("error_map", None) - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ManagedInstance", pipeline_response) + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast( @@ -1330,15 +1203,13 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller[_models.ManagedInstance].from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller[_models.ManagedInstance]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list_by_managed_instance( @@ -1387,10 +1258,10 @@ def list_by_managed_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[_models.TopQueriesListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_ledger_digest_uploads_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_ledger_digest_uploads_operations.py index 51a04a0cb835..9972dca0a4e5 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_ledger_digest_uploads_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_ledger_digest_uploads_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -37,6 +38,10 @@ build_list_by_database_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -85,7 +90,7 @@ def list_by_database( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[_models.ManagedLedgerDigestUploadsListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -163,7 +168,7 @@ async def get( :rtype: ~azure.mgmt.sql.models.ManagedLedgerDigestUploads :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -217,7 +222,7 @@ async def _create_or_update_initial( parameters: Union[_models.ManagedLedgerDigestUploads, IO[bytes]], **kwargs: Any ) -> Optional[_models.ManagedLedgerDigestUploads]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -435,7 +440,7 @@ async def _disable_initial( ledger_digest_uploads: Union[str, _models.ManagedLedgerDigestUploadsName], **kwargs: Any ) -> Optional[_models.ManagedLedgerDigestUploads]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_restorable_dropped_database_backup_short_term_retention_policies_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_restorable_dropped_database_backup_short_term_retention_policies_operations.py index 4cdb3a00f952..f090058092f9 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_restorable_dropped_database_backup_short_term_retention_policies_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_restorable_dropped_database_backup_short_term_retention_policies_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -37,6 +38,10 @@ build_update_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -84,7 +89,7 @@ async def get( :rtype: ~azure.mgmt.sql.models.ManagedBackupShortTermRetentionPolicy :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -138,7 +143,7 @@ async def _create_or_update_initial( parameters: Union[_models.ManagedBackupShortTermRetentionPolicy, IO[bytes]], **kwargs: Any ) -> Optional[_models.ManagedBackupShortTermRetentionPolicy]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -354,7 +359,7 @@ async def _update_initial( parameters: Union[_models.ManagedBackupShortTermRetentionPolicy, IO[bytes]], **kwargs: Any ) -> Optional[_models.ManagedBackupShortTermRetentionPolicy]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -586,7 +591,7 @@ def list_by_restorable_dropped_database( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.ManagedBackupShortTermRetentionPolicyListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_server_dns_aliases_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_server_dns_aliases_operations.py index 7dabd9c743e2..0d192b47556b 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_server_dns_aliases_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_server_dns_aliases_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -38,6 +39,10 @@ build_list_by_managed_instance_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -83,7 +88,7 @@ def list_by_managed_instance( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) cls: ClsType[_models.ManagedServerDnsAliasListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -153,7 +158,7 @@ async def get( :rtype: ~azure.mgmt.sql.models.ManagedServerDnsAlias :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -205,7 +210,7 @@ async def _create_or_update_initial( parameters: Union[_models.ManagedServerDnsAliasCreation, IO[bytes]], **kwargs: Any ) -> Optional[_models.ManagedServerDnsAlias]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -404,7 +409,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, managed_instance_name: str, dns_alias_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -509,7 +514,7 @@ async def _acquire_initial( parameters: Union[_models.ManagedServerDnsAliasAcquisition, IO[bytes]], **kwargs: Any ) -> Optional[_models.ManagedServerDnsAlias]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_server_security_alert_policies_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_server_security_alert_policies_operations.py index 3f8f0bfec97c..9697d79bae91 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_server_security_alert_policies_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_server_security_alert_policies_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -36,6 +37,10 @@ build_list_by_instance_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -80,7 +85,7 @@ async def get( :rtype: ~azure.mgmt.sql.models.ManagedServerSecurityAlertPolicy :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -132,7 +137,7 @@ async def _create_or_update_initial( parameters: Union[_models.ManagedServerSecurityAlertPolicy, IO[bytes]], **kwargs: Any ) -> Optional[_models.ManagedServerSecurityAlertPolicy]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -351,7 +356,7 @@ def list_by_instance( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.ManagedServerSecurityAlertPolicyListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_operations.py index af93f10cc6d4..c1c99a419924 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -28,6 +29,10 @@ from ..._vendor import _convert_request from ...operations._operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -65,7 +70,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_outbound_firewall_rules_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_outbound_firewall_rules_operations.py index 7637bbe367b0..3d817cf93f9c 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_outbound_firewall_rules_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_outbound_firewall_rules_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -37,6 +38,10 @@ build_list_by_server_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -77,7 +82,7 @@ async def get( :rtype: ~azure.mgmt.sql.models.OutboundFirewallRule :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -129,7 +134,7 @@ async def _create_or_update_initial( parameters: Union[_models.OutboundFirewallRule, IO[bytes]], **kwargs: Any ) -> Optional[_models.OutboundFirewallRule]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -327,7 +332,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, server_name: str, outbound_rule_fqdn: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -446,7 +451,7 @@ def list_by_server( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) cls: ClsType[_models.OutboundFirewallRuleListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_private_endpoint_connections_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_private_endpoint_connections_operations.py index 699c4eace003..e401c014d706 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_private_endpoint_connections_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_private_endpoint_connections_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -37,6 +38,10 @@ build_list_by_server_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -83,7 +88,7 @@ def list_by_server( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[_models.PrivateEndpointConnectionListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -153,7 +158,7 @@ async def get( :rtype: ~azure.mgmt.sql.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -205,7 +210,7 @@ async def _create_or_update_initial( parameters: Union[_models.PrivateEndpointConnection, IO[bytes]], **kwargs: Any ) -> Optional[_models.PrivateEndpointConnection]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -400,7 +405,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, server_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_private_link_resources_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_private_link_resources_operations.py index 7fa0d4286320..91e6c9e614f5 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_private_link_resources_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_private_link_resources_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._private_link_resources_operations import build_get_request, build_list_by_server_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -73,7 +78,7 @@ def list_by_server( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.PrivateLinkResourceListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -143,7 +148,7 @@ async def get( :rtype: ~azure.mgmt.sql.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_recommended_sensitivity_labels_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_recommended_sensitivity_labels_operations.py index 5847a7acc22d..15f83b7317fb 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_recommended_sensitivity_labels_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_recommended_sensitivity_labels_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from ..._vendor import _convert_request from ...operations._recommended_sensitivity_labels_operations import build_update_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -136,7 +141,7 @@ async def update( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_recoverable_databases_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_recoverable_databases_operations.py index 50d4a0ab73dc..0b016952ee91 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_recoverable_databases_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_recoverable_databases_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._recoverable_databases_operations import build_get_request, build_list_by_server_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -73,7 +78,7 @@ def list_by_server( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[_models.RecoverableDatabaseListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -154,7 +159,7 @@ async def get( :rtype: ~azure.mgmt.sql.models.RecoverableDatabase :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_recoverable_managed_databases_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_recoverable_managed_databases_operations.py index ab9084f00cdc..98c0f1753e6c 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_recoverable_managed_databases_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_recoverable_managed_databases_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._recoverable_managed_databases_operations import build_get_request, build_list_by_instance_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -75,7 +80,7 @@ def list_by_instance( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.RecoverableManagedDatabaseListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -145,7 +150,7 @@ async def get( :rtype: ~azure.mgmt.sql.models.RecoverableManagedDatabase :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_replication_links_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_replication_links_operations.py index 3d5931670d0c..288a43f5bb2c 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_replication_links_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_replication_links_operations.py @@ -6,7 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union, cast +from io import IOBase +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -30,14 +32,20 @@ from ... import models as _models from ..._vendor import _convert_request from ...operations._replication_links_operations import ( + build_create_or_update_request, build_delete_request, build_failover_allow_data_loss_request, build_failover_request, build_get_request, build_list_by_database_request, build_list_by_server_request, + build_update_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -81,10 +89,10 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01-preview")) cls: ClsType[_models.ReplicationLinkListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -157,7 +165,7 @@ async def get( :rtype: ~azure.mgmt.sql.models.ReplicationLink :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -168,7 +176,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01-preview")) cls: ClsType[_models.ReplicationLink] = kwargs.pop("cls", None) _request = build_get_request( @@ -202,10 +210,223 @@ async def get( return deserialized # type: ignore + async def _create_or_update_initial( + self, + resource_group_name: str, + server_name: str, + database_name: str, + link_id: str, + parameters: Union[_models.ReplicationLink, IO[bytes]], + **kwargs: Any + ) -> Optional[_models.ReplicationLink]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01-preview")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ReplicationLink]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "ReplicationLink") + + _request = build_create_or_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + link_id=link_id, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _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, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("ReplicationLink", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + link_id: str, + parameters: _models.ReplicationLink, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ReplicationLink]: + """Updates the replication link type. + + :param resource_group_name: The name of the resource group that contains the resource. You can + obtain this value from the Azure Resource Manager API or the portal. Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param link_id: Required. + :type link_id: str + :param parameters: Required. + :type parameters: ~azure.mgmt.sql.models.ReplicationLink + :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 either ReplicationLink or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ReplicationLink] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + link_id: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ReplicationLink]: + """Updates the replication link type. + + :param resource_group_name: The name of the resource group that contains the resource. You can + obtain this value from the Azure Resource Manager API or the portal. Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param link_id: Required. + :type link_id: str + :param parameters: 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 AsyncLROPoller that returns either ReplicationLink or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ReplicationLink] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + link_id: str, + parameters: Union[_models.ReplicationLink, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.ReplicationLink]: + """Updates the replication link type. + + :param resource_group_name: The name of the resource group that contains the resource. You can + obtain this value from the Azure Resource Manager API or the portal. Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param link_id: Required. + :type link_id: str + :param parameters: Is either a ReplicationLink type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.sql.models.ReplicationLink or IO[bytes] + :return: An instance of AsyncLROPoller that returns either ReplicationLink or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ReplicationLink] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _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", "2023-05-01-preview")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ReplicationLink] = 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._create_or_update_initial( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + link_id=link_id, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ReplicationLink", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ReplicationLink].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ReplicationLink]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, server_name: str, database_name: str, link_id: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -216,7 +437,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) _request = build_delete_request( @@ -268,7 +489,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -306,10 +527,223 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- ) return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + async def _update_initial( + self, + resource_group_name: str, + server_name: str, + database_name: str, + link_id: str, + parameters: Union[_models.ReplicationLinkUpdate, IO[bytes]], + **kwargs: Any + ) -> Optional[_models.ReplicationLink]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01-preview")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ReplicationLink]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "ReplicationLinkUpdate") + + _request = build_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + link_id=link_id, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _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, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("ReplicationLink", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + link_id: str, + parameters: _models.ReplicationLinkUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ReplicationLink]: + """Updates the replication link type. + + :param resource_group_name: The name of the resource group that contains the resource. You can + obtain this value from the Azure Resource Manager API or the portal. Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param link_id: Required. + :type link_id: str + :param parameters: Required. + :type parameters: ~azure.mgmt.sql.models.ReplicationLinkUpdate + :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 either ReplicationLink or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ReplicationLink] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + link_id: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ReplicationLink]: + """Updates the replication link type. + + :param resource_group_name: The name of the resource group that contains the resource. You can + obtain this value from the Azure Resource Manager API or the portal. Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param link_id: Required. + :type link_id: str + :param parameters: 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 AsyncLROPoller that returns either ReplicationLink or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ReplicationLink] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + link_id: str, + parameters: Union[_models.ReplicationLinkUpdate, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.ReplicationLink]: + """Updates the replication link type. + + :param resource_group_name: The name of the resource group that contains the resource. You can + obtain this value from the Azure Resource Manager API or the portal. Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param link_id: Required. + :type link_id: str + :param parameters: Is either a ReplicationLinkUpdate type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.sql.models.ReplicationLinkUpdate or IO[bytes] + :return: An instance of AsyncLROPoller that returns either ReplicationLink or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ReplicationLink] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _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", "2023-05-01-preview")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ReplicationLink] = 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._update_initial( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + link_id=link_id, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ReplicationLink", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ReplicationLink].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ReplicationLink]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + async def _failover_initial( self, resource_group_name: str, server_name: str, database_name: str, link_id: str, **kwargs: Any ) -> Optional[_models.ReplicationLink]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -320,7 +754,7 @@ async def _failover_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01-preview")) cls: ClsType[Optional[_models.ReplicationLink]] = kwargs.pop("cls", None) _request = build_failover_request( @@ -379,7 +813,7 @@ async def begin_failover( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01-preview")) cls: ClsType[_models.ReplicationLink] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -424,7 +858,7 @@ def get_long_running_output(pipeline_response): async def _failover_allow_data_loss_initial( self, resource_group_name: str, server_name: str, database_name: str, link_id: str, **kwargs: Any ) -> Optional[_models.ReplicationLink]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -435,7 +869,7 @@ async def _failover_allow_data_loss_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01-preview")) cls: ClsType[Optional[_models.ReplicationLink]] = kwargs.pop("cls", None) _request = build_failover_allow_data_loss_request( @@ -494,7 +928,7 @@ async def begin_failover_allow_data_loss( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01-preview")) cls: ClsType[_models.ReplicationLink] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -554,10 +988,10 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01-preview")) cls: ClsType[_models.ReplicationLinkListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_restorable_dropped_databases_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_restorable_dropped_databases_operations.py index 2ff68426de1f..55bb5f2834cc 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_restorable_dropped_databases_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_restorable_dropped_databases_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._restorable_dropped_databases_operations import build_get_request, build_list_by_server_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -75,7 +80,7 @@ def list_by_server( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[_models.RestorableDroppedDatabaseListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -156,7 +161,7 @@ async def get( :rtype: ~azure.mgmt.sql.models.RestorableDroppedDatabase :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_restorable_dropped_managed_databases_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_restorable_dropped_managed_databases_operations.py index 228879788909..a0bee524de82 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_restorable_dropped_managed_databases_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_restorable_dropped_managed_databases_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -32,6 +33,10 @@ build_list_by_instance_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -78,7 +83,7 @@ def list_by_instance( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01-preview")) cls: ClsType[_models.RestorableDroppedManagedDatabaseListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -148,7 +153,7 @@ async def get( :rtype: ~azure.mgmt.sql.models.RestorableDroppedManagedDatabase :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_restore_points_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_restore_points_operations.py index 0a6f2a29ce64..e2ead3b43a31 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_restore_points_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_restore_points_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -37,6 +38,10 @@ build_list_by_database_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -83,7 +88,7 @@ def list_by_database( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.RestorePointListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -145,7 +150,7 @@ async def _create_initial( parameters: Union[_models.CreateDatabaseRestorePointDefinition, IO[bytes]], **kwargs: Any ) -> Optional[_models.RestorePoint]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -360,7 +365,7 @@ async def get( :rtype: ~azure.mgmt.sql.models.RestorePoint :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -424,7 +429,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sensitivity_labels_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sensitivity_labels_operations.py index 54c28484156f..7c30c550779a 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sensitivity_labels_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sensitivity_labels_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Literal, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Literal, Optional, Type, TypeVar, Union, overload from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -39,6 +40,10 @@ build_update_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -99,7 +104,7 @@ def list_current_by_database( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.SensitivityLabelListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -240,7 +245,7 @@ async def update( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -330,7 +335,7 @@ def list_recommended_by_database( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.SensitivityLabelListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -418,7 +423,7 @@ async def enable_recommendation( # pylint: disable=inconsistent-return-statemen :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -493,7 +498,7 @@ async def disable_recommendation( # pylint: disable=inconsistent-return-stateme :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -572,7 +577,7 @@ async def get( :rtype: ~azure.mgmt.sql.models.SensitivityLabel :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -732,7 +737,7 @@ async def create_or_update( :rtype: ~azure.mgmt.sql.models.SensitivityLabel :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -827,7 +832,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_advanced_threat_protection_settings_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_advanced_threat_protection_settings_operations.py index d33883ee3b22..9e003cbdb43e 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_advanced_threat_protection_settings_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_advanced_threat_protection_settings_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -36,6 +37,10 @@ build_list_by_server_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -82,7 +87,7 @@ def list_by_server( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) cls: ClsType[_models.LogicalServerAdvancedThreatProtectionListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -158,7 +163,7 @@ async def get( :rtype: ~azure.mgmt.sql.models.ServerAdvancedThreatProtection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -210,7 +215,7 @@ async def _create_or_update_initial( parameters: Union[_models.ServerAdvancedThreatProtection, IO[bytes]], **kwargs: Any ) -> Optional[_models.ServerAdvancedThreatProtection]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_advisors_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_advisors_operations.py index 333a10871aa2..a78ab2707ff5 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_advisors_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_advisors_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, List, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, List, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -32,6 +33,10 @@ build_update_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -72,7 +77,7 @@ async def list_by_server( :rtype: list[~azure.mgmt.sql.models.Advisor] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -133,7 +138,7 @@ async def get( :rtype: ~azure.mgmt.sql.models.Advisor :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -262,7 +267,7 @@ async def update( :rtype: ~azure.mgmt.sql.models.Advisor :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_automatic_tuning_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_automatic_tuning_operations.py index faecea885e5a..107f364d50f5 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_automatic_tuning_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_automatic_tuning_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from ..._vendor import _convert_request from ...operations._server_automatic_tuning_operations import build_get_request, build_update_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -64,7 +69,7 @@ async def get(self, resource_group_name: str, server_name: str, **kwargs: Any) - :rtype: ~azure.mgmt.sql.models.ServerAutomaticTuning :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -183,7 +188,7 @@ async def update( :rtype: ~azure.mgmt.sql.models.ServerAutomaticTuning :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_azure_ad_administrators_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_azure_ad_administrators_operations.py index 70851fb8eb74..9a3973472051 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_azure_ad_administrators_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_azure_ad_administrators_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -37,6 +38,10 @@ build_list_by_server_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -82,7 +87,7 @@ async def get( :rtype: ~azure.mgmt.sql.models.ServerAzureADAdministrator :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -134,7 +139,7 @@ async def _create_or_update_initial( parameters: Union[_models.ServerAzureADAdministrator, IO[bytes]], **kwargs: Any ) -> Optional[_models.ServerAzureADAdministrator]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -340,7 +345,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements administrator_name: Union[str, _models.AdministratorName], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -465,7 +470,7 @@ def list_by_server( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.AdministratorListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_azure_ad_only_authentications_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_azure_ad_only_authentications_operations.py index 91a8436e0edb..da9cbb713062 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_azure_ad_only_authentications_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_azure_ad_only_authentications_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -37,6 +38,10 @@ build_list_by_server_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -82,7 +87,7 @@ async def get( :rtype: ~azure.mgmt.sql.models.ServerAzureADOnlyAuthentication :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -134,7 +139,7 @@ async def _create_or_update_initial( parameters: Union[_models.ServerAzureADOnlyAuthentication, IO[bytes]], **kwargs: Any ) -> Optional[_models.ServerAzureADOnlyAuthentication]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -349,7 +354,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements authentication_name: Union[str, _models.AuthenticationName], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -474,7 +479,7 @@ def list_by_server( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.AzureADOnlyAuthListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_blob_auditing_policies_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_blob_auditing_policies_operations.py index 7b86a7ad544c..ed24672a5eca 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_blob_auditing_policies_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_blob_auditing_policies_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Literal, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Literal, Optional, Type, TypeVar, Union, cast, overload from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -36,6 +37,10 @@ build_list_by_server_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -82,7 +87,7 @@ def list_by_server( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) cls: ClsType[_models.ServerBlobAuditingPolicyListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -148,7 +153,7 @@ async def get(self, resource_group_name: str, server_name: str, **kwargs: Any) - :rtype: ~azure.mgmt.sql.models.ServerBlobAuditingPolicy :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -200,7 +205,7 @@ async def _create_or_update_initial( parameters: Union[_models.ServerBlobAuditingPolicy, IO[bytes]], **kwargs: Any ) -> Optional[_models.ServerBlobAuditingPolicy]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_communication_links_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_communication_links_operations.py index 8c38b78baa6c..4556477b54d8 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_communication_links_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_communication_links_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -37,6 +38,10 @@ build_list_by_server_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -77,7 +82,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -134,7 +139,7 @@ async def get( :rtype: ~azure.mgmt.sql.models.ServerCommunicationLink :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -186,7 +191,7 @@ async def _create_or_update_initial( parameters: Union[_models.ServerCommunicationLink, IO[bytes]], **kwargs: Any ) -> Optional[_models.ServerCommunicationLink]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -401,7 +406,7 @@ def list_by_server( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) cls: ClsType[_models.ServerCommunicationLinkListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_configuration_options_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_configuration_options_operations.py index f0a87fcd4c31..21ac06786b2a 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_configuration_options_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_configuration_options_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -36,6 +37,10 @@ build_list_by_managed_instance_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -82,7 +87,7 @@ def list_by_managed_instance( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[_models.ServerConfigurationOptionListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -158,7 +163,7 @@ async def get( :rtype: ~azure.mgmt.sql.models.ServerConfigurationOption :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -210,7 +215,7 @@ async def _create_or_update_initial( parameters: Union[_models.ServerConfigurationOption, IO[bytes]], **kwargs: Any ) -> _models.ServerConfigurationOption: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_connection_policies_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_connection_policies_operations.py index 3026cc62cbdf..90b73877e2f1 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_connection_policies_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_connection_policies_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -36,6 +37,10 @@ build_list_by_server_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -80,7 +85,7 @@ async def get( :rtype: ~azure.mgmt.sql.models.ServerConnectionPolicy :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -132,7 +137,7 @@ async def _create_or_update_initial( parameters: Union[_models.ServerConnectionPolicy, IO[bytes]], **kwargs: Any ) -> Optional[_models.ServerConnectionPolicy]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -347,7 +352,7 @@ def list_by_server( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01-preview")) cls: ClsType[_models.ServerConnectionPolicyListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_dev_ops_audit_settings_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_dev_ops_audit_settings_operations.py index 4b71f2d7b2e4..8b2263d80d17 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_dev_ops_audit_settings_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_dev_ops_audit_settings_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -36,6 +37,10 @@ build_list_by_server_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -82,7 +87,7 @@ def list_by_server( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01-preview")) cls: ClsType[_models.ServerDevOpsAuditSettingsListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -156,7 +161,7 @@ async def get( :rtype: ~azure.mgmt.sql.models.ServerDevOpsAuditingSettings :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -208,7 +213,7 @@ async def _create_or_update_initial( parameters: Union[_models.ServerDevOpsAuditingSettings, IO[bytes]], **kwargs: Any ) -> Optional[_models.ServerDevOpsAuditingSettings]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_dns_aliases_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_dns_aliases_operations.py index fabc6b713223..f71e6852aef6 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_dns_aliases_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_dns_aliases_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -38,6 +39,10 @@ build_list_by_server_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -78,7 +83,7 @@ async def get( :rtype: ~azure.mgmt.sql.models.ServerDnsAlias :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -125,7 +130,7 @@ async def get( async def _create_or_update_initial( self, resource_group_name: str, server_name: str, dns_alias_name: str, **kwargs: Any ) -> Optional[_models.ServerDnsAlias]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -239,7 +244,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, server_name: str, dns_alias_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -357,7 +362,7 @@ def list_by_server( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.ServerDnsAliasListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -418,7 +423,7 @@ async def _acquire_initial( parameters: Union[_models.ServerDnsAliasAcquisition, IO[bytes]], **kwargs: Any ) -> Optional[_models.ServerDnsAlias]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_keys_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_keys_operations.py index f430649f6b65..8230bb90ba50 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_keys_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_keys_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -37,6 +38,10 @@ build_list_by_server_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -81,7 +86,7 @@ def list_by_server( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.ServerKeyListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -149,7 +154,7 @@ async def get(self, resource_group_name: str, server_name: str, key_name: str, * :rtype: ~azure.mgmt.sql.models.ServerKey :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -201,7 +206,7 @@ async def _create_or_update_initial( parameters: Union[_models.ServerKey, IO[bytes]], **kwargs: Any ) -> Optional[_models.ServerKey]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -409,7 +414,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, server_name: str, key_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_operations_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_operations_operations.py index 13f671a72c69..2a4b4f34d57f 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_operations_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_operations_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -28,6 +29,10 @@ from ..._vendor import _convert_request from ...operations._server_operations_operations import build_list_by_server_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -72,7 +77,7 @@ def list_by_server( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.ServerOperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_security_alert_policies_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_security_alert_policies_operations.py index 44de0d75d19d..7d589acf5513 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_security_alert_policies_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_security_alert_policies_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -36,6 +37,10 @@ build_list_by_server_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -80,7 +85,7 @@ async def get( :rtype: ~azure.mgmt.sql.models.ServerSecurityAlertPolicy :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -132,7 +137,7 @@ async def _create_or_update_initial( parameters: Union[_models.ServerSecurityAlertPolicy, IO[bytes]], **kwargs: Any ) -> Optional[_models.ServerSecurityAlertPolicy]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -348,7 +353,7 @@ def list_by_server( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.LogicalServerSecurityAlertPolicyListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_trust_certificates_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_trust_certificates_operations.py index 10b09d13cc43..5dfb613aba87 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_trust_certificates_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_trust_certificates_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -37,6 +38,10 @@ build_list_by_instance_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -83,7 +88,7 @@ def list_by_instance( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) cls: ClsType[_models.ServerTrustCertificatesListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -153,7 +158,7 @@ async def get( :rtype: ~azure.mgmt.sql.models.ServerTrustCertificate :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -205,7 +210,7 @@ async def _create_or_update_initial( parameters: Union[_models.ServerTrustCertificate, IO[bytes]], **kwargs: Any ) -> Optional[_models.ServerTrustCertificate]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -404,7 +409,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, managed_instance_name: str, certificate_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_trust_groups_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_trust_groups_operations.py index b2eb29b4e583..90c670a52416 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_trust_groups_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_trust_groups_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -38,6 +39,10 @@ build_list_by_location_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -78,7 +83,7 @@ async def get( :rtype: ~azure.mgmt.sql.models.ServerTrustGroup :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -130,7 +135,7 @@ async def _create_or_update_initial( parameters: Union[_models.ServerTrustGroup, IO[bytes]], **kwargs: Any ) -> Optional[_models.ServerTrustGroup]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -329,7 +334,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, location_name: str, server_trust_group_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -447,7 +452,7 @@ def list_by_location( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.ServerTrustGroupListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -521,7 +526,7 @@ def list_by_instance( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.ServerTrustGroupListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_usages_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_usages_operations.py index 4986abc6a24e..bf4a60d3913e 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_usages_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_usages_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -28,6 +29,10 @@ from ..._vendor import _convert_request from ...operations._server_usages_operations import build_list_by_server_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -72,7 +77,7 @@ def list_by_server( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) cls: ClsType[_models.ServerUsageListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_vulnerability_assessments_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_vulnerability_assessments_operations.py index 2d986371640f..972f090a7f4d 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_vulnerability_assessments_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_vulnerability_assessments_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -35,6 +36,10 @@ build_list_by_server_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -81,7 +86,7 @@ async def get( :rtype: ~azure.mgmt.sql.models.ServerVulnerabilityAssessment :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -222,7 +227,7 @@ async def create_or_update( :rtype: ~azure.mgmt.sql.models.ServerVulnerabilityAssessment :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -305,7 +310,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -368,7 +373,7 @@ def list_by_server( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.ServerVulnerabilityAssessmentListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_servers_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_servers_operations.py index 2de89a069322..0f598bba82ef 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_servers_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_servers_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -42,6 +43,10 @@ build_update_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -110,7 +115,7 @@ async def check_name_availability( :rtype: ~azure.mgmt.sql.models.CheckNameAvailabilityResponse :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -180,7 +185,7 @@ def list(self, expand: Optional[str] = None, **kwargs: Any) -> AsyncIterable["_m api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01-preview")) cls: ClsType[_models.ServerListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -254,7 +259,7 @@ def list_by_resource_group( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01-preview")) cls: ClsType[_models.ServerListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -325,7 +330,7 @@ async def get( :rtype: ~azure.mgmt.sql.models.Server :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -373,7 +378,7 @@ async def get( async def _create_or_update_initial( self, resource_group_name: str, server_name: str, parameters: Union[_models.Server, IO[bytes]], **kwargs: Any ) -> Optional[_models.Server]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -558,7 +563,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, server_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -657,7 +662,7 @@ async def _update_initial( parameters: Union[_models.ServerUpdate, IO[bytes]], **kwargs: Any ) -> Optional[_models.Server]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -847,7 +852,7 @@ async def _import_database_initial( parameters: Union[_models.ImportNewDatabaseDefinition, IO[bytes]], **kwargs: Any ) -> Optional[_models.ImportExportOperationResult]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1033,7 +1038,7 @@ def get_long_running_output(pipeline_response): async def _refresh_status_initial( self, resource_group_name: str, server_name: str, **kwargs: Any ) -> Optional[_models.RefreshExternalGovernanceStatusOperationResult]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_service_objectives_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_service_objectives_operations.py index ae6b78e130b4..ea33bca83f3c 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_service_objectives_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_service_objectives_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._service_objectives_operations import build_get_request, build_list_by_server_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -69,7 +74,7 @@ async def get( :rtype: ~azure.mgmt.sql.models.ServiceObjective :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -134,7 +139,7 @@ def list_by_server( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) cls: ClsType[_models.ServiceObjectiveListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sql_agent_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sql_agent_operations.py index 0700e7ab70ea..e01228f24ce8 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sql_agent_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sql_agent_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from ..._vendor import _convert_request from ...operations._sql_agent_operations import build_create_or_update_request, build_get_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -66,7 +71,7 @@ async def get( :rtype: ~azure.mgmt.sql.models.SqlAgentConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -184,7 +189,7 @@ async def create_or_update( :rtype: ~azure.mgmt.sql.models.SqlAgentConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sql_vulnerability_assessment_baseline_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sql_vulnerability_assessment_baseline_operations.py index 6c830e26c1d5..4ef9bc30e081 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sql_vulnerability_assessment_baseline_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sql_vulnerability_assessment_baseline_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Literal, Optional, TypeVar, Union +import sys +from typing import Any, AsyncIterable, Callable, Dict, Literal, Optional, Type, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -32,6 +33,10 @@ build_list_by_sql_vulnerability_assessment_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -88,7 +93,7 @@ def list_by_sql_vulnerability_assessment( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) cls: ClsType[_models.DatabaseSqlVulnerabilityAssessmentBaselineSetListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -170,7 +175,7 @@ async def get( :rtype: ~azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentBaselineSet :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sql_vulnerability_assessment_baselines_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sql_vulnerability_assessment_baselines_operations.py index a17273387e57..ecbf67790a04 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sql_vulnerability_assessment_baselines_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sql_vulnerability_assessment_baselines_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Literal, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Literal, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from ..._vendor import _convert_request from ...operations._sql_vulnerability_assessment_baselines_operations import build_create_or_update_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -150,7 +155,7 @@ async def create_or_update( :rtype: ~azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentBaselineSet :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sql_vulnerability_assessment_execute_scan_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sql_vulnerability_assessment_execute_scan_operations.py index 15ac2e52ee0f..e0508662d6fd 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sql_vulnerability_assessment_execute_scan_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sql_vulnerability_assessment_execute_scan_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Literal, Optional, TypeVar, Union, cast +import sys +from typing import Any, Callable, Dict, Literal, Optional, Type, TypeVar, Union, cast from azure.core.exceptions import ( ClientAuthenticationError, @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._sql_vulnerability_assessment_execute_scan_operations import build_execute_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -59,7 +64,7 @@ async def _execute_initial( # pylint: disable=inconsistent-return-statements vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sql_vulnerability_assessment_rule_baseline_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sql_vulnerability_assessment_rule_baseline_operations.py index 8db4ddcc414e..ecc70902b478 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sql_vulnerability_assessment_rule_baseline_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sql_vulnerability_assessment_rule_baseline_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Literal, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Literal, Optional, Type, TypeVar, Union, overload from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -34,6 +35,10 @@ build_list_by_baseline_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -93,7 +98,7 @@ def list_by_baseline( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) cls: ClsType[_models.DatabaseSqlVulnerabilityAssessmentRuleBaselineListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -179,7 +184,7 @@ async def get( :rtype: ~azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentRuleBaseline :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -336,7 +341,7 @@ async def create_or_update( :rtype: ~azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentRuleBaseline :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sql_vulnerability_assessment_rule_baselines_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sql_vulnerability_assessment_rule_baselines_operations.py index 393f80f8696d..9ca23d8aef52 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sql_vulnerability_assessment_rule_baselines_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sql_vulnerability_assessment_rule_baselines_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Literal, Optional, TypeVar, Union +import sys +from typing import Any, Callable, Dict, Literal, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -27,6 +28,10 @@ from ..._vendor import _convert_request from ...operations._sql_vulnerability_assessment_rule_baselines_operations import build_delete_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -78,7 +83,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sql_vulnerability_assessment_scan_result_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sql_vulnerability_assessment_scan_result_operations.py index 19c409cf8361..54fccc45e6df 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sql_vulnerability_assessment_scan_result_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sql_vulnerability_assessment_scan_result_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Literal, Optional, TypeVar, Union +import sys +from typing import Any, AsyncIterable, Callable, Dict, Literal, Optional, Type, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -32,6 +33,10 @@ build_list_by_scan_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -93,7 +98,7 @@ def list_by_scan( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) cls: ClsType[_models.SQLVulnerabilityAssessmentScanListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -179,7 +184,7 @@ async def get( :rtype: ~azure.mgmt.sql.models.SqlVulnerabilityAssessmentScanResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sql_vulnerability_assessment_scans_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sql_vulnerability_assessment_scans_operations.py index 7438933f21d3..d1ccfe0f5811 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sql_vulnerability_assessment_scans_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sql_vulnerability_assessment_scans_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Literal, Optional, TypeVar, Union +import sys +from typing import Any, AsyncIterable, Callable, Dict, Literal, Optional, Type, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -32,6 +33,10 @@ build_list_by_sql_vulnerability_assessments_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -88,7 +93,7 @@ def list_by_sql_vulnerability_assessments( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) cls: ClsType[_models.SqlVulnerabilityAssessmentScanRecordListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -168,7 +173,7 @@ async def get( :rtype: ~azure.mgmt.sql.models.SqlVulnerabilityAssessmentScanRecord :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sql_vulnerability_assessments_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sql_vulnerability_assessments_operations.py index 272dceccaf9d..e3cf6d02ea60 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sql_vulnerability_assessments_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sql_vulnerability_assessments_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar, Union +import sys +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -27,6 +28,10 @@ from ..._vendor import _convert_request from ...operations._sql_vulnerability_assessments_operations import build_delete_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -72,7 +77,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sql_vulnerability_assessments_settings_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sql_vulnerability_assessments_settings_operations.py index 5beee70c4ad2..ab45f887010a 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sql_vulnerability_assessments_settings_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sql_vulnerability_assessments_settings_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -34,6 +35,10 @@ build_list_by_server_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -80,7 +85,7 @@ def list_by_server( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) cls: ClsType[_models.SqlVulnerabilityAssessmentListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -156,7 +161,7 @@ async def get( :rtype: ~azure.mgmt.sql.models.SqlVulnerabilityAssessment :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -288,7 +293,7 @@ async def create_or_update( :rtype: ~azure.mgmt.sql.models.SqlVulnerabilityAssessment :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_start_stop_managed_instance_schedules_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_start_stop_managed_instance_schedules_operations.py index eed9e5af9c04..3567614baf78 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_start_stop_managed_instance_schedules_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_start_stop_managed_instance_schedules_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -35,6 +36,10 @@ build_list_by_instance_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -81,7 +86,7 @@ def list_by_instance( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[_models.StartStopManagedInstanceScheduleListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -156,7 +161,7 @@ async def get( :rtype: ~azure.mgmt.sql.models.StartStopManagedInstanceSchedule :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -288,7 +293,7 @@ async def create_or_update( :rtype: ~azure.mgmt.sql.models.StartStopManagedInstanceSchedule :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -370,7 +375,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_subscription_usages_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_subscription_usages_operations.py index e3355bc02069..9f215891a9b2 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_subscription_usages_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_subscription_usages_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._subscription_usages_operations import build_get_request, build_list_by_location_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -68,7 +73,7 @@ def list_by_location(self, location_name: str, **kwargs: Any) -> AsyncIterable[" api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.SubscriptionUsageListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -132,7 +137,7 @@ async def get(self, location_name: str, usage_name: str, **kwargs: Any) -> _mode :rtype: ~azure.mgmt.sql.models.SubscriptionUsage :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_synapse_link_workspaces_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_synapse_link_workspaces_operations.py index af8f84ff960e..e4e46074600d 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_synapse_link_workspaces_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_synapse_link_workspaces_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -28,6 +29,10 @@ from ..._vendor import _convert_request from ...operations._synapse_link_workspaces_operations import build_list_by_database_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -75,7 +80,7 @@ def list_by_database( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01-preview")) cls: ClsType[_models.SynapseLinkWorkspaceListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sync_agents_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sync_agents_operations.py index 72e7dfe4fee9..8fd647674785 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sync_agents_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sync_agents_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -39,6 +40,10 @@ build_list_linked_databases_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -79,7 +84,7 @@ async def get( :rtype: ~azure.mgmt.sql.models.SyncAgent :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -131,7 +136,7 @@ async def _create_or_update_initial( parameters: Union[_models.SyncAgent, IO[bytes]], **kwargs: Any ) -> Optional[_models.SyncAgent]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -330,7 +335,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, server_name: str, sync_agent_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -448,7 +453,7 @@ def list_by_server( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.SyncAgentListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -518,7 +523,7 @@ async def generate_key( :rtype: ~azure.mgmt.sql.models.SyncAgentKeyProperties :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -586,7 +591,7 @@ def list_linked_databases( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.SyncAgentLinkedDatabaseListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sync_groups_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sync_groups_operations.py index bbd3328dd0c4..8bdaf243b812 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sync_groups_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sync_groups_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -44,6 +45,10 @@ build_update_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -87,7 +92,7 @@ def list_sync_database_ids( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.SyncDatabaseIdListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -142,7 +147,7 @@ async def get_next(next_link=None): async def _refresh_hub_schema_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, server_name: str, database_name: str, sync_group_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -270,7 +275,7 @@ def list_hub_schemas( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.SyncFullSchemaPropertiesListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -370,7 +375,7 @@ def list_logs( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.SyncGroupLogListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -448,7 +453,7 @@ async def cancel_sync( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -508,7 +513,7 @@ async def trigger_sync( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -568,7 +573,7 @@ async def get( :rtype: ~azure.mgmt.sql.models.SyncGroup :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -622,7 +627,7 @@ async def _create_or_update_initial( parameters: Union[_models.SyncGroup, IO[bytes]], **kwargs: Any ) -> Optional[_models.SyncGroup]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -832,7 +837,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, server_name: str, database_name: str, sync_group_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -942,7 +947,7 @@ async def _update_initial( parameters: Union[_models.SyncGroup, IO[bytes]], **kwargs: Any ) -> Optional[_models.SyncGroup]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1169,7 +1174,7 @@ def list_by_database( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.SyncGroupListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sync_members_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sync_members_operations.py index 28c3a7e4cadd..da5d27a4d1ef 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sync_members_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sync_members_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -40,6 +41,10 @@ build_update_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -91,7 +96,7 @@ async def get( :rtype: ~azure.mgmt.sql.models.SyncMember :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -147,7 +152,7 @@ async def _create_or_update_initial( parameters: Union[_models.SyncMember, IO[bytes]], **kwargs: Any ) -> Optional[_models.SyncMember]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -377,7 +382,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements sync_member_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -499,7 +504,7 @@ async def _update_initial( parameters: Union[_models.SyncMember, IO[bytes]], **kwargs: Any ) -> Optional[_models.SyncMember]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -742,7 +747,7 @@ def list_by_sync_group( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.SyncMemberListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -833,7 +838,7 @@ def list_member_schemas( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.SyncFullSchemaPropertiesListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -898,7 +903,7 @@ async def _refresh_member_schema_initial( # pylint: disable=inconsistent-return sync_member_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_tde_certificates_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_tde_certificates_operations.py index ca69b9a04708..d12da2b588f2 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_tde_certificates_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_tde_certificates_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -30,6 +31,10 @@ from ..._vendor import _convert_request from ...operations._tde_certificates_operations import build_create_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -60,7 +65,7 @@ async def _create_initial( # pylint: disable=inconsistent-return-statements parameters: Union[_models.TdeCertificate, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_time_zones_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_time_zones_operations.py index 8a4867cbfc95..4f1912db3032 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_time_zones_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_time_zones_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._time_zones_operations import build_get_request, build_list_by_location_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -68,7 +73,7 @@ def list_by_location(self, location_name: str, **kwargs: Any) -> AsyncIterable[" api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.TimeZoneListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -132,7 +137,7 @@ async def get(self, location_name: str, time_zone_id: str, **kwargs: Any) -> _mo :rtype: ~azure.mgmt.sql.models.TimeZone :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_transparent_data_encryptions_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_transparent_data_encryptions_operations.py index 2426ff8101bc..4853d918bcae 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_transparent_data_encryptions_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_transparent_data_encryptions_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -36,6 +37,10 @@ build_list_by_database_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -85,7 +90,7 @@ def list_by_database( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[_models.LogicalDatabaseTransparentDataEncryptionListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -164,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.sql.models.LogicalDatabaseTransparentDataEncryption :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -218,7 +223,7 @@ async def _create_or_update_initial( parameters: Union[_models.LogicalDatabaseTransparentDataEncryption, IO[bytes]], **kwargs: Any ) -> Optional[_models.LogicalDatabaseTransparentDataEncryption]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_usages_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_usages_operations.py index 2ff183d6b53c..8cf1b2bf46cb 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_usages_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_usages_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -28,6 +29,10 @@ from ..._vendor import _convert_request from ...operations._usages_operations import build_list_by_instance_pool_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -75,7 +80,7 @@ def list_by_instance_pool( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) cls: ClsType[_models.UsageListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_virtual_clusters_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_virtual_clusters_operations.py index b49a7bd8ef17..23dcee6e15fa 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_virtual_clusters_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_virtual_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -39,6 +40,10 @@ build_update_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -76,7 +81,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.VirtualCluster"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01-preview")) cls: ClsType[_models.VirtualClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -146,7 +151,7 @@ def list_by_resource_group( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01-preview")) cls: ClsType[_models.VirtualClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -211,7 +216,7 @@ async def get(self, resource_group_name: str, virtual_cluster_name: str, **kwarg :rtype: ~azure.mgmt.sql.models.VirtualCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -257,7 +262,7 @@ async def get(self, resource_group_name: str, virtual_cluster_name: str, **kwarg async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, virtual_cluster_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -357,7 +362,7 @@ async def _update_initial( parameters: Union[_models.VirtualClusterUpdate, IO[bytes]], **kwargs: Any ) -> Optional[_models.VirtualCluster]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -542,7 +547,7 @@ def get_long_running_output(pipeline_response): async def _update_dns_servers_initial( self, resource_group_name: str, virtual_cluster_name: str, **kwargs: Any ) -> Optional[_models.UpdateVirtualClusterDnsServersOperation]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_virtual_network_rules_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_virtual_network_rules_operations.py index a72b630abb2f..0c17ac53e872 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_virtual_network_rules_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_virtual_network_rules_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -37,6 +38,10 @@ build_list_by_server_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -77,7 +82,7 @@ async def get( :rtype: ~azure.mgmt.sql.models.VirtualNetworkRule :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -129,7 +134,7 @@ async def _create_or_update_initial( parameters: Union[_models.VirtualNetworkRule, IO[bytes]], **kwargs: Any ) -> Optional[_models.VirtualNetworkRule]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -328,7 +333,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, server_name: str, virtual_network_rule_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -446,7 +451,7 @@ def list_by_server( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.VirtualNetworkRuleListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_workload_classifiers_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_workload_classifiers_operations.py index 3b61ac3dede8..0c3a2897aa21 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_workload_classifiers_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_workload_classifiers_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -37,6 +38,10 @@ build_list_by_workload_group_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -88,7 +93,7 @@ async def get( :rtype: ~azure.mgmt.sql.models.WorkloadClassifier :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -144,7 +149,7 @@ async def _create_or_update_initial( parameters: Union[_models.WorkloadClassifier, IO[bytes]], **kwargs: Any ) -> Optional[_models.WorkloadClassifier]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -377,7 +382,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements workload_classifier_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -515,7 +520,7 @@ def list_by_workload_group( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.WorkloadClassifierListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_workload_groups_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_workload_groups_operations.py index 9ba0c72e7d1b..065336e54855 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_workload_groups_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_workload_groups_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -37,6 +38,10 @@ build_list_by_database_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -79,7 +84,7 @@ async def get( :rtype: ~azure.mgmt.sql.models.WorkloadGroup :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -133,7 +138,7 @@ async def _create_or_update_initial( parameters: Union[_models.WorkloadGroup, IO[bytes]], **kwargs: Any ) -> Optional[_models.WorkloadGroup]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -343,7 +348,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, server_name: str, database_name: str, workload_group_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -467,7 +472,7 @@ def list_by_database( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.WorkloadGroupListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/__init__.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/__init__.py index 8af75be12d82..7ba3f9b45230 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/__init__.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/__init__.py @@ -17,7 +17,6 @@ from ._models_py3 import Baseline from ._models_py3 import BaselineAdjustedResult from ._models_py3 import BenchmarkReference -from ._models_py3 import CertificateInfo from ._models_py3 import ChangeLongTermRetentionBackupAccessTierParameters from ._models_py3 import CheckNameAvailabilityRequest from ._models_py3 import CheckNameAvailabilityResponse @@ -67,9 +66,6 @@ from ._models_py3 import DeletedServer from ._models_py3 import DeletedServerListResult from ._models_py3 import DistributedAvailabilityGroup -from ._models_py3 import DistributedAvailabilityGroupDatabase -from ._models_py3 import DistributedAvailabilityGroupSetRole -from ._models_py3 import DistributedAvailabilityGroupsFailoverRequest from ._models_py3 import DistributedAvailabilityGroupsListResult from ._models_py3 import EditionCapability from ._models_py3 import ElasticPool @@ -276,7 +272,6 @@ from ._models_py3 import ProxyResourceWithWritableName from ._models_py3 import QueryCheck from ._models_py3 import QueryMetricInterval -from ._models_py3 import QueryMetricIntervalAutoGenerated from ._models_py3 import QueryMetricProperties from ._models_py3 import QueryStatistics from ._models_py3 import QueryStatisticsProperties @@ -294,10 +289,10 @@ from ._models_py3 import RecoverableManagedDatabase from ._models_py3 import RecoverableManagedDatabaseListResult from ._models_py3 import RefreshExternalGovernanceStatusOperationResult -from ._models_py3 import RefreshExternalGovernanceStatusOperationResultMI from ._models_py3 import Remediation from ._models_py3 import ReplicationLink from ._models_py3 import ReplicationLinkListResult +from ._models_py3 import ReplicationLinkUpdate from ._models_py3 import Resource from ._models_py3 import ResourceIdentity from ._models_py3 import ResourceMoveDefinition @@ -432,7 +427,6 @@ from ._sql_management_client_enums import AdvisorStatus from ._sql_management_client_enums import AggregationFunctionType from ._sql_management_client_enums import AlwaysEncryptedEnclaveType -from ._sql_management_client_enums import AuthMetadataLookupModes from ._sql_management_client_enums import AuthenticationName from ._sql_management_client_enums import AutoExecuteStatus from ._sql_management_client_enums import AutoExecuteStatusInheritedFrom @@ -474,20 +468,15 @@ from ._sql_management_client_enums import ElasticPoolState from ._sql_management_client_enums import EncryptionProtectorName from ._sql_management_client_enums import ExternalGovernanceStatus +from ._sql_management_client_enums import FailoverGroupDatabasesSecondaryType from ._sql_management_client_enums import FailoverGroupReplicationRole -from ._sql_management_client_enums import FailoverModeType -from ._sql_management_client_enums import FailoverType from ._sql_management_client_enums import FreeLimitExhaustionBehavior -from ._sql_management_client_enums import FreemiumType from ._sql_management_client_enums import GeoBackupPolicyName from ._sql_management_client_enums import GeoBackupPolicyState -from ._sql_management_client_enums import HybridSecondaryUsage -from ._sql_management_client_enums import HybridSecondaryUsageDetected from ._sql_management_client_enums import IdentityType from ._sql_management_client_enums import ImplementationMethod from ._sql_management_client_enums import InstanceFailoverGroupReplicationRole from ._sql_management_client_enums import InstancePoolLicenseType -from ._sql_management_client_enums import InstanceRole from ._sql_management_client_enums import IsRetryable from ._sql_management_client_enums import JobAgentState from ._sql_management_client_enums import JobExecutionLifecycle @@ -499,15 +488,14 @@ from ._sql_management_client_enums import JobTargetType from ._sql_management_client_enums import LedgerDigestUploadsName from ._sql_management_client_enums import LedgerDigestUploadsState -from ._sql_management_client_enums import LinkRole from ._sql_management_client_enums import LogSizeUnit from ._sql_management_client_enums import LongTermRetentionPolicyName from ._sql_management_client_enums import ManagedDatabaseCreateMode from ._sql_management_client_enums import ManagedDatabaseStatus from ._sql_management_client_enums import ManagedInstanceAdministratorType -from ._sql_management_client_enums import ManagedInstanceDatabaseFormat from ._sql_management_client_enums import ManagedInstanceLicenseType from ._sql_management_client_enums import ManagedInstanceLongTermRetentionPolicyName +from ._sql_management_client_enums import ManagedInstancePropertiesProvisioningState from ._sql_management_client_enums import ManagedInstanceProxyOverride from ._sql_management_client_enums import ManagedLedgerDigestUploadsName from ._sql_management_client_enums import ManagedLedgerDigestUploadsState @@ -536,16 +524,13 @@ from ._sql_management_client_enums import RecommendedActionCurrentState from ._sql_management_client_enums import RecommendedActionInitiatedBy from ._sql_management_client_enums import RecommendedSensitivityLabelUpdateKind -from ._sql_management_client_enums import ReplicaConnectedState -from ._sql_management_client_enums import ReplicaSynchronizationHealth from ._sql_management_client_enums import ReplicaType from ._sql_management_client_enums import ReplicationLinkType -from ._sql_management_client_enums import ReplicationModeType +from ._sql_management_client_enums import ReplicationMode from ._sql_management_client_enums import ReplicationRole from ._sql_management_client_enums import ReplicationState from ._sql_management_client_enums import RestoreDetailsName from ._sql_management_client_enums import RestorePointType -from ._sql_management_client_enums import RoleChangeType from ._sql_management_client_enums import RuleSeverity from ._sql_management_client_enums import RuleStatus from ._sql_management_client_enums import RuleType @@ -556,7 +541,6 @@ from ._sql_management_client_enums import SecurityAlertPolicyState from ._sql_management_client_enums import SecurityAlertsPolicyState from ._sql_management_client_enums import SecurityEventType -from ._sql_management_client_enums import SeedingModeType from ._sql_management_client_enums import SensitivityLabelRank from ._sql_management_client_enums import SensitivityLabelSource from ._sql_management_client_enums import SensitivityLabelUpdateKind @@ -611,7 +595,6 @@ "Baseline", "BaselineAdjustedResult", "BenchmarkReference", - "CertificateInfo", "ChangeLongTermRetentionBackupAccessTierParameters", "CheckNameAvailabilityRequest", "CheckNameAvailabilityResponse", @@ -661,9 +644,6 @@ "DeletedServer", "DeletedServerListResult", "DistributedAvailabilityGroup", - "DistributedAvailabilityGroupDatabase", - "DistributedAvailabilityGroupSetRole", - "DistributedAvailabilityGroupsFailoverRequest", "DistributedAvailabilityGroupsListResult", "EditionCapability", "ElasticPool", @@ -870,7 +850,6 @@ "ProxyResourceWithWritableName", "QueryCheck", "QueryMetricInterval", - "QueryMetricIntervalAutoGenerated", "QueryMetricProperties", "QueryStatistics", "QueryStatisticsProperties", @@ -888,10 +867,10 @@ "RecoverableManagedDatabase", "RecoverableManagedDatabaseListResult", "RefreshExternalGovernanceStatusOperationResult", - "RefreshExternalGovernanceStatusOperationResultMI", "Remediation", "ReplicationLink", "ReplicationLinkListResult", + "ReplicationLinkUpdate", "Resource", "ResourceIdentity", "ResourceMoveDefinition", @@ -1025,7 +1004,6 @@ "AdvisorStatus", "AggregationFunctionType", "AlwaysEncryptedEnclaveType", - "AuthMetadataLookupModes", "AuthenticationName", "AutoExecuteStatus", "AutoExecuteStatusInheritedFrom", @@ -1067,20 +1045,15 @@ "ElasticPoolState", "EncryptionProtectorName", "ExternalGovernanceStatus", + "FailoverGroupDatabasesSecondaryType", "FailoverGroupReplicationRole", - "FailoverModeType", - "FailoverType", "FreeLimitExhaustionBehavior", - "FreemiumType", "GeoBackupPolicyName", "GeoBackupPolicyState", - "HybridSecondaryUsage", - "HybridSecondaryUsageDetected", "IdentityType", "ImplementationMethod", "InstanceFailoverGroupReplicationRole", "InstancePoolLicenseType", - "InstanceRole", "IsRetryable", "JobAgentState", "JobExecutionLifecycle", @@ -1092,15 +1065,14 @@ "JobTargetType", "LedgerDigestUploadsName", "LedgerDigestUploadsState", - "LinkRole", "LogSizeUnit", "LongTermRetentionPolicyName", "ManagedDatabaseCreateMode", "ManagedDatabaseStatus", "ManagedInstanceAdministratorType", - "ManagedInstanceDatabaseFormat", "ManagedInstanceLicenseType", "ManagedInstanceLongTermRetentionPolicyName", + "ManagedInstancePropertiesProvisioningState", "ManagedInstanceProxyOverride", "ManagedLedgerDigestUploadsName", "ManagedLedgerDigestUploadsState", @@ -1129,16 +1101,13 @@ "RecommendedActionCurrentState", "RecommendedActionInitiatedBy", "RecommendedSensitivityLabelUpdateKind", - "ReplicaConnectedState", - "ReplicaSynchronizationHealth", "ReplicaType", "ReplicationLinkType", - "ReplicationModeType", + "ReplicationMode", "ReplicationRole", "ReplicationState", "RestoreDetailsName", "RestorePointType", - "RoleChangeType", "RuleSeverity", "RuleStatus", "RuleType", @@ -1149,7 +1118,6 @@ "SecurityAlertPolicyState", "SecurityAlertsPolicyState", "SecurityEventType", - "SeedingModeType", "SensitivityLabelRank", "SensitivityLabelSource", "SensitivityLabelUpdateKind", diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/_models_py3.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/_models_py3.py index 8be732d2d91f..925aebdffef2 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/_models_py3.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/_models_py3.py @@ -528,34 +528,6 @@ def __init__(self, **kwargs: Any) -> None: self.reference = None -class CertificateInfo(_serialization.Model): - """Certificate information. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar certificate_name: The certificate name. - :vartype certificate_name: str - :ivar expiry_date: The certificate expiry date. - :vartype expiry_date: ~datetime.datetime - """ - - _validation = { - "certificate_name": {"readonly": True}, - "expiry_date": {"readonly": True}, - } - - _attribute_map = { - "certificate_name": {"key": "certificateName", "type": "str"}, - "expiry_date": {"key": "expiryDate", "type": "iso-8601"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.certificate_name = None - self.expiry_date = None - - class ChangeLongTermRetentionBackupAccessTierParameters(_serialization.Model): # pylint: disable=name-too-long """Contains the information necessary to change long term retention backup access tier and related operation mode. @@ -4111,307 +4083,90 @@ class DistributedAvailabilityGroup(ProxyResource): # pylint: disable=too-many-i :vartype name: str :ivar type: Resource type. :vartype type: str - :ivar distributed_availability_group_name: Name of the distributed availability group. - :vartype distributed_availability_group_name: str - :ivar distributed_availability_group_id: ID of the distributed availability group. + :ivar target_database: The name of the target database. + :vartype target_database: str + :ivar source_endpoint: The source endpoint. + :vartype source_endpoint: str + :ivar primary_availability_group_name: The primary availability group name. + :vartype primary_availability_group_name: str + :ivar secondary_availability_group_name: The secondary availability group name. + :vartype secondary_availability_group_name: str + :ivar replication_mode: The replication mode of a distributed availability group. Parameter + will be ignored during link creation. Known values are: "Async" and "Sync". + :vartype replication_mode: str or ~azure.mgmt.sql.models.ReplicationMode + :ivar distributed_availability_group_id: The distributed availability group id. :vartype distributed_availability_group_id: str - :ivar replication_mode: Replication mode of the link. Known values are: "Async" and "Sync". - :vartype replication_mode: str or ~azure.mgmt.sql.models.ReplicationModeType - :ivar partner_link_role: SQL server side link role. Known values are: "Primary" and - "Secondary". - :vartype partner_link_role: str or ~azure.mgmt.sql.models.LinkRole - :ivar partner_availability_group_name: SQL server side availability group name. - :vartype partner_availability_group_name: str - :ivar partner_endpoint: SQL server side endpoint - IP or DNS resolvable name. - :vartype partner_endpoint: str - :ivar instance_link_role: Managed instance side link role. Known values are: "Primary" and - "Secondary". - :vartype instance_link_role: str or ~azure.mgmt.sql.models.LinkRole - :ivar instance_availability_group_name: Managed instance side availability group name. - :vartype instance_availability_group_name: str - :ivar failover_mode: The link failover mode - can be Manual if intended to be used for two-way - failover with a supported SQL Server, or None for one-way failover to Azure. Known values are: - "None" and "Manual". - :vartype failover_mode: str or ~azure.mgmt.sql.models.FailoverModeType - :ivar seeding_mode: Database seeding mode – can be Automatic (default), or Manual for supported - scenarios. Known values are: "Automatic" and "Manual". - :vartype seeding_mode: str or ~azure.mgmt.sql.models.SeedingModeType - :ivar databases: Databases in the distributed availability group. - :vartype databases: list[~azure.mgmt.sql.models.DistributedAvailabilityGroupDatabase] + :ivar source_replica_id: The source replica id. + :vartype source_replica_id: str + :ivar target_replica_id: The target replica id. + :vartype target_replica_id: str + :ivar link_state: The link state. + :vartype link_state: str + :ivar last_hardened_lsn: The last hardened lsn. + :vartype last_hardened_lsn: str """ _validation = { "id": {"readonly": True}, "name": {"readonly": True}, "type": {"readonly": True}, - "distributed_availability_group_name": {"readonly": True}, "distributed_availability_group_id": {"readonly": True}, - "partner_link_role": {"readonly": True}, + "source_replica_id": {"readonly": True}, + "target_replica_id": {"readonly": True}, + "link_state": {"readonly": True}, + "last_hardened_lsn": {"readonly": True}, } _attribute_map = { "id": {"key": "id", "type": "str"}, "name": {"key": "name", "type": "str"}, "type": {"key": "type", "type": "str"}, - "distributed_availability_group_name": {"key": "properties.distributedAvailabilityGroupName", "type": "str"}, - "distributed_availability_group_id": {"key": "properties.distributedAvailabilityGroupId", "type": "str"}, + "target_database": {"key": "properties.targetDatabase", "type": "str"}, + "source_endpoint": {"key": "properties.sourceEndpoint", "type": "str"}, + "primary_availability_group_name": {"key": "properties.primaryAvailabilityGroupName", "type": "str"}, + "secondary_availability_group_name": {"key": "properties.secondaryAvailabilityGroupName", "type": "str"}, "replication_mode": {"key": "properties.replicationMode", "type": "str"}, - "partner_link_role": {"key": "properties.partnerLinkRole", "type": "str"}, - "partner_availability_group_name": {"key": "properties.partnerAvailabilityGroupName", "type": "str"}, - "partner_endpoint": {"key": "properties.partnerEndpoint", "type": "str"}, - "instance_link_role": {"key": "properties.instanceLinkRole", "type": "str"}, - "instance_availability_group_name": {"key": "properties.instanceAvailabilityGroupName", "type": "str"}, - "failover_mode": {"key": "properties.failoverMode", "type": "str"}, - "seeding_mode": {"key": "properties.seedingMode", "type": "str"}, - "databases": {"key": "properties.databases", "type": "[DistributedAvailabilityGroupDatabase]"}, + "distributed_availability_group_id": {"key": "properties.distributedAvailabilityGroupId", "type": "str"}, + "source_replica_id": {"key": "properties.sourceReplicaId", "type": "str"}, + "target_replica_id": {"key": "properties.targetReplicaId", "type": "str"}, + "link_state": {"key": "properties.linkState", "type": "str"}, + "last_hardened_lsn": {"key": "properties.lastHardenedLsn", "type": "str"}, } def __init__( self, *, - replication_mode: Optional[Union[str, "_models.ReplicationModeType"]] = None, - partner_availability_group_name: Optional[str] = None, - partner_endpoint: Optional[str] = None, - instance_link_role: Optional[Union[str, "_models.LinkRole"]] = None, - instance_availability_group_name: Optional[str] = None, - failover_mode: Optional[Union[str, "_models.FailoverModeType"]] = None, - seeding_mode: Optional[Union[str, "_models.SeedingModeType"]] = None, - databases: Optional[List["_models.DistributedAvailabilityGroupDatabase"]] = None, + target_database: Optional[str] = None, + source_endpoint: Optional[str] = None, + primary_availability_group_name: Optional[str] = None, + secondary_availability_group_name: Optional[str] = None, + replication_mode: Optional[Union[str, "_models.ReplicationMode"]] = None, **kwargs: Any ) -> None: """ - :keyword replication_mode: Replication mode of the link. Known values are: "Async" and "Sync". - :paramtype replication_mode: str or ~azure.mgmt.sql.models.ReplicationModeType - :keyword partner_availability_group_name: SQL server side availability group name. - :paramtype partner_availability_group_name: str - :keyword partner_endpoint: SQL server side endpoint - IP or DNS resolvable name. - :paramtype partner_endpoint: str - :keyword instance_link_role: Managed instance side link role. Known values are: "Primary" and - "Secondary". - :paramtype instance_link_role: str or ~azure.mgmt.sql.models.LinkRole - :keyword instance_availability_group_name: Managed instance side availability group name. - :paramtype instance_availability_group_name: str - :keyword failover_mode: The link failover mode - can be Manual if intended to be used for - two-way failover with a supported SQL Server, or None for one-way failover to Azure. Known - values are: "None" and "Manual". - :paramtype failover_mode: str or ~azure.mgmt.sql.models.FailoverModeType - :keyword seeding_mode: Database seeding mode – can be Automatic (default), or Manual for - supported scenarios. Known values are: "Automatic" and "Manual". - :paramtype seeding_mode: str or ~azure.mgmt.sql.models.SeedingModeType - :keyword databases: Databases in the distributed availability group. - :paramtype databases: list[~azure.mgmt.sql.models.DistributedAvailabilityGroupDatabase] - """ - super().__init__(**kwargs) - self.distributed_availability_group_name = None - self.distributed_availability_group_id = None + :keyword target_database: The name of the target database. + :paramtype target_database: str + :keyword source_endpoint: The source endpoint. + :paramtype source_endpoint: str + :keyword primary_availability_group_name: The primary availability group name. + :paramtype primary_availability_group_name: str + :keyword secondary_availability_group_name: The secondary availability group name. + :paramtype secondary_availability_group_name: str + :keyword replication_mode: The replication mode of a distributed availability group. Parameter + will be ignored during link creation. Known values are: "Async" and "Sync". + :paramtype replication_mode: str or ~azure.mgmt.sql.models.ReplicationMode + """ + super().__init__(**kwargs) + self.target_database = target_database + self.source_endpoint = source_endpoint + self.primary_availability_group_name = primary_availability_group_name + self.secondary_availability_group_name = secondary_availability_group_name self.replication_mode = replication_mode - self.partner_link_role = None - self.partner_availability_group_name = partner_availability_group_name - self.partner_endpoint = partner_endpoint - self.instance_link_role = instance_link_role - self.instance_availability_group_name = instance_availability_group_name - self.failover_mode = failover_mode - self.seeding_mode = seeding_mode - self.databases = databases - - -class DistributedAvailabilityGroupDatabase(_serialization.Model): # pylint: disable=too-many-instance-attributes - """Database specific information. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar database_name: The name of the database in link. - :vartype database_name: str - :ivar instance_replica_id: Managed instance replica id. - :vartype instance_replica_id: str - :ivar partner_replica_id: SQL server replica id. - :vartype partner_replica_id: str - :ivar replica_state: Current link state. - :vartype replica_state: str - :ivar seeding_progress: Seeding progress. - :vartype seeding_progress: str - :ivar synchronization_health: Link health state. Known values are: "NOT_HEALTHY", - "PARTIALLY_HEALTHY", and "HEALTHY". - :vartype synchronization_health: str or ~azure.mgmt.sql.models.ReplicaSynchronizationHealth - :ivar connected_state: Link connected state. Known values are: "DISCONNECTED" and "CONNECTED". - :vartype connected_state: str or ~azure.mgmt.sql.models.ReplicaConnectedState - :ivar last_received_lsn: Last received LSN. - :vartype last_received_lsn: str - :ivar last_received_time: Last received LSN time. - :vartype last_received_time: ~datetime.datetime - :ivar last_sent_lsn: Last sent LSN. - :vartype last_sent_lsn: str - :ivar last_sent_time: Last sent LSN time. - :vartype last_sent_time: ~datetime.datetime - :ivar last_commit_lsn: Last commit LSN. - :vartype last_commit_lsn: str - :ivar last_commit_time: Last commit LSN time. - :vartype last_commit_time: ~datetime.datetime - :ivar last_hardened_lsn: Last hardened LSN. - :vartype last_hardened_lsn: str - :ivar last_hardened_time: Last hardened LSN time. - :vartype last_hardened_time: ~datetime.datetime - :ivar last_backup_lsn: Last backup LSN. - :vartype last_backup_lsn: str - :ivar last_backup_time: Last backup LSN time. - :vartype last_backup_time: ~datetime.datetime - :ivar most_recent_link_error: The most recent link connection error description. - :vartype most_recent_link_error: str - :ivar partner_auth_cert_validity: SQL server certificate validity. - :vartype partner_auth_cert_validity: ~azure.mgmt.sql.models.CertificateInfo - :ivar instance_send_replication_lag_seconds: Replication lag when Managed Instance link side is - primary. - :vartype instance_send_replication_lag_seconds: int - :ivar instance_redo_replication_lag_seconds: Redo lag when Managed Instance link side is - primary. - :vartype instance_redo_replication_lag_seconds: int - """ - - _validation = { - "instance_replica_id": {"readonly": True}, - "partner_replica_id": {"readonly": True}, - "replica_state": {"readonly": True}, - "seeding_progress": {"readonly": True}, - "synchronization_health": {"readonly": True}, - "connected_state": {"readonly": True}, - "last_received_lsn": {"readonly": True}, - "last_received_time": {"readonly": True}, - "last_sent_lsn": {"readonly": True}, - "last_sent_time": {"readonly": True}, - "last_commit_lsn": {"readonly": True}, - "last_commit_time": {"readonly": True}, - "last_hardened_lsn": {"readonly": True}, - "last_hardened_time": {"readonly": True}, - "last_backup_lsn": {"readonly": True}, - "last_backup_time": {"readonly": True}, - "most_recent_link_error": {"readonly": True}, - "partner_auth_cert_validity": {"readonly": True}, - "instance_send_replication_lag_seconds": {"readonly": True}, - "instance_redo_replication_lag_seconds": {"readonly": True}, - } - - _attribute_map = { - "database_name": {"key": "databaseName", "type": "str"}, - "instance_replica_id": {"key": "instanceReplicaId", "type": "str"}, - "partner_replica_id": {"key": "partnerReplicaId", "type": "str"}, - "replica_state": {"key": "replicaState", "type": "str"}, - "seeding_progress": {"key": "seedingProgress", "type": "str"}, - "synchronization_health": {"key": "synchronizationHealth", "type": "str"}, - "connected_state": {"key": "connectedState", "type": "str"}, - "last_received_lsn": {"key": "lastReceivedLsn", "type": "str"}, - "last_received_time": {"key": "lastReceivedTime", "type": "iso-8601"}, - "last_sent_lsn": {"key": "lastSentLsn", "type": "str"}, - "last_sent_time": {"key": "lastSentTime", "type": "iso-8601"}, - "last_commit_lsn": {"key": "lastCommitLsn", "type": "str"}, - "last_commit_time": {"key": "lastCommitTime", "type": "iso-8601"}, - "last_hardened_lsn": {"key": "lastHardenedLsn", "type": "str"}, - "last_hardened_time": {"key": "lastHardenedTime", "type": "iso-8601"}, - "last_backup_lsn": {"key": "lastBackupLsn", "type": "str"}, - "last_backup_time": {"key": "lastBackupTime", "type": "iso-8601"}, - "most_recent_link_error": {"key": "mostRecentLinkError", "type": "str"}, - "partner_auth_cert_validity": {"key": "partnerAuthCertValidity", "type": "CertificateInfo"}, - "instance_send_replication_lag_seconds": {"key": "instanceSendReplicationLagSeconds", "type": "int"}, - "instance_redo_replication_lag_seconds": {"key": "instanceRedoReplicationLagSeconds", "type": "int"}, - } - - def __init__(self, *, database_name: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword database_name: The name of the database in link. - :paramtype database_name: str - """ - super().__init__(**kwargs) - self.database_name = database_name - self.instance_replica_id = None - self.partner_replica_id = None - self.replica_state = None - self.seeding_progress = None - self.synchronization_health = None - self.connected_state = None - self.last_received_lsn = None - self.last_received_time = None - self.last_sent_lsn = None - self.last_sent_time = None - self.last_commit_lsn = None - self.last_commit_time = None + self.distributed_availability_group_id = None + self.source_replica_id = None + self.target_replica_id = None + self.link_state = None self.last_hardened_lsn = None - self.last_hardened_time = None - self.last_backup_lsn = None - self.last_backup_time = None - self.most_recent_link_error = None - self.partner_auth_cert_validity = None - self.instance_send_replication_lag_seconds = None - self.instance_redo_replication_lag_seconds = None - - -class DistributedAvailabilityGroupSetRole(_serialization.Model): - """Distributed availability group failover request. - - All required parameters must be populated in order to send to server. - - :ivar instance_role: New role of managed instance in a distributed availability group, can be - Primary or Secondary. Required. Known values are: "Primary" and "Secondary". - :vartype instance_role: str or ~azure.mgmt.sql.models.InstanceRole - :ivar role_change_type: The type of the role change, can be Planned or Forced. Required. Known - values are: "Forced" and "Planned". - :vartype role_change_type: str or ~azure.mgmt.sql.models.RoleChangeType - """ - - _validation = { - "instance_role": {"required": True}, - "role_change_type": {"required": True}, - } - - _attribute_map = { - "instance_role": {"key": "instanceRole", "type": "str"}, - "role_change_type": {"key": "roleChangeType", "type": "str"}, - } - - def __init__( - self, - *, - instance_role: Union[str, "_models.InstanceRole"], - role_change_type: Union[str, "_models.RoleChangeType"], - **kwargs: Any - ) -> None: - """ - :keyword instance_role: New role of managed instance in a distributed availability group, can - be Primary or Secondary. Required. Known values are: "Primary" and "Secondary". - :paramtype instance_role: str or ~azure.mgmt.sql.models.InstanceRole - :keyword role_change_type: The type of the role change, can be Planned or Forced. Required. - Known values are: "Forced" and "Planned". - :paramtype role_change_type: str or ~azure.mgmt.sql.models.RoleChangeType - """ - super().__init__(**kwargs) - self.instance_role = instance_role - self.role_change_type = role_change_type - - -class DistributedAvailabilityGroupsFailoverRequest(_serialization.Model): # pylint: disable=name-too-long - """Distributed availability group failover. - - All required parameters must be populated in order to send to server. - - :ivar failover_type: The failover type, can be ForcedAllowDataLoss or Planned. Required. Known - values are: "ForcedAllowDataLoss" and "Planned". - :vartype failover_type: str or ~azure.mgmt.sql.models.FailoverType - """ - - _validation = { - "failover_type": {"required": True}, - } - - _attribute_map = { - "failover_type": {"key": "failoverType", "type": "str"}, - } - - def __init__(self, *, failover_type: Union[str, "_models.FailoverType"], **kwargs: Any) -> None: - """ - :keyword failover_type: The failover type, can be ForcedAllowDataLoss or Planned. Required. - Known values are: "ForcedAllowDataLoss" and "Planned". - :paramtype failover_type: str or ~azure.mgmt.sql.models.FailoverType - """ - super().__init__(**kwargs) - self.failover_type = failover_type class DistributedAvailabilityGroupsListResult(_serialization.Model): @@ -6671,6 +6426,9 @@ class FailoverGroup(ProxyResource): # pylint: disable=too-many-instance-attribu :vartype partner_servers: list[~azure.mgmt.sql.models.PartnerInfo] :ivar databases: List of databases in the failover group. :vartype databases: list[str] + :ivar secondary_type: Databases secondary type on partner server. Known values are: "Geo" and + "Standby". + :vartype secondary_type: str or ~azure.mgmt.sql.models.FailoverGroupDatabasesSecondaryType """ _validation = { @@ -6694,6 +6452,7 @@ class FailoverGroup(ProxyResource): # pylint: disable=too-many-instance-attribu "replication_state": {"key": "properties.replicationState", "type": "str"}, "partner_servers": {"key": "properties.partnerServers", "type": "[PartnerInfo]"}, "databases": {"key": "properties.databases", "type": "[str]"}, + "secondary_type": {"key": "properties.secondaryType", "type": "str"}, } def __init__( @@ -6704,6 +6463,7 @@ def __init__( read_only_endpoint: Optional["_models.FailoverGroupReadOnlyEndpoint"] = None, partner_servers: Optional[List["_models.PartnerInfo"]] = None, databases: Optional[List[str]] = None, + secondary_type: Optional[Union[str, "_models.FailoverGroupDatabasesSecondaryType"]] = None, **kwargs: Any ) -> None: """ @@ -6717,6 +6477,9 @@ def __init__( :paramtype partner_servers: list[~azure.mgmt.sql.models.PartnerInfo] :keyword databases: List of databases in the failover group. :paramtype databases: list[str] + :keyword secondary_type: Databases secondary type on partner server. Known values are: "Geo" + and "Standby". + :paramtype secondary_type: str or ~azure.mgmt.sql.models.FailoverGroupDatabasesSecondaryType """ super().__init__(**kwargs) self.location = None @@ -6727,6 +6490,7 @@ def __init__( self.replication_state = None self.partner_servers = partner_servers self.databases = databases + self.secondary_type = secondary_type class FailoverGroupListResult(_serialization.Model): @@ -6853,6 +6617,9 @@ class FailoverGroupUpdate(_serialization.Model): :vartype databases: list[str] :ivar partner_servers: List of partner server information for the failover group. :vartype partner_servers: list[~azure.mgmt.sql.models.PartnerInfo] + :ivar secondary_type: Databases secondary type on partner server. Known values are: "Geo" and + "Standby". + :vartype secondary_type: str or ~azure.mgmt.sql.models.FailoverGroupDatabasesSecondaryType """ _attribute_map = { @@ -6861,6 +6628,7 @@ class FailoverGroupUpdate(_serialization.Model): "read_only_endpoint": {"key": "properties.readOnlyEndpoint", "type": "FailoverGroupReadOnlyEndpoint"}, "databases": {"key": "properties.databases", "type": "[str]"}, "partner_servers": {"key": "properties.partnerServers", "type": "[PartnerInfo]"}, + "secondary_type": {"key": "properties.secondaryType", "type": "str"}, } def __init__( @@ -6871,6 +6639,7 @@ def __init__( read_only_endpoint: Optional["_models.FailoverGroupReadOnlyEndpoint"] = None, databases: Optional[List[str]] = None, partner_servers: Optional[List["_models.PartnerInfo"]] = None, + secondary_type: Optional[Union[str, "_models.FailoverGroupDatabasesSecondaryType"]] = None, **kwargs: Any ) -> None: """ @@ -6884,6 +6653,9 @@ def __init__( :paramtype databases: list[str] :keyword partner_servers: List of partner server information for the failover group. :paramtype partner_servers: list[~azure.mgmt.sql.models.PartnerInfo] + :keyword secondary_type: Databases secondary type on partner server. Known values are: "Geo" + and "Standby". + :paramtype secondary_type: str or ~azure.mgmt.sql.models.FailoverGroupDatabasesSecondaryType """ super().__init__(**kwargs) self.tags = tags @@ -6891,6 +6663,7 @@ def __init__( self.read_only_endpoint = read_only_endpoint self.databases = databases self.partner_servers = partner_servers + self.secondary_type = secondary_type class ResourceWithWritableName(_serialization.Model): @@ -9801,8 +9574,8 @@ class MaintenanceWindowOptions(ProxyResource): :vartype type: str :ivar is_enabled: Whether maintenance windows are enabled for the database. :vartype is_enabled: bool - :ivar maintenance_window_cycles: Available maintenance cycles e.g. {Saturday, 0, 48\ *60}, - {Wednesday, 0, 24*\ 60}. + :ivar maintenance_window_cycles: Available maintenance cycles e.g. {Saturday, 0, 48\\ *60}, + {Wednesday, 0, 24*\\ 60}. :vartype maintenance_window_cycles: list[~azure.mgmt.sql.models.MaintenanceWindowTimeRange] :ivar min_duration_in_minutes: Minimum duration of maintenance window. :vartype min_duration_in_minutes: int @@ -9857,8 +9630,8 @@ def __init__( """ :keyword is_enabled: Whether maintenance windows are enabled for the database. :paramtype is_enabled: bool - :keyword maintenance_window_cycles: Available maintenance cycles e.g. {Saturday, 0, 48\ *60}, - {Wednesday, 0, 24*\ 60}. + :keyword maintenance_window_cycles: Available maintenance cycles e.g. {Saturday, 0, 48\\ *60}, + {Wednesday, 0, 24*\\ 60}. :paramtype maintenance_window_cycles: list[~azure.mgmt.sql.models.MaintenanceWindowTimeRange] :keyword min_duration_in_minutes: Minimum duration of maintenance window. :paramtype min_duration_in_minutes: int @@ -11224,9 +10997,11 @@ class ManagedInstance(TrackedResource): # pylint: disable=too-many-instance-att :ivar sku: Managed instance SKU. Allowed values for sku.name: GP_Gen5, GP_G8IM, GP_G8IH, BC_Gen5, BC_G8IM, BC_G8IH. :vartype sku: ~azure.mgmt.sql.models.Sku - :ivar provisioning_state: Provisioning state of managed instance. Known values are: "Created", - "InProgress", "Succeeded", "Failed", and "Canceled". - :vartype provisioning_state: str or ~azure.mgmt.sql.models.ProvisioningState + :ivar provisioning_state: Known values are: "Creating", "Deleting", "Updating", "Unknown", + "Succeeded", "Failed", "Accepted", "Created", "Deleted", "Unrecognized", "Running", "Canceled", + "NotSpecified", "Registering", and "TimedOut". + :vartype provisioning_state: str or + ~azure.mgmt.sql.models.ManagedInstancePropertiesProvisioningState :ivar managed_instance_create_mode: Specifies the mode of database creation. Default: Regular instance creation. @@ -11237,8 +11012,6 @@ class ManagedInstance(TrackedResource): # pylint: disable=too-many-instance-att :vartype managed_instance_create_mode: str or ~azure.mgmt.sql.models.ManagedServerCreateMode :ivar fully_qualified_domain_name: The fully qualified domain name of the managed instance. :vartype fully_qualified_domain_name: str - :ivar is_general_purpose_v2: Whether or not this is a GPv2 variant of General Purpose edition. - :vartype is_general_purpose_v2: bool :ivar administrator_login: Administrator username for the managed instance. Can only be specified when the managed instance is being created (and is required for creation). :vartype administrator_login: str @@ -11253,28 +11026,12 @@ class ManagedInstance(TrackedResource): # pylint: disable=too-many-instance-att inclusive of a new SQL license) and 'BasePrice' (discounted AHB price for bringing your own SQL licenses). Known values are: "LicenseIncluded" and "BasePrice". :vartype license_type: str or ~azure.mgmt.sql.models.ManagedInstanceLicenseType - :ivar hybrid_secondary_usage: Hybrid secondary usage. Possible values are 'Active' (default - value) and 'Passive' (customer uses the secondary as Passive DR). Known values are: "Active" - and "Passive". - :vartype hybrid_secondary_usage: str or ~azure.mgmt.sql.models.HybridSecondaryUsage - :ivar hybrid_secondary_usage_detected: Hybrid secondary usage detected. Possible values are - 'Active' (customer does not meet the requirements to use the secondary as Passive DR) and - 'Passive' (customer meets the requirements to use the secondary as Passive DR). Known values - are: "Active" and "Passive". - :vartype hybrid_secondary_usage_detected: str or - ~azure.mgmt.sql.models.HybridSecondaryUsageDetected :ivar v_cores: The number of vCores. Allowed values: 8, 16, 24, 32, 40, 64, 80. :vartype v_cores: int :ivar storage_size_in_gb: Storage size in GB. Minimum value: 32. Maximum value: 16384. Increments of 32 GB allowed only. Maximum value depends on the selected hardware family and number of vCores. :vartype storage_size_in_gb: int - :ivar storage_i_ops: Storage IOps. Minimum value: 300. Maximum value: 80000. Increments of 1 - IOps allowed only. Maximum value depends on the selected hardware family and number of vCores. - :vartype storage_i_ops: int - :ivar storage_throughput_m_bps: Storage throughput MBps parameter is not supported in the - instance create/update operation. - :vartype storage_throughput_m_bps: int :ivar collation: Collation of the managed instance. :vartype collation: str :ivar dns_zone: The Dns Zone that the managed instance is in. @@ -11295,7 +11052,7 @@ class ManagedInstance(TrackedResource): # pylint: disable=too-many-instance-att :vartype proxy_override: str or ~azure.mgmt.sql.models.ManagedInstanceProxyOverride :ivar timezone_id: Id of the timezone. Allowed values are timezones supported by Windows. Windows keeps details on supported timezones, including the id, in registry under - KEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones. + KEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Time Zones. You can get those registry values via SQL Server by querying SELECT name AS timezone_id FROM sys.time_zone_info. List of Ids can also be obtained by executing [System.TimeZoneInfo]::GetSystemTimeZones() in @@ -11336,23 +11093,6 @@ class ManagedInstance(TrackedResource): # pylint: disable=too-many-instance-att :vartype administrators: ~azure.mgmt.sql.models.ManagedInstanceExternalAdministrator :ivar service_principal: The managed instance's service principal. :vartype service_principal: ~azure.mgmt.sql.models.ServicePrincipal - :ivar virtual_cluster_id: Virtual cluster resource id for the Managed Instance. - :vartype virtual_cluster_id: str - :ivar external_governance_status: Status of external governance. Known values are: "Enabled" - and "Disabled". - :vartype external_governance_status: str or ~azure.mgmt.sql.models.ExternalGovernanceStatus - :ivar pricing_model: Weather or not Managed Instance is freemium. Known values are: "Regular" - and "Freemium". - :vartype pricing_model: str or ~azure.mgmt.sql.models.FreemiumType - :ivar create_time: Specifies the point in time (ISO8601 format) of the Managed Instance - creation. - :vartype create_time: ~datetime.datetime - :ivar authentication_metadata: The managed instance's authentication metadata lookup mode. - Known values are: "AzureAD", "Paired", and "Windows". - :vartype authentication_metadata: str or ~azure.mgmt.sql.models.AuthMetadataLookupModes - :ivar database_format: Specifies the internal format of instance databases specific to the SQL - engine version. Known values are: "AlwaysUpToDate" and "SQLServer2022". - :vartype database_format: str or ~azure.mgmt.sql.models.ManagedInstanceDatabaseFormat """ _validation = { @@ -11363,13 +11103,9 @@ class ManagedInstance(TrackedResource): # pylint: disable=too-many-instance-att "provisioning_state": {"readonly": True}, "fully_qualified_domain_name": {"readonly": True}, "state": {"readonly": True}, - "hybrid_secondary_usage_detected": {"readonly": True}, "dns_zone": {"readonly": True}, "private_endpoint_connections": {"readonly": True}, "current_backup_storage_redundancy": {"readonly": True}, - "virtual_cluster_id": {"readonly": True}, - "external_governance_status": {"readonly": True}, - "create_time": {"readonly": True}, } _attribute_map = { @@ -11383,18 +11119,13 @@ class ManagedInstance(TrackedResource): # pylint: disable=too-many-instance-att "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, "managed_instance_create_mode": {"key": "properties.managedInstanceCreateMode", "type": "str"}, "fully_qualified_domain_name": {"key": "properties.fullyQualifiedDomainName", "type": "str"}, - "is_general_purpose_v2": {"key": "properties.isGeneralPurposeV2", "type": "bool"}, "administrator_login": {"key": "properties.administratorLogin", "type": "str"}, "administrator_login_password": {"key": "properties.administratorLoginPassword", "type": "str"}, "subnet_id": {"key": "properties.subnetId", "type": "str"}, "state": {"key": "properties.state", "type": "str"}, "license_type": {"key": "properties.licenseType", "type": "str"}, - "hybrid_secondary_usage": {"key": "properties.hybridSecondaryUsage", "type": "str"}, - "hybrid_secondary_usage_detected": {"key": "properties.hybridSecondaryUsageDetected", "type": "str"}, "v_cores": {"key": "properties.vCores", "type": "int"}, "storage_size_in_gb": {"key": "properties.storageSizeInGB", "type": "int"}, - "storage_i_ops": {"key": "properties.storageIOps", "type": "int"}, - "storage_throughput_m_bps": {"key": "properties.storageThroughputMBps", "type": "int"}, "collation": {"key": "properties.collation", "type": "str"}, "dns_zone": {"key": "properties.dnsZone", "type": "str"}, "dns_zone_partner": {"key": "properties.dnsZonePartner", "type": "str"}, @@ -11417,12 +11148,6 @@ class ManagedInstance(TrackedResource): # pylint: disable=too-many-instance-att "key_id": {"key": "properties.keyId", "type": "str"}, "administrators": {"key": "properties.administrators", "type": "ManagedInstanceExternalAdministrator"}, "service_principal": {"key": "properties.servicePrincipal", "type": "ServicePrincipal"}, - "virtual_cluster_id": {"key": "properties.virtualClusterId", "type": "str"}, - "external_governance_status": {"key": "properties.externalGovernanceStatus", "type": "str"}, - "pricing_model": {"key": "properties.pricingModel", "type": "str"}, - "create_time": {"key": "properties.createTime", "type": "iso-8601"}, - "authentication_metadata": {"key": "properties.authenticationMetadata", "type": "str"}, - "database_format": {"key": "properties.databaseFormat", "type": "str"}, } def __init__( # pylint: disable=too-many-locals @@ -11433,16 +11158,12 @@ def __init__( # pylint: disable=too-many-locals identity: Optional["_models.ResourceIdentity"] = None, sku: Optional["_models.Sku"] = None, managed_instance_create_mode: Optional[Union[str, "_models.ManagedServerCreateMode"]] = None, - is_general_purpose_v2: Optional[bool] = None, administrator_login: Optional[str] = None, administrator_login_password: Optional[str] = None, subnet_id: Optional[str] = None, license_type: Optional[Union[str, "_models.ManagedInstanceLicenseType"]] = None, - hybrid_secondary_usage: Optional[Union[str, "_models.HybridSecondaryUsage"]] = None, v_cores: Optional[int] = None, storage_size_in_gb: Optional[int] = None, - storage_i_ops: Optional[int] = None, - storage_throughput_m_bps: Optional[int] = None, collation: Optional[str] = None, dns_zone_partner: Optional[str] = None, public_data_endpoint_enabled: Optional[bool] = None, @@ -11459,9 +11180,6 @@ def __init__( # pylint: disable=too-many-locals key_id: Optional[str] = None, administrators: Optional["_models.ManagedInstanceExternalAdministrator"] = None, service_principal: Optional["_models.ServicePrincipal"] = None, - pricing_model: Optional[Union[str, "_models.FreemiumType"]] = None, - authentication_metadata: Optional[Union[str, "_models.AuthMetadataLookupModes"]] = None, - database_format: Optional[Union[str, "_models.ManagedInstanceDatabaseFormat"]] = None, **kwargs: Any ) -> None: """ @@ -11482,9 +11200,6 @@ def __init__( # pylint: disable=too-many-locals RestorePointInTime and SourceManagedInstanceId must be specified. Known values are: "Default" and "PointInTimeRestore". :paramtype managed_instance_create_mode: str or ~azure.mgmt.sql.models.ManagedServerCreateMode - :keyword is_general_purpose_v2: Whether or not this is a GPv2 variant of General Purpose - edition. - :paramtype is_general_purpose_v2: bool :keyword administrator_login: Administrator username for the managed instance. Can only be specified when the managed instance is being created (and is required for creation). :paramtype administrator_login: str @@ -11497,22 +11212,12 @@ def __init__( # pylint: disable=too-many-locals inclusive of a new SQL license) and 'BasePrice' (discounted AHB price for bringing your own SQL licenses). Known values are: "LicenseIncluded" and "BasePrice". :paramtype license_type: str or ~azure.mgmt.sql.models.ManagedInstanceLicenseType - :keyword hybrid_secondary_usage: Hybrid secondary usage. Possible values are 'Active' (default - value) and 'Passive' (customer uses the secondary as Passive DR). Known values are: "Active" - and "Passive". - :paramtype hybrid_secondary_usage: str or ~azure.mgmt.sql.models.HybridSecondaryUsage :keyword v_cores: The number of vCores. Allowed values: 8, 16, 24, 32, 40, 64, 80. :paramtype v_cores: int :keyword storage_size_in_gb: Storage size in GB. Minimum value: 32. Maximum value: 16384. Increments of 32 GB allowed only. Maximum value depends on the selected hardware family and number of vCores. :paramtype storage_size_in_gb: int - :keyword storage_i_ops: Storage IOps. Minimum value: 300. Maximum value: 80000. Increments of 1 - IOps allowed only. Maximum value depends on the selected hardware family and number of vCores. - :paramtype storage_i_ops: int - :keyword storage_throughput_m_bps: Storage throughput MBps parameter is not supported in the - instance create/update operation. - :paramtype storage_throughput_m_bps: int :keyword collation: Collation of the managed instance. :paramtype collation: str :keyword dns_zone_partner: The resource id of another managed instance whose DNS zone this @@ -11531,7 +11236,7 @@ def __init__( # pylint: disable=too-many-locals :paramtype proxy_override: str or ~azure.mgmt.sql.models.ManagedInstanceProxyOverride :keyword timezone_id: Id of the timezone. Allowed values are timezones supported by Windows. Windows keeps details on supported timezones, including the id, in registry under - KEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones. + KEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Time Zones. You can get those registry values via SQL Server by querying SELECT name AS timezone_id FROM sys.time_zone_info. List of Ids can also be obtained by executing [System.TimeZoneInfo]::GetSystemTimeZones() in @@ -11564,15 +11269,6 @@ def __init__( # pylint: disable=too-many-locals :paramtype administrators: ~azure.mgmt.sql.models.ManagedInstanceExternalAdministrator :keyword service_principal: The managed instance's service principal. :paramtype service_principal: ~azure.mgmt.sql.models.ServicePrincipal - :keyword pricing_model: Weather or not Managed Instance is freemium. Known values are: - "Regular" and "Freemium". - :paramtype pricing_model: str or ~azure.mgmt.sql.models.FreemiumType - :keyword authentication_metadata: The managed instance's authentication metadata lookup mode. - Known values are: "AzureAD", "Paired", and "Windows". - :paramtype authentication_metadata: str or ~azure.mgmt.sql.models.AuthMetadataLookupModes - :keyword database_format: Specifies the internal format of instance databases specific to the - SQL engine version. Known values are: "AlwaysUpToDate" and "SQLServer2022". - :paramtype database_format: str or ~azure.mgmt.sql.models.ManagedInstanceDatabaseFormat """ super().__init__(location=location, tags=tags, **kwargs) self.identity = identity @@ -11580,18 +11276,13 @@ def __init__( # pylint: disable=too-many-locals self.provisioning_state = None self.managed_instance_create_mode = managed_instance_create_mode self.fully_qualified_domain_name = None - self.is_general_purpose_v2 = is_general_purpose_v2 self.administrator_login = administrator_login self.administrator_login_password = administrator_login_password self.subnet_id = subnet_id self.state = None self.license_type = license_type - self.hybrid_secondary_usage = hybrid_secondary_usage - self.hybrid_secondary_usage_detected = None self.v_cores = v_cores self.storage_size_in_gb = storage_size_in_gb - self.storage_i_ops = storage_i_ops - self.storage_throughput_m_bps = storage_throughput_m_bps self.collation = collation self.dns_zone = None self.dns_zone_partner = dns_zone_partner @@ -11611,12 +11302,6 @@ def __init__( # pylint: disable=too-many-locals self.key_id = key_id self.administrators = administrators self.service_principal = service_principal - self.virtual_cluster_id = None - self.external_governance_status = None - self.pricing_model = pricing_model - self.create_time = None - self.authentication_metadata = authentication_metadata - self.database_format = database_format class ManagedInstanceAdministrator(ProxyResource): @@ -13301,9 +12986,11 @@ class ManagedInstanceUpdate(_serialization.Model): # pylint: disable=too-many-i :vartype identity: ~azure.mgmt.sql.models.ResourceIdentity :ivar tags: Resource tags. :vartype tags: dict[str, str] - :ivar provisioning_state: Provisioning state of managed instance. Known values are: "Created", - "InProgress", "Succeeded", "Failed", and "Canceled". - :vartype provisioning_state: str or ~azure.mgmt.sql.models.ProvisioningState + :ivar provisioning_state: Known values are: "Creating", "Deleting", "Updating", "Unknown", + "Succeeded", "Failed", "Accepted", "Created", "Deleted", "Unrecognized", "Running", "Canceled", + "NotSpecified", "Registering", and "TimedOut". + :vartype provisioning_state: str or + ~azure.mgmt.sql.models.ManagedInstancePropertiesProvisioningState :ivar managed_instance_create_mode: Specifies the mode of database creation. Default: Regular instance creation. @@ -13314,8 +13001,6 @@ class ManagedInstanceUpdate(_serialization.Model): # pylint: disable=too-many-i :vartype managed_instance_create_mode: str or ~azure.mgmt.sql.models.ManagedServerCreateMode :ivar fully_qualified_domain_name: The fully qualified domain name of the managed instance. :vartype fully_qualified_domain_name: str - :ivar is_general_purpose_v2: Whether or not this is a GPv2 variant of General Purpose edition. - :vartype is_general_purpose_v2: bool :ivar administrator_login: Administrator username for the managed instance. Can only be specified when the managed instance is being created (and is required for creation). :vartype administrator_login: str @@ -13330,28 +13015,12 @@ class ManagedInstanceUpdate(_serialization.Model): # pylint: disable=too-many-i inclusive of a new SQL license) and 'BasePrice' (discounted AHB price for bringing your own SQL licenses). Known values are: "LicenseIncluded" and "BasePrice". :vartype license_type: str or ~azure.mgmt.sql.models.ManagedInstanceLicenseType - :ivar hybrid_secondary_usage: Hybrid secondary usage. Possible values are 'Active' (default - value) and 'Passive' (customer uses the secondary as Passive DR). Known values are: "Active" - and "Passive". - :vartype hybrid_secondary_usage: str or ~azure.mgmt.sql.models.HybridSecondaryUsage - :ivar hybrid_secondary_usage_detected: Hybrid secondary usage detected. Possible values are - 'Active' (customer does not meet the requirements to use the secondary as Passive DR) and - 'Passive' (customer meets the requirements to use the secondary as Passive DR). Known values - are: "Active" and "Passive". - :vartype hybrid_secondary_usage_detected: str or - ~azure.mgmt.sql.models.HybridSecondaryUsageDetected :ivar v_cores: The number of vCores. Allowed values: 8, 16, 24, 32, 40, 64, 80. :vartype v_cores: int :ivar storage_size_in_gb: Storage size in GB. Minimum value: 32. Maximum value: 16384. Increments of 32 GB allowed only. Maximum value depends on the selected hardware family and number of vCores. :vartype storage_size_in_gb: int - :ivar storage_i_ops: Storage IOps. Minimum value: 300. Maximum value: 80000. Increments of 1 - IOps allowed only. Maximum value depends on the selected hardware family and number of vCores. - :vartype storage_i_ops: int - :ivar storage_throughput_m_bps: Storage throughput MBps parameter is not supported in the - instance create/update operation. - :vartype storage_throughput_m_bps: int :ivar collation: Collation of the managed instance. :vartype collation: str :ivar dns_zone: The Dns Zone that the managed instance is in. @@ -13372,7 +13041,7 @@ class ManagedInstanceUpdate(_serialization.Model): # pylint: disable=too-many-i :vartype proxy_override: str or ~azure.mgmt.sql.models.ManagedInstanceProxyOverride :ivar timezone_id: Id of the timezone. Allowed values are timezones supported by Windows. Windows keeps details on supported timezones, including the id, in registry under - KEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones. + KEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Time Zones. You can get those registry values via SQL Server by querying SELECT name AS timezone_id FROM sys.time_zone_info. List of Ids can also be obtained by executing [System.TimeZoneInfo]::GetSystemTimeZones() in @@ -13413,36 +13082,15 @@ class ManagedInstanceUpdate(_serialization.Model): # pylint: disable=too-many-i :vartype administrators: ~azure.mgmt.sql.models.ManagedInstanceExternalAdministrator :ivar service_principal: The managed instance's service principal. :vartype service_principal: ~azure.mgmt.sql.models.ServicePrincipal - :ivar virtual_cluster_id: Virtual cluster resource id for the Managed Instance. - :vartype virtual_cluster_id: str - :ivar external_governance_status: Status of external governance. Known values are: "Enabled" - and "Disabled". - :vartype external_governance_status: str or ~azure.mgmt.sql.models.ExternalGovernanceStatus - :ivar pricing_model: Weather or not Managed Instance is freemium. Known values are: "Regular" - and "Freemium". - :vartype pricing_model: str or ~azure.mgmt.sql.models.FreemiumType - :ivar create_time: Specifies the point in time (ISO8601 format) of the Managed Instance - creation. - :vartype create_time: ~datetime.datetime - :ivar authentication_metadata: The managed instance's authentication metadata lookup mode. - Known values are: "AzureAD", "Paired", and "Windows". - :vartype authentication_metadata: str or ~azure.mgmt.sql.models.AuthMetadataLookupModes - :ivar database_format: Specifies the internal format of instance databases specific to the SQL - engine version. Known values are: "AlwaysUpToDate" and "SQLServer2022". - :vartype database_format: str or ~azure.mgmt.sql.models.ManagedInstanceDatabaseFormat """ _validation = { "provisioning_state": {"readonly": True}, "fully_qualified_domain_name": {"readonly": True}, "state": {"readonly": True}, - "hybrid_secondary_usage_detected": {"readonly": True}, "dns_zone": {"readonly": True}, "private_endpoint_connections": {"readonly": True}, "current_backup_storage_redundancy": {"readonly": True}, - "virtual_cluster_id": {"readonly": True}, - "external_governance_status": {"readonly": True}, - "create_time": {"readonly": True}, } _attribute_map = { @@ -13452,18 +13100,13 @@ class ManagedInstanceUpdate(_serialization.Model): # pylint: disable=too-many-i "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, "managed_instance_create_mode": {"key": "properties.managedInstanceCreateMode", "type": "str"}, "fully_qualified_domain_name": {"key": "properties.fullyQualifiedDomainName", "type": "str"}, - "is_general_purpose_v2": {"key": "properties.isGeneralPurposeV2", "type": "bool"}, "administrator_login": {"key": "properties.administratorLogin", "type": "str"}, "administrator_login_password": {"key": "properties.administratorLoginPassword", "type": "str"}, "subnet_id": {"key": "properties.subnetId", "type": "str"}, "state": {"key": "properties.state", "type": "str"}, "license_type": {"key": "properties.licenseType", "type": "str"}, - "hybrid_secondary_usage": {"key": "properties.hybridSecondaryUsage", "type": "str"}, - "hybrid_secondary_usage_detected": {"key": "properties.hybridSecondaryUsageDetected", "type": "str"}, "v_cores": {"key": "properties.vCores", "type": "int"}, "storage_size_in_gb": {"key": "properties.storageSizeInGB", "type": "int"}, - "storage_i_ops": {"key": "properties.storageIOps", "type": "int"}, - "storage_throughput_m_bps": {"key": "properties.storageThroughputMBps", "type": "int"}, "collation": {"key": "properties.collation", "type": "str"}, "dns_zone": {"key": "properties.dnsZone", "type": "str"}, "dns_zone_partner": {"key": "properties.dnsZonePartner", "type": "str"}, @@ -13486,12 +13129,6 @@ class ManagedInstanceUpdate(_serialization.Model): # pylint: disable=too-many-i "key_id": {"key": "properties.keyId", "type": "str"}, "administrators": {"key": "properties.administrators", "type": "ManagedInstanceExternalAdministrator"}, "service_principal": {"key": "properties.servicePrincipal", "type": "ServicePrincipal"}, - "virtual_cluster_id": {"key": "properties.virtualClusterId", "type": "str"}, - "external_governance_status": {"key": "properties.externalGovernanceStatus", "type": "str"}, - "pricing_model": {"key": "properties.pricingModel", "type": "str"}, - "create_time": {"key": "properties.createTime", "type": "iso-8601"}, - "authentication_metadata": {"key": "properties.authenticationMetadata", "type": "str"}, - "database_format": {"key": "properties.databaseFormat", "type": "str"}, } def __init__( # pylint: disable=too-many-locals @@ -13501,16 +13138,12 @@ def __init__( # pylint: disable=too-many-locals identity: Optional["_models.ResourceIdentity"] = None, tags: Optional[Dict[str, str]] = None, managed_instance_create_mode: Optional[Union[str, "_models.ManagedServerCreateMode"]] = None, - is_general_purpose_v2: Optional[bool] = None, administrator_login: Optional[str] = None, administrator_login_password: Optional[str] = None, subnet_id: Optional[str] = None, license_type: Optional[Union[str, "_models.ManagedInstanceLicenseType"]] = None, - hybrid_secondary_usage: Optional[Union[str, "_models.HybridSecondaryUsage"]] = None, v_cores: Optional[int] = None, storage_size_in_gb: Optional[int] = None, - storage_i_ops: Optional[int] = None, - storage_throughput_m_bps: Optional[int] = None, collation: Optional[str] = None, dns_zone_partner: Optional[str] = None, public_data_endpoint_enabled: Optional[bool] = None, @@ -13527,9 +13160,6 @@ def __init__( # pylint: disable=too-many-locals key_id: Optional[str] = None, administrators: Optional["_models.ManagedInstanceExternalAdministrator"] = None, service_principal: Optional["_models.ServicePrincipal"] = None, - pricing_model: Optional[Union[str, "_models.FreemiumType"]] = None, - authentication_metadata: Optional[Union[str, "_models.AuthMetadataLookupModes"]] = None, - database_format: Optional[Union[str, "_models.ManagedInstanceDatabaseFormat"]] = None, **kwargs: Any ) -> None: """ @@ -13547,9 +13177,6 @@ def __init__( # pylint: disable=too-many-locals RestorePointInTime and SourceManagedInstanceId must be specified. Known values are: "Default" and "PointInTimeRestore". :paramtype managed_instance_create_mode: str or ~azure.mgmt.sql.models.ManagedServerCreateMode - :keyword is_general_purpose_v2: Whether or not this is a GPv2 variant of General Purpose - edition. - :paramtype is_general_purpose_v2: bool :keyword administrator_login: Administrator username for the managed instance. Can only be specified when the managed instance is being created (and is required for creation). :paramtype administrator_login: str @@ -13562,22 +13189,12 @@ def __init__( # pylint: disable=too-many-locals inclusive of a new SQL license) and 'BasePrice' (discounted AHB price for bringing your own SQL licenses). Known values are: "LicenseIncluded" and "BasePrice". :paramtype license_type: str or ~azure.mgmt.sql.models.ManagedInstanceLicenseType - :keyword hybrid_secondary_usage: Hybrid secondary usage. Possible values are 'Active' (default - value) and 'Passive' (customer uses the secondary as Passive DR). Known values are: "Active" - and "Passive". - :paramtype hybrid_secondary_usage: str or ~azure.mgmt.sql.models.HybridSecondaryUsage :keyword v_cores: The number of vCores. Allowed values: 8, 16, 24, 32, 40, 64, 80. :paramtype v_cores: int :keyword storage_size_in_gb: Storage size in GB. Minimum value: 32. Maximum value: 16384. Increments of 32 GB allowed only. Maximum value depends on the selected hardware family and number of vCores. :paramtype storage_size_in_gb: int - :keyword storage_i_ops: Storage IOps. Minimum value: 300. Maximum value: 80000. Increments of 1 - IOps allowed only. Maximum value depends on the selected hardware family and number of vCores. - :paramtype storage_i_ops: int - :keyword storage_throughput_m_bps: Storage throughput MBps parameter is not supported in the - instance create/update operation. - :paramtype storage_throughput_m_bps: int :keyword collation: Collation of the managed instance. :paramtype collation: str :keyword dns_zone_partner: The resource id of another managed instance whose DNS zone this @@ -13596,7 +13213,7 @@ def __init__( # pylint: disable=too-many-locals :paramtype proxy_override: str or ~azure.mgmt.sql.models.ManagedInstanceProxyOverride :keyword timezone_id: Id of the timezone. Allowed values are timezones supported by Windows. Windows keeps details on supported timezones, including the id, in registry under - KEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones. + KEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Time Zones. You can get those registry values via SQL Server by querying SELECT name AS timezone_id FROM sys.time_zone_info. List of Ids can also be obtained by executing [System.TimeZoneInfo]::GetSystemTimeZones() in @@ -13629,15 +13246,6 @@ def __init__( # pylint: disable=too-many-locals :paramtype administrators: ~azure.mgmt.sql.models.ManagedInstanceExternalAdministrator :keyword service_principal: The managed instance's service principal. :paramtype service_principal: ~azure.mgmt.sql.models.ServicePrincipal - :keyword pricing_model: Weather or not Managed Instance is freemium. Known values are: - "Regular" and "Freemium". - :paramtype pricing_model: str or ~azure.mgmt.sql.models.FreemiumType - :keyword authentication_metadata: The managed instance's authentication metadata lookup mode. - Known values are: "AzureAD", "Paired", and "Windows". - :paramtype authentication_metadata: str or ~azure.mgmt.sql.models.AuthMetadataLookupModes - :keyword database_format: Specifies the internal format of instance databases specific to the - SQL engine version. Known values are: "AlwaysUpToDate" and "SQLServer2022". - :paramtype database_format: str or ~azure.mgmt.sql.models.ManagedInstanceDatabaseFormat """ super().__init__(**kwargs) self.sku = sku @@ -13646,18 +13254,13 @@ def __init__( # pylint: disable=too-many-locals self.provisioning_state = None self.managed_instance_create_mode = managed_instance_create_mode self.fully_qualified_domain_name = None - self.is_general_purpose_v2 = is_general_purpose_v2 self.administrator_login = administrator_login self.administrator_login_password = administrator_login_password self.subnet_id = subnet_id self.state = None self.license_type = license_type - self.hybrid_secondary_usage = hybrid_secondary_usage - self.hybrid_secondary_usage_detected = None self.v_cores = v_cores self.storage_size_in_gb = storage_size_in_gb - self.storage_i_ops = storage_i_ops - self.storage_throughput_m_bps = storage_throughput_m_bps self.collation = collation self.dns_zone = None self.dns_zone_partner = dns_zone_partner @@ -13677,12 +13280,6 @@ def __init__( # pylint: disable=too-many-locals self.key_id = key_id self.administrators = administrators self.service_principal = service_principal - self.virtual_cluster_id = None - self.external_governance_status = None - self.pricing_model = pricing_model - self.create_time = None - self.authentication_metadata = authentication_metadata - self.database_format = database_format class ManagedInstanceVcoresCapability(_serialization.Model): @@ -15553,46 +15150,6 @@ def __init__(self, *, metrics: Optional[List["_models.QueryMetricProperties"]] = self.metrics = metrics -class QueryMetricIntervalAutoGenerated(_serialization.Model): - """Properties of a query metrics interval. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar interval_start_time: The start time for the metric interval (ISO-8601 format). - :vartype interval_start_time: str - :ivar interval_type: Interval type (length). Known values are: "PT1H" and "P1D". - :vartype interval_type: str or ~azure.mgmt.sql.models.QueryTimeGrainType - :ivar execution_count: Execution count of a query in this interval. - :vartype execution_count: int - :ivar metrics: List of metric objects for this interval. - :vartype metrics: list[~azure.mgmt.sql.models.QueryMetricProperties] - """ - - _validation = { - "interval_start_time": {"readonly": True}, - "interval_type": {"readonly": True}, - "execution_count": {"readonly": True}, - } - - _attribute_map = { - "interval_start_time": {"key": "intervalStartTime", "type": "str"}, - "interval_type": {"key": "intervalType", "type": "str"}, - "execution_count": {"key": "executionCount", "type": "int"}, - "metrics": {"key": "metrics", "type": "[QueryMetricProperties]"}, - } - - def __init__(self, *, metrics: Optional[List["_models.QueryMetricProperties"]] = None, **kwargs: Any) -> None: - """ - :keyword metrics: List of metric objects for this interval. - :paramtype metrics: list[~azure.mgmt.sql.models.QueryMetricProperties] - """ - super().__init__(**kwargs) - self.interval_start_time = None - self.interval_type = None - self.execution_count = None - self.metrics = metrics - - class QueryMetricProperties(_serialization.Model): """Properties of a topquery metric in one interval. @@ -15728,7 +15285,7 @@ class QueryStatisticsProperties(_serialization.Model): :ivar end_time: The end time for the metric (ISO-8601 format). :vartype end_time: str :ivar intervals: List of intervals with appropriate metric data. - :vartype intervals: list[~azure.mgmt.sql.models.QueryMetricIntervalAutoGenerated] + :vartype intervals: list[~azure.mgmt.sql.models.QueryMetricInterval] """ _validation = { @@ -15743,15 +15300,13 @@ class QueryStatisticsProperties(_serialization.Model): "query_id": {"key": "queryId", "type": "str"}, "start_time": {"key": "startTime", "type": "str"}, "end_time": {"key": "endTime", "type": "str"}, - "intervals": {"key": "intervals", "type": "[QueryMetricIntervalAutoGenerated]"}, + "intervals": {"key": "intervals", "type": "[QueryMetricInterval]"}, } - def __init__( - self, *, intervals: Optional[List["_models.QueryMetricIntervalAutoGenerated"]] = None, **kwargs: Any - ) -> None: + def __init__(self, *, intervals: Optional[List["_models.QueryMetricInterval"]] = None, **kwargs: Any) -> None: """ :keyword intervals: List of intervals with appropriate metric data. - :paramtype intervals: list[~azure.mgmt.sql.models.QueryMetricIntervalAutoGenerated] + :paramtype intervals: list[~azure.mgmt.sql.models.QueryMetricInterval] """ super().__init__(**kwargs) self.database_name = None @@ -16492,66 +16047,6 @@ def __init__(self, **kwargs: Any) -> None: self.error_message = None -class RefreshExternalGovernanceStatusOperationResultMI(ProxyResource): # pylint: disable=name-too-long - """An RefreshExternalGovernanceStatus operation result resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource ID. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :ivar request_id: Request Id. - :vartype request_id: str - :ivar request_type: Request type. - :vartype request_type: str - :ivar queued_time: Queued time. - :vartype queued_time: str - :ivar managed_instance_name: Managed instance name. - :vartype managed_instance_name: str - :ivar status: Operation status. - :vartype status: str - :ivar error_message: Error message. - :vartype error_message: str - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "request_id": {"readonly": True}, - "request_type": {"readonly": True}, - "queued_time": {"readonly": True}, - "managed_instance_name": {"readonly": True}, - "status": {"readonly": True}, - "error_message": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "request_id": {"key": "properties.requestId", "type": "str"}, - "request_type": {"key": "properties.requestType", "type": "str"}, - "queued_time": {"key": "properties.queuedTime", "type": "str"}, - "managed_instance_name": {"key": "properties.managedInstanceName", "type": "str"}, - "status": {"key": "properties.status", "type": "str"}, - "error_message": {"key": "properties.errorMessage", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.request_id = None - self.request_type = None - self.queued_time = None - self.managed_instance_name = None - self.status = None - self.error_message = None - - class Remediation(_serialization.Model): """SQL Vulnerability Assessment remediation Details. @@ -16605,6 +16100,8 @@ class ReplicationLink(ProxyResource): # pylint: disable=too-many-instance-attri :vartype partner_server: str :ivar partner_database: Resource partner database. :vartype partner_database: str + :ivar partner_database_id: Resource partner database Id. + :vartype partner_database_id: str :ivar partner_location: Resource partner location. :vartype partner_location: str :ivar role: Local replication role. Known values are: "Primary", "Secondary", @@ -16624,8 +16121,8 @@ class ReplicationLink(ProxyResource): # pylint: disable=too-many-instance-attri :vartype replication_state: str or ~azure.mgmt.sql.models.ReplicationState :ivar is_termination_allowed: Whether the user is currently allowed to terminate the link. :vartype is_termination_allowed: bool - :ivar link_type: Link type (GEO, NAMED, STANDBY). Known values are: "GEO", "NAMED", and - "STANDBY". + :ivar link_type: Link type (GEO, NAMED, STANDBY). Update operation does not support NAMED. + Known values are: "GEO", "NAMED", and "STANDBY". :vartype link_type: str or ~azure.mgmt.sql.models.ReplicationLinkType """ @@ -16635,6 +16132,7 @@ class ReplicationLink(ProxyResource): # pylint: disable=too-many-instance-attri "type": {"readonly": True}, "partner_server": {"readonly": True}, "partner_database": {"readonly": True}, + "partner_database_id": {"readonly": True}, "partner_location": {"readonly": True}, "role": {"readonly": True}, "partner_role": {"readonly": True}, @@ -16643,7 +16141,6 @@ class ReplicationLink(ProxyResource): # pylint: disable=too-many-instance-attri "percent_complete": {"readonly": True}, "replication_state": {"readonly": True}, "is_termination_allowed": {"readonly": True}, - "link_type": {"readonly": True}, } _attribute_map = { @@ -16652,6 +16149,7 @@ class ReplicationLink(ProxyResource): # pylint: disable=too-many-instance-attri "type": {"key": "type", "type": "str"}, "partner_server": {"key": "properties.partnerServer", "type": "str"}, "partner_database": {"key": "properties.partnerDatabase", "type": "str"}, + "partner_database_id": {"key": "properties.partnerDatabaseId", "type": "str"}, "partner_location": {"key": "properties.partnerLocation", "type": "str"}, "role": {"key": "properties.role", "type": "str"}, "partner_role": {"key": "properties.partnerRole", "type": "str"}, @@ -16663,11 +16161,16 @@ class ReplicationLink(ProxyResource): # pylint: disable=too-many-instance-attri "link_type": {"key": "properties.linkType", "type": "str"}, } - def __init__(self, **kwargs: Any) -> None: - """ """ + def __init__(self, *, link_type: Optional[Union[str, "_models.ReplicationLinkType"]] = None, **kwargs: Any) -> None: + """ + :keyword link_type: Link type (GEO, NAMED, STANDBY). Update operation does not support NAMED. + Known values are: "GEO", "NAMED", and "STANDBY". + :paramtype link_type: str or ~azure.mgmt.sql.models.ReplicationLinkType + """ super().__init__(**kwargs) self.partner_server = None self.partner_database = None + self.partner_database_id = None self.partner_location = None self.role = None self.partner_role = None @@ -16676,7 +16179,7 @@ def __init__(self, **kwargs: Any) -> None: self.percent_complete = None self.replication_state = None self.is_termination_allowed = None - self.link_type = None + self.link_type = link_type class ReplicationLinkListResult(_serialization.Model): @@ -16707,6 +16210,45 @@ def __init__(self, **kwargs: Any) -> None: self.next_link = None +class ReplicationLinkUpdate(ProxyResource): + """A replication link update request. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar link_type: Link type (GEO, NAMED, STANDBY). Update operation does not support NAMED. + Known values are: "GEO", "NAMED", and "STANDBY". + :vartype link_type: str or ~azure.mgmt.sql.models.ReplicationLinkType + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "link_type": {"key": "properties.linkType", "type": "str"}, + } + + def __init__(self, *, link_type: Optional[Union[str, "_models.ReplicationLinkType"]] = None, **kwargs: Any) -> None: + """ + :keyword link_type: Link type (GEO, NAMED, STANDBY). Update operation does not support NAMED. + Known values are: "GEO", "NAMED", and "STANDBY". + :paramtype link_type: str or ~azure.mgmt.sql.models.ReplicationLinkType + """ + super().__init__(**kwargs) + self.link_type = link_type + + class ResourceIdentity(_serialization.Model): """Azure Active Directory identity configuration for a resource. diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/_sql_management_client_enums.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/_sql_management_client_enums.py index 99769869dc61..03b24a306a0c 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/_sql_management_client_enums.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/_sql_management_client_enums.py @@ -72,14 +72,6 @@ class AuthenticationName(str, Enum, metaclass=CaseInsensitiveEnumMeta): DEFAULT = "Default" -class AuthMetadataLookupModes(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The managed instance's authentication metadata lookup mode.""" - - AZURE_AD = "AzureAD" - PAIRED = "Paired" - WINDOWS = "Windows" - - class AutoExecuteStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Gets the auto-execute status (whether to let the system execute the recommendations) of this advisor. Possible values are 'Enabled' and 'Disabled'. @@ -503,6 +495,13 @@ class ExternalGovernanceStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): DISABLED = "Disabled" +class FailoverGroupDatabasesSecondaryType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Databases secondary type on partner server.""" + + GEO = "Geo" + STANDBY = "Standby" + + class FailoverGroupReplicationRole(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Local replication role of the failover group instance.""" @@ -510,22 +509,6 @@ class FailoverGroupReplicationRole(str, Enum, metaclass=CaseInsensitiveEnumMeta) SECONDARY = "Secondary" -class FailoverModeType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The link failover mode - can be Manual if intended to be used for two-way failover with a - supported SQL Server, or None for one-way failover to Azure. - """ - - NONE = "None" - MANUAL = "Manual" - - -class FailoverType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The failover type, can be ForcedAllowDataLoss or Planned.""" - - FORCED_ALLOW_DATA_LOSS = "ForcedAllowDataLoss" - PLANNED = "Planned" - - class FreeLimitExhaustionBehavior(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Specifies the behavior when monthly free limits are exhausted for the free database. @@ -540,13 +523,6 @@ class FreeLimitExhaustionBehavior(str, Enum, metaclass=CaseInsensitiveEnumMeta): BILL_OVER_USAGE = "BillOverUsage" -class FreemiumType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Weather or not Managed Instance is freemium.""" - - REGULAR = "Regular" - FREEMIUM = "Freemium" - - class GeoBackupPolicyName(str, Enum, metaclass=CaseInsensitiveEnumMeta): """GeoBackupPolicyName.""" @@ -560,25 +536,6 @@ class GeoBackupPolicyState(str, Enum, metaclass=CaseInsensitiveEnumMeta): ENABLED = "Enabled" -class HybridSecondaryUsage(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Hybrid secondary usage. Possible values are 'Active' (default value) and 'Passive' (customer - uses the secondary as Passive DR). - """ - - ACTIVE = "Active" - PASSIVE = "Passive" - - -class HybridSecondaryUsageDetected(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Hybrid secondary usage detected. Possible values are 'Active' (customer does not meet the - requirements to use the secondary as Passive DR) and 'Passive' (customer meets the requirements - to use the secondary as Passive DR). - """ - - ACTIVE = "Active" - PASSIVE = "Passive" - - class IdentityType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The identity type. Set this to 'SystemAssigned' in order to automatically create and assign an Azure Active Directory principal for the resource. @@ -615,13 +572,6 @@ class InstancePoolLicenseType(str, Enum, metaclass=CaseInsensitiveEnumMeta): BASE_PRICE = "BasePrice" -class InstanceRole(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """New role of managed instance in a distributed availability group, can be Primary or Secondary.""" - - PRIMARY = "Primary" - SECONDARY = "Secondary" - - class IsRetryable(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Gets whether the error could be ignored and recommended action could be retried. Possible values are: Yes/No. @@ -711,13 +661,6 @@ class LedgerDigestUploadsState(str, Enum, metaclass=CaseInsensitiveEnumMeta): DISABLED = "Disabled" -class LinkRole(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """SQL server side link role.""" - - PRIMARY = "Primary" - SECONDARY = "Secondary" - - class LogSizeUnit(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The units that the limit is expressed in.""" @@ -775,13 +718,6 @@ class ManagedInstanceAdministratorType(str, Enum, metaclass=CaseInsensitiveEnumM ACTIVE_DIRECTORY = "ActiveDirectory" -class ManagedInstanceDatabaseFormat(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Specifies the internal format of instance databases specific to the SQL engine version.""" - - ALWAYS_UP_TO_DATE = "AlwaysUpToDate" - SQL_SERVER2022 = "SQLServer2022" - - class ManagedInstanceLicenseType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The license type. Possible values are 'LicenseIncluded' (regular price inclusive of a new SQL license) and 'BasePrice' (discounted AHB price for bringing your own SQL licenses). @@ -797,6 +733,26 @@ class ManagedInstanceLongTermRetentionPolicyName(str, Enum, metaclass=CaseInsens DEFAULT = "default" +class ManagedInstancePropertiesProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """ManagedInstancePropertiesProvisioningState.""" + + CREATING = "Creating" + DELETING = "Deleting" + UPDATING = "Updating" + UNKNOWN = "Unknown" + SUCCEEDED = "Succeeded" + FAILED = "Failed" + ACCEPTED = "Accepted" + CREATED = "Created" + DELETED = "Deleted" + UNRECOGNIZED = "Unrecognized" + RUNNING = "Running" + CANCELED = "Canceled" + NOT_SPECIFIED = "NotSpecified" + REGISTERING = "Registering" + TIMED_OUT = "TimedOut" + + class ManagedInstanceProxyOverride(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Connection type used for connecting to the instance.""" @@ -1048,31 +1004,18 @@ class RecommendedSensitivityLabelUpdateKind(str, Enum, metaclass=CaseInsensitive DISABLE = "disable" -class ReplicaConnectedState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Link connected state.""" - - DISCONNECTED = "DISCONNECTED" - CONNECTED = "CONNECTED" - - -class ReplicaSynchronizationHealth(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Link health state.""" - - NOT_HEALTHY = "NOT_HEALTHY" - PARTIALLY_HEALTHY = "PARTIALLY_HEALTHY" - HEALTHY = "HEALTHY" - - class ReplicationLinkType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Link type (GEO, NAMED, STANDBY).""" + """Link type (GEO, NAMED, STANDBY). Update operation does not support NAMED.""" GEO = "GEO" NAMED = "NAMED" STANDBY = "STANDBY" -class ReplicationModeType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Replication mode of the link.""" +class ReplicationMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The replication mode of a distributed availability group. Parameter will be ignored during link + creation. + """ ASYNC_ENUM = "Async" SYNC = "Sync" @@ -1117,13 +1060,6 @@ class RestorePointType(str, Enum, metaclass=CaseInsensitiveEnumMeta): DISCRETE = "DISCRETE" -class RoleChangeType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The type of the role change, can be Planned or Forced.""" - - FORCED = "Forced" - PLANNED = "Planned" - - class RuleSeverity(str, Enum, metaclass=CaseInsensitiveEnumMeta): """SQL Vulnerability Assessment rule severity.""" @@ -1209,13 +1145,6 @@ class SecurityEventType(str, Enum, metaclass=CaseInsensitiveEnumMeta): SQL_INJECTION_EXPLOIT = "SqlInjectionExploit" -class SeedingModeType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Database seeding mode – can be Automatic (default), or Manual for supported scenarios.""" - - AUTOMATIC = "Automatic" - MANUAL = "Manual" - - class SensitivityLabelRank(str, Enum, metaclass=CaseInsensitiveEnumMeta): """SensitivityLabelRank.""" diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/__init__.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/__init__.py index 9d571ab6d5e8..137da16d048c 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/__init__.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/__init__.py @@ -138,7 +138,6 @@ from ._managed_instance_advanced_threat_protection_settings_operations import ( ManagedInstanceAdvancedThreatProtectionSettingsOperations, ) -from ._replication_links_operations import ReplicationLinksOperations from ._managed_database_move_operations_operations import ManagedDatabaseMoveOperationsOperations from ._managed_instance_dtcs_operations import ManagedInstanceDtcsOperations from ._synapse_link_workspaces_operations import SynapseLinkWorkspacesOperations @@ -147,6 +146,7 @@ from ._managed_database_restore_details_operations import ManagedDatabaseRestoreDetailsOperations from ._database_encryption_protectors_operations import DatabaseEncryptionProtectorsOperations from ._managed_databases_operations import ManagedDatabasesOperations +from ._managed_instances_operations import ManagedInstancesOperations from ._managed_ledger_digest_uploads_operations import ManagedLedgerDigestUploadsOperations from ._recoverable_databases_operations import RecoverableDatabasesOperations from ._restorable_dropped_databases_operations import RestorableDroppedDatabasesOperations @@ -184,8 +184,8 @@ from ._instance_pools_operations import InstancePoolsOperations from ._long_term_retention_backups_operations import LongTermRetentionBackupsOperations from ._long_term_retention_policies_operations import LongTermRetentionPoliciesOperations -from ._managed_instances_operations import ManagedInstancesOperations from ._servers_operations import ServersOperations +from ._replication_links_operations import ReplicationLinksOperations from ._patch import __all__ as _patch_all from ._patch import * # pylint: disable=unused-wildcard-import @@ -304,7 +304,6 @@ "ManagedServerDnsAliasesOperations", "ManagedDatabaseAdvancedThreatProtectionSettingsOperations", "ManagedInstanceAdvancedThreatProtectionSettingsOperations", - "ReplicationLinksOperations", "ManagedDatabaseMoveOperationsOperations", "ManagedInstanceDtcsOperations", "SynapseLinkWorkspacesOperations", @@ -313,6 +312,7 @@ "ManagedDatabaseRestoreDetailsOperations", "DatabaseEncryptionProtectorsOperations", "ManagedDatabasesOperations", + "ManagedInstancesOperations", "ManagedLedgerDigestUploadsOperations", "RecoverableDatabasesOperations", "RestorableDroppedDatabasesOperations", @@ -340,8 +340,8 @@ "InstancePoolsOperations", "LongTermRetentionBackupsOperations", "LongTermRetentionPoliciesOperations", - "ManagedInstancesOperations", "ServersOperations", + "ReplicationLinksOperations", ] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_backup_short_term_retention_policies_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_backup_short_term_retention_policies_operations.py index 5c6c6f912a5a..ed7373701999 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_backup_short_term_retention_policies_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_backup_short_term_retention_policies_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -31,6 +32,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -233,7 +238,7 @@ def get( :rtype: ~azure.mgmt.sql.models.BackupShortTermRetentionPolicy :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -287,7 +292,7 @@ def _create_or_update_initial( parameters: Union[_models.BackupShortTermRetentionPolicy, IO[bytes]], **kwargs: Any ) -> Optional[_models.BackupShortTermRetentionPolicy]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -500,7 +505,7 @@ def _update_initial( parameters: Union[_models.BackupShortTermRetentionPolicy, IO[bytes]], **kwargs: Any ) -> Optional[_models.BackupShortTermRetentionPolicy]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -728,7 +733,7 @@ def list_by_database( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) cls: ClsType[_models.BackupShortTermRetentionPolicyListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_capabilities_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_capabilities_operations.py index 872ee44620ad..4a4af584a11b 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_capabilities_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_capabilities_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar, Union +import sys +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -27,6 +28,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -105,7 +110,7 @@ def list_by_location( :rtype: ~azure.mgmt.sql.models.LocationCapabilities :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_data_masking_policies_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_data_masking_policies_operations.py index dca1da81d896..5380818d79cb 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_data_masking_policies_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_data_masking_policies_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Literal, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Literal, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -210,7 +215,7 @@ def create_or_update( :rtype: ~azure.mgmt.sql.models.DataMaskingPolicy :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -285,7 +290,7 @@ def get( :rtype: ~azure.mgmt.sql.models.DataMaskingPolicy :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_data_masking_rules_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_data_masking_rules_operations.py index 8c206739ea1e..1d97a610c454 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_data_masking_rules_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_data_masking_rules_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Literal, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Literal, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -29,6 +30,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -228,7 +233,7 @@ def create_or_update( :rtype: ~azure.mgmt.sql.models.DataMaskingRule :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -315,7 +320,7 @@ def list_by_database( data_masking_policy_name: Literal["Default"] = kwargs.pop("data_masking_policy_name", "Default") cls: ClsType[_models.DataMaskingRuleListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_data_warehouse_user_activities_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_data_warehouse_user_activities_operations.py index 6b79df9d0d50..de01ec08cfd1 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_data_warehouse_user_activities_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_data_warehouse_user_activities_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -152,7 +157,7 @@ def get( :rtype: ~azure.mgmt.sql.models.DataWarehouseUserActivities :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -221,7 +226,7 @@ def list_by_database( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.DataWarehouseUserActivitiesListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_advanced_threat_protection_settings_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_advanced_threat_protection_settings_operations.py index fb3deddf9edf..4a5daa623f46 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_advanced_threat_protection_settings_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_advanced_threat_protection_settings_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -29,6 +30,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -194,7 +199,7 @@ def list_by_database( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) cls: ClsType[_models.DatabaseAdvancedThreatProtectionListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -274,7 +279,7 @@ def get( :rtype: ~azure.mgmt.sql.models.DatabaseAdvancedThreatProtection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -419,7 +424,7 @@ def create_or_update( :rtype: ~azure.mgmt.sql.models.DatabaseAdvancedThreatProtection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_advisors_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_advisors_operations.py index f284df337d4b..2300144a121c 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_advisors_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_advisors_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, List, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, List, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -197,7 +202,7 @@ def list_by_database( :rtype: list[~azure.mgmt.sql.models.Advisor] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -261,7 +266,7 @@ def get( :rtype: ~azure.mgmt.sql.models.Advisor :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -400,7 +405,7 @@ def update( :rtype: ~azure.mgmt.sql.models.Advisor :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_automatic_tuning_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_automatic_tuning_operations.py index 9c41b4f1c4ad..c904b7615bc5 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_automatic_tuning_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_automatic_tuning_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -138,7 +143,7 @@ def get( :rtype: ~azure.mgmt.sql.models.DatabaseAutomaticTuning :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -267,7 +272,7 @@ def update( :rtype: ~azure.mgmt.sql.models.DatabaseAutomaticTuning :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_blob_auditing_policies_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_blob_auditing_policies_operations.py index 230a463914c3..c79678b8f772 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_blob_auditing_policies_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_blob_auditing_policies_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Literal, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Literal, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -29,6 +30,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -182,7 +187,7 @@ def list_by_database( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) cls: ClsType[_models.DatabaseBlobAuditingPolicyListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -253,7 +258,7 @@ def get( :rtype: ~azure.mgmt.sql.models.DatabaseBlobAuditingPolicy :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -384,7 +389,7 @@ def create_or_update( :rtype: ~azure.mgmt.sql.models.DatabaseBlobAuditingPolicy :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_columns_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_columns_operations.py index 70b57b2aeb8f..cb1f46c17d95 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_columns_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_columns_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, List, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, List, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -235,7 +240,7 @@ def list_by_database( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.DatabaseColumnListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -331,7 +336,7 @@ def list_by_table( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.DatabaseColumnListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -418,7 +423,7 @@ def get( :rtype: ~azure.mgmt.sql.models.DatabaseColumn :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_encryption_protectors_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_encryption_protectors_operations.py index 7babff876f5a..0ff12fadd99d 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_encryption_protectors_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_encryption_protectors_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar, Union, cast +import sys +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union, cast from azure.core.exceptions import ( ClientAuthenticationError, @@ -29,6 +30,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -127,7 +132,7 @@ def _revalidate_initial( # pylint: disable=inconsistent-return-statements encryption_protector_name: Union[str, _models.EncryptionProtectorName], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -244,7 +249,7 @@ def _revert_initial( # pylint: disable=inconsistent-return-statements encryption_protector_name: Union[str, _models.EncryptionProtectorName], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_extensions_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_extensions_operations.py index ff2d1de283a3..9e0142d15acc 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_extensions_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_extensions_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -31,6 +32,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -181,7 +186,7 @@ def get( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -231,7 +236,7 @@ def _create_or_update_initial( parameters: Union[_models.DatabaseExtensions, IO[bytes]], **kwargs: Any ) -> Optional[_models.ImportExportExtensionsOperationResult]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -463,7 +468,7 @@ def list_by_database( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) cls: ClsType[_models.ImportExportExtensionsOperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_operations_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_operations_operations.py index e535743d92de..5c7da9c635f2 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_operations_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_operations_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -141,7 +146,7 @@ def list_by_database( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) cls: ClsType[_models.DatabaseOperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -214,7 +219,7 @@ def cancel( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_recommended_actions_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_recommended_actions_operations.py index 4a3288d56180..0979d396d16f 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_recommended_actions_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_recommended_actions_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, List, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, List, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -194,7 +199,7 @@ def list_by_database_advisor( :rtype: list[~azure.mgmt.sql.models.RecommendedAction] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -266,7 +271,7 @@ def get( :rtype: ~azure.mgmt.sql.models.RecommendedAction :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -415,7 +420,7 @@ def update( :rtype: ~azure.mgmt.sql.models.RecommendedAction :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_schemas_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_schemas_operations.py index df4df3440efd..f27a1de34a40 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_schemas_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_schemas_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -163,7 +168,7 @@ def list_by_database( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.DatabaseSchemaListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -237,7 +242,7 @@ def get( :rtype: ~azure.mgmt.sql.models.DatabaseSchema :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_security_alert_policies_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_security_alert_policies_operations.py index 8519b813f4eb..c1aafcf0df75 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_security_alert_policies_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_security_alert_policies_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -29,6 +30,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -191,7 +196,7 @@ def get( :rtype: ~azure.mgmt.sql.models.DatabaseSecurityAlertPolicy :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -333,7 +338,7 @@ def create_or_update( :rtype: ~azure.mgmt.sql.models.DatabaseSecurityAlertPolicy :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -419,7 +424,7 @@ def list_by_database( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.DatabaseSecurityAlertListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_sql_vulnerability_assessment_baselines_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_sql_vulnerability_assessment_baselines_operations.py index 02dff13554e4..5ad6d8362791 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_sql_vulnerability_assessment_baselines_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_sql_vulnerability_assessment_baselines_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -29,6 +30,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -215,7 +220,7 @@ def list_by_sql_vulnerability_assessment( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) cls: ClsType[_models.DatabaseSqlVulnerabilityAssessmentBaselineSetListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -300,7 +305,7 @@ def get( :rtype: ~azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentBaselineSet :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -454,7 +459,7 @@ def create_or_update( :rtype: ~azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentBaselineSet :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_sql_vulnerability_assessment_execute_scan_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_sql_vulnerability_assessment_execute_scan_operations.py index 972954884a0a..888b13224315 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_sql_vulnerability_assessment_execute_scan_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_sql_vulnerability_assessment_execute_scan_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar, Union, cast +import sys +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union, cast from azure.core.exceptions import ( ClientAuthenticationError, @@ -29,6 +30,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -97,7 +102,7 @@ def _execute_initial( # pylint: disable=inconsistent-return-statements vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_sql_vulnerability_assessment_rule_baselines_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_sql_vulnerability_assessment_rule_baselines_operations.py index d8acf95517de..c7fad6d1d630 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_sql_vulnerability_assessment_rule_baselines_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_sql_vulnerability_assessment_rule_baselines_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -29,6 +30,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -262,7 +267,7 @@ def list_by_baseline( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) cls: ClsType[_models.DatabaseSqlVulnerabilityAssessmentRuleBaselineListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -351,7 +356,7 @@ def get( :rtype: ~azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentRuleBaseline :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -514,7 +519,7 @@ def create_or_update( :rtype: ~azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentRuleBaseline :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -604,7 +609,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_sql_vulnerability_assessment_scan_result_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_sql_vulnerability_assessment_scan_result_operations.py index 5a380c6d8a00..4bf4d60616ca 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_sql_vulnerability_assessment_scan_result_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_sql_vulnerability_assessment_scan_result_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -178,7 +183,7 @@ def list_by_scan( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) cls: ClsType[_models.SQLVulnerabilityAssessmentScanListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -267,7 +272,7 @@ def get( :rtype: ~azure.mgmt.sql.models.SqlVulnerabilityAssessmentScanResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_sql_vulnerability_assessment_scans_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_sql_vulnerability_assessment_scans_operations.py index 45cef942e378..49e6f2142635 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_sql_vulnerability_assessment_scans_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_sql_vulnerability_assessment_scans_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -169,7 +174,7 @@ def list_by_sql_vulnerability_assessments( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) cls: ClsType[_models.SqlVulnerabilityAssessmentScanRecordListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -252,7 +257,7 @@ def get( :rtype: ~azure.mgmt.sql.models.SqlVulnerabilityAssessmentScanRecord :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_sql_vulnerability_assessments_settings_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_sql_vulnerability_assessments_settings_operations.py index 95d1ca8a330f..d772db285b54 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_sql_vulnerability_assessments_settings_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_sql_vulnerability_assessments_settings_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -150,7 +155,7 @@ def list_by_database( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) cls: ClsType[_models.SqlVulnerabilityAssessmentListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -230,7 +235,7 @@ def get( :rtype: ~azure.mgmt.sql.models.SqlVulnerabilityAssessment :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_tables_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_tables_operations.py index 0bf3272c7ea2..bf18eb92f7e3 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_tables_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_tables_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -170,7 +175,7 @@ def list_by_schema( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.DatabaseTableListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -253,7 +258,7 @@ def get( :rtype: ~azure.mgmt.sql.models.DatabaseTable :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_usages_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_usages_operations.py index 87481071feca..3001dbfb7ca4 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_usages_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_usages_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -109,7 +114,7 @@ def list_by_database( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) cls: ClsType[_models.DatabaseUsageListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_vulnerability_assessment_rule_baselines_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_vulnerability_assessment_rule_baselines_operations.py index 30ff2499e993..a900b5f764c1 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_vulnerability_assessment_rule_baselines_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_vulnerability_assessment_rule_baselines_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -217,7 +222,7 @@ def get( :rtype: ~azure.mgmt.sql.models.DatabaseVulnerabilityAssessmentRuleBaseline :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -389,7 +394,7 @@ def create_or_update( :rtype: ~azure.mgmt.sql.models.DatabaseVulnerabilityAssessmentRuleBaseline :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -482,7 +487,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_vulnerability_assessment_scans_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_vulnerability_assessment_scans_operations.py index 350abeeeef15..862e83aaf349 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_vulnerability_assessment_scans_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_vulnerability_assessment_scans_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union, cast +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar, Union, cast from azure.core.exceptions import ( ClientAuthenticationError, @@ -30,6 +31,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -225,7 +230,7 @@ def _initiate_scan_initial( # pylint: disable=inconsistent-return-statements scan_id: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -369,7 +374,7 @@ def list_by_database( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.VulnerabilityAssessmentScanRecordListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -452,7 +457,7 @@ def get( :rtype: ~azure.mgmt.sql.models.VulnerabilityAssessmentScanRecord :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -526,7 +531,7 @@ def export( :rtype: ~azure.mgmt.sql.models.DatabaseVulnerabilityAssessmentScansExport :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_vulnerability_assessments_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_vulnerability_assessments_operations.py index 279cf73fbad9..a36610c9757e 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_vulnerability_assessments_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_vulnerability_assessments_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -29,6 +30,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -230,7 +235,7 @@ def get( :rtype: ~azure.mgmt.sql.models.DatabaseVulnerabilityAssessment :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -375,7 +380,7 @@ def create_or_update( :rtype: ~azure.mgmt.sql.models.DatabaseVulnerabilityAssessment :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -462,7 +467,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -528,7 +533,7 @@ def list_by_database( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.DatabaseVulnerabilityAssessmentListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_databases_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_databases_operations.py index 95c1170a3cc9..ebf826cb972f 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_databases_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_databases_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -31,6 +32,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -609,7 +614,7 @@ def list_metrics( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) cls: ClsType[_models.MetricListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -687,7 +692,7 @@ def list_metric_definitions( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) cls: ClsType[_models.MetricDefinitionListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -764,7 +769,7 @@ def list_by_server( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-02-01-preview")) cls: ClsType[_models.DatabaseListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -846,7 +851,7 @@ def get( :rtype: ~azure.mgmt.sql.models.Database :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -900,7 +905,7 @@ def _create_or_update_initial( parameters: Union[_models.Database, IO[bytes]], **kwargs: Any ) -> Optional[_models.Database]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1098,7 +1103,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1205,7 +1210,7 @@ def _update_initial( parameters: Union[_models.DatabaseUpdate, IO[bytes]], **kwargs: Any ) -> Optional[_models.Database]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1405,7 +1410,7 @@ def _export_initial( parameters: Union[_models.ExportDatabaseDefinition, IO[bytes]], **kwargs: Any ) -> Optional[_models.ImportExportOperationResult]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1606,7 +1611,7 @@ def _failover_initial( # pylint: disable=inconsistent-return-statements replica_type: Optional[Union[str, _models.ReplicaType]] = None, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1721,7 +1726,7 @@ def _import_initial( parameters: Union[_models.ImportExistingDatabaseDefinition, IO[bytes]], **kwargs: Any ) -> Optional[_models.ImportExportOperationResult]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1999,7 +2004,7 @@ def rename( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2054,7 +2059,7 @@ def rename( # pylint: disable=inconsistent-return-statements def _pause_initial( self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any ) -> Optional[_models.Database]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2164,7 +2169,7 @@ def get_long_running_output(pipeline_response): def _resume_initial( self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any ) -> Optional[_models.Database]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2274,7 +2279,7 @@ def get_long_running_output(pipeline_response): def _upgrade_data_warehouse_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2394,7 +2399,7 @@ def list_by_elastic_pool( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-02-01-preview")) cls: ClsType[_models.DatabaseListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2469,7 +2474,7 @@ def list_inaccessible_by_server( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-02-01-preview")) cls: ClsType[_models.DatabaseListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_deleted_servers_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_deleted_servers_operations.py index f9e8e9518968..b4f37ffa5935 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_deleted_servers_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_deleted_servers_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union, cast +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar, Union, cast from azure.core.exceptions import ( ClientAuthenticationError, @@ -30,6 +31,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -182,7 +187,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.DeletedServer"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.DeletedServerListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -245,7 +250,7 @@ def get(self, location_name: str, deleted_server_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.sql.models.DeletedServer :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -304,7 +309,7 @@ def list_by_location(self, location_name: str, **kwargs: Any) -> Iterable["_mode api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.DeletedServerListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -359,7 +364,7 @@ def get_next(next_link=None): def _recover_initial( self, location_name: str, deleted_server_name: str, **kwargs: Any ) -> Optional[_models.DeletedServer]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_distributed_availability_groups_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_distributed_availability_groups_operations.py index 47aa7a3c57b2..3495ffb8f795 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_distributed_availability_groups_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_distributed_availability_groups_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -31,6 +32,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_list_by_instance_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", "2023-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -79,7 +84,7 @@ def build_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", "2023-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -117,7 +122,7 @@ def build_create_or_update_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", "2023-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -155,12 +160,9 @@ def build_delete_request( 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", "2023-08-01-preview")) - accept = _headers.pop("Accept", "application/json") - + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) # Construct URL _url = kwargs.pop( "template_url", @@ -180,10 +182,7 @@ def build_delete_request( # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) def build_update_request( @@ -196,7 +195,7 @@ def build_update_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", "2023-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -227,100 +226,6 @@ def build_update_request( return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) -def build_failover_request( - resource_group_name: str, - managed_instance_name: str, - distributed_availability_group_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", "2023-08-01-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/distributedAvailabilityGroups/{distributedAvailabilityGroupName}/failover", - ) # pylint: disable=line-too-long - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "managedInstanceName": _SERIALIZER.url( - "managed_instance_name", - managed_instance_name, - "str", - max_length=63, - min_length=1, - pattern=r"^[a-z0-9]+(?:-[a-z0-9]+)*$", - ), - "distributedAvailabilityGroupName": _SERIALIZER.url( - "distributed_availability_group_name", - distributed_availability_group_name, - "str", - max_length=128, - min_length=1, - pattern=r"^[#a-zA-Z_][\w@#$]*$", - ), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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_set_role_request( - resource_group_name: str, - managed_instance_name: str, - distributed_availability_group_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", "2023-08-01-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/distributedAvailabilityGroups/{distributedAvailabilityGroupName}/setRole", - ) # pylint: disable=line-too-long - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), - "distributedAvailabilityGroupName": _SERIALIZER.url( - "distributed_availability_group_name", distributed_availability_group_name, "str" - ), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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) - - class DistributedAvailabilityGroupsOperations: """ .. warning:: @@ -359,10 +264,10 @@ def list_by_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) cls: ClsType[_models.DistributedAvailabilityGroupsListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -409,8 +314,7 @@ def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) return pipeline_response @@ -437,7 +341,7 @@ def get( :rtype: ~azure.mgmt.sql.models.DistributedAvailabilityGroup :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -448,7 +352,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) cls: ClsType[_models.DistributedAvailabilityGroup] = kwargs.pop("cls", None) _request = build_get_request( @@ -472,8 +376,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) deserialized = self._deserialize("DistributedAvailabilityGroup", pipeline_response) @@ -490,7 +393,7 @@ def _create_or_update_initial( parameters: Union[_models.DistributedAvailabilityGroup, IO[bytes]], **kwargs: Any ) -> Optional[_models.DistributedAvailabilityGroup]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -501,7 +404,7 @@ def _create_or_update_initial( _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", "2023-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.DistributedAvailabilityGroup]] = kwargs.pop("cls", None) @@ -537,8 +440,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) deserialized = None if response.status_code == 200: @@ -643,7 +545,7 @@ def begin_create_or_update( _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", "2023-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DistributedAvailabilityGroup] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -694,7 +596,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements distributed_availability_group_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -705,7 +607,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) _request = build_delete_request( @@ -729,8 +631,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) # type: ignore @@ -759,7 +660,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) 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) @@ -804,7 +705,7 @@ def _update_initial( parameters: Union[_models.DistributedAvailabilityGroup, IO[bytes]], **kwargs: Any ) -> Optional[_models.DistributedAvailabilityGroup]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -815,7 +716,7 @@ def _update_initial( _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", "2023-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.DistributedAvailabilityGroup]] = kwargs.pop("cls", None) @@ -851,8 +752,7 @@ def _update_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) deserialized = None if response.status_code == 200: @@ -954,7 +854,7 @@ def begin_update( _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", "2023-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DistributedAvailabilityGroup] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -997,416 +897,3 @@ def get_long_running_output(pipeline_response): return LROPoller[_models.DistributedAvailabilityGroup]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - - def _failover_initial( - self, - resource_group_name: str, - managed_instance_name: str, - distributed_availability_group_name: str, - parameters: Union[_models.DistributedAvailabilityGroupsFailoverRequest, IO[bytes]], - **kwargs: Any - ) -> Optional[_models.DistributedAvailabilityGroup]: - error_map = { - 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 = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-08-01-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.DistributedAvailabilityGroup]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "DistributedAvailabilityGroupsFailoverRequest") - - _request = build_failover_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - distributed_availability_group_name=distributed_availability_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - _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, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("DistributedAvailabilityGroup", pipeline_response) - - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_failover( - self, - resource_group_name: str, - managed_instance_name: str, - distributed_availability_group_name: str, - parameters: _models.DistributedAvailabilityGroupsFailoverRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.DistributedAvailabilityGroup]: - """Performs requested failover type in this distributed availability group. - - :param resource_group_name: The name of the resource group that contains the resource. You can - obtain this value from the Azure Resource Manager API or the portal. Required. - :type resource_group_name: str - :param managed_instance_name: The name of the managed instance. Required. - :type managed_instance_name: str - :param distributed_availability_group_name: The distributed availability group name. Required. - :type distributed_availability_group_name: str - :param parameters: The distributed availability group failover request parameters. Required. - :type parameters: ~azure.mgmt.sql.models.DistributedAvailabilityGroupsFailoverRequest - :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 either DistributedAvailabilityGroup or the - result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.DistributedAvailabilityGroup] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_failover( - self, - resource_group_name: str, - managed_instance_name: str, - distributed_availability_group_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.DistributedAvailabilityGroup]: - """Performs requested failover type in this distributed availability group. - - :param resource_group_name: The name of the resource group that contains the resource. You can - obtain this value from the Azure Resource Manager API or the portal. Required. - :type resource_group_name: str - :param managed_instance_name: The name of the managed instance. Required. - :type managed_instance_name: str - :param distributed_availability_group_name: The distributed availability group name. Required. - :type distributed_availability_group_name: str - :param parameters: The distributed availability group failover request parameters. 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 either DistributedAvailabilityGroup or the - result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.DistributedAvailabilityGroup] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_failover( - self, - resource_group_name: str, - managed_instance_name: str, - distributed_availability_group_name: str, - parameters: Union[_models.DistributedAvailabilityGroupsFailoverRequest, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.DistributedAvailabilityGroup]: - """Performs requested failover type in this distributed availability group. - - :param resource_group_name: The name of the resource group that contains the resource. You can - obtain this value from the Azure Resource Manager API or the portal. Required. - :type resource_group_name: str - :param managed_instance_name: The name of the managed instance. Required. - :type managed_instance_name: str - :param distributed_availability_group_name: The distributed availability group name. Required. - :type distributed_availability_group_name: str - :param parameters: The distributed availability group failover request parameters. Is either a - DistributedAvailabilityGroupsFailoverRequest type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.DistributedAvailabilityGroupsFailoverRequest or - IO[bytes] - :return: An instance of LROPoller that returns either DistributedAvailabilityGroup or the - result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.DistributedAvailabilityGroup] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _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", "2023-08-01-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.DistributedAvailabilityGroup] = 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._failover_initial( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - distributed_availability_group_name=distributed_availability_group_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("DistributedAvailabilityGroup", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.DistributedAvailabilityGroup].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.DistributedAvailabilityGroup]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _set_role_initial( - self, - resource_group_name: str, - managed_instance_name: str, - distributed_availability_group_name: str, - parameters: Union[_models.DistributedAvailabilityGroupSetRole, IO[bytes]], - **kwargs: Any - ) -> Optional[_models.DistributedAvailabilityGroup]: - error_map = { - 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 = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-08-01-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.DistributedAvailabilityGroup]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "DistributedAvailabilityGroupSetRole") - - _request = build_set_role_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - distributed_availability_group_name=distributed_availability_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - _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, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize("DistributedAvailabilityGroup", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_set_role( - self, - resource_group_name: str, - managed_instance_name: str, - distributed_availability_group_name: str, - parameters: _models.DistributedAvailabilityGroupSetRole, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.DistributedAvailabilityGroup]: - """Sets the role for managed instance in a distributed availability group. - - :param resource_group_name: The name of the resource group that contains the resource. You can - obtain this value from the Azure Resource Manager API or the portal. Required. - :type resource_group_name: str - :param managed_instance_name: The name of the managed instance. Required. - :type managed_instance_name: str - :param distributed_availability_group_name: The distributed availability group name. Required. - :type distributed_availability_group_name: str - :param parameters: The distributed availability group set role request parameters. Required. - :type parameters: ~azure.mgmt.sql.models.DistributedAvailabilityGroupSetRole - :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 either DistributedAvailabilityGroup or the - result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.DistributedAvailabilityGroup] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_set_role( - self, - resource_group_name: str, - managed_instance_name: str, - distributed_availability_group_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.DistributedAvailabilityGroup]: - """Sets the role for managed instance in a distributed availability group. - - :param resource_group_name: The name of the resource group that contains the resource. You can - obtain this value from the Azure Resource Manager API or the portal. Required. - :type resource_group_name: str - :param managed_instance_name: The name of the managed instance. Required. - :type managed_instance_name: str - :param distributed_availability_group_name: The distributed availability group name. Required. - :type distributed_availability_group_name: str - :param parameters: The distributed availability group set role request parameters. 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 either DistributedAvailabilityGroup or the - result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.DistributedAvailabilityGroup] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_set_role( - self, - resource_group_name: str, - managed_instance_name: str, - distributed_availability_group_name: str, - parameters: Union[_models.DistributedAvailabilityGroupSetRole, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.DistributedAvailabilityGroup]: - """Sets the role for managed instance in a distributed availability group. - - :param resource_group_name: The name of the resource group that contains the resource. You can - obtain this value from the Azure Resource Manager API or the portal. Required. - :type resource_group_name: str - :param managed_instance_name: The name of the managed instance. Required. - :type managed_instance_name: str - :param distributed_availability_group_name: The distributed availability group name. Required. - :type distributed_availability_group_name: str - :param parameters: The distributed availability group set role request parameters. Is either a - DistributedAvailabilityGroupSetRole type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.DistributedAvailabilityGroupSetRole or IO[bytes] - :return: An instance of LROPoller that returns either DistributedAvailabilityGroup or the - result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.DistributedAvailabilityGroup] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _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", "2023-08-01-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.DistributedAvailabilityGroup] = 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._set_role_initial( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - distributed_availability_group_name=distributed_availability_group_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("DistributedAvailabilityGroup", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.DistributedAvailabilityGroup].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.DistributedAvailabilityGroup]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_elastic_pool_activities_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_elastic_pool_activities_operations.py index 6c42f5e92232..6d0f3d185afb 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_elastic_pool_activities_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_elastic_pool_activities_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -110,7 +115,7 @@ def list_by_elastic_pool( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) cls: ClsType[_models.ElasticPoolActivityListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_elastic_pool_database_activities_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_elastic_pool_database_activities_operations.py index e140beea965f..ad691782497b 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_elastic_pool_database_activities_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_elastic_pool_database_activities_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -110,7 +115,7 @@ def list_by_elastic_pool( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) cls: ClsType[_models.ElasticPoolDatabaseActivityListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_elastic_pool_operations_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_elastic_pool_operations_operations.py index 39330dc4fd69..fe76e02b966c 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_elastic_pool_operations_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_elastic_pool_operations_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -137,7 +142,7 @@ def cancel( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -202,7 +207,7 @@ def list_by_elastic_pool( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.ElasticPoolOperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_elastic_pools_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_elastic_pools_operations.py index b52496f2efa0..7a8a99c21e85 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_elastic_pools_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_elastic_pools_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -31,6 +32,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -341,7 +346,7 @@ def list_metrics( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) cls: ClsType[_models.MetricListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -419,7 +424,7 @@ def list_metric_definitions( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) cls: ClsType[_models.MetricDefinitionListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -496,7 +501,7 @@ def list_by_server( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[_models.ElasticPoolListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -567,7 +572,7 @@ def get( :rtype: ~azure.mgmt.sql.models.ElasticPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -619,7 +624,7 @@ def _create_or_update_initial( parameters: Union[_models.ElasticPool, IO[bytes]], **kwargs: Any ) -> Optional[_models.ElasticPool]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -820,7 +825,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, server_name: str, elastic_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -927,7 +932,7 @@ def _update_initial( parameters: Union[_models.ElasticPoolUpdate, IO[bytes]], **kwargs: Any ) -> Optional[_models.ElasticPool]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1125,7 +1130,7 @@ def get_long_running_output(pipeline_response): def _failover_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, server_name: str, elastic_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_encryption_protectors_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_encryption_protectors_operations.py index 2e396ce287bc..ab702ce7b27d 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_encryption_protectors_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_encryption_protectors_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -31,6 +32,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -214,7 +219,7 @@ def list_by_server( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.EncryptionProtectorListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -289,7 +294,7 @@ def get( :rtype: ~azure.mgmt.sql.models.EncryptionProtector :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -341,7 +346,7 @@ def _create_or_update_initial( parameters: Union[_models.EncryptionProtector, IO[bytes]], **kwargs: Any ) -> Optional[_models.EncryptionProtector]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -544,7 +549,7 @@ def _revalidate_initial( # pylint: disable=inconsistent-return-statements encryption_protector_name: Union[str, _models.EncryptionProtectorName], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_endpoint_certificates_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_endpoint_certificates_operations.py index 035427492368..43f76577b53b 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_endpoint_certificates_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_endpoint_certificates_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -138,7 +143,7 @@ def list_by_instance( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) cls: ClsType[_models.EndpointCertificateListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -209,7 +214,7 @@ def get( :rtype: ~azure.mgmt.sql.models.EndpointCertificate :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_extended_database_blob_auditing_policies_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_extended_database_blob_auditing_policies_operations.py index 334bc1cb15cc..7eaac61d97fd 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_extended_database_blob_auditing_policies_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_extended_database_blob_auditing_policies_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Literal, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Literal, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -29,6 +30,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -182,7 +187,7 @@ def list_by_database( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) cls: ClsType[_models.ExtendedDatabaseBlobAuditingPolicyListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -253,7 +258,7 @@ def get( :rtype: ~azure.mgmt.sql.models.ExtendedDatabaseBlobAuditingPolicy :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -384,7 +389,7 @@ def create_or_update( :rtype: ~azure.mgmt.sql.models.ExtendedDatabaseBlobAuditingPolicy :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_extended_server_blob_auditing_policies_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_extended_server_blob_auditing_policies_operations.py index d26d40da06b3..53e2275401e8 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_extended_server_blob_auditing_policies_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_extended_server_blob_auditing_policies_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Literal, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Literal, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -31,6 +32,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -177,7 +182,7 @@ def list_by_server( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) cls: ClsType[_models.ExtendedServerBlobAuditingPolicyListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -245,7 +250,7 @@ def get( :rtype: ~azure.mgmt.sql.models.ExtendedServerBlobAuditingPolicy :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -297,7 +302,7 @@ def _create_or_update_initial( parameters: Union[_models.ExtendedServerBlobAuditingPolicy, IO[bytes]], **kwargs: Any ) -> Optional[_models.ExtendedServerBlobAuditingPolicy]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_failover_groups_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_failover_groups_operations.py index 5436f6475e8c..a8b4ef85c4a4 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_failover_groups_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_failover_groups_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -31,6 +32,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_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", "2023-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -75,7 +80,7 @@ def build_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", "2023-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -107,7 +112,7 @@ def build_create_or_update_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", "2023-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -141,7 +146,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01-preview")) # Construct URL _url = kwargs.pop( "template_url", @@ -168,7 +173,7 @@ def build_update_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", "2023-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -203,7 +208,7 @@ def build_failover_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", "2023-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -235,7 +240,7 @@ def build_force_failover_allow_data_loss_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", "2023-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -267,7 +272,7 @@ def build_try_planned_before_forced_failover_request( # pylint: disable=name-to _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", "2023-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -330,10 +335,10 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01-preview")) cls: ClsType[_models.FailoverGroupListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -403,7 +408,7 @@ def get( :rtype: ~azure.mgmt.sql.models.FailoverGroup :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -414,7 +419,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01-preview")) cls: ClsType[_models.FailoverGroup] = kwargs.pop("cls", None) _request = build_get_request( @@ -455,7 +460,7 @@ def _create_or_update_initial( parameters: Union[_models.FailoverGroup, IO[bytes]], **kwargs: Any ) -> Optional[_models.FailoverGroup]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -466,7 +471,7 @@ def _create_or_update_initial( _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", "2023-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.FailoverGroup]] = kwargs.pop("cls", None) @@ -607,7 +612,7 @@ def begin_create_or_update( _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", "2023-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.FailoverGroup] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -654,7 +659,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, server_name: str, failover_group_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -665,7 +670,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) _request = build_delete_request( @@ -714,7 +719,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01-preview")) 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) @@ -759,7 +764,7 @@ def _update_initial( parameters: Union[_models.FailoverGroupUpdate, IO[bytes]], **kwargs: Any ) -> Optional[_models.FailoverGroup]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -770,7 +775,7 @@ def _update_initial( _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", "2023-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.FailoverGroup]] = kwargs.pop("cls", None) @@ -908,7 +913,7 @@ def begin_update( _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", "2023-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.FailoverGroup] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -955,7 +960,7 @@ def get_long_running_output(pipeline_response): def _failover_initial( self, resource_group_name: str, server_name: str, failover_group_name: str, **kwargs: Any ) -> Optional[_models.FailoverGroup]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -966,7 +971,7 @@ def _failover_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01-preview")) cls: ClsType[Optional[_models.FailoverGroup]] = kwargs.pop("cls", None) _request = build_failover_request( @@ -1022,7 +1027,7 @@ def begin_failover( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01-preview")) cls: ClsType[_models.FailoverGroup] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1066,7 +1071,7 @@ def get_long_running_output(pipeline_response): def _force_failover_allow_data_loss_initial( self, resource_group_name: str, server_name: str, failover_group_name: str, **kwargs: Any ) -> Optional[_models.FailoverGroup]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1077,7 +1082,7 @@ def _force_failover_allow_data_loss_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01-preview")) cls: ClsType[Optional[_models.FailoverGroup]] = kwargs.pop("cls", None) _request = build_force_failover_allow_data_loss_request( @@ -1134,7 +1139,7 @@ def begin_force_failover_allow_data_loss( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01-preview")) cls: ClsType[_models.FailoverGroup] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1178,7 +1183,7 @@ def get_long_running_output(pipeline_response): def _try_planned_before_forced_failover_initial( # pylint: disable=name-too-long self, resource_group_name: str, server_name: str, failover_group_name: str, **kwargs: Any ) -> Optional[_models.FailoverGroup]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1189,7 +1194,7 @@ def _try_planned_before_forced_failover_initial( # pylint: disable=name-too-lon _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01-preview")) cls: ClsType[Optional[_models.FailoverGroup]] = kwargs.pop("cls", None) _request = build_try_planned_before_forced_failover_request( @@ -1250,7 +1255,7 @@ def begin_try_planned_before_forced_failover( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01-preview")) cls: ClsType[_models.FailoverGroup] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_firewall_rules_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_firewall_rules_operations.py index b7df21d75821..fd5bb52f7e11 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_firewall_rules_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_firewall_rules_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -29,6 +30,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -230,7 +235,7 @@ def get( :rtype: ~azure.mgmt.sql.models.FirewallRule :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -359,7 +364,7 @@ def create_or_update( :rtype: ~azure.mgmt.sql.models.FirewallRule :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -436,7 +441,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -497,7 +502,7 @@ def list_by_server( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.FirewallRuleListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -625,7 +630,7 @@ def replace( :rtype: ~azure.mgmt.sql.models.FirewallRule or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_geo_backup_policies_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_geo_backup_policies_operations.py index f13b167d0a9a..a70fe077d2ca 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_geo_backup_policies_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_geo_backup_policies_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -29,6 +30,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -262,7 +267,7 @@ def create_or_update( :rtype: ~azure.mgmt.sql.models.GeoBackupPolicy :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -347,7 +352,7 @@ def get( :rtype: ~azure.mgmt.sql.models.GeoBackupPolicy :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -415,7 +420,7 @@ def list_by_database( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) cls: ClsType[_models.GeoBackupPolicyListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_instance_failover_groups_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_instance_failover_groups_operations.py index 9b8416ac2ab7..636ad9f6ccc1 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_instance_failover_groups_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_instance_failover_groups_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -31,6 +32,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -267,7 +272,7 @@ def list_by_location( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01-preview")) cls: ClsType[_models.InstanceFailoverGroupListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -337,7 +342,7 @@ def get( :rtype: ~azure.mgmt.sql.models.InstanceFailoverGroup :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -389,7 +394,7 @@ def _create_or_update_initial( parameters: Union[_models.InstanceFailoverGroup, IO[bytes]], **kwargs: Any ) -> Optional[_models.InstanceFailoverGroup]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -588,7 +593,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, location_name: str, failover_group_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -688,7 +693,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _failover_initial( self, resource_group_name: str, location_name: str, failover_group_name: str, **kwargs: Any ) -> Optional[_models.InstanceFailoverGroup]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -799,7 +804,7 @@ def get_long_running_output(pipeline_response): def _force_failover_allow_data_loss_initial( self, resource_group_name: str, location_name: str, failover_group_name: str, **kwargs: Any ) -> Optional[_models.InstanceFailoverGroup]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_instance_pools_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_instance_pools_operations.py index bf4aa7764463..92419288a5aa 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_instance_pools_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_instance_pools_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -31,6 +32,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -247,7 +252,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.InstancePool"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01-preview")) cls: ClsType[_models.InstancePoolListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -315,7 +320,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01-preview")) cls: ClsType[_models.InstancePoolListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -380,7 +385,7 @@ def get(self, resource_group_name: str, instance_pool_name: str, **kwargs: Any) :rtype: ~azure.mgmt.sql.models.InstancePool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -430,7 +435,7 @@ def _create_or_update_initial( parameters: Union[_models.InstancePool, IO[bytes]], **kwargs: Any ) -> Optional[_models.InstancePool]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -618,7 +623,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, instance_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -716,7 +721,7 @@ def _update_initial( parameters: Union[_models.InstancePoolUpdate, IO[bytes]], **kwargs: Any ) -> Optional[_models.InstancePool]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_ipv6_firewall_rules_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_ipv6_firewall_rules_operations.py index c597c9ea3c8a..2520a358f1a4 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_ipv6_firewall_rules_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_ipv6_firewall_rules_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -29,6 +30,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -200,7 +205,7 @@ def list_by_server( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) cls: ClsType[_models.IPv6FirewallRuleListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -270,7 +275,7 @@ def get( :rtype: ~azure.mgmt.sql.models.IPv6FirewallRule :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -401,7 +406,7 @@ def create_or_update( :rtype: ~azure.mgmt.sql.models.IPv6FirewallRule :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -478,7 +483,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_job_agents_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_job_agents_operations.py index ebf3ebc479a9..8ee638cc4f5c 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_job_agents_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_job_agents_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -31,6 +32,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -235,7 +240,7 @@ def list_by_server(self, resource_group_name: str, server_name: str, **kwargs: A api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.JobAgentListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -303,7 +308,7 @@ def get(self, resource_group_name: str, server_name: str, job_agent_name: str, * :rtype: ~azure.mgmt.sql.models.JobAgent :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -355,7 +360,7 @@ def _create_or_update_initial( parameters: Union[_models.JobAgent, IO[bytes]], **kwargs: Any ) -> Optional[_models.JobAgent]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -551,7 +556,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, server_name: str, job_agent_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -656,7 +661,7 @@ def _update_initial( parameters: Union[_models.JobAgentUpdate, IO[bytes]], **kwargs: Any ) -> Optional[_models.JobAgent]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_job_credentials_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_job_credentials_operations.py index ba3eee893e59..03d9921531ad 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_job_credentials_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_job_credentials_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -29,6 +30,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -221,7 +226,7 @@ def list_by_agent( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.JobCredentialListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -294,7 +299,7 @@ def get( :rtype: ~azure.mgmt.sql.models.JobCredential :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -433,7 +438,7 @@ def create_or_update( :rtype: ~azure.mgmt.sql.models.JobCredential :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -513,7 +518,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_job_executions_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_job_executions_operations.py index be31c6b21101..80ad1931e1fc 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_job_executions_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_job_executions_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import datetime -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union, cast +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar, Union, cast from azure.core.exceptions import ( ClientAuthenticationError, @@ -31,6 +32,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -375,7 +380,7 @@ def list_by_agent( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.JobExecutionListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -463,7 +468,7 @@ def cancel( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -508,7 +513,7 @@ def cancel( # pylint: disable=inconsistent-return-statements def _create_initial( self, resource_group_name: str, server_name: str, job_agent_name: str, job_name: str, **kwargs: Any ) -> Optional[_models.JobExecution]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -676,7 +681,7 @@ def list_by_job( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.JobExecutionListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -765,7 +770,7 @@ def get( :rtype: ~azure.mgmt.sql.models.JobExecution :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -820,7 +825,7 @@ def _create_or_update_initial( job_execution_id: str, **kwargs: Any ) -> Optional[_models.JobExecution]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_job_private_endpoints_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_job_private_endpoints_operations.py index bfcec7d7e7c1..7855e800e605 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_job_private_endpoints_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_job_private_endpoints_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -31,6 +32,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -223,7 +228,7 @@ def list_by_agent( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01-preview")) cls: ClsType[_models.JobPrivateEndpointListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -296,7 +301,7 @@ def get( :rtype: ~azure.mgmt.sql.models.JobPrivateEndpoint :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -350,7 +355,7 @@ def _create_or_update_initial( parameters: Union[_models.JobPrivateEndpoint, IO[bytes]], **kwargs: Any ) -> Optional[_models.JobPrivateEndpoint]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -562,7 +567,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, server_name: str, job_agent_name: str, private_endpoint_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_job_step_executions_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_job_step_executions_operations.py index c6302d339f23..89918f9178cb 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_job_step_executions_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_job_step_executions_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import datetime -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -29,6 +30,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -218,7 +223,7 @@ def list_by_job_execution( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.JobExecutionListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -311,7 +316,7 @@ def get( :rtype: ~azure.mgmt.sql.models.JobExecution :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_job_steps_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_job_steps_operations.py index af4fe52429dc..23936c9e82f7 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_job_steps_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_job_steps_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -29,6 +30,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -320,7 +325,7 @@ def list_by_version( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.JobStepListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -406,7 +411,7 @@ def get_by_version( :rtype: ~azure.mgmt.sql.models.JobStep :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -478,7 +483,7 @@ def list_by_job( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.JobStepListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -560,7 +565,7 @@ def get( :rtype: ~azure.mgmt.sql.models.JobStep :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -709,7 +714,7 @@ def create_or_update( :rtype: ~azure.mgmt.sql.models.JobStep :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -798,7 +803,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_job_target_executions_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_job_target_executions_operations.py index 56da86cc5ac2..7ba78b21e8bc 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_job_target_executions_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_job_target_executions_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import datetime -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -29,6 +30,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -284,7 +289,7 @@ def list_by_job_execution( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.JobExecutionListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -409,7 +414,7 @@ def list_by_step( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.JobExecutionListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -506,7 +511,7 @@ def get( :rtype: ~azure.mgmt.sql.models.JobExecution :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_job_target_groups_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_job_target_groups_operations.py index 776256552ee7..2ba2fa34738e 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_job_target_groups_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_job_target_groups_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -29,6 +30,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -221,7 +226,7 @@ def list_by_agent( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.JobTargetGroupListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -294,7 +299,7 @@ def get( :rtype: ~azure.mgmt.sql.models.JobTargetGroup :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -433,7 +438,7 @@ def create_or_update( :rtype: ~azure.mgmt.sql.models.JobTargetGroup :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -513,7 +518,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_job_versions_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_job_versions_operations.py index 8f6b438ef563..f4c346892813 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_job_versions_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_job_versions_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -152,7 +157,7 @@ def list_by_job( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.JobVersionListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -234,7 +239,7 @@ def get( :rtype: ~azure.mgmt.sql.models.JobVersion :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_jobs_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_jobs_operations.py index 7b0699ae3947..f1bad015c54c 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_jobs_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_jobs_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -29,6 +30,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -206,7 +211,7 @@ def list_by_agent( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.JobListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -279,7 +284,7 @@ def get( :rtype: ~azure.mgmt.sql.models.Job :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -417,7 +422,7 @@ def create_or_update( :rtype: ~azure.mgmt.sql.models.Job :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -497,7 +502,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_ledger_digest_uploads_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_ledger_digest_uploads_operations.py index fc4f163d9bff..b22042ff5887 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_ledger_digest_uploads_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_ledger_digest_uploads_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -31,6 +32,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -230,7 +235,7 @@ def get( :rtype: ~azure.mgmt.sql.models.LedgerDigestUploads :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -284,7 +289,7 @@ def _create_or_update_initial( parameters: Union[_models.LedgerDigestUploads, IO[bytes]], **kwargs: Any ) -> Optional[_models.LedgerDigestUploads]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -513,7 +518,7 @@ def list_by_database( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) cls: ClsType[_models.LedgerDigestUploadsListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -575,7 +580,7 @@ def _disable_initial( ledger_digest_uploads: Union[str, _models.LedgerDigestUploadsName], **kwargs: Any ) -> Optional[_models.LedgerDigestUploads]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_long_term_retention_backups_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_long_term_retention_backups_operations.py index ffcd92288a8a..b407bfaddc3b 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_long_term_retention_backups_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_long_term_retention_backups_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -31,6 +32,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -810,7 +815,7 @@ def list_by_location( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01-preview")) cls: ClsType[_models.LongTermRetentionBackupListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -897,7 +902,7 @@ def list_by_server( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01-preview")) cls: ClsType[_models.LongTermRetentionBackupListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -988,7 +993,7 @@ def list_by_database( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01-preview")) cls: ClsType[_models.LongTermRetentionBackupListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1068,7 +1073,7 @@ def get( :rtype: ~azure.mgmt.sql.models.LongTermRetentionBackup :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1122,7 +1127,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements backup_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1237,7 +1242,7 @@ def _change_access_tier_initial( parameters: Union[_models.ChangeLongTermRetentionBackupAccessTierParameters, IO[bytes]], **kwargs: Any ) -> Optional[_models.LongTermRetentionBackup]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1449,7 +1454,7 @@ def _copy_initial( parameters: Union[_models.CopyLongTermRetentionBackupParameters, IO[bytes]], **kwargs: Any ) -> Optional[_models.LongTermRetentionBackupOperationResult]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1663,7 +1668,7 @@ def _update_initial( parameters: Union[_models.UpdateLongTermRetentionBackupParameters, IO[bytes]], **kwargs: Any ) -> Optional[_models.LongTermRetentionBackupOperationResult]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1901,7 +1906,7 @@ def list_by_resource_group_location( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01-preview")) cls: ClsType[_models.LongTermRetentionBackupListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1993,7 +1998,7 @@ def list_by_resource_group_server( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01-preview")) cls: ClsType[_models.LongTermRetentionBackupListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2089,7 +2094,7 @@ def list_by_resource_group_database( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01-preview")) cls: ClsType[_models.LongTermRetentionBackupListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2174,7 +2179,7 @@ def get_by_resource_group( :rtype: ~azure.mgmt.sql.models.LongTermRetentionBackup :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2230,7 +2235,7 @@ def _delete_by_resource_group_initial( # pylint: disable=inconsistent-return-st backup_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2352,7 +2357,7 @@ def _change_access_tier_by_resource_group_initial( # pylint: disable=name-too-l parameters: Union[_models.ChangeLongTermRetentionBackupAccessTierParameters, IO[bytes]], **kwargs: Any ) -> Optional[_models.LongTermRetentionBackup]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2579,7 +2584,7 @@ def _copy_by_resource_group_initial( parameters: Union[_models.CopyLongTermRetentionBackupParameters, IO[bytes]], **kwargs: Any ) -> Optional[_models.LongTermRetentionBackupOperationResult]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2808,7 +2813,7 @@ def _update_by_resource_group_initial( parameters: Union[_models.UpdateLongTermRetentionBackupParameters, IO[bytes]], **kwargs: Any ) -> Optional[_models.LongTermRetentionBackupOperationResult]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_long_term_retention_managed_instance_backups_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_long_term_retention_managed_instance_backups_operations.py index ec5785ed8264..22dc6adbcb56 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_long_term_retention_managed_instance_backups_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_long_term_retention_managed_instance_backups_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union, cast +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar, Union, cast from azure.core.exceptions import ( ClientAuthenticationError, @@ -30,6 +31,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -482,7 +487,7 @@ def get( :rtype: ~azure.mgmt.sql.models.ManagedInstanceLongTermRetentionBackup :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -530,7 +535,7 @@ def get( def _delete_initial( # pylint: disable=inconsistent-return-statements self, location_name: str, managed_instance_name: str, database_name: str, backup_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -666,7 +671,7 @@ def list_by_database( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01-preview")) cls: ClsType[_models.ManagedInstanceLongTermRetentionBackupListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -755,7 +760,7 @@ def list_by_instance( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01-preview")) cls: ClsType[_models.ManagedInstanceLongTermRetentionBackupListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -840,7 +845,7 @@ def list_by_location( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01-preview")) cls: ClsType[_models.ManagedInstanceLongTermRetentionBackupListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -921,7 +926,7 @@ def get_by_resource_group( :rtype: ~azure.mgmt.sql.models.ManagedInstanceLongTermRetentionBackup :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -976,7 +981,7 @@ def _delete_by_resource_group_initial( # pylint: disable=inconsistent-return-st backup_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1127,7 +1132,7 @@ def list_by_resource_group_database( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01-preview")) cls: ClsType[_models.ManagedInstanceLongTermRetentionBackupListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1221,7 +1226,7 @@ def list_by_resource_group_instance( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01-preview")) cls: ClsType[_models.ManagedInstanceLongTermRetentionBackupListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1311,7 +1316,7 @@ def list_by_resource_group_location( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01-preview")) cls: ClsType[_models.ManagedInstanceLongTermRetentionBackupListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_long_term_retention_policies_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_long_term_retention_policies_operations.py index c0138cf007b1..0964e83e1681 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_long_term_retention_policies_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_long_term_retention_policies_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -31,6 +32,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -192,7 +197,7 @@ def list_by_database( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01-preview")) cls: ClsType[_models.LongTermRetentionPolicyListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -271,7 +276,7 @@ def get( :rtype: ~azure.mgmt.sql.models.LongTermRetentionPolicy :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -326,7 +331,7 @@ def _create_or_update_initial( parameters: Union[_models.LongTermRetentionPolicy, IO[bytes]], **kwargs: Any ) -> Optional[_models.LongTermRetentionPolicy]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_maintenance_window_options_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_maintenance_window_options_operations.py index 8e664db1f7dd..ea6a6e2fd928 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_maintenance_window_options_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_maintenance_window_options_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -27,6 +28,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -119,7 +124,7 @@ def get( :rtype: ~azure.mgmt.sql.models.MaintenanceWindowOptions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_maintenance_windows_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_maintenance_windows_operations.py index 6add8e951453..0eb551b1c29e 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_maintenance_windows_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_maintenance_windows_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -156,7 +161,7 @@ def get( :rtype: ~azure.mgmt.sql.models.MaintenanceWindows :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -294,7 +299,7 @@ def create_or_update( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_backup_short_term_retention_policies_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_backup_short_term_retention_policies_operations.py index c88e6aa6bf53..7383460d88a0 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_backup_short_term_retention_policies_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_backup_short_term_retention_policies_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -31,6 +32,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -233,7 +238,7 @@ def get( :rtype: ~azure.mgmt.sql.models.ManagedBackupShortTermRetentionPolicy :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -287,7 +292,7 @@ def _create_or_update_initial( parameters: Union[_models.ManagedBackupShortTermRetentionPolicy, IO[bytes]], **kwargs: Any ) -> Optional[_models.ManagedBackupShortTermRetentionPolicy]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -503,7 +508,7 @@ def _update_initial( parameters: Union[_models.ManagedBackupShortTermRetentionPolicy, IO[bytes]], **kwargs: Any ) -> Optional[_models.ManagedBackupShortTermRetentionPolicy]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -735,7 +740,7 @@ def list_by_database( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.ManagedBackupShortTermRetentionPolicyListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_advanced_threat_protection_settings_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_advanced_threat_protection_settings_operations.py index 89e30c1c2953..c263e4d00f19 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_advanced_threat_protection_settings_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_advanced_threat_protection_settings_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -29,6 +30,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -195,7 +200,7 @@ def list_by_database( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01-preview")) cls: ClsType[_models.ManagedDatabaseAdvancedThreatProtectionListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -275,7 +280,7 @@ def get( :rtype: ~azure.mgmt.sql.models.ManagedDatabaseAdvancedThreatProtection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -420,7 +425,7 @@ def create_or_update( :rtype: ~azure.mgmt.sql.models.ManagedDatabaseAdvancedThreatProtection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_columns_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_columns_operations.py index 942ac80a4a85..b502217ab732 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_columns_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_columns_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, List, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, List, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -235,7 +240,7 @@ def list_by_database( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.DatabaseColumnListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -331,7 +336,7 @@ def list_by_table( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.DatabaseColumnListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -418,7 +423,7 @@ def get( :rtype: ~azure.mgmt.sql.models.DatabaseColumn :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_move_operations_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_move_operations_operations.py index cd72e3f3a691..0dab9707ddd0 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_move_operations_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_move_operations_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -162,7 +167,7 @@ def list_by_location( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01-preview")) cls: ClsType[_models.ManagedDatabaseMoveOperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -234,7 +239,7 @@ def get( :rtype: ~azure.mgmt.sql.models.ManagedDatabaseMoveOperationResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_queries_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_queries_operations.py index 59e8067e9415..ccfc923ac320 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_queries_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_queries_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -159,7 +164,7 @@ def get( :rtype: ~azure.mgmt.sql.models.ManagedInstanceQuery :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -244,7 +249,7 @@ def list_by_query( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.ManagedInstanceQueryStatistics] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_recommended_sensitivity_labels_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_recommended_sensitivity_labels_operations.py index e8f3feeb4213..05057b5c63e7 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_recommended_sensitivity_labels_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_recommended_sensitivity_labels_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -171,7 +176,7 @@ def update( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_restore_details_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_restore_details_operations.py index f87e6a2b66b8..257c0fd92387 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_restore_details_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_restore_details_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar, Union +import sys +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -27,6 +28,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -115,7 +120,7 @@ def get( :rtype: ~azure.mgmt.sql.models.ManagedDatabaseRestoreDetailsResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_schemas_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_schemas_operations.py index 2e41250a2441..fccbb41197c0 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_schemas_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_schemas_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -163,7 +168,7 @@ def list_by_database( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.DatabaseSchemaListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -237,7 +242,7 @@ def get( :rtype: ~azure.mgmt.sql.models.DatabaseSchema :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_security_alert_policies_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_security_alert_policies_operations.py index 71c0c514538c..186ba48aa77d 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_security_alert_policies_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_security_alert_policies_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -29,6 +30,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -191,7 +196,7 @@ def get( :rtype: ~azure.mgmt.sql.models.ManagedDatabaseSecurityAlertPolicy :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -333,7 +338,7 @@ def create_or_update( :rtype: ~azure.mgmt.sql.models.ManagedDatabaseSecurityAlertPolicy :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -419,7 +424,7 @@ def list_by_database( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.ManagedDatabaseSecurityAlertPolicyListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_security_events_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_security_events_operations.py index 5ad2f0e813da..a76f8a850cb1 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_security_events_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_security_events_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -145,7 +150,7 @@ def list_by_database( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.SecurityEventCollection] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_sensitivity_labels_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_sensitivity_labels_operations.py index bcfd7fd774e5..37ff7035b2d0 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_sensitivity_labels_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_sensitivity_labels_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Literal, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Literal, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -29,6 +30,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -420,7 +425,7 @@ def get( :rtype: ~azure.mgmt.sql.models.SensitivityLabel :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -580,7 +585,7 @@ def create_or_update( :rtype: ~azure.mgmt.sql.models.SensitivityLabel :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -675,7 +680,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -750,7 +755,7 @@ def disable_recommendation( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -826,7 +831,7 @@ def enable_recommendation( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -908,7 +913,7 @@ def list_current_by_database( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.SensitivityLabelListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1049,7 +1054,7 @@ def update( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1139,7 +1144,7 @@ def list_recommended_by_database( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.SensitivityLabelListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_tables_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_tables_operations.py index d54554db9e64..43387f8eb5c7 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_tables_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_tables_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -170,7 +175,7 @@ def list_by_schema( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.DatabaseTableListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -253,7 +258,7 @@ def get( :rtype: ~azure.mgmt.sql.models.DatabaseTable :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_transparent_data_encryption_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_transparent_data_encryption_operations.py index bfd6a63e387d..ad891e0aa6cf 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_transparent_data_encryption_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_transparent_data_encryption_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -29,6 +30,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -191,7 +196,7 @@ def get( :rtype: ~azure.mgmt.sql.models.ManagedTransparentDataEncryption :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -333,7 +338,7 @@ def create_or_update( :rtype: ~azure.mgmt.sql.models.ManagedTransparentDataEncryption :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -419,7 +424,7 @@ def list_by_database( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.ManagedTransparentDataEncryptionListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_vulnerability_assessment_rule_baselines_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_vulnerability_assessment_rule_baselines_operations.py index e96decefd54a..33c3f7cf2da1 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_vulnerability_assessment_rule_baselines_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_vulnerability_assessment_rule_baselines_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -217,7 +222,7 @@ def get( :rtype: ~azure.mgmt.sql.models.DatabaseVulnerabilityAssessmentRuleBaseline :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -389,7 +394,7 @@ def create_or_update( :rtype: ~azure.mgmt.sql.models.DatabaseVulnerabilityAssessmentRuleBaseline :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -482,7 +487,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_vulnerability_assessment_scans_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_vulnerability_assessment_scans_operations.py index ba41b765b239..e48ff575c33e 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_vulnerability_assessment_scans_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_vulnerability_assessment_scans_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union, cast +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar, Union, cast from azure.core.exceptions import ( ClientAuthenticationError, @@ -30,6 +31,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -225,7 +230,7 @@ def _initiate_scan_initial( # pylint: disable=inconsistent-return-statements scan_id: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -365,7 +370,7 @@ def export( :rtype: ~azure.mgmt.sql.models.DatabaseVulnerabilityAssessmentScansExport :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -447,7 +452,7 @@ def list_by_database( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.VulnerabilityAssessmentScanRecordListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -530,7 +535,7 @@ def get( :rtype: ~azure.mgmt.sql.models.VulnerabilityAssessmentScanRecord :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_vulnerability_assessments_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_vulnerability_assessments_operations.py index d28a6c34c7fb..8b307dcc18f0 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_vulnerability_assessments_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_vulnerability_assessments_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -29,6 +30,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -230,7 +235,7 @@ def get( :rtype: ~azure.mgmt.sql.models.DatabaseVulnerabilityAssessment :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -375,7 +380,7 @@ def create_or_update( :rtype: ~azure.mgmt.sql.models.DatabaseVulnerabilityAssessment :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -462,7 +467,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -528,7 +533,7 @@ def list_by_database( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.DatabaseVulnerabilityAssessmentListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_databases_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_databases_operations.py index 268ab48c960f..4af75aa04a84 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_databases_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_databases_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -31,6 +32,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -396,7 +401,7 @@ def list_by_instance( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[_models.ManagedDatabaseListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -466,7 +471,7 @@ def get( :rtype: ~azure.mgmt.sql.models.ManagedDatabase :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -518,7 +523,7 @@ def _create_or_update_initial( parameters: Union[_models.ManagedDatabase, IO[bytes]], **kwargs: Any ) -> Optional[_models.ManagedDatabase]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -717,7 +722,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, managed_instance_name: str, database_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -822,7 +827,7 @@ def _update_initial( parameters: Union[_models.ManagedDatabaseUpdate, IO[bytes]], **kwargs: Any ) -> Optional[_models.ManagedDatabase]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1023,7 +1028,7 @@ def _cancel_move_initial( # pylint: disable=inconsistent-return-statements parameters: Union[_models.ManagedDatabaseMoveDefinition, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1211,7 +1216,7 @@ def _complete_move_initial( # pylint: disable=inconsistent-return-statements parameters: Union[_models.ManagedDatabaseMoveDefinition, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1399,7 +1404,7 @@ def _complete_restore_initial( # pylint: disable=inconsistent-return-statements parameters: Union[_models.CompleteDatabaseRestoreDefinition, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1589,7 +1594,7 @@ def _start_move_initial( # pylint: disable=inconsistent-return-statements parameters: Union[_models.ManagedDatabaseStartMoveDefinition, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1790,7 +1795,7 @@ def list_inaccessible_by_instance( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[_models.ManagedDatabaseListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_administrators_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_administrators_operations.py index 97b40c61bea3..9368450f86cb 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_administrators_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_administrators_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -31,6 +32,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -215,7 +220,7 @@ def list_by_instance( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.ManagedInstanceAdministratorListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -289,7 +294,7 @@ def get( :rtype: ~azure.mgmt.sql.models.ManagedInstanceAdministrator :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -341,7 +346,7 @@ def _create_or_update_initial( parameters: Union[_models.ManagedInstanceAdministrator, IO[bytes]], **kwargs: Any ) -> Optional[_models.ManagedInstanceAdministrator]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -544,7 +549,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements administrator_name: Union[str, _models.AdministratorName], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_advanced_threat_protection_settings_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_advanced_threat_protection_settings_operations.py index 696b651a44f2..b8f52a1e99a5 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_advanced_threat_protection_settings_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_advanced_threat_protection_settings_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -31,6 +32,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -190,7 +195,7 @@ def list_by_instance( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01-preview")) cls: ClsType[_models.ManagedInstanceAdvancedThreatProtectionListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -266,7 +271,7 @@ def get( :rtype: ~azure.mgmt.sql.models.ManagedInstanceAdvancedThreatProtection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -318,7 +323,7 @@ def _create_or_update_initial( parameters: Union[_models.ManagedInstanceAdvancedThreatProtection, IO[bytes]], **kwargs: Any ) -> Optional[_models.ManagedInstanceAdvancedThreatProtection]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_azure_ad_only_authentications_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_azure_ad_only_authentications_operations.py index af8615ddddfe..ef2299089648 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_azure_ad_only_authentications_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_azure_ad_only_authentications_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -31,6 +32,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -215,7 +220,7 @@ def get( :rtype: ~azure.mgmt.sql.models.ManagedInstanceAzureADOnlyAuthentication :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -267,7 +272,7 @@ def _create_or_update_initial( parameters: Union[_models.ManagedInstanceAzureADOnlyAuthentication, IO[bytes]], **kwargs: Any ) -> Optional[_models.ManagedInstanceAzureADOnlyAuthentication]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -482,7 +487,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements authentication_name: Union[str, _models.AuthenticationName], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -607,7 +612,7 @@ def list_by_instance( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.ManagedInstanceAzureADOnlyAuthListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_dtcs_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_dtcs_operations.py index 076a2a700466..42ad876a7ad8 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_dtcs_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_dtcs_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -31,6 +32,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -184,7 +189,7 @@ def list_by_managed_instance( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01-preview")) cls: ClsType[_models.ManagedInstanceDtcListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -254,7 +259,7 @@ def get( :rtype: ~azure.mgmt.sql.models.ManagedInstanceDtc :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -306,7 +311,7 @@ def _create_or_update_initial( parameters: Union[_models.ManagedInstanceDtc, IO[bytes]], **kwargs: Any ) -> _models.ManagedInstanceDtc: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_encryption_protectors_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_encryption_protectors_operations.py index 3a43e9cf6cca..0c76c5c706a7 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_encryption_protectors_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_encryption_protectors_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -31,6 +32,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -200,7 +205,7 @@ def _revalidate_initial( # pylint: disable=inconsistent-return-statements encryption_protector_name: Union[str, _models.EncryptionProtectorName], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -324,7 +329,7 @@ def list_by_instance( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.ManagedInstanceEncryptionProtectorListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -399,7 +404,7 @@ def get( :rtype: ~azure.mgmt.sql.models.ManagedInstanceEncryptionProtector :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -451,7 +456,7 @@ def _create_or_update_initial( parameters: Union[_models.ManagedInstanceEncryptionProtector, IO[bytes]], **kwargs: Any ) -> Optional[_models.ManagedInstanceEncryptionProtector]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_keys_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_keys_operations.py index 8588b61f6884..e71833371520 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_keys_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_keys_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -31,6 +32,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -212,7 +217,7 @@ def list_by_instance( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.ManagedInstanceKeyListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -283,7 +288,7 @@ def get( :rtype: ~azure.mgmt.sql.models.ManagedInstanceKey :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -335,7 +340,7 @@ def _create_or_update_initial( parameters: Union[_models.ManagedInstanceKey, IO[bytes]], **kwargs: Any ) -> Optional[_models.ManagedInstanceKey]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -537,7 +542,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, managed_instance_name: str, key_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_long_term_retention_policies_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_long_term_retention_policies_operations.py index 0a16eb18e896..a861f3309aef 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_long_term_retention_policies_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_long_term_retention_policies_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -31,6 +32,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -192,7 +197,7 @@ def get( :rtype: ~azure.mgmt.sql.models.ManagedInstanceLongTermRetentionPolicy :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -246,7 +251,7 @@ def _create_or_update_initial( parameters: Union[_models.ManagedInstanceLongTermRetentionPolicy, IO[bytes]], **kwargs: Any ) -> Optional[_models.ManagedInstanceLongTermRetentionPolicy]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -478,7 +483,7 @@ def list_by_database( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.ManagedInstanceLongTermRetentionPolicyListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_operations_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_operations_operations.py index 0ea649f7d9cd..db0e2ac9297a 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_operations_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_operations_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -165,7 +170,7 @@ def list_by_managed_instance( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.ManagedInstanceOperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -235,7 +240,7 @@ def get( :rtype: ~azure.mgmt.sql.models.ManagedInstanceOperation :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -296,7 +301,7 @@ def cancel( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_private_endpoint_connections_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_private_endpoint_connections_operations.py index 314ab8b89a7e..0308db386889 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_private_endpoint_connections_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_private_endpoint_connections_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -31,6 +32,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -216,7 +221,7 @@ def get( :rtype: ~azure.mgmt.sql.models.ManagedInstancePrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -268,7 +273,7 @@ def _create_or_update_initial( parameters: Union[_models.ManagedInstancePrivateEndpointConnection, IO[bytes]], **kwargs: Any ) -> Optional[_models.ManagedInstancePrivateEndpointConnection]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -467,7 +472,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, managed_instance_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -587,7 +592,7 @@ def list_by_managed_instance( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.ManagedInstancePrivateEndpointConnectionListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_private_link_resources_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_private_link_resources_operations.py index 6667b6afe93b..cf3f4a30a9f8 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_private_link_resources_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_private_link_resources_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -139,7 +144,7 @@ def list_by_managed_instance( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.ManagedInstancePrivateLinkListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -209,7 +214,7 @@ def get( :rtype: ~azure.mgmt.sql.models.ManagedInstancePrivateLink :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_tde_certificates_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_tde_certificates_operations.py index 881ca052963f..7646517627e3 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_tde_certificates_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_tde_certificates_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -30,6 +31,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -94,7 +99,7 @@ def _create_initial( # pylint: disable=inconsistent-return-statements parameters: Union[_models.TdeCertificate, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_vulnerability_assessments_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_vulnerability_assessments_operations.py index 5e0f2ce7f8c7..fbcef86f3c2b 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_vulnerability_assessments_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_vulnerability_assessments_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -29,6 +30,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -220,7 +225,7 @@ def get( :rtype: ~azure.mgmt.sql.models.ManagedInstanceVulnerabilityAssessment :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -361,7 +366,7 @@ def create_or_update( :rtype: ~azure.mgmt.sql.models.ManagedInstanceVulnerabilityAssessment :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -444,7 +449,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -508,7 +513,7 @@ def list_by_instance( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.ManagedInstanceVulnerabilityAssessmentListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instances_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instances_operations.py index 92f21b1266ae..5d3986f32d5b 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instances_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instances_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -31,6 +32,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_list_request(subscription_id: str, *, expand: Optional[str] = None, ** _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", "2023-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -75,7 +80,7 @@ def build_list_by_instance_pool_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", "2023-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -108,7 +113,7 @@ def build_list_by_resource_group_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", "2023-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -145,7 +150,7 @@ def build_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", "2023-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -178,7 +183,7 @@ def build_create_or_update_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", "2023-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -211,7 +216,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) # Construct URL _url = kwargs.pop( "template_url", @@ -237,7 +242,7 @@ def build_update_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", "2023-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -275,7 +280,7 @@ def build_failover_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) # Construct URL _url = kwargs.pop( "template_url", @@ -303,7 +308,7 @@ def build_list_outbound_network_dependencies_by_managed_instance_request( # pyl _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", "2023-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -328,46 +333,12 @@ def build_list_outbound_network_dependencies_by_managed_instance_request( # pyl return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_refresh_status_request( - resource_group_name: str, managed_instance_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", "2023-05-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/refreshExternalGovernanceStatus", - ) # pylint: disable=line-too-long - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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_start_request( resource_group_name: str, managed_instance_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", "2023-05-01-preview")) - accept = _headers.pop("Accept", "application/json") - + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) # Construct URL _url = kwargs.pop( "template_url", @@ -384,21 +355,15 @@ def build_start_request( # 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) + return HttpRequest(method="POST", url=_url, params=_params, **kwargs) def build_stop_request( resource_group_name: str, managed_instance_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", "2023-05-01-preview")) - accept = _headers.pop("Accept", "application/json") - + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) # Construct URL _url = kwargs.pop( "template_url", @@ -415,10 +380,7 @@ def build_stop_request( # 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) + return HttpRequest(method="POST", url=_url, params=_params, **kwargs) def build_list_by_managed_instance_request( @@ -438,7 +400,7 @@ def build_list_by_managed_instance_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", "2023-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -509,10 +471,10 @@ def list(self, expand: Optional[str] = None, **kwargs: Any) -> Iterable["_models _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[_models.ManagedInstanceListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -584,10 +546,10 @@ def list_by_instance_pool( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[_models.ManagedInstanceListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -659,10 +621,10 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[_models.ManagedInstanceListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -732,7 +694,7 @@ def get( :rtype: ~azure.mgmt.sql.models.ManagedInstance :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -743,7 +705,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[_models.ManagedInstance] = kwargs.pop("cls", None) _request = build_get_request( @@ -783,7 +745,7 @@ def _create_or_update_initial( parameters: Union[_models.ManagedInstance, IO[bytes]], **kwargs: Any ) -> Optional[_models.ManagedInstance]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -794,7 +756,7 @@ def _create_or_update_initial( _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", "2023-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.ManagedInstance]] = kwargs.pop("cls", None) @@ -925,7 +887,7 @@ def begin_create_or_update( _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", "2023-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ManagedInstance] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -971,7 +933,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, managed_instance_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -982,7 +944,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) _request = build_delete_request( @@ -1026,7 +988,7 @@ def begin_delete(self, resource_group_name: str, managed_instance_name: str, **k _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) 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) @@ -1069,7 +1031,7 @@ def _update_initial( parameters: Union[_models.ManagedInstanceUpdate, IO[bytes]], **kwargs: Any ) -> Optional[_models.ManagedInstance]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1080,7 +1042,7 @@ def _update_initial( _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", "2023-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.ManagedInstance]] = kwargs.pop("cls", None) @@ -1208,7 +1170,7 @@ def begin_update( _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", "2023-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ManagedInstance] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -1258,7 +1220,7 @@ def _failover_initial( # pylint: disable=inconsistent-return-statements replica_type: Optional[Union[str, _models.ReplicaType]] = None, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1269,7 +1231,7 @@ def _failover_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) _request = build_failover_request( @@ -1323,7 +1285,7 @@ def begin_failover( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) 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) @@ -1379,10 +1341,10 @@ def list_outbound_network_dependencies_by_managed_instance( # pylint: disable=n _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[_models.OutboundEnvironmentEndpointCollection] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1435,121 +1397,10 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - def _refresh_status_initial( - self, resource_group_name: str, managed_instance_name: str, **kwargs: Any - ) -> Optional[_models.RefreshExternalGovernanceStatusOperationResultMI]: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01-preview")) - cls: ClsType[Optional[_models.RefreshExternalGovernanceStatusOperationResultMI]] = kwargs.pop("cls", None) - - _request = build_refresh_status_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - _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, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize("RefreshExternalGovernanceStatusOperationResultMI", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_refresh_status( - self, resource_group_name: str, managed_instance_name: str, **kwargs: Any - ) -> LROPoller[_models.RefreshExternalGovernanceStatusOperationResultMI]: - """Refresh external governance enablement status. - - :param resource_group_name: The name of the resource group that contains the resource. You can - obtain this value from the Azure Resource Manager API or the portal. Required. - :type resource_group_name: str - :param managed_instance_name: The name of the managed instance. Required. - :type managed_instance_name: str - :return: An instance of LROPoller that returns either - RefreshExternalGovernanceStatusOperationResultMI or the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.RefreshExternalGovernanceStatusOperationResultMI] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01-preview")) - cls: ClsType[_models.RefreshExternalGovernanceStatusOperationResultMI] = 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._refresh_status_initial( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("RefreshExternalGovernanceStatusOperationResultMI", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.RefreshExternalGovernanceStatusOperationResultMI].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.RefreshExternalGovernanceStatusOperationResultMI]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _start_initial( + def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, managed_instance_name: str, **kwargs: Any - ) -> Optional[_models.ManagedInstance]: - error_map = { + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1560,8 +1411,8 @@ def _start_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01-preview")) - cls: ClsType[Optional[_models.ManagedInstance]] = kwargs.pop("cls", None) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) + cls: ClsType[None] = kwargs.pop("cls", None) _request = build_start_request( resource_group_name=resource_group_name, @@ -1581,23 +1432,15 @@ def _start_initial( response = pipeline_response.http_response - if response.status_code not in [200, 202]: + if response.status_code not in [202]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize("ManagedInstance", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace - def begin_start( - self, resource_group_name: str, managed_instance_name: str, **kwargs: Any - ) -> LROPoller[_models.ManagedInstance]: + def begin_start(self, resource_group_name: str, managed_instance_name: str, **kwargs: Any) -> LROPoller[None]: """Starts the managed instance. :param resource_group_name: The name of the resource group that contains the resource. You can @@ -1605,21 +1448,20 @@ def begin_start( :type resource_group_name: str :param managed_instance_name: The name of the managed instance. Required. :type managed_instance_name: str - :return: An instance of LROPoller that returns either ManagedInstance or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedInstance] + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01-preview")) - cls: ClsType[_models.ManagedInstance] = kwargs.pop("cls", None) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) + 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._start_initial( + raw_result = self._start_initial( # type: ignore resource_group_name=resource_group_name, managed_instance_name=managed_instance_name, api_version=api_version, @@ -1630,11 +1472,9 @@ def begin_start( ) kwargs.pop("error_map", None) - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ManagedInstance", pipeline_response) + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast( @@ -1645,20 +1485,18 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller[_models.ManagedInstance].from_continuation_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[_models.ManagedInstance]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - def _stop_initial( + def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, managed_instance_name: str, **kwargs: Any - ) -> Optional[_models.ManagedInstance]: - error_map = { + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1669,8 +1507,8 @@ def _stop_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01-preview")) - cls: ClsType[Optional[_models.ManagedInstance]] = kwargs.pop("cls", None) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) + cls: ClsType[None] = kwargs.pop("cls", None) _request = build_stop_request( resource_group_name=resource_group_name, @@ -1690,23 +1528,15 @@ def _stop_initial( response = pipeline_response.http_response - if response.status_code not in [200, 202]: + if response.status_code not in [202]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize("ManagedInstance", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace - def begin_stop( - self, resource_group_name: str, managed_instance_name: str, **kwargs: Any - ) -> LROPoller[_models.ManagedInstance]: + def begin_stop(self, resource_group_name: str, managed_instance_name: str, **kwargs: Any) -> LROPoller[None]: """Stops the managed instance. :param resource_group_name: The name of the resource group that contains the resource. You can @@ -1714,21 +1544,20 @@ def begin_stop( :type resource_group_name: str :param managed_instance_name: The name of the managed instance. Required. :type managed_instance_name: str - :return: An instance of LROPoller that returns either ManagedInstance or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedInstance] + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01-preview")) - cls: ClsType[_models.ManagedInstance] = kwargs.pop("cls", None) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) + 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._stop_initial( + raw_result = self._stop_initial( # type: ignore resource_group_name=resource_group_name, managed_instance_name=managed_instance_name, api_version=api_version, @@ -1739,11 +1568,9 @@ def begin_stop( ) kwargs.pop("error_map", None) - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ManagedInstance", pipeline_response) + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast( @@ -1754,15 +1581,13 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller[_models.ManagedInstance].from_continuation_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[_models.ManagedInstance]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list_by_managed_instance( @@ -1811,10 +1636,10 @@ def list_by_managed_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[_models.TopQueriesListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_ledger_digest_uploads_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_ledger_digest_uploads_operations.py index 3d595ef8a7b4..809b38e73b03 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_ledger_digest_uploads_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_ledger_digest_uploads_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -31,6 +32,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -230,7 +235,7 @@ def list_by_database( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[_models.ManagedLedgerDigestUploadsListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -308,7 +313,7 @@ def get( :rtype: ~azure.mgmt.sql.models.ManagedLedgerDigestUploads :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -362,7 +367,7 @@ def _create_or_update_initial( parameters: Union[_models.ManagedLedgerDigestUploads, IO[bytes]], **kwargs: Any ) -> Optional[_models.ManagedLedgerDigestUploads]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -580,7 +585,7 @@ def _disable_initial( ledger_digest_uploads: Union[str, _models.ManagedLedgerDigestUploadsName], **kwargs: Any ) -> Optional[_models.ManagedLedgerDigestUploads]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_restorable_dropped_database_backup_short_term_retention_policies_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_restorable_dropped_database_backup_short_term_retention_policies_operations.py index eaa230fed28c..31dfc8350270 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_restorable_dropped_database_backup_short_term_retention_policies_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_restorable_dropped_database_backup_short_term_retention_policies_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -31,6 +32,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -245,7 +250,7 @@ def get( :rtype: ~azure.mgmt.sql.models.ManagedBackupShortTermRetentionPolicy :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -299,7 +304,7 @@ def _create_or_update_initial( parameters: Union[_models.ManagedBackupShortTermRetentionPolicy, IO[bytes]], **kwargs: Any ) -> Optional[_models.ManagedBackupShortTermRetentionPolicy]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -515,7 +520,7 @@ def _update_initial( parameters: Union[_models.ManagedBackupShortTermRetentionPolicy, IO[bytes]], **kwargs: Any ) -> Optional[_models.ManagedBackupShortTermRetentionPolicy]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -747,7 +752,7 @@ def list_by_restorable_dropped_database( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.ManagedBackupShortTermRetentionPolicyListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_server_dns_aliases_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_server_dns_aliases_operations.py index 3ead928d9913..d24dfd24cd23 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_server_dns_aliases_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_server_dns_aliases_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -31,6 +32,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -238,7 +243,7 @@ def list_by_managed_instance( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) cls: ClsType[_models.ManagedServerDnsAliasListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -308,7 +313,7 @@ def get( :rtype: ~azure.mgmt.sql.models.ManagedServerDnsAlias :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -360,7 +365,7 @@ def _create_or_update_initial( parameters: Union[_models.ManagedServerDnsAliasCreation, IO[bytes]], **kwargs: Any ) -> Optional[_models.ManagedServerDnsAlias]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -559,7 +564,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, managed_instance_name: str, dns_alias_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -664,7 +669,7 @@ def _acquire_initial( parameters: Union[_models.ManagedServerDnsAliasAcquisition, IO[bytes]], **kwargs: Any ) -> Optional[_models.ManagedServerDnsAlias]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_server_security_alert_policies_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_server_security_alert_policies_operations.py index 285bd41e29c8..7e1ca66a1df8 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_server_security_alert_policies_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_server_security_alert_policies_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -31,6 +32,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -184,7 +189,7 @@ def get( :rtype: ~azure.mgmt.sql.models.ManagedServerSecurityAlertPolicy :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -236,7 +241,7 @@ def _create_or_update_initial( parameters: Union[_models.ManagedServerSecurityAlertPolicy, IO[bytes]], **kwargs: Any ) -> Optional[_models.ManagedServerSecurityAlertPolicy]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -451,7 +456,7 @@ def list_by_instance( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.ManagedServerSecurityAlertPolicyListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_operations.py index 64cc9208a865..ccbdd86df44a 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -87,7 +92,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Operation"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_outbound_firewall_rules_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_outbound_firewall_rules_operations.py index 77fe43c39568..c77ed914aa10 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_outbound_firewall_rules_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_outbound_firewall_rules_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -31,6 +32,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -198,7 +203,7 @@ def get( :rtype: ~azure.mgmt.sql.models.OutboundFirewallRule :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -250,7 +255,7 @@ def _create_or_update_initial( parameters: Union[_models.OutboundFirewallRule, IO[bytes]], **kwargs: Any ) -> Optional[_models.OutboundFirewallRule]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -448,7 +453,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, server_name: str, outbound_rule_fqdn: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -567,7 +572,7 @@ def list_by_server( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) cls: ClsType[_models.OutboundFirewallRuleListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_private_endpoint_connections_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_private_endpoint_connections_operations.py index 44f72869f590..834c3a0d9f87 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_private_endpoint_connections_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_private_endpoint_connections_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -31,6 +32,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -221,7 +226,7 @@ def list_by_server( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[_models.PrivateEndpointConnectionListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -291,7 +296,7 @@ def get( :rtype: ~azure.mgmt.sql.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -343,7 +348,7 @@ def _create_or_update_initial( parameters: Union[_models.PrivateEndpointConnection, IO[bytes]], **kwargs: Any ) -> Optional[_models.PrivateEndpointConnection]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -538,7 +543,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, server_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_private_link_resources_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_private_link_resources_operations.py index 3853c27af671..bcfd3dded748 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_private_link_resources_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_private_link_resources_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -138,7 +143,7 @@ def list_by_server( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.PrivateLinkResourceListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -208,7 +213,7 @@ def get( :rtype: ~azure.mgmt.sql.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_recommended_sensitivity_labels_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_recommended_sensitivity_labels_operations.py index 9ed56e1543eb..b17777c82755 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_recommended_sensitivity_labels_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_recommended_sensitivity_labels_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -171,7 +176,7 @@ def update( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_recoverable_databases_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_recoverable_databases_operations.py index cebb04b864bc..c63703104c16 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_recoverable_databases_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_recoverable_databases_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -149,7 +154,7 @@ def list_by_server( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[_models.RecoverableDatabaseListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -230,7 +235,7 @@ def get( :rtype: ~azure.mgmt.sql.models.RecoverableDatabase :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_recoverable_managed_databases_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_recoverable_managed_databases_operations.py index 9b8662972bcd..d68cf315d1ed 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_recoverable_managed_databases_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_recoverable_managed_databases_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -143,7 +148,7 @@ def list_by_instance( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.RecoverableManagedDatabaseListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -213,7 +218,7 @@ def get( :rtype: ~azure.mgmt.sql.models.RecoverableManagedDatabase :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_replication_links_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_replication_links_operations.py index 4cad36553e24..62264d4a53ee 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_replication_links_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_replication_links_operations.py @@ -6,7 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union, cast +from io import IOBase +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -30,6 +32,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -43,7 +49,7 @@ def build_list_by_database_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", "2022-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -75,7 +81,7 @@ def build_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", "2022-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -102,12 +108,48 @@ def build_get_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) +def build_create_or_update_request( + resource_group_name: str, server_name: str, database_name: str, link_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", "2023-05-01-preview")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks/{linkId}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "linkId": _SERIALIZER.url("link_id", link_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + def build_delete_request( resource_group_name: str, server_name: str, database_name: str, link_id: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01-preview")) # Construct URL _url = kwargs.pop( "template_url", @@ -129,13 +171,49 @@ def build_delete_request( return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) +def build_update_request( + resource_group_name: str, server_name: str, database_name: str, link_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", "2023-05-01-preview")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks/{linkId}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "linkId": _SERIALIZER.url("link_id", link_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + def build_failover_request( resource_group_name: str, server_name: str, database_name: str, link_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", "2022-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -168,7 +246,7 @@ def build_failover_allow_data_loss_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", "2022-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -201,7 +279,7 @@ def build_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", "2022-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -265,10 +343,10 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01-preview")) cls: ClsType[_models.ReplicationLinkListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -341,7 +419,7 @@ def get( :rtype: ~azure.mgmt.sql.models.ReplicationLink :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -352,7 +430,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01-preview")) cls: ClsType[_models.ReplicationLink] = kwargs.pop("cls", None) _request = build_get_request( @@ -386,10 +464,223 @@ def get( return deserialized # type: ignore + def _create_or_update_initial( + self, + resource_group_name: str, + server_name: str, + database_name: str, + link_id: str, + parameters: Union[_models.ReplicationLink, IO[bytes]], + **kwargs: Any + ) -> Optional[_models.ReplicationLink]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01-preview")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ReplicationLink]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "ReplicationLink") + + _request = build_create_or_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + link_id=link_id, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _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, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("ReplicationLink", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + link_id: str, + parameters: _models.ReplicationLink, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ReplicationLink]: + """Updates the replication link type. + + :param resource_group_name: The name of the resource group that contains the resource. You can + obtain this value from the Azure Resource Manager API or the portal. Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param link_id: Required. + :type link_id: str + :param parameters: Required. + :type parameters: ~azure.mgmt.sql.models.ReplicationLink + :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 either ReplicationLink or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ReplicationLink] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + link_id: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ReplicationLink]: + """Updates the replication link type. + + :param resource_group_name: The name of the resource group that contains the resource. You can + obtain this value from the Azure Resource Manager API or the portal. Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param link_id: Required. + :type link_id: str + :param parameters: 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 either ReplicationLink or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ReplicationLink] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + link_id: str, + parameters: Union[_models.ReplicationLink, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.ReplicationLink]: + """Updates the replication link type. + + :param resource_group_name: The name of the resource group that contains the resource. You can + obtain this value from the Azure Resource Manager API or the portal. Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param link_id: Required. + :type link_id: str + :param parameters: Is either a ReplicationLink type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.sql.models.ReplicationLink or IO[bytes] + :return: An instance of LROPoller that returns either ReplicationLink or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ReplicationLink] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _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", "2023-05-01-preview")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ReplicationLink] = 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._create_or_update_initial( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + link_id=link_id, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ReplicationLink", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.ReplicationLink].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.ReplicationLink]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, server_name: str, database_name: str, link_id: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -400,7 +691,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) _request = build_delete_request( @@ -452,7 +743,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01-preview")) 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) @@ -490,10 +781,223 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- ) return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + def _update_initial( + self, + resource_group_name: str, + server_name: str, + database_name: str, + link_id: str, + parameters: Union[_models.ReplicationLinkUpdate, IO[bytes]], + **kwargs: Any + ) -> Optional[_models.ReplicationLink]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01-preview")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ReplicationLink]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "ReplicationLinkUpdate") + + _request = build_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + link_id=link_id, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _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, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("ReplicationLink", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + link_id: str, + parameters: _models.ReplicationLinkUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ReplicationLink]: + """Updates the replication link type. + + :param resource_group_name: The name of the resource group that contains the resource. You can + obtain this value from the Azure Resource Manager API or the portal. Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param link_id: Required. + :type link_id: str + :param parameters: Required. + :type parameters: ~azure.mgmt.sql.models.ReplicationLinkUpdate + :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 either ReplicationLink or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ReplicationLink] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + link_id: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ReplicationLink]: + """Updates the replication link type. + + :param resource_group_name: The name of the resource group that contains the resource. You can + obtain this value from the Azure Resource Manager API or the portal. Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param link_id: Required. + :type link_id: str + :param parameters: 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 either ReplicationLink or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ReplicationLink] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + link_id: str, + parameters: Union[_models.ReplicationLinkUpdate, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.ReplicationLink]: + """Updates the replication link type. + + :param resource_group_name: The name of the resource group that contains the resource. You can + obtain this value from the Azure Resource Manager API or the portal. Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param link_id: Required. + :type link_id: str + :param parameters: Is either a ReplicationLinkUpdate type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.sql.models.ReplicationLinkUpdate or IO[bytes] + :return: An instance of LROPoller that returns either ReplicationLink or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ReplicationLink] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _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", "2023-05-01-preview")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ReplicationLink] = 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, + database_name=database_name, + link_id=link_id, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ReplicationLink", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.ReplicationLink].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.ReplicationLink]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + def _failover_initial( self, resource_group_name: str, server_name: str, database_name: str, link_id: str, **kwargs: Any ) -> Optional[_models.ReplicationLink]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -504,7 +1008,7 @@ def _failover_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01-preview")) cls: ClsType[Optional[_models.ReplicationLink]] = kwargs.pop("cls", None) _request = build_failover_request( @@ -563,7 +1067,7 @@ def begin_failover( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01-preview")) cls: ClsType[_models.ReplicationLink] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -608,7 +1112,7 @@ def get_long_running_output(pipeline_response): def _failover_allow_data_loss_initial( self, resource_group_name: str, server_name: str, database_name: str, link_id: str, **kwargs: Any ) -> Optional[_models.ReplicationLink]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -619,7 +1123,7 @@ def _failover_allow_data_loss_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01-preview")) cls: ClsType[Optional[_models.ReplicationLink]] = kwargs.pop("cls", None) _request = build_failover_allow_data_loss_request( @@ -678,7 +1182,7 @@ def begin_failover_allow_data_loss( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01-preview")) cls: ClsType[_models.ReplicationLink] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -738,10 +1242,10 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01-preview")) cls: ClsType[_models.ReplicationLinkListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_restorable_dropped_databases_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_restorable_dropped_databases_operations.py index 944307e6ffab..27442b72125a 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_restorable_dropped_databases_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_restorable_dropped_databases_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -152,7 +157,7 @@ def list_by_server( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[_models.RestorableDroppedDatabaseListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -233,7 +238,7 @@ def get( :rtype: ~azure.mgmt.sql.models.RestorableDroppedDatabase :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_restorable_dropped_managed_databases_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_restorable_dropped_managed_databases_operations.py index 693616f7a927..96b6063af11e 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_restorable_dropped_managed_databases_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_restorable_dropped_managed_databases_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -145,7 +150,7 @@ def list_by_instance( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01-preview")) cls: ClsType[_models.RestorableDroppedManagedDatabaseListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -215,7 +220,7 @@ def get( :rtype: ~azure.mgmt.sql.models.RestorableDroppedManagedDatabase :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_restore_points_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_restore_points_operations.py index 0fe7ac78fd42..f3bb15924673 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_restore_points_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_restore_points_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -31,6 +32,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -217,7 +222,7 @@ def list_by_database( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.RestorePointListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -279,7 +284,7 @@ def _create_initial( parameters: Union[_models.CreateDatabaseRestorePointDefinition, IO[bytes]], **kwargs: Any ) -> Optional[_models.RestorePoint]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -494,7 +499,7 @@ def get( :rtype: ~azure.mgmt.sql.models.RestorePoint :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -558,7 +563,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sensitivity_labels_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sensitivity_labels_operations.py index 4c12067bca94..0b7ef20b0c02 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sensitivity_labels_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sensitivity_labels_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Literal, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Literal, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -29,6 +30,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -423,7 +428,7 @@ def list_current_by_database( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.SensitivityLabelListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -564,7 +569,7 @@ def update( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -654,7 +659,7 @@ def list_recommended_by_database( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.SensitivityLabelListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -742,7 +747,7 @@ def enable_recommendation( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -817,7 +822,7 @@ def disable_recommendation( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -896,7 +901,7 @@ def get( :rtype: ~azure.mgmt.sql.models.SensitivityLabel :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1056,7 +1061,7 @@ def create_or_update( :rtype: ~azure.mgmt.sql.models.SensitivityLabel :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1151,7 +1156,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_advanced_threat_protection_settings_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_advanced_threat_protection_settings_operations.py index 47e6e3d7c5e7..3fa242db36f3 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_advanced_threat_protection_settings_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_advanced_threat_protection_settings_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -31,6 +32,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -189,7 +194,7 @@ def list_by_server( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) cls: ClsType[_models.LogicalServerAdvancedThreatProtectionListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -265,7 +270,7 @@ def get( :rtype: ~azure.mgmt.sql.models.ServerAdvancedThreatProtection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -317,7 +322,7 @@ def _create_or_update_initial( parameters: Union[_models.ServerAdvancedThreatProtection, IO[bytes]], **kwargs: Any ) -> Optional[_models.ServerAdvancedThreatProtection]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_advisors_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_advisors_operations.py index 6f2ee72281c9..da9233bb196a 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_advisors_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_advisors_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, List, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, List, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -171,7 +176,7 @@ def list_by_server( :rtype: list[~azure.mgmt.sql.models.Advisor] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -230,7 +235,7 @@ def get(self, resource_group_name: str, server_name: str, advisor_name: str, **k :rtype: ~azure.mgmt.sql.models.Advisor :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -359,7 +364,7 @@ def update( :rtype: ~azure.mgmt.sql.models.Advisor :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_automatic_tuning_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_automatic_tuning_operations.py index 5487be4fa11f..6f0bc8c199e4 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_automatic_tuning_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_automatic_tuning_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -130,7 +135,7 @@ def get(self, resource_group_name: str, server_name: str, **kwargs: Any) -> _mod :rtype: ~azure.mgmt.sql.models.ServerAutomaticTuning :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -249,7 +254,7 @@ def update( :rtype: ~azure.mgmt.sql.models.ServerAutomaticTuning :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_azure_ad_administrators_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_azure_ad_administrators_operations.py index d22d8a4d9d37..3fe6e6b76f09 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_azure_ad_administrators_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_azure_ad_administrators_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -31,6 +32,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -215,7 +220,7 @@ def get( :rtype: ~azure.mgmt.sql.models.ServerAzureADAdministrator :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -267,7 +272,7 @@ def _create_or_update_initial( parameters: Union[_models.ServerAzureADAdministrator, IO[bytes]], **kwargs: Any ) -> Optional[_models.ServerAzureADAdministrator]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -473,7 +478,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements administrator_name: Union[str, _models.AdministratorName], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -597,7 +602,7 @@ def list_by_server( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.AdministratorListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_azure_ad_only_authentications_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_azure_ad_only_authentications_operations.py index facd81ecbbbe..004e8774737f 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_azure_ad_only_authentications_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_azure_ad_only_authentications_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -31,6 +32,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -215,7 +220,7 @@ def get( :rtype: ~azure.mgmt.sql.models.ServerAzureADOnlyAuthentication :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -267,7 +272,7 @@ def _create_or_update_initial( parameters: Union[_models.ServerAzureADOnlyAuthentication, IO[bytes]], **kwargs: Any ) -> Optional[_models.ServerAzureADOnlyAuthentication]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -479,7 +484,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements authentication_name: Union[str, _models.AuthenticationName], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -603,7 +608,7 @@ def list_by_server( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.AzureADOnlyAuthListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_blob_auditing_policies_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_blob_auditing_policies_operations.py index 4f69cef97290..2812223ac5a9 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_blob_auditing_policies_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_blob_auditing_policies_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Literal, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Literal, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -31,6 +32,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -177,7 +182,7 @@ def list_by_server( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) cls: ClsType[_models.ServerBlobAuditingPolicyListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -243,7 +248,7 @@ def get(self, resource_group_name: str, server_name: str, **kwargs: Any) -> _mod :rtype: ~azure.mgmt.sql.models.ServerBlobAuditingPolicy :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -295,7 +300,7 @@ def _create_or_update_initial( parameters: Union[_models.ServerBlobAuditingPolicy, IO[bytes]], **kwargs: Any ) -> Optional[_models.ServerBlobAuditingPolicy]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_communication_links_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_communication_links_operations.py index fec91357df77..16c21c2c4c90 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_communication_links_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_communication_links_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -31,6 +32,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -198,7 +203,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -255,7 +260,7 @@ def get( :rtype: ~azure.mgmt.sql.models.ServerCommunicationLink :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -307,7 +312,7 @@ def _create_or_update_initial( parameters: Union[_models.ServerCommunicationLink, IO[bytes]], **kwargs: Any ) -> Optional[_models.ServerCommunicationLink]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -522,7 +527,7 @@ def list_by_server( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) cls: ClsType[_models.ServerCommunicationLinkListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_configuration_options_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_configuration_options_operations.py index fac8c04c7525..d309916c4e42 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_configuration_options_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_configuration_options_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -31,6 +32,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -189,7 +194,7 @@ def list_by_managed_instance( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[_models.ServerConfigurationOptionListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -265,7 +270,7 @@ def get( :rtype: ~azure.mgmt.sql.models.ServerConfigurationOption :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -317,7 +322,7 @@ def _create_or_update_initial( parameters: Union[_models.ServerConfigurationOption, IO[bytes]], **kwargs: Any ) -> _models.ServerConfigurationOption: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_connection_policies_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_connection_policies_operations.py index e1231fe1fd97..5e26da509f1f 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_connection_policies_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_connection_policies_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -31,6 +32,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -184,7 +189,7 @@ def get( :rtype: ~azure.mgmt.sql.models.ServerConnectionPolicy :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -236,7 +241,7 @@ def _create_or_update_initial( parameters: Union[_models.ServerConnectionPolicy, IO[bytes]], **kwargs: Any ) -> Optional[_models.ServerConnectionPolicy]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -451,7 +456,7 @@ def list_by_server( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01-preview")) cls: ClsType[_models.ServerConnectionPolicyListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_dev_ops_audit_settings_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_dev_ops_audit_settings_operations.py index eda0bb689d14..fd1a43baafd7 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_dev_ops_audit_settings_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_dev_ops_audit_settings_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -31,6 +32,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -189,7 +194,7 @@ def list_by_server( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01-preview")) cls: ClsType[_models.ServerDevOpsAuditSettingsListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -263,7 +268,7 @@ def get( :rtype: ~azure.mgmt.sql.models.ServerDevOpsAuditingSettings :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -315,7 +320,7 @@ def _create_or_update_initial( parameters: Union[_models.ServerDevOpsAuditingSettings, IO[bytes]], **kwargs: Any ) -> Optional[_models.ServerDevOpsAuditingSettings]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_dns_aliases_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_dns_aliases_operations.py index ce6626f83bc8..626cc6b95f89 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_dns_aliases_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_dns_aliases_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -31,6 +32,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -230,7 +235,7 @@ def get( :rtype: ~azure.mgmt.sql.models.ServerDnsAlias :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -277,7 +282,7 @@ def get( def _create_or_update_initial( self, resource_group_name: str, server_name: str, dns_alias_name: str, **kwargs: Any ) -> Optional[_models.ServerDnsAlias]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -391,7 +396,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, server_name: str, dns_alias_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -509,7 +514,7 @@ def list_by_server( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.ServerDnsAliasListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -570,7 +575,7 @@ def _acquire_initial( parameters: Union[_models.ServerDnsAliasAcquisition, IO[bytes]], **kwargs: Any ) -> Optional[_models.ServerDnsAlias]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_keys_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_keys_operations.py index 5a0bb1f2b537..1612255f7eaa 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_keys_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_keys_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -31,6 +32,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -202,7 +207,7 @@ def list_by_server( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.ServerKeyListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -270,7 +275,7 @@ def get(self, resource_group_name: str, server_name: str, key_name: str, **kwarg :rtype: ~azure.mgmt.sql.models.ServerKey :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -322,7 +327,7 @@ def _create_or_update_initial( parameters: Union[_models.ServerKey, IO[bytes]], **kwargs: Any ) -> Optional[_models.ServerKey]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -527,7 +532,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, server_name: str, key_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_operations_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_operations_operations.py index 05b07a25e1a8..97e6c98c04db 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_operations_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_operations_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -106,7 +111,7 @@ def list_by_server( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.ServerOperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_security_alert_policies_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_security_alert_policies_operations.py index 08f0be430e5f..2a980b2c643e 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_security_alert_policies_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_security_alert_policies_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -31,6 +32,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -184,7 +189,7 @@ def get( :rtype: ~azure.mgmt.sql.models.ServerSecurityAlertPolicy :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -236,7 +241,7 @@ def _create_or_update_initial( parameters: Union[_models.ServerSecurityAlertPolicy, IO[bytes]], **kwargs: Any ) -> Optional[_models.ServerSecurityAlertPolicy]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -451,7 +456,7 @@ def list_by_server( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.LogicalServerSecurityAlertPolicyListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_trust_certificates_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_trust_certificates_operations.py index 4f19a378dff1..46049370089b 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_trust_certificates_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_trust_certificates_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -31,6 +32,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -204,7 +209,7 @@ def list_by_instance( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) cls: ClsType[_models.ServerTrustCertificatesListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -274,7 +279,7 @@ def get( :rtype: ~azure.mgmt.sql.models.ServerTrustCertificate :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -326,7 +331,7 @@ def _create_or_update_initial( parameters: Union[_models.ServerTrustCertificate, IO[bytes]], **kwargs: Any ) -> Optional[_models.ServerTrustCertificate]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -525,7 +530,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, managed_instance_name: str, certificate_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_trust_groups_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_trust_groups_operations.py index 480a8412f6ff..6523b548a33c 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_trust_groups_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_trust_groups_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -31,6 +32,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -229,7 +234,7 @@ def get( :rtype: ~azure.mgmt.sql.models.ServerTrustGroup :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -281,7 +286,7 @@ def _create_or_update_initial( parameters: Union[_models.ServerTrustGroup, IO[bytes]], **kwargs: Any ) -> Optional[_models.ServerTrustGroup]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -480,7 +485,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, location_name: str, server_trust_group_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -598,7 +603,7 @@ def list_by_location( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.ServerTrustGroupListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -672,7 +677,7 @@ def list_by_instance( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.ServerTrustGroupListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_usages_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_usages_operations.py index b46373624792..85048b343dd0 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_usages_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_usages_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -106,7 +111,7 @@ def list_by_server( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) cls: ClsType[_models.ServerUsageListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_vulnerability_assessments_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_vulnerability_assessments_operations.py index c1723eba6dad..1863379d2e53 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_vulnerability_assessments_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_vulnerability_assessments_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -29,6 +30,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -220,7 +225,7 @@ def get( :rtype: ~azure.mgmt.sql.models.ServerVulnerabilityAssessment :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -361,7 +366,7 @@ def create_or_update( :rtype: ~azure.mgmt.sql.models.ServerVulnerabilityAssessment :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -444,7 +449,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -506,7 +511,7 @@ def list_by_server( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.ServerVulnerabilityAssessmentListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_servers_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_servers_operations.py index 9e996bdcbf9a..e1aeae34c70a 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_servers_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_servers_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -31,6 +32,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -384,7 +389,7 @@ def check_name_availability( :rtype: ~azure.mgmt.sql.models.CheckNameAvailabilityResponse :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -454,7 +459,7 @@ def list(self, expand: Optional[str] = None, **kwargs: Any) -> Iterable["_models api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01-preview")) cls: ClsType[_models.ServerListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -528,7 +533,7 @@ def list_by_resource_group( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01-preview")) cls: ClsType[_models.ServerListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -599,7 +604,7 @@ def get( :rtype: ~azure.mgmt.sql.models.Server :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -647,7 +652,7 @@ def get( def _create_or_update_initial( self, resource_group_name: str, server_name: str, parameters: Union[_models.Server, IO[bytes]], **kwargs: Any ) -> Optional[_models.Server]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -829,7 +834,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, server_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -928,7 +933,7 @@ def _update_initial( parameters: Union[_models.ServerUpdate, IO[bytes]], **kwargs: Any ) -> Optional[_models.Server]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1115,7 +1120,7 @@ def _import_database_initial( parameters: Union[_models.ImportNewDatabaseDefinition, IO[bytes]], **kwargs: Any ) -> Optional[_models.ImportExportOperationResult]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1301,7 +1306,7 @@ def get_long_running_output(pipeline_response): def _refresh_status_initial( self, resource_group_name: str, server_name: str, **kwargs: Any ) -> Optional[_models.RefreshExternalGovernanceStatusOperationResult]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_service_objectives_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_service_objectives_operations.py index 33f3eae4ead2..eb722a55be9e 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_service_objectives_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_service_objectives_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -134,7 +139,7 @@ def get( :rtype: ~azure.mgmt.sql.models.ServiceObjective :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -199,7 +204,7 @@ def list_by_server( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) cls: ClsType[_models.ServiceObjectiveListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sql_agent_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sql_agent_operations.py index df8bbbf295d7..a8a6eeccbc57 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sql_agent_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sql_agent_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -132,7 +137,7 @@ def get(self, resource_group_name: str, managed_instance_name: str, **kwargs: An :rtype: ~azure.mgmt.sql.models.SqlAgentConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -250,7 +255,7 @@ def create_or_update( :rtype: ~azure.mgmt.sql.models.SqlAgentConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sql_vulnerability_assessment_baseline_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sql_vulnerability_assessment_baseline_operations.py index d9cc66a4bc6c..ff0e74988d82 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sql_vulnerability_assessment_baseline_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sql_vulnerability_assessment_baseline_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Literal, Optional, TypeVar, Union +import sys +from typing import Any, Callable, Dict, Iterable, Literal, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -173,7 +178,7 @@ def list_by_sql_vulnerability_assessment( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) cls: ClsType[_models.DatabaseSqlVulnerabilityAssessmentBaselineSetListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -255,7 +260,7 @@ def get( :rtype: ~azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentBaselineSet :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sql_vulnerability_assessment_baselines_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sql_vulnerability_assessment_baselines_operations.py index 827d1d5dd767..db11eb64c2c8 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sql_vulnerability_assessment_baselines_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sql_vulnerability_assessment_baselines_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Literal, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Literal, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -200,7 +205,7 @@ def create_or_update( :rtype: ~azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentBaselineSet :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sql_vulnerability_assessment_execute_scan_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sql_vulnerability_assessment_execute_scan_operations.py index 82be0f0c7b3f..e1281944b2f4 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sql_vulnerability_assessment_execute_scan_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sql_vulnerability_assessment_execute_scan_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Literal, Optional, TypeVar, Union, cast +import sys +from typing import Any, Callable, Dict, Literal, Optional, Type, TypeVar, Union, cast from azure.core.exceptions import ( ClientAuthenticationError, @@ -29,6 +30,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -98,7 +103,7 @@ def _execute_initial( # pylint: disable=inconsistent-return-statements vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sql_vulnerability_assessment_rule_baseline_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sql_vulnerability_assessment_rule_baseline_operations.py index 3b9dd2103551..33e6f93ae15a 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sql_vulnerability_assessment_rule_baseline_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sql_vulnerability_assessment_rule_baseline_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Literal, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Literal, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -29,6 +30,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -230,7 +235,7 @@ def list_by_baseline( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) cls: ClsType[_models.DatabaseSqlVulnerabilityAssessmentRuleBaselineListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -316,7 +321,7 @@ def get( :rtype: ~azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentRuleBaseline :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -473,7 +478,7 @@ def create_or_update( :rtype: ~azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentRuleBaseline :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sql_vulnerability_assessment_rule_baselines_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sql_vulnerability_assessment_rule_baselines_operations.py index 4a00c549d183..41a1d194dd0e 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sql_vulnerability_assessment_rule_baselines_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sql_vulnerability_assessment_rule_baselines_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Literal, Optional, TypeVar, Union +import sys +from typing import Any, Callable, Dict, Literal, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -27,6 +28,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -121,7 +126,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sql_vulnerability_assessment_scan_result_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sql_vulnerability_assessment_scan_result_operations.py index 662630d70afa..2488eec0af03 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sql_vulnerability_assessment_scan_result_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sql_vulnerability_assessment_scan_result_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Literal, Optional, TypeVar, Union +import sys +from typing import Any, Callable, Dict, Iterable, Literal, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -182,7 +187,7 @@ def list_by_scan( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) cls: ClsType[_models.SQLVulnerabilityAssessmentScanListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -268,7 +273,7 @@ def get( :rtype: ~azure.mgmt.sql.models.SqlVulnerabilityAssessmentScanResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sql_vulnerability_assessment_scans_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sql_vulnerability_assessment_scans_operations.py index 5e1a26402d23..32e8433b8209 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sql_vulnerability_assessment_scans_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sql_vulnerability_assessment_scans_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Literal, Optional, TypeVar, Union +import sys +from typing import Any, Callable, Dict, Iterable, Literal, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -173,7 +178,7 @@ def list_by_sql_vulnerability_assessments( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) cls: ClsType[_models.SqlVulnerabilityAssessmentScanRecordListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -253,7 +258,7 @@ def get( :rtype: ~azure.mgmt.sql.models.SqlVulnerabilityAssessmentScanRecord :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sql_vulnerability_assessments_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sql_vulnerability_assessments_operations.py index 34461dd6cf62..5aedd3e26424 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sql_vulnerability_assessments_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sql_vulnerability_assessments_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar, Union +import sys +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -27,6 +28,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -107,7 +112,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sql_vulnerability_assessments_settings_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sql_vulnerability_assessments_settings_operations.py index a9009166c950..6ab1da31e612 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sql_vulnerability_assessments_settings_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sql_vulnerability_assessments_settings_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -29,6 +30,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -187,7 +192,7 @@ def list_by_server( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) cls: ClsType[_models.SqlVulnerabilityAssessmentListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -263,7 +268,7 @@ def get( :rtype: ~azure.mgmt.sql.models.SqlVulnerabilityAssessment :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -395,7 +400,7 @@ def create_or_update( :rtype: ~azure.mgmt.sql.models.SqlVulnerabilityAssessment :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_start_stop_managed_instance_schedules_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_start_stop_managed_instance_schedules_operations.py index aed9933e1948..0914c220fa60 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_start_stop_managed_instance_schedules_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_start_stop_managed_instance_schedules_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -29,6 +30,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -213,7 +218,7 @@ def list_by_instance( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[_models.StartStopManagedInstanceScheduleListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -288,7 +293,7 @@ def get( :rtype: ~azure.mgmt.sql.models.StartStopManagedInstanceSchedule :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -420,7 +425,7 @@ def create_or_update( :rtype: ~azure.mgmt.sql.models.StartStopManagedInstanceSchedule :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -502,7 +507,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_subscription_usages_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_subscription_usages_operations.py index 95aebd6c4f32..d218e95be8ef 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_subscription_usages_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_subscription_usages_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -126,7 +131,7 @@ def list_by_location(self, location_name: str, **kwargs: Any) -> Iterable["_mode api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.SubscriptionUsageListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -190,7 +195,7 @@ def get(self, location_name: str, usage_name: str, **kwargs: Any) -> _models.Sub :rtype: ~azure.mgmt.sql.models.SubscriptionUsage :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_synapse_link_workspaces_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_synapse_link_workspaces_operations.py index 02ef9fab1fba..d27bc6d6e0cf 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_synapse_link_workspaces_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_synapse_link_workspaces_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -110,7 +115,7 @@ def list_by_database( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01-preview")) cls: ClsType[_models.SynapseLinkWorkspaceListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sync_agents_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sync_agents_operations.py index 89c612dc1f58..41b6ef6c5397 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sync_agents_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sync_agents_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -31,6 +32,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -260,7 +265,7 @@ def get(self, resource_group_name: str, server_name: str, sync_agent_name: str, :rtype: ~azure.mgmt.sql.models.SyncAgent :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -312,7 +317,7 @@ def _create_or_update_initial( parameters: Union[_models.SyncAgent, IO[bytes]], **kwargs: Any ) -> Optional[_models.SyncAgent]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -508,7 +513,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, server_name: str, sync_agent_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -626,7 +631,7 @@ def list_by_server( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.SyncAgentListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -696,7 +701,7 @@ def generate_key( :rtype: ~azure.mgmt.sql.models.SyncAgentKeyProperties :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -764,7 +769,7 @@ def list_linked_databases( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.SyncAgentLinkedDatabaseListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sync_groups_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sync_groups_operations.py index 9040ca39b788..527c989be9b2 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sync_groups_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sync_groups_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -31,6 +32,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -470,7 +475,7 @@ def list_sync_database_ids(self, location_name: str, **kwargs: Any) -> Iterable[ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.SyncDatabaseIdListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -525,7 +530,7 @@ def get_next(next_link=None): def _refresh_hub_schema_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, server_name: str, database_name: str, sync_group_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -652,7 +657,7 @@ def list_hub_schemas( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.SyncFullSchemaPropertiesListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -752,7 +757,7 @@ def list_logs( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.SyncGroupLogListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -830,7 +835,7 @@ def cancel_sync( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -890,7 +895,7 @@ def trigger_sync( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -950,7 +955,7 @@ def get( :rtype: ~azure.mgmt.sql.models.SyncGroup :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1004,7 +1009,7 @@ def _create_or_update_initial( parameters: Union[_models.SyncGroup, IO[bytes]], **kwargs: Any ) -> Optional[_models.SyncGroup]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1211,7 +1216,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, server_name: str, database_name: str, sync_group_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1321,7 +1326,7 @@ def _update_initial( parameters: Union[_models.SyncGroup, IO[bytes]], **kwargs: Any ) -> Optional[_models.SyncGroup]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1545,7 +1550,7 @@ def list_by_database( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.SyncGroupListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sync_members_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sync_members_operations.py index 1ade4143af6e..308e3d1c76a0 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sync_members_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sync_members_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -31,6 +32,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -357,7 +362,7 @@ def get( :rtype: ~azure.mgmt.sql.models.SyncMember :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -413,7 +418,7 @@ def _create_or_update_initial( parameters: Union[_models.SyncMember, IO[bytes]], **kwargs: Any ) -> Optional[_models.SyncMember]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -640,7 +645,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements sync_member_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -762,7 +767,7 @@ def _update_initial( parameters: Union[_models.SyncMember, IO[bytes]], **kwargs: Any ) -> Optional[_models.SyncMember]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1002,7 +1007,7 @@ def list_by_sync_group( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.SyncMemberListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1092,7 +1097,7 @@ def list_member_schemas( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.SyncFullSchemaPropertiesListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1157,7 +1162,7 @@ def _refresh_member_schema_initial( # pylint: disable=inconsistent-return-state sync_member_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_tde_certificates_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_tde_certificates_operations.py index 89044bdc168f..0dc1998a3e34 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_tde_certificates_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_tde_certificates_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -30,6 +31,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -94,7 +99,7 @@ def _create_initial( # pylint: disable=inconsistent-return-statements parameters: Union[_models.TdeCertificate, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_time_zones_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_time_zones_operations.py index 0bc723da3b01..b92fcd74dd26 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_time_zones_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_time_zones_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -126,7 +131,7 @@ def list_by_location(self, location_name: str, **kwargs: Any) -> Iterable["_mode api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.TimeZoneListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -190,7 +195,7 @@ def get(self, location_name: str, time_zone_id: str, **kwargs: Any) -> _models.T :rtype: ~azure.mgmt.sql.models.TimeZone :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_transparent_data_encryptions_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_transparent_data_encryptions_operations.py index e6c50abf17d1..9c5d853baf9e 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_transparent_data_encryptions_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_transparent_data_encryptions_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -31,6 +32,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -194,7 +199,7 @@ def list_by_database( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[_models.LogicalDatabaseTransparentDataEncryptionListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -273,7 +278,7 @@ def get( :rtype: ~azure.mgmt.sql.models.LogicalDatabaseTransparentDataEncryption :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -327,7 +332,7 @@ def _create_or_update_initial( parameters: Union[_models.LogicalDatabaseTransparentDataEncryption, IO[bytes]], **kwargs: Any ) -> Optional[_models.LogicalDatabaseTransparentDataEncryption]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_usages_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_usages_operations.py index 45cdcb956c88..90af20842859 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_usages_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_usages_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -116,7 +121,7 @@ def list_by_instance_pool( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) cls: ClsType[_models.UsageListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_virtual_clusters_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_virtual_clusters_operations.py index aee8b7e1acf2..ca2e47ff901d 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_virtual_clusters_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_virtual_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -31,6 +32,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -244,7 +249,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.VirtualCluster"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01-preview")) cls: ClsType[_models.VirtualClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -312,7 +317,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01-preview")) cls: ClsType[_models.VirtualClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -377,7 +382,7 @@ def get(self, resource_group_name: str, virtual_cluster_name: str, **kwargs: Any :rtype: ~azure.mgmt.sql.models.VirtualCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -423,7 +428,7 @@ def get(self, resource_group_name: str, virtual_cluster_name: str, **kwargs: Any def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, virtual_cluster_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -521,7 +526,7 @@ def _update_initial( parameters: Union[_models.VirtualClusterUpdate, IO[bytes]], **kwargs: Any ) -> Optional[_models.VirtualCluster]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -706,7 +711,7 @@ def get_long_running_output(pipeline_response): def _update_dns_servers_initial( self, resource_group_name: str, virtual_cluster_name: str, **kwargs: Any ) -> Optional[_models.UpdateVirtualClusterDnsServersOperation]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_virtual_network_rules_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_virtual_network_rules_operations.py index b9414c6a7d7d..d85bb8e72107 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_virtual_network_rules_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_virtual_network_rules_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -31,6 +32,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -198,7 +203,7 @@ def get( :rtype: ~azure.mgmt.sql.models.VirtualNetworkRule :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -250,7 +255,7 @@ def _create_or_update_initial( parameters: Union[_models.VirtualNetworkRule, IO[bytes]], **kwargs: Any ) -> Optional[_models.VirtualNetworkRule]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -449,7 +454,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, server_name: str, virtual_network_rule_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -567,7 +572,7 @@ def list_by_server( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.VirtualNetworkRuleListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_workload_classifiers_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_workload_classifiers_operations.py index 168bfbc650fb..aa49002c66ce 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_workload_classifiers_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_workload_classifiers_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -31,6 +32,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -240,7 +245,7 @@ def get( :rtype: ~azure.mgmt.sql.models.WorkloadClassifier :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -296,7 +301,7 @@ def _create_or_update_initial( parameters: Union[_models.WorkloadClassifier, IO[bytes]], **kwargs: Any ) -> Optional[_models.WorkloadClassifier]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -529,7 +534,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements workload_classifier_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -667,7 +672,7 @@ def list_by_workload_group( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.WorkloadClassifierListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_workload_groups_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_workload_groups_operations.py index 285ccf160948..fe6c262cf087 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_workload_groups_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_workload_groups_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -31,6 +32,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -219,7 +224,7 @@ def get( :rtype: ~azure.mgmt.sql.models.WorkloadGroup :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -273,7 +278,7 @@ def _create_or_update_initial( parameters: Union[_models.WorkloadGroup, IO[bytes]], **kwargs: Any ) -> Optional[_models.WorkloadGroup]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -483,7 +488,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, server_name: str, database_name: str, workload_group_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -607,7 +612,7 @@ def list_by_database( api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.WorkloadGroupListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/distributed_availability_groups_create_min.py b/sdk/sql/azure-mgmt-sql/generated_samples/distributed_availability_groups_create.py similarity index 81% rename from sdk/sql/azure-mgmt-sql/generated_samples/distributed_availability_groups_create_min.py rename to sdk/sql/azure-mgmt-sql/generated_samples/distributed_availability_groups_create.py index c4c3d034adee..4349199805dc 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/distributed_availability_groups_create_min.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/distributed_availability_groups_create.py @@ -17,7 +17,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python distributed_availability_groups_create_min.py + python distributed_availability_groups_create.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, @@ -38,16 +38,16 @@ def main(): distributed_availability_group_name="dag", parameters={ "properties": { - "databases": [{"databaseName": "testdb"}], - "instanceAvailabilityGroupName": "testcl", - "partnerAvailabilityGroupName": "BoxLocalAg1", - "partnerEndpoint": "TCP://SERVER:7022", + "primaryAvailabilityGroupName": "BoxLocalAg1", + "secondaryAvailabilityGroupName": "testcl", + "sourceEndpoint": "TCP://SERVER:7022", + "targetDatabase": "testdb", } }, ).result() print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2023-08-01-preview/examples/DistributedAvailabilityGroupsCreateMin.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/DistributedAvailabilityGroupsCreate.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/distributed_availability_groups_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/distributed_availability_groups_delete.py index 6b1b9baa83fa..ba3e4beb412f 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/distributed_availability_groups_delete.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/distributed_availability_groups_delete.py @@ -27,7 +27,7 @@ def main(): client = SqlManagementClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="f2669dff-5f08-45dd-b857-b2a60b72cdc9", ) client.distributed_availability_groups.begin_delete( @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2023-08-01-preview/examples/DistributedAvailabilityGroupsDelete.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/DistributedAvailabilityGroupsDelete.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/distributed_availability_groups_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/distributed_availability_groups_get.py index bd3f94df18f0..8b4f0c38b1e8 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/distributed_availability_groups_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/distributed_availability_groups_get.py @@ -27,7 +27,7 @@ def main(): client = SqlManagementClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="f2669dff-5f08-45dd-b857-b2a60b72cdc9", ) response = client.distributed_availability_groups.get( @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2023-08-01-preview/examples/DistributedAvailabilityGroupsGet.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/DistributedAvailabilityGroupsGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/distributed_availability_groups_list_by_instance.py b/sdk/sql/azure-mgmt-sql/generated_samples/distributed_availability_groups_list_by_instance.py index 46fcf2d932fb..6a72d6419afd 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/distributed_availability_groups_list_by_instance.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/distributed_availability_groups_list_by_instance.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2023-08-01-preview/examples/DistributedAvailabilityGroupsListByInstance.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/DistributedAvailabilityGroupsListByInstance.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/distributed_availability_groups_update.py b/sdk/sql/azure-mgmt-sql/generated_samples/distributed_availability_groups_update.py index df4a1bf0c3cc..ba778336cce0 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/distributed_availability_groups_update.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/distributed_availability_groups_update.py @@ -41,6 +41,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2023-08-01-preview/examples/DistributedAvailabilityGroupsUpdate.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/DistributedAvailabilityGroupsUpdate.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/failover_group_create_or_update.py b/sdk/sql/azure-mgmt-sql/generated_samples/failover_group_create_or_update.py index 3887817c5282..9f5a6de3cf11 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/failover_group_create_or_update.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/failover_group_create_or_update.py @@ -55,6 +55,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-01-preview/examples/FailoverGroupCreateOrUpdate.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/FailoverGroupCreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/failover_group_create_or_update_standby_secondary.py b/sdk/sql/azure-mgmt-sql/generated_samples/failover_group_create_or_update_standby_secondary.py new file mode 100644 index 000000000000..12392ab1c824 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/failover_group_create_or_update_standby_secondary.py @@ -0,0 +1,61 @@ +# 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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, IO, Union + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python failover_group_create_or_update_standby_secondary.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.failover_groups.begin_create_or_update( + resource_group_name="Default", + server_name="failover-group-primary-server", + failover_group_name="failover-group-test-3", + parameters={ + "properties": { + "databases": [ + "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/servers/failover-group-primary-server/databases/testdb-1", + "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/servers/failover-group-primary-server/databases/testdb-2", + ], + "partnerServers": [ + { + "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/servers/failover-group-secondary-server" + } + ], + "readOnlyEndpoint": {"failoverPolicy": "Disabled"}, + "readWriteEndpoint": {"failoverPolicy": "Automatic", "failoverWithDataLossGracePeriodMinutes": 480}, + "secondaryType": "Standby", + } + }, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/FailoverGroupCreateOrUpdateStandbySecondary.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/failover_group_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/failover_group_delete.py index 8aa051278289..b744d8a1ca63 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/failover_group_delete.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/failover_group_delete.py @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-01-preview/examples/FailoverGroupDelete.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/FailoverGroupDelete.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/failover_group_failover.py b/sdk/sql/azure-mgmt-sql/generated_samples/failover_group_failover.py index cd1f38924993..3a86ef70d23e 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/failover_group_failover.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/failover_group_failover.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-01-preview/examples/FailoverGroupFailover.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/FailoverGroupFailover.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/failover_group_force_failover_allow_data_loss.py b/sdk/sql/azure-mgmt-sql/generated_samples/failover_group_force_failover_allow_data_loss.py index 97220e69d940..38fe5d610c6e 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/failover_group_force_failover_allow_data_loss.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/failover_group_force_failover_allow_data_loss.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-01-preview/examples/FailoverGroupForceFailoverAllowDataLoss.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/FailoverGroupForceFailoverAllowDataLoss.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/failover_group_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/failover_group_get.py index e8d43fd0c8e0..9c405a12c091 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/failover_group_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/failover_group_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-01-preview/examples/FailoverGroupGet.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/FailoverGroupGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/failover_group_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/failover_group_list.py index 5445bebf3686..d4eb841c2ac2 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/failover_group_list.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/failover_group_list.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-01-preview/examples/FailoverGroupList.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/FailoverGroupList.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/failover_group_try_planned_before_forced_failover.py b/sdk/sql/azure-mgmt-sql/generated_samples/failover_group_try_planned_before_forced_failover.py index 08156d54fc00..7d516a5e2474 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/failover_group_try_planned_before_forced_failover.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/failover_group_try_planned_before_forced_failover.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-01-preview/examples/FailoverGroupTryPlannedBeforeForcedFailover.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/FailoverGroupTryPlannedBeforeForcedFailover.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/failover_group_update.py b/sdk/sql/azure-mgmt-sql/generated_samples/failover_group_update.py index ded6d9d61d2a..91a8dd8a52a8 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/failover_group_update.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/failover_group_update.py @@ -48,6 +48,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-01-preview/examples/FailoverGroupUpdate.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/FailoverGroupUpdate.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/distributed_availability_groups_create_max.py b/sdk/sql/azure-mgmt-sql/generated_samples/failover_group_update_standby_secondary.py similarity index 66% rename from sdk/sql/azure-mgmt-sql/generated_samples/distributed_availability_groups_create_max.py rename to sdk/sql/azure-mgmt-sql/generated_samples/failover_group_update_standby_secondary.py index 3b35cfb94ed9..66c37f958153 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/distributed_availability_groups_create_max.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/failover_group_update_standby_secondary.py @@ -17,7 +17,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python distributed_availability_groups_create_max.py + python failover_group_update_standby_secondary.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, @@ -32,25 +32,23 @@ def main(): subscription_id="00000000-1111-2222-3333-444444444444", ) - response = client.distributed_availability_groups.begin_create_or_update( - resource_group_name="testrg", - managed_instance_name="testcl", - distributed_availability_group_name="dag", + response = client.failover_groups.begin_update( + resource_group_name="Default", + server_name="failover-group-primary-server", + failover_group_name="failover-group-test-1", parameters={ "properties": { - "databases": [{"databaseName": "testdb"}], - "failoverMode": "None", - "instanceAvailabilityGroupName": "testcl", - "instanceLinkRole": "Primary", - "partnerAvailabilityGroupName": "BoxLocalAg1", - "partnerEndpoint": "TCP://SERVER:7022", - "seedingMode": "Automatic", + "databases": [ + "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/servers/failover-group-primary-server/databases/testdb-1" + ], + "readWriteEndpoint": {"failoverPolicy": "Automatic", "failoverWithDataLossGracePeriodMinutes": 120}, + "secondaryType": "Standby", } }, ).result() print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2023-08-01-preview/examples/DistributedAvailabilityGroupsCreateMax.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/FailoverGroupUpdateStandbySecondary.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/failover_managed_instance.py b/sdk/sql/azure-mgmt-sql/generated_samples/failover_managed_instance.py index 0b2fc2129e5b..530f672031b9 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/failover_managed_instance.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/failover_managed_instance.py @@ -36,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/FailoverManagedInstance.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/FailoverManagedInstance.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_outbound_network_dependencies_by_managed_instance.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_outbound_network_dependencies_by_managed_instance.py index 56ce22b20d6a..919cbbba7b77 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_outbound_network_dependencies_by_managed_instance.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/list_outbound_network_dependencies_by_managed_instance.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/ListOutboundNetworkDependenciesByManagedInstance.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ListOutboundNetworkDependenciesByManagedInstance.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_create_max.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_create_max.py index 6013425162a4..8a72a1bc083a 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_create_max.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_create_max.py @@ -48,9 +48,7 @@ def main(): "tenantId": "00000011-1111-2222-2222-123456789111", }, "collation": "SQL_Latin1_General_CP1_CI_AS", - "databaseFormat": "AlwaysUpToDate", "dnsZonePartner": "/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/resourceGroups/testrg/providers/Microsoft.Sql/managedInstances/testinstance", - "hybridSecondaryUsage": "Passive", "instancePoolId": "/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/resourceGroups/testrg/providers/Microsoft.Sql/instancePools/pool1", "licenseType": "LicenseIncluded", "maintenanceConfigurationId": "/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_JapanEast_MI_1", @@ -71,6 +69,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/ManagedInstanceCreateMax.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedInstanceCreateMax.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_create_min.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_create_min.py index 6dde22c0b3f3..65f5627cda61 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_create_min.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_create_min.py @@ -45,12 +45,12 @@ def main(): "subnetId": "/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1", "vCores": 8, }, - "sku": {"name": "GP_Gen5", "tier": "GeneralPurpose"}, + "sku": {"name": "GP_Gen4", "tier": "GeneralPurpose"}, }, ).result() print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/ManagedInstanceCreateMin.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedInstanceCreateMin.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_delete.py index 176fc7320696..69d4b6bf6239 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_delete.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_delete.py @@ -27,7 +27,7 @@ def main(): client = SqlManagementClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="20D7082A-0FC7-4468-82BD-542694D5042B", ) client.managed_instances.begin_delete( @@ -36,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/ManagedInstanceDelete.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedInstanceDelete.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_get.py index 1a88405456d3..d6c34144228c 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_get.py @@ -27,7 +27,7 @@ def main(): client = SqlManagementClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="20d7082a-0fc7-4468-82bd-542694d5042b", ) response = client.managed_instances.get( @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/ManagedInstanceGet.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedInstanceGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_get_while_updating.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_get_while_updating.py deleted file mode 100644 index b6e64f8b0087..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_get_while_updating.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python managed_instance_get_while_updating.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.managed_instances.get( - resource_group_name="testrg", - managed_instance_name="testinstance", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/ManagedInstanceGetWhileUpdating.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_get_with_expand_equals_administrators.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_get_with_expand_equals_administrators.py index 37cd182bbfc4..925a9ab29c06 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_get_with_expand_equals_administrators.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_get_with_expand_equals_administrators.py @@ -27,7 +27,7 @@ def main(): client = SqlManagementClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="20d7082a-0fc7-4468-82bd-542694d5042b", ) response = client.managed_instances.get( @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/ManagedInstanceGetWithExpandEqualsAdministrators.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedInstanceGetWithExpandEqualsAdministrators.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_list.py index a5638d27a0bf..9fca76c18230 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_list.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_list.py @@ -27,7 +27,7 @@ def main(): client = SqlManagementClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="20D7082A-0FC7-4468-82BD-542694D5042B", ) response = client.managed_instances.list() @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/ManagedInstanceList.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedInstanceList.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_list_by_instance_pool.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_list_by_instance_pool.py index 597b31de977c..ab6de6aaaed6 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_list_by_instance_pool.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_list_by_instance_pool.py @@ -27,7 +27,7 @@ def main(): client = SqlManagementClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="20D7082A-0FC7-4468-82BD-542694D5042B", ) response = client.managed_instances.list_by_instance_pool( @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/ManagedInstanceListByInstancePool.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedInstanceListByInstancePool.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_list_by_instance_pool_with_expand_equals_administrators.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_list_by_instance_pool_with_expand_equals_administrators.py index 78d49cd78986..23b74cf6fd46 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_list_by_instance_pool_with_expand_equals_administrators.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_list_by_instance_pool_with_expand_equals_administrators.py @@ -27,7 +27,7 @@ def main(): client = SqlManagementClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="20D7082A-0FC7-4468-82BD-542694D5042B", ) response = client.managed_instances.list_by_instance_pool( @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/ManagedInstanceListByInstancePoolWithExpandEqualsAdministrators.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedInstanceListByInstancePoolWithExpandEqualsAdministrators.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_list_by_resource_group.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_list_by_resource_group.py index 1d295a12145c..44ec7ed0a1e5 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_list_by_resource_group.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_list_by_resource_group.py @@ -27,7 +27,7 @@ def main(): client = SqlManagementClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="20D7082A-0FC7-4468-82BD-542694D5042B", ) response = client.managed_instances.list_by_resource_group( @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/ManagedInstanceListByResourceGroup.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedInstanceListByResourceGroup.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_list_by_resource_group_with_expand_equals_administrators.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_list_by_resource_group_with_expand_equals_administrators.py index 5bfc1fc3e03a..63ac76ef5f06 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_list_by_resource_group_with_expand_equals_administrators.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_list_by_resource_group_with_expand_equals_administrators.py @@ -27,7 +27,7 @@ def main(): client = SqlManagementClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="20D7082A-0FC7-4468-82BD-542694D5042B", ) response = client.managed_instances.list_by_resource_group( @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/ManagedInstanceListByResourceGroupWithExpandEqualsAdministrators.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedInstanceListByResourceGroupWithExpandEqualsAdministrators.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_list_with_expand_equals_administrators.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_list_with_expand_equals_administrators.py index 073d01f7ee62..96744b11ed5e 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_list_with_expand_equals_administrators.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_list_with_expand_equals_administrators.py @@ -27,7 +27,7 @@ def main(): client = SqlManagementClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="20D7082A-0FC7-4468-82BD-542694D5042B", ) response = client.managed_instances.list() @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/ManagedInstanceListWithExpandEqualsAdministrators.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedInstanceListWithExpandEqualsAdministrators.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_refresh_external_governance_status.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_refresh_external_governance_status.py deleted file mode 100644 index 7315d03c48ef..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_refresh_external_governance_status.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python managed_instance_refresh_external_governance_status.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.managed_instances.begin_refresh_status( - resource_group_name="sqlcrudtest-7398", - managed_instance_name="sqlcrudtest-4645", - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/ManagedInstanceRefreshExternalGovernanceStatus.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_remove_maintenance_configuration.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_remove_maintenance_configuration.py index 82301044d9e7..dd5c506c42a1 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_remove_maintenance_configuration.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_remove_maintenance_configuration.py @@ -29,7 +29,7 @@ def main(): client = SqlManagementClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="20D7082A-0FC7-4468-82BD-542694D5042B", ) response = client.managed_instances.begin_update( @@ -37,13 +37,13 @@ def main(): managed_instance_name="testinstance", parameters={ "properties": { - "maintenanceConfigurationId": "/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_Default" + "maintenanceConfigurationId": "/subscriptions/20d7082a-0fc7-4468-82bd-542694d5042b/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_Default" } }, ).result() print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/ManagedInstanceRemoveMaintenanceConfiguration.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedInstanceRemoveMaintenanceConfiguration.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_top_queries_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_top_queries_list.py index ce0be09fdebb..0ee178cfaf5f 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_top_queries_list.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_top_queries_list.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/ManagedInstanceTopQueriesList.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedInstanceTopQueriesList.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_top_queries_list_max.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_top_queries_list_max.py index c421e9e6b8b8..d191d890509a 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_top_queries_list_max.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_top_queries_list_max.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/ManagedInstanceTopQueriesListMax.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedInstanceTopQueriesListMax.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_top_queries_list_min.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_top_queries_list_min.py index e207eaad092e..e7e1777d0346 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_top_queries_list_min.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_top_queries_list_min.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/ManagedInstanceTopQueriesListMin.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedInstanceTopQueriesListMin.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_update_max.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_update_max.py index 98adc19b63e5..03d146eb00ee 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_update_max.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_update_max.py @@ -29,7 +29,7 @@ def main(): client = SqlManagementClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="20D7082A-0FC7-4468-82BD-542694D5042B", ) response = client.managed_instances.begin_update( @@ -39,12 +39,9 @@ def main(): "properties": { "administratorLogin": "dummylogin", "administratorLoginPassword": "PLACEHOLDER", - "authenticationMetadata": "Windows", "collation": "SQL_Latin1_General_CP1_CI_AS", - "databaseFormat": "AlwaysUpToDate", - "hybridSecondaryUsage": "Passive", "licenseType": "BasePrice", - "maintenanceConfigurationId": "/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_JapanEast_MI_1", + "maintenanceConfigurationId": "/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_JapanEast_MI_1", "minimalTlsVersion": "1.2", "proxyOverride": "Redirect", "publicDataEndpointEnabled": False, @@ -52,13 +49,13 @@ def main(): "storageSizeInGB": 448, "vCores": 8, }, - "sku": {"capacity": 8, "name": "GP_Gen5", "tier": "GeneralPurpose"}, + "sku": {"capacity": 8, "name": "GP_Gen4", "tier": "GeneralPurpose"}, "tags": {"tagKey1": "TagValue1"}, }, ).result() print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/ManagedInstanceUpdateMax.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedInstanceUpdateMax.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_update_min.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_update_min.py index df8a7bb56484..f566bf20f3f4 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_update_min.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_update_min.py @@ -29,7 +29,7 @@ def main(): client = SqlManagementClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="20D7082A-0FC7-4468-82BD-542694D5042B", ) response = client.managed_instances.begin_update( @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/ManagedInstanceUpdateMin.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedInstanceUpdateMin.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/distributed_availability_groups_set_role.py b/sdk/sql/azure-mgmt-sql/generated_samples/replication_link_create_or_update.py similarity index 76% rename from sdk/sql/azure-mgmt-sql/generated_samples/distributed_availability_groups_set_role.py rename to sdk/sql/azure-mgmt-sql/generated_samples/replication_link_create_or_update.py index f9c16b1606e8..d3245ce91ad6 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/distributed_availability_groups_set_role.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/replication_link_create_or_update.py @@ -17,7 +17,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python distributed_availability_groups_set_role.py + python replication_link_create_or_update.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, @@ -32,15 +32,16 @@ def main(): subscription_id="00000000-1111-2222-3333-444444444444", ) - response = client.distributed_availability_groups.begin_set_role( - resource_group_name="testrg", - managed_instance_name="testcl", - distributed_availability_group_name="dag", - parameters={"instanceRole": "Primary", "roleChangeType": "Forced"}, + response = client.replication_links.begin_create_or_update( + resource_group_name="Default", + server_name="sourcesvr", + database_name="gamma-db", + link_id="00000000-1111-2222-3333-666666666666", + parameters={"properties": {"linkType": "STANDBY"}}, ).result() print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2023-08-01-preview/examples/DistributedAvailabilityGroupsSetRole.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/ReplicationLinkCreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/replication_link_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/replication_link_delete.py index 8172c174e2ce..8abd762bb258 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/replication_link_delete.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/replication_link_delete.py @@ -38,6 +38,6 @@ def main(): ).result() -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ReplicationLinkDelete.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/ReplicationLinkDelete.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/replication_link_failover.py b/sdk/sql/azure-mgmt-sql/generated_samples/replication_link_failover.py index a53ed7b5095f..c6e8379411ba 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/replication_link_failover.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/replication_link_failover.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ReplicationLinkFailover.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/ReplicationLinkFailover.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/replication_link_failover_allow_data_loss.py b/sdk/sql/azure-mgmt-sql/generated_samples/replication_link_failover_allow_data_loss.py index c0c4b9c8b734..616299e5dec6 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/replication_link_failover_allow_data_loss.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/replication_link_failover_allow_data_loss.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ReplicationLinkFailoverAllowDataLoss.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/ReplicationLinkFailoverAllowDataLoss.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/replication_link_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/replication_link_get.py index 34ab6d412747..9e383bbc46ad 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/replication_link_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/replication_link_get.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ReplicationLinkGet.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/ReplicationLinkGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/replication_link_list_by_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/replication_link_list_by_database.py index 865107804810..529c8fedf111 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/replication_link_list_by_database.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/replication_link_list_by_database.py @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ReplicationLinkListByDatabase.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/ReplicationLinkListByDatabase.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/replication_link_list_by_server.py b/sdk/sql/azure-mgmt-sql/generated_samples/replication_link_list_by_server.py index 1409a9320f72..618bd686cea2 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/replication_link_list_by_server.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/replication_link_list_by_server.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ReplicationLinkListByServer.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/ReplicationLinkListByServer.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/distributed_availability_groups_failover.py b/sdk/sql/azure-mgmt-sql/generated_samples/replication_link_update.py similarity index 77% rename from sdk/sql/azure-mgmt-sql/generated_samples/distributed_availability_groups_failover.py rename to sdk/sql/azure-mgmt-sql/generated_samples/replication_link_update.py index de6abefa3fe3..d4108e6ff464 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/distributed_availability_groups_failover.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/replication_link_update.py @@ -17,7 +17,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python distributed_availability_groups_failover.py + python replication_link_update.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, @@ -32,15 +32,16 @@ def main(): subscription_id="00000000-1111-2222-3333-444444444444", ) - response = client.distributed_availability_groups.begin_failover( - resource_group_name="testrg", - managed_instance_name="testcl", - distributed_availability_group_name="dag", - parameters={"failoverType": "ForcedAllowDataLoss"}, + response = client.replication_links.begin_update( + resource_group_name="Default", + server_name="sourcesvr", + database_name="gamma-db", + link_id="00000000-1111-2222-3333-666666666666", + parameters={"properties": {"linkType": "STANDBY"}}, ).result() print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2023-08-01-preview/examples/DistributedAvailabilityGroupsFailover.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/ReplicationLinkUpdate.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/start_managed_instance.py b/sdk/sql/azure-mgmt-sql/generated_samples/start_managed_instance.py index 77b7abedfe93..65734e7b13b3 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/start_managed_instance.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/start_managed_instance.py @@ -30,13 +30,12 @@ def main(): subscription_id="00000000-1111-2222-3333-444444444444", ) - response = client.managed_instances.begin_start( + client.managed_instances.begin_start( resource_group_name="startrg", managed_instance_name="mitostart", ).result() - print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/StartManagedInstance.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/StartManagedInstance.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/stop_managed_instance.py b/sdk/sql/azure-mgmt-sql/generated_samples/stop_managed_instance.py index b9d35b225dcb..853f05c3cd1a 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/stop_managed_instance.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/stop_managed_instance.py @@ -30,13 +30,12 @@ def main(): subscription_id="00000000-1111-2222-3333-444444444444", ) - response = client.managed_instances.begin_stop( + client.managed_instances.begin_stop( resource_group_name="stoprg", managed_instance_name="mitostop", ).result() - print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/StopManagedInstance.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/StopManagedInstance.json if __name__ == "__main__": main()